author | zautrix <zautrix> | 2005-08-17 22:44:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-17 22:44:12 (UTC) |
commit | bd0f0feb2e1af8a346dc724c81f31214c52128e4 (patch) (unidiff) | |
tree | 7234e97f485901026e37a2deab734e9d431002f2 | |
parent | 671857b232224314ad7720ad4bc037758a90fa4b (diff) | |
download | kdepimpi-bd0f0feb2e1af8a346dc724c81f31214c52128e4.zip kdepimpi-bd0f0feb2e1af8a346dc724c81f31214c52128e4.tar.gz kdepimpi-bd0f0feb2e1af8a346dc724c81f31214c52128e4.tar.bz2 |
conflict settings
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 14 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 73 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 10 | ||||
-rw-r--r-- | korganizer/koprefs.h | 9 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 52 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 2 |
6 files changed, 138 insertions, 22 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 1a1fd0e..fcfa282 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1501,7 +1501,7 @@ | |||
1501 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, | 1501 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, |
1502 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, | 1502 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, |
1503 | { "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, | 1503 | { "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, |
1504 | { "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" }, | 1504 | { "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, |
1505 | { "Show date","Zeige Datum" }, | 1505 | { "Show date","Zeige Datum" }, |
1506 | { "No problem!","Null Problemo!" }, | 1506 | { "No problem!","Null Problemo!" }, |
1507 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, | 1507 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, |
@@ -1546,9 +1546,15 @@ | |||
1546 | { "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, | 1546 | { "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, |
1547 | { "Error saving data","Fehler beim Abspeichern" }, | 1547 | { "Error saving data","Fehler beim Abspeichern" }, |
1548 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, | 1548 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, |
1549 | { "","" }, | 1549 | { "Enable conflict detection","Schalte Konflikterkennung an" }, |
1550 | { "","" }, | 1550 | { "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, |
1551 | { "","" }, | 1551 | { "Filter for the edited event","Filter für den bearbeiteten Termin" }, |
1552 | { "Filter for other existing events","Filter für die anderen Termine" }, | ||
1553 | { "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, | ||
1554 | { "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, | ||
1555 | { "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, | ||
1556 | { "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, | ||
1557 | { "Conflict detection","Konflikterkennung" }, | ||
1552 | { "","" }, | 1558 | { "","" }, |
1553 | { "","" }, | 1559 | { "","" }, |
1554 | { "","" }, | 1560 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 26323b1..898da6c 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3036,7 +3036,16 @@ void CalendarView::changeEventDisplay(Event *which, int action) | |||
3036 | #ifdef DESKTOP_VERSION | 3036 | #ifdef DESKTOP_VERSION |
3037 | time = 500; | 3037 | time = 500; |
3038 | #endif | 3038 | #endif |
3039 | QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); | 3039 | bool checkC = false; |
3040 | if ( mConflictingEvent->doesFloat() ) { | ||
3041 | checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay | ||
3042 | || KOPrefs::instance()->mCheckConflictsAllDayNonAD; | ||
3043 | } else { | ||
3044 | checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay | ||
3045 | || KOPrefs::instance()->mCheckConflictsNonADNonAD; | ||
3046 | } | ||
3047 | if ( checkC ) | ||
3048 | QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); | ||
3040 | } | 3049 | } |
3041 | // } | 3050 | // } |
3042 | } else { | 3051 | } else { |
@@ -3055,32 +3064,62 @@ void CalendarView::checkConflictForEvent() | |||
3055 | if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { | 3064 | if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { |
3056 | return; | 3065 | return; |
3057 | } | 3066 | } |
3067 | CalFilter *filterIN = 0; | ||
3068 | CalFilter *filterALL = 0; | ||
3069 | CalFilter *filter = mFilters.first(); | ||
3070 | while(filter) { | ||
3071 | if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) | ||
3072 | filterIN = filter; | ||
3073 | if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) | ||
3074 | filterALL = filter; | ||
3075 | filter = mFilters.next(); | ||
3076 | } | ||
3077 | if ( filterIN ) { | ||
3078 | if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { | ||
3079 | return; | ||
3080 | } | ||
3081 | } | ||
3058 | QPtrList<Event> testlist = mCalendar->events(); | 3082 | QPtrList<Event> testlist = mCalendar->events(); |
3059 | Event * test = testlist.first(); | 3083 | Event * test = testlist.first(); |
3060 | QDateTime conflict; | 3084 | QDateTime conflict; |
3061 | QDateTime retVal; | 3085 | QDateTime retVal; |
3062 | bool found = false; | 3086 | bool found = false; |
3063 | Event * cE = 0; | 3087 | Event * cE = 0; |
3088 | bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; | ||
3089 | bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; | ||
3090 | if ( !conflictingEvent->doesFloat() ) { | ||
3091 | chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; | ||
3092 | chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; | ||
3093 | } | ||
3064 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); | 3094 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); |
3065 | while ( test ) { | 3095 | while ( test ) { |
3066 | qApp->processEvents(); | 3096 | qApp->processEvents(); |
3067 | bool skip = false; | 3097 | bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); |
3068 | if ( found ) | 3098 | if ( !skip ) { |
3069 | skip = !test->matchTime( ¤t, &conflict ); | 3099 | if ( filterALL ) { |
3070 | else | 3100 | if ( !filterALL->filterCalendarItem( test ) ) { |
3071 | skip = !test->matchTime( ¤t, 0 ); | 3101 | skip = true; |
3072 | if ( !skip && !test->doesFloat() ) { | 3102 | } |
3073 | if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { | 3103 | } |
3074 | if ( ! found ) { | 3104 | if ( !skip ) { |
3075 | conflict = retVal; | 3105 | if ( found ) |
3076 | cE = test; | 3106 | skip = !test->matchTime( ¤t, &conflict ); |
3077 | } else { | 3107 | else |
3078 | if ( retVal < conflict ) { | 3108 | skip = !test->matchTime( ¤t, 0 ); |
3079 | conflict = retVal; | 3109 | if ( !skip ) { |
3080 | cE = test; | 3110 | if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |
3111 | if ( ! found ) { | ||
3112 | conflict = retVal; | ||
3113 | cE = test; | ||
3114 | } else { | ||
3115 | if ( retVal < conflict ) { | ||
3116 | conflict = retVal; | ||
3117 | cE = test; | ||
3118 | } | ||
3119 | } | ||
3120 | found = true; | ||
3081 | } | 3121 | } |
3082 | } | 3122 | } |
3083 | found = true; | ||
3084 | } | 3123 | } |
3085 | } | 3124 | } |
3086 | test = testlist.next(); | 3125 | test = testlist.next(); |
@@ -3090,7 +3129,7 @@ void CalendarView::checkConflictForEvent() | |||
3090 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; | 3129 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; |
3091 | qApp->processEvents(); | 3130 | qApp->processEvents(); |
3092 | int km = KMessageBox::warningContinueCancel(this,mess, | 3131 | int km = KMessageBox::warningContinueCancel(this,mess, |
3093 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); | 3132 | i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!")); |
3094 | if ( km != KMessageBox::Continue ) { | 3133 | if ( km != KMessageBox::Continue ) { |
3095 | return; | 3134 | return; |
3096 | } | 3135 | } |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 77f572c..571ca11 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -230,7 +230,15 @@ KOPrefs::KOPrefs() : | |||
230 | addItemBool("UseAppColors",&mUseAppColors,false); | 230 | addItemBool("UseAppColors",&mUseAppColors,false); |
231 | 231 | ||
232 | 232 | ||
233 | 233 | KPrefs::setCurrentGroup("Conflicts"); | |
234 | addItemBool("EnableAutoDetect",&mDetectConflicts,true); | ||
235 | addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false); | ||
236 | addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false); | ||
237 | addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false); | ||
238 | addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true); | ||
239 | addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" ); | ||
240 | addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" ); | ||
241 | |||
234 | KPrefs::setCurrentGroup("Views"); | 242 | KPrefs::setCurrentGroup("Views"); |
235 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); | 243 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); |
236 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 244 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 9749ba3..576edf9 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -349,6 +349,15 @@ class KOPrefs : public KPimPrefs | |||
349 | int mNextAvailableCalendar; | 349 | int mNextAvailableCalendar; |
350 | bool mGlobalUpdateDisabled; | 350 | bool mGlobalUpdateDisabled; |
351 | 351 | ||
352 | |||
353 | bool mDetectConflicts; | ||
354 | bool mCheckConflictsAllDayAllDay; | ||
355 | bool mCheckConflictsAllDayNonAD; | ||
356 | bool mCheckConflictsNonADAllDay; | ||
357 | bool mCheckConflictsNonADNonAD; | ||
358 | QString mFilterConflictEditItem; | ||
359 | QString mFilterConflictAllItem; | ||
360 | |||
352 | private: | 361 | private: |
353 | QDict<QColor> mCategoryColors; | 362 | QDict<QColor> mCategoryColors; |
354 | QArray<KopiCalendarFile*> mDefCalColors; | 363 | QArray<KopiCalendarFile*> mDefCalColors; |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 9e2378a..bbdf508 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -922,6 +922,41 @@ dummy = | |||
922 | &(KOPrefs::instance()->mWTshowChanged),topFrame); | 922 | &(KOPrefs::instance()->mWTshowChanged),topFrame); |
923 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 923 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
924 | 924 | ||
925 | topFrame = addPage(i18n("Conflict detection"),0,0); | ||
926 | |||
927 | topLayout = new QGridLayout(topFrame,2,1); | ||
928 | topLayout->setSpacing(mSpacingHint); | ||
929 | topLayout->setMargin(mMarginHint); | ||
930 | ii = 0; | ||
931 | dummy = addWidBool(i18n("Enable conflict detection"), | ||
932 | &(KOPrefs::instance()->mDetectConflicts),topFrame); | ||
933 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
934 | topFrame = new QFrame( topFrame ); | ||
935 | topLayout->addWidget(topFrame ,ii++,0); | ||
936 | topLayout = new QGridLayout(topFrame,4,1); | ||
937 | connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); | ||
938 | topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:"), topFrame ) , ii++,0); | ||
939 | topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0); | ||
940 | mFilterEditItem = new QComboBox( topFrame ); | ||
941 | topLayout->addWidget(mFilterEditItem,ii++,0); | ||
942 | topLayout->addWidget( new QLabel ( i18n("Filter for other existing events"), topFrame ) , ii++,0); | ||
943 | mFilterAllItem = new QComboBox( topFrame ); | ||
944 | topLayout->addWidget(mFilterAllItem,ii++,0); | ||
945 | dummy = addWidBool(i18n("Check Allday with Allday"), | ||
946 | &(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame); | ||
947 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
948 | dummy = addWidBool(i18n("Check Allday with NonAllday"), | ||
949 | &(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame); | ||
950 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
951 | dummy = addWidBool(i18n("Check NonAllday with Allday"), | ||
952 | &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame); | ||
953 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
954 | dummy = addWidBool(i18n("Check NonAllday with NonAllday"), | ||
955 | &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame); | ||
956 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
957 | |||
958 | |||
959 | |||
925 | 960 | ||
926 | topFrame = addPage(i18n("Alarm"),0,0); | 961 | topFrame = addPage(i18n("Alarm"),0,0); |
927 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 962 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
@@ -1435,6 +1470,20 @@ void KOPrefsDialog::usrReadConfig() | |||
1435 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); | 1470 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); |
1436 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); | 1471 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); |
1437 | mCatDefaultColor = KOPrefs::instance()->mEventColor; | 1472 | mCatDefaultColor = KOPrefs::instance()->mEventColor; |
1473 | |||
1474 | |||
1475 | KConfig cfgko(locateLocal("config","korganizerrc")); | ||
1476 | cfgko.setGroup("General"); | ||
1477 | QStringList temp = cfgko.readListEntry("CalendarFilters"); | ||
1478 | temp.prepend(i18n("No Filter") ); | ||
1479 | mFilterEditItem->insertStringList( temp ); | ||
1480 | mFilterAllItem->insertStringList( temp ); | ||
1481 | int index = temp.findIndex( KOPrefs::instance()->mFilterConflictEditItem ); | ||
1482 | if ( index >= 0 ) | ||
1483 | mFilterEditItem->setCurrentItem( index ); | ||
1484 | index = temp.findIndex( KOPrefs::instance()->mFilterConflictAllItem ); | ||
1485 | if ( index >= 0 ) | ||
1486 | mFilterAllItem->setCurrentItem( index ); | ||
1438 | } | 1487 | } |
1439 | 1488 | ||
1440 | 1489 | ||
@@ -1479,6 +1528,9 @@ void KOPrefsDialog::usrWriteConfig() | |||
1479 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | 1528 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; |
1480 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | 1529 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; |
1481 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | 1530 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; |
1531 | |||
1532 | KOPrefs::instance()->mFilterConflictEditItem = mFilterEditItem->currentText(); | ||
1533 | KOPrefs::instance()->mFilterConflictAllItem = mFilterAllItem->currentText(); | ||
1482 | } | 1534 | } |
1483 | 1535 | ||
1484 | void KOPrefsDialog::updateCategories() | 1536 | void KOPrefsDialog::updateCategories() |
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index baa6cf9..ee7a7aa 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h | |||
@@ -147,6 +147,8 @@ class KOPrefsDialog : public KPrefsDialog | |||
147 | QSpinBox * mAlarmSuspendCount; | 147 | QSpinBox * mAlarmSuspendCount; |
148 | QSpinBox * mAlarmBeepInterval; | 148 | QSpinBox * mAlarmBeepInterval; |
149 | 149 | ||
150 | QComboBox * mFilterEditItem, *mFilterAllItem; | ||
151 | |||
150 | QLineEdit * mDefaultAlarmFile; | 152 | QLineEdit * mDefaultAlarmFile; |
151 | int mSpacingHint; | 153 | int mSpacingHint; |
152 | int mMarginHint; | 154 | int mMarginHint; |