-rw-r--r-- | korganizer/koprefs.cpp | 3 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 38 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 79 |
4 files changed, 68 insertions, 53 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 8dca3ae..1cdb2fb 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -208,49 +208,50 @@ KOPrefs::KOPrefs() : | |||
208 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 208 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
209 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 209 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
210 | addItemBool("UseAppColors",&mUseAppColors,false); | 210 | addItemBool("UseAppColors",&mUseAppColors,false); |
211 | 211 | ||
212 | 212 | ||
213 | 213 | ||
214 | KPrefs::setCurrentGroup("Views"); | 214 | KPrefs::setCurrentGroup("Views"); |
215 | addItemInt("Hour Size",&mHourSize,8); | 215 | addItemInt("Hour Size",&mHourSize,8); |
216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
222 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 222 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
223 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 223 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
224 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 224 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
225 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 225 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
226 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 226 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
227 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); | 227 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); |
228 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 228 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
229 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 229 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
230 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 230 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
231 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 231 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
232 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); | 232 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
233 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | ||
233 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 234 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
234 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 235 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
235 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 236 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
236 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 237 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
237 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 238 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
238 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); | 239 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); |
239 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 240 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
240 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 241 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
241 | #ifdef DESKTOP_VERSION | 242 | #ifdef DESKTOP_VERSION |
242 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 243 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
243 | #else | 244 | #else |
244 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 245 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
245 | #endif | 246 | #endif |
246 | addItemInt("Day Begins",&mDayBegins,7); | 247 | addItemInt("Day Begins",&mDayBegins,7); |
247 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 248 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
248 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 249 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
249 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 250 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
250 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 251 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
251 | 252 | ||
252 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 253 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
253 | addItemBool("Full View Month",&mFullViewMonth,true); | 254 | addItemBool("Full View Month",&mFullViewMonth,true); |
254 | addItemBool("Full View Todo",&mFullViewTodo,true); | 255 | addItemBool("Full View Todo",&mFullViewTodo,true); |
255 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 256 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
256 | 257 | ||
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 0656644..f2fe77a 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -211,48 +211,49 @@ class KOPrefs : public KPimPrefs | |||
211 | int mIMIPScheduler; | 211 | int mIMIPScheduler; |
212 | int mIMIPSend; | 212 | int mIMIPSend; |
213 | QStringList mAdditionalMails; | 213 | QStringList mAdditionalMails; |
214 | int mIMIPAutoRefresh; | 214 | int mIMIPAutoRefresh; |
215 | int mIMIPAutoInsertReply; | 215 | int mIMIPAutoInsertReply; |
216 | int mIMIPAutoInsertRequest; | 216 | int mIMIPAutoInsertRequest; |
217 | int mIMIPAutoFreeBusy; | 217 | int mIMIPAutoFreeBusy; |
218 | int mIMIPAutoFreeBusyReply; | 218 | int mIMIPAutoFreeBusyReply; |
219 | 219 | ||
220 | QStringList mTodoTemplates; | 220 | QStringList mTodoTemplates; |
221 | QStringList mEventTemplates; | 221 | QStringList mEventTemplates; |
222 | 222 | ||
223 | int mDestination; | 223 | int mDestination; |
224 | 224 | ||
225 | 225 | ||
226 | bool mEditOnDoubleClick; | 226 | bool mEditOnDoubleClick; |
227 | bool mViewChangeHoldFullscreen; | 227 | bool mViewChangeHoldFullscreen; |
228 | bool mViewChangeHoldNonFullscreen; | 228 | bool mViewChangeHoldNonFullscreen; |
229 | bool mCenterOnCurrentTime; | 229 | bool mCenterOnCurrentTime; |
230 | bool mSetTimeToDayStartAt; | 230 | bool mSetTimeToDayStartAt; |
231 | bool mHighlightCurrentDay; | 231 | bool mHighlightCurrentDay; |
232 | bool mUseHighlightLightColor; | 232 | bool mUseHighlightLightColor; |
233 | bool mListViewMonthTimespan; | 233 | bool mListViewMonthTimespan; |
234 | bool mWNViewShowsParents; | 234 | bool mWNViewShowsParents; |
235 | bool mWNViewShowsPast; | ||
235 | bool mWNViewShowLocation; | 236 | bool mWNViewShowLocation; |
236 | bool mTodoViewShowsPercentage; | 237 | bool mTodoViewShowsPercentage; |
237 | bool mTodoViewUsesCatColors; | 238 | bool mTodoViewUsesCatColors; |
238 | bool mTodoViewUsesSmallFont; | 239 | bool mTodoViewUsesSmallFont; |
239 | bool mTodoViewUsesForegroundColor; | 240 | bool mTodoViewUsesForegroundColor; |
240 | bool mMonthViewUsesForegroundColor; | 241 | bool mMonthViewUsesForegroundColor; |
241 | 242 | ||
242 | bool mHightlightDateTimeEdit; | 243 | bool mHightlightDateTimeEdit; |
243 | bool mShortDateInViewer; | 244 | bool mShortDateInViewer; |
244 | 245 | ||
245 | QStringList mLocationDefaults; | 246 | QStringList mLocationDefaults; |
246 | QStringList mEventSummaryUser; | 247 | QStringList mEventSummaryUser; |
247 | QStringList mTodoSummaryUser; | 248 | QStringList mTodoSummaryUser; |
248 | 249 | ||
249 | bool mUseInternalAlarmNotification; | 250 | bool mUseInternalAlarmNotification; |
250 | int mAlarmPlayBeeps; | 251 | int mAlarmPlayBeeps; |
251 | int mAlarmSuspendTime; | 252 | int mAlarmSuspendTime; |
252 | int mAlarmSuspendCount; | 253 | int mAlarmSuspendCount; |
253 | int mAlarmBeepInterval; | 254 | int mAlarmBeepInterval; |
254 | int mOldLanguage; | 255 | int mOldLanguage; |
255 | int mOldLoadedLanguage; | 256 | int mOldLoadedLanguage; |
256 | 257 | ||
257 | 258 | ||
258 | QString mActiveSyncPort; | 259 | QString mActiveSyncPort; |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 393e6e6..578c0e9 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -763,80 +763,88 @@ void KOPrefsDialog::setupViewsTab() | |||
763 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 763 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
764 | 764 | ||
765 | dummy = | 765 | dummy = |
766 | addWidBool(i18n("Categorie colors are applied to text"), | 766 | addWidBool(i18n("Categorie colors are applied to text"), |
767 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 767 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
768 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 768 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
769 | coloredCategoriesInMonthView = | 769 | coloredCategoriesInMonthView = |
770 | addWidBool(i18n("Month view uses day colors"), | 770 | addWidBool(i18n("Month view uses day colors"), |
771 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 771 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
772 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 772 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
773 | 773 | ||
774 | KPrefsDialogWidColor *holidayColor = | 774 | KPrefsDialogWidColor *holidayColor = |
775 | addWidColor(i18n("Day color odd months"), | 775 | addWidColor(i18n("Day color odd months"), |
776 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 776 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
777 | topLayout->addWidget(holidayColor->label(),ii,0); | 777 | topLayout->addWidget(holidayColor->label(),ii,0); |
778 | topLayout->addWidget(holidayColor->button(),ii++,1); | 778 | topLayout->addWidget(holidayColor->button(),ii++,1); |
779 | 779 | ||
780 | holidayColor = | 780 | holidayColor = |
781 | addWidColor(i18n("Day color even months"), | 781 | addWidColor(i18n("Day color even months"), |
782 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 782 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
783 | topLayout->addWidget(holidayColor->label(),ii,0); | 783 | topLayout->addWidget(holidayColor->label(),ii,0); |
784 | topLayout->addWidget(holidayColor->button(),ii++,1); | 784 | topLayout->addWidget(holidayColor->button(),ii++,1); |
785 | 785 | ||
786 | 786 | ||
787 | holidayColor = | 787 | holidayColor = |
788 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 788 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
789 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 789 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
790 | topLayout->addWidget(holidayColor->label(),ii,0); | 790 | topLayout->addWidget(holidayColor->label(),ii,0); |
791 | topLayout->addWidget(holidayColor->button(),ii++,1); | 791 | topLayout->addWidget(holidayColor->button(),ii++,1); |
792 | // *********************** What'sNext View | 792 | // *********************** What'sNext View |
793 | topFrame = addPage(i18n("What's Next View"),0,0); | 793 | topFrame = addPage(i18n("What's Next View"),0,0); |
794 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 794 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
795 | 795 | ||
796 | topLayout = new QGridLayout(topFrame,4,1); | 796 | topLayout = new QGridLayout(topFrame,4,1); |
797 | topLayout->setSpacing(spacingHint()); | 797 | topLayout->setSpacing(spacingHint()); |
798 | topLayout->setMargin(marginHint()); | 798 | topLayout->setMargin(marginHint()); |
799 | ii = 0; | 799 | ii = 0; |
800 | KPrefsDialogWidBool *passwdk = | 800 | KPrefsDialogWidBool *passwdk = |
801 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 801 | |
802 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 802 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), |
803 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 803 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); |
804 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
805 | passwdk = | ||
806 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | ||
807 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | ||
808 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
804 | 809 | ||
805 | passwdk = | 810 | passwdk = |
806 | addWidBool(i18n("Show location in What's Next view"), | 811 | addWidBool(i18n("Show location in What's Next view"), |
807 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 812 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
808 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 813 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
809 | 814 | ||
810 | passwdk = | 815 | passwdk = |
811 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), | 816 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), |
812 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 817 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
813 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 818 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
814 | passwdk = | 819 | passwdk = |
815 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), | 820 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), |
816 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 821 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
817 | topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1); | 822 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
818 | 823 | ||
824 | |||
825 | |||
826 | |||
819 | // *********************** Todo View | 827 | // *********************** Todo View |
820 | 828 | ||
821 | topFrame = addPage(i18n("Todo View"),0,0); | 829 | topFrame = addPage(i18n("Todo View"),0,0); |
822 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 830 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
823 | 831 | ||
824 | topLayout = new QGridLayout(topFrame,4,1); | 832 | topLayout = new QGridLayout(topFrame,4,1); |
825 | topLayout->setSpacing(spacingHint()); | 833 | topLayout->setSpacing(spacingHint()); |
826 | topLayout->setMargin(marginHint()); | 834 | topLayout->setMargin(marginHint()); |
827 | ii = 0; | 835 | ii = 0; |
828 | 836 | ||
829 | KPrefsDialogWidBool *showCompletedTodo = | 837 | KPrefsDialogWidBool *showCompletedTodo = |
830 | addWidBool(i18n("To-do view shows completed Todos"), | 838 | addWidBool(i18n("To-do view shows completed Todos"), |
831 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 839 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
832 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 840 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
833 | dummy = | 841 | dummy = |
834 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 842 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
835 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 843 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
836 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 844 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
837 | 845 | ||
838 | dummy = | 846 | dummy = |
839 | addWidBool(i18n("Small To-do view uses smaller font"), | 847 | addWidBool(i18n("Small To-do view uses smaller font"), |
840 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 848 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
841 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 849 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
842 | 850 | ||
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 0f0bf11..aa33588 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -336,49 +336,49 @@ void KOWhatsNextView::updateView() | |||
336 | appendEvent(to, true); | 336 | appendEvent(to, true); |
337 | } | 337 | } |
338 | } | 338 | } |
339 | } | 339 | } |
340 | to = todos.next(); | 340 | to = todos.next(); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | if (replys > 0 ) mText += "</table>\n"; | 343 | if (replys > 0 ) mText += "</table>\n"; |
344 | 344 | ||
345 | 345 | ||
346 | mText += "</td></tr>\n</table></qt>\n"; | 346 | mText += "</td></tr>\n</table></qt>\n"; |
347 | 347 | ||
348 | mView->setText(mText); | 348 | mView->setText(mText); |
349 | mView->setFocus(); | 349 | mView->setFocus(); |
350 | 350 | ||
351 | // QPixmap bPix = SmallIcon( "back" ); | 351 | // QPixmap bPix = SmallIcon( "back" ); |
352 | // qDebug("xxxxxxxxxxxxxxxxxxxxx "); | 352 | // qDebug("xxxxxxxxxxxxxxxxxxxxx "); |
353 | // QWidget* test = new QWidget(); | 353 | // QWidget* test = new QWidget(); |
354 | // test->setBackgroundMode(FixedPixmap ); | 354 | // test->setBackgroundMode(FixedPixmap ); |
355 | // test->setBackgroundPixmap ( bPix ); | 355 | // test->setBackgroundPixmap ( bPix ); |
356 | // test->resize( 300, 400 ); | 356 | // test->resize( 300, 400 ); |
357 | // test->show(); | 357 | // test->show(); |
358 | // mView->setBackgroundMode(FixedPixmap ); | 358 | // mView->setBackgroundMode(FixedPixmap ); |
359 | // mView->setBackgroundPixmap ( bPix ); | 359 | // mView->setBackgroundPixmap ( bPix ); |
360 | qDebug("%s ",mText.latin1()); | 360 | // qDebug("%s ",mText.latin1()); |
361 | } | 361 | } |
362 | 362 | ||
363 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) | 363 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) |
364 | { | 364 | { |
365 | QString date; | 365 | QString date; |
366 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); | 366 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); |
367 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { | 367 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { |
368 | if ( i == 0 ) { | 368 | if ( i == 0 ) { |
369 | mText += "<table>\n"; | 369 | mText += "<table>\n"; |
370 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; | 370 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; |
371 | } | 371 | } |
372 | else if ( i == 1 ) | 372 | else if ( i == 1 ) |
373 | date = "<em><font color=\"#000080\">" + day + "</font></em>" ; | 373 | date = "<em><font color=\"#000080\">" + day + "</font></em>" ; |
374 | else date = "<em><font color=\"#000080\">" + day + "</font></em>"; | 374 | else date = "<em><font color=\"#000080\">" + day + "</font></em>"; |
375 | mText += "<h2>" + date + "</h2>\n"; | 375 | mText += "<h2>" + date + "</h2>\n"; |
376 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; | 376 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; |
377 | mText += "<table>\n"; | 377 | mText += "<table>\n"; |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
381 | } else { | 381 | } else { |
382 | if ( i == 0 ) { | 382 | if ( i == 0 ) { |
383 | mText += "<table>\n"; | 383 | mText += "<table>\n"; |
384 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; | 384 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; |
@@ -415,182 +415,187 @@ void KOWhatsNextView::showEvents(QPtrList<Event>) | |||
415 | void KOWhatsNextView::changeEventDisplay(Event *, int action) | 415 | void KOWhatsNextView::changeEventDisplay(Event *, int action) |
416 | { | 416 | { |
417 | switch(action) { | 417 | switch(action) { |
418 | case KOGlobals::EVENTADDED: | 418 | case KOGlobals::EVENTADDED: |
419 | updateView(); | 419 | updateView(); |
420 | break; | 420 | break; |
421 | case KOGlobals::EVENTEDITED: | 421 | case KOGlobals::EVENTEDITED: |
422 | updateView(); | 422 | updateView(); |
423 | break; | 423 | break; |
424 | case KOGlobals::EVENTDELETED: | 424 | case KOGlobals::EVENTDELETED: |
425 | updateView(); | 425 | updateView(); |
426 | break; | 426 | break; |
427 | default: | 427 | default: |
428 | updateView(); | 428 | updateView(); |
429 | kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; | 429 | kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) | 433 | void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) |
434 | { | 434 | { |
435 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) | 435 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) |
436 | return; | 436 | return; |
437 | QDateTime cdt = QDateTime::currentDateTime(); | 437 | QDateTime cdt = QDateTime::currentDateTime(); |
438 | QDateTime noc; | 438 | QDateTime noc; |
439 | QString tempText; | ||
439 | bool ok = true; | 440 | bool ok = true; |
440 | if ( reply ) { | 441 | if ( reply ) { |
441 | noc = ev->getNextOccurence( cdt, &ok ); | 442 | noc = ev->getNextOccurence( cdt, &ok ); |
442 | if (! ok && ev->type() == "Event") | 443 | if (! ok && ev->type() == "Event") |
443 | return; | 444 | return; |
444 | } | 445 | } |
445 | mText += "<tr><td><b>"; | 446 | tempText += "<tr><td><b>"; |
446 | if (ev->type()=="Event") { | 447 | if (ev->type()=="Event") { |
447 | if (reply) { | 448 | if (reply) { |
448 | if (!ev->doesFloat()) | 449 | if (!ev->doesFloat()) |
449 | mText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; | 450 | tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; |
450 | else | 451 | else |
451 | mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | 452 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; |
452 | 453 | ||
453 | } else { | 454 | } else { |
454 | if (!ev->doesFloat()) { | 455 | if (!ev->doesFloat()) { |
455 | Event *event = static_cast<Event *>(ev); | 456 | Event *event = static_cast<Event *>(ev); |
456 | QDateTime st,end; | 457 | QDateTime st,end; |
457 | if ( event->recurrence()->doesRecur() ) { | 458 | if ( event->recurrence()->doesRecur() ) { |
458 | QDate recDate= mEventDate; | 459 | QDate recDate= mEventDate; |
459 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); | 460 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); |
460 | while ( ! event->recursOn( recDate ) ) { | 461 | while ( ! event->recursOn( recDate ) ) { |
461 | recDate = recDate.addDays( -1 ); | 462 | recDate = recDate.addDays( -1 ); |
462 | 463 | ||
463 | } | 464 | } |
464 | st = QDateTime ( recDate, event->dtStart().time() ); | 465 | st = QDateTime ( recDate, event->dtStart().time() ); |
465 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); | 466 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); |
466 | } | 467 | } |
467 | else { | 468 | else { |
468 | st = event->dtStart(); | 469 | st = event->dtStart(); |
469 | end = event->dtEnd(); | 470 | end = event->dtEnd(); |
470 | } | 471 | } |
471 | 472 | ||
472 | 473 | ||
473 | QString dateText; | 474 | QString dateText; |
474 | // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); | 475 | // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); |
475 | if ( st.date() < mEventDate ) | 476 | if ( st.date() < mEventDate ) |
476 | dateText = "++:++-"; | 477 | dateText = "++:++-"; |
477 | else | 478 | else |
478 | dateText = event->dtStartTimeStr() + "-"; | 479 | dateText = event->dtStartTimeStr() + "-"; |
479 | if ( end.date() > mEventDate ) | 480 | if ( end.date() > mEventDate ) |
480 | dateText += "++:++"; | 481 | dateText += "++:++"; |
481 | else | 482 | else |
482 | dateText += event->dtEndTimeStr(); | 483 | dateText += event->dtEndTimeStr(); |
483 | if ( notRed ) | 484 | if ( notRed ) |
484 | mText += dateText; | 485 | tempText += dateText; |
485 | else { | 486 | else { |
486 | if ( end < cdt ) | 487 | if ( end < cdt ) { |
487 | mText += "<font color=\"#F00000\">" + dateText + "</font>"; | 488 | if ( !KOPrefs::instance()->mWNViewShowsPast ) |
489 | return; | ||
490 | tempText += "<font color=\"#F00000\">" + dateText + "</font>"; | ||
491 | } | ||
488 | else if ( st < cdt ) | 492 | else if ( st < cdt ) |
489 | mText += "<font color=\"#008000\">" + dateText + "</font>"; | 493 | tempText += "<font color=\"#008000\">" + dateText + "</font>"; |
490 | else | 494 | else |
491 | mText += dateText; | 495 | tempText += dateText; |
492 | 496 | ||
493 | } | 497 | } |
494 | 498 | ||
495 | } else { | 499 | } else { |
496 | mText += i18n("Allday:"); | 500 | tempText += i18n("Allday:"); |
497 | 501 | ||
498 | } | 502 | } |
499 | } | 503 | } |
500 | } else { | 504 | } else { |
501 | mTodos.append( ev ); | 505 | mTodos.append( ev ); |
502 | mText += i18n("ToDo:"); | 506 | tempText += i18n("ToDo:"); |
503 | if (reply) { | 507 | if (reply) { |
504 | mText += " "; | 508 | tempText += " "; |
505 | if ( noc != cdt ) { | 509 | if ( noc != cdt ) { |
506 | mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | 510 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; |
507 | } | 511 | } |
508 | } else { | 512 | } else { |
509 | if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { | 513 | if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { |
510 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 514 | // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
511 | QString dfs = KGlobal::locale()->dateFormatShort(); | 515 | QString dfs = KGlobal::locale()->dateFormatShort(); |
512 | KGlobal::locale()->setDateFormatShort("%d.%b"); | 516 | KGlobal::locale()->setDateFormatShort("%d.%b"); |
513 | mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; | 517 | tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; |
514 | KGlobal::locale()->setDateFormatShort(dfs); | 518 | KGlobal::locale()->setDateFormatShort(dfs); |
515 | } else { | 519 | } else { |
516 | if (!ev->doesFloat() ) | 520 | if (!ev->doesFloat() ) |
517 | if( ( (Todo*)ev)->dtDue() < cdt ) { | 521 | if( ( (Todo*)ev)->dtDue() < cdt ) { |
518 | mText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; | 522 | tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; |
519 | 523 | ||
520 | 524 | ||
521 | } else | 525 | } else |
522 | mText +=((Todo*)ev)->dtDueTimeStr(); | 526 | tempText +=((Todo*)ev)->dtDueTimeStr(); |
523 | mTodos.append( ev ); | 527 | mTodos.append( ev ); |
524 | } | 528 | } |
525 | } | 529 | } |
526 | } | 530 | } |
527 | mText += "</b></td><td>"; | 531 | tempText += "</b></td><td>"; |
528 | bool needClose = false; | 532 | bool needClose = false; |
529 | if ( ev->cancelled() ) { | 533 | if ( ev->cancelled() ) { |
530 | mText += "<font color=\"#F00000\">[c"; | 534 | tempText += "<font color=\"#F00000\">[c"; |
531 | needClose =true; | 535 | needClose =true; |
532 | 536 | ||
533 | } | 537 | } |
534 | if ( ev->isAlarmEnabled() ) { | 538 | if ( ev->isAlarmEnabled() ) { |
535 | if ( !needClose) | 539 | if ( !needClose) |
536 | mText +="["; | 540 | tempText +="["; |
537 | mText += "a"; | 541 | tempText += "a"; |
538 | needClose =true; | 542 | needClose =true; |
539 | 543 | ||
540 | } | 544 | } |
541 | if ( ev->description().length() > 0 ) { | 545 | if ( ev->description().length() > 0 ) { |
542 | if ( !needClose) | 546 | if ( !needClose) |
543 | mText +="["; | 547 | tempText +="["; |
544 | mText += "i"; | 548 | tempText += "i"; |
545 | needClose =true; | 549 | needClose =true; |
546 | } | 550 | } |
547 | if ( ev->recurrence()->doesRecur() ) { | 551 | if ( ev->recurrence()->doesRecur() ) { |
548 | if ( !needClose) | 552 | if ( !needClose) |
549 | mText +="["; | 553 | tempText +="["; |
550 | mText += "r"; | 554 | tempText += "r"; |
551 | needClose =true; | 555 | needClose =true; |
552 | } | 556 | } |
553 | if ( needClose ) { | 557 | if ( needClose ) { |
554 | mText += "] "; | 558 | tempText += "] "; |
555 | } | 559 | } |
556 | if ( ev->cancelled() ) | 560 | if ( ev->cancelled() ) |
557 | mText += "</font>"; | 561 | tempText += "</font>"; |
558 | mText += "<a "; | 562 | tempText += "<a "; |
559 | if (ev->type()=="Event") mText += "href=\"event:"; | 563 | if (ev->type()=="Event") tempText += "href=\"event:"; |
560 | if (ev->type()=="Todo") mText += "href=\"todo:"; | 564 | if (ev->type()=="Todo") tempText += "href=\"todo:"; |
561 | mText += ev->uid() + "\">"; | 565 | tempText += ev->uid() + "\">"; |
562 | if ( ev->summary().length() > 0 ) | 566 | if ( ev->summary().length() > 0 ) |
563 | mText += ev->summary(); | 567 | tempText += ev->summary(); |
564 | else | 568 | else |
565 | mText += i18n("-no summary-"); | 569 | tempText += i18n("-no summary-"); |
566 | mText += "</a>"; | 570 | tempText += "</a>"; |
567 | if ( KOPrefs::instance()->mWNViewShowLocation ) | 571 | if ( KOPrefs::instance()->mWNViewShowLocation ) |
568 | if ( !ev->location().isEmpty() ) | 572 | if ( !ev->location().isEmpty() ) |
569 | mText += " ("+ev->location() +")"; | 573 | tempText += " ("+ev->location() +")"; |
570 | if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) | 574 | if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) |
571 | mText += " ["+ev->relatedTo()->summary() +"]"; | 575 | tempText += " ["+ev->relatedTo()->summary() +"]"; |
572 | mText += "</td></tr>\n"; | 576 | tempText += "</td></tr>\n"; |
577 | mText += tempText; | ||
573 | } | 578 | } |
574 | 579 | ||
575 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | 580 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) |
576 | { | 581 | { |
577 | if ( mTodos.find( ev ) != mTodos.end() ) return false; | 582 | if ( mTodos.find( ev ) != mTodos.end() ) return false; |
578 | 583 | ||
579 | mTodos.append( ev ); | 584 | mTodos.append( ev ); |
580 | if ( !isSub ) | 585 | if ( !isSub ) |
581 | mText += "<p>"; | 586 | mText += "<p>"; |
582 | else | 587 | else |
583 | mText += "<li>"; | 588 | mText += "<li>"; |
584 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; | 589 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; |
585 | 590 | ||
586 | 591 | ||
587 | mText += ind; | 592 | mText += ind; |
588 | bool needClose = false; | 593 | bool needClose = false; |
589 | if ( ev->cancelled() ) { | 594 | if ( ev->cancelled() ) { |
590 | mText += "<font color=\"#F00000\">[c"; | 595 | mText += "<font color=\"#F00000\">[c"; |
591 | needClose =true; | 596 | needClose =true; |
592 | 597 | ||
593 | } | 598 | } |
594 | if ( ev->isAlarmEnabled() ) { | 599 | if ( ev->isAlarmEnabled() ) { |
595 | if ( !needClose) | 600 | if ( !needClose) |
596 | mText +="["; | 601 | mText +="["; |