-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 14 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 45 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 8 | ||||
-rw-r--r-- | korganizer/koprefs.h | 9 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 52 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 2 |
6 files changed, 123 insertions, 7 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 @@ -1456,101 +1456,107 @@ { "Reload","Neu laden" }, { "Timezone settings","Zeitzoneneinstellung" }, { "Title: ","Titel: " }, { "Journal from: ","Journal vom: " }, { "Journal: %1 from ","Journal: %1 vom " }, { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, { "Selected Item","Ausgewähltes Item" }, { "Select Date...","Wähle Datum..." }, { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, { "Change category list now!","Ändere Kategorieliste jetzt!" }, { "Edit category list...","Ändere Kategorieliste..." }, { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, { "Filepath: ","Dateipfad: " }, { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, { "Pending Suspend Alarm","Laufender Suspend Alarm" }, { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, { "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, { "Alarm Options","Alarm Einstellungen" }, { "Delete selected...","Lösche Ausgewählte..." }, { "None","Nichts" }, { "Selection","Auswahl" }, { "Set categories","Setze Kategorien" }, { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, { "Reset","Neu setzen" }, { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, { "Edit","Edit" }, { "Last Modified","Zuletzt geändert" }, { "Journal viewer","Journal Anzeige" }, { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, { "Hide Completed","Verstecke erledigte Todos" }, { "Show not Running","Zeige nicht Laufende" }, { "Click to add new Todo","Klick für neues Todo!" }, { "Show next conflict for","Zeige nächsten Konflikt für" }, { "All events","Alle Termine" }, { "Allday events","Ganztagestermine" }, { "Events with time","Termine mit Zeit" }, { "No conflict found","Kein Konflikt gefunden" }, { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, { "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" }, -{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" }, +{ "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, { "Show date","Zeige Datum" }, { "No problem!","Null Problemo!" }, { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, { "Pi-Sync Error","Pi-Sync Fehler" }, { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, { "Receiving file from remote...","Empfange entfernte Datei..." }, { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, { "Writing back file ...","Schreibe Datei zurück..." }, { "Sending back file ...","Sende Datei zurück..." }, { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, { "Created","Angelegt" }, { "Last Modified Sub","Zuletzt geändertes Sub" }, { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, { "Duration","Dauer" }, { " day"," Tag" }, { "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, { "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, { "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, { "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, { "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, { "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, { "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, { "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, { "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, { "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, { "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, { "<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)" }, { "Error saving data","Fehler beim Abspeichern" }, { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, -{ "","" }, -{ "","" }, -{ "","" }, +{ "Enable conflict detection","Schalte Konflikterkennung an" }, +{ "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:" }, +{ "Filter for the edited event","Filter für den bearbeiteten Termin" }, +{ "Filter for other existing events","Filter für die anderen Termine" }, +{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, +{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, +{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, +{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, +{ "Conflict detection","Konflikterkennung" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 26323b1..898da6c 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2991,151 +2991,190 @@ void CalendarView::changeTodoDisplay(Todo *which, int action) mViewManager->updateWNview(); //mTodoList->updateView(); } } void CalendarView::changeIncidenceDisplay(Incidence *which, int action) { updateUnmanagedViews(); //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); if ( action == KOGlobals::EVENTDELETED ) { //delete mCalendar->checkAlarmForIncidence( 0, true ); if ( mEventViewerDialog ) mEventViewerDialog->hide(); } else mCalendar->checkAlarmForIncidence( which , false ); } // most of the changeEventDisplays() right now just call the view's // total update mode, but they SHOULD be recoded to be more refresh-efficient. void CalendarView::changeEventDisplay(Event *which, int action) { // kdDebug() << "CalendarView::changeEventDisplay" << endl; changeIncidenceDisplay((Incidence *)which, action); static bool clearallviews = false; if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { if ( clearallviews ) { clearAllViews(); clearallviews = false; } return; } clearallviews = true; mDateNavigator->updateView(); //mDialogManager->updateSearchDialog(); if (which) { // If there is an event view visible update the display mViewManager->currentView()->changeEventDisplay(which,action); // TODO: check, if update needed // if (which->getTodoStatus()) { mTodoList->updateView(); if ( action != KOGlobals::EVENTDELETED ) { mConflictingEvent = which ; int time = 1000; #ifdef DESKTOP_VERSION time = 500; #endif + bool checkC = false; + if ( mConflictingEvent->doesFloat() ) { + checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay + || KOPrefs::instance()->mCheckConflictsAllDayNonAD; + } else { + checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay + || KOPrefs::instance()->mCheckConflictsNonADNonAD; + } + if ( checkC ) QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); } // } } else { mViewManager->currentView()->updateView(); } } void CalendarView::checkConflictForEvent() { if (!KOPrefs::instance()->mConfirm) return; if ( ! mConflictingEvent ) return; Event * conflictingEvent = mConflictingEvent; mConflictingEvent = 0; QDateTime current = QDateTime::currentDateTime(); if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { return; } + CalFilter *filterIN = 0; + CalFilter *filterALL = 0; + CalFilter *filter = mFilters.first(); + while(filter) { + if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) + filterIN = filter; + if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) + filterALL = filter; + filter = mFilters.next(); + } + if ( filterIN ) { + if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { + return; + } + } QPtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); QDateTime conflict; QDateTime retVal; bool found = false; Event * cE = 0; + bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; + bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; + if ( !conflictingEvent->doesFloat() ) { + chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; + chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; + } topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); while ( test ) { qApp->processEvents(); - bool skip = false; + bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); + if ( !skip ) { + if ( filterALL ) { + if ( !filterALL->filterCalendarItem( test ) ) { + skip = true; + } + } + if ( !skip ) { if ( found ) skip = !test->matchTime( ¤t, &conflict ); else skip = !test->matchTime( ¤t, 0 ); - if ( !skip && !test->doesFloat() ) { + if ( !skip ) { if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { if ( ! found ) { conflict = retVal; cE = test; } else { if ( retVal < conflict ) { conflict = retVal; cE = test; } } found = true; } } + } + } test = testlist.next(); } topLevelWidget()->setCaption( i18n("KO/Pi") ); if ( found ) { 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()) ) ; qApp->processEvents(); int km = KMessageBox::warningContinueCancel(this,mess, - i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); + i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!")); if ( km != KMessageBox::Continue ) { return; } if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) mViewManager->showDayView(); mNavigator->slotDaySelect( conflict.date() ); int hour = conflict.time().hour(); mViewManager->agendaView()->setStartHour( hour ); topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); } else topLevelWidget()->setCaption( i18n("No conflict found") ); return; } void CalendarView::updateTodoViews() { mTodoList->updateView(); mViewManager->currentView()->updateView(); } void CalendarView::clearAllViews() { mTodoList->clearList(); mViewManager->clearAllViews(); SearchDialog * sd = mDialogManager->getSearchDialog(); if ( sd ) { KOListView* kol = sd->listview(); if ( kol ) kol->clearList(); } } void CalendarView::updateView() { static bool clearallviews = false; if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { if ( clearallviews ) { clearAllViews(); clearallviews = false; } return; } clearallviews = true; DateList tmpList = mNavigator->selectedDates(); diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 77f572c..571ca11 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -185,96 +185,104 @@ KOPrefs::KOPrefs() : addItemFont("EventView Font",&mEventViewFont,fon); KPrefs::setCurrentGroup("RemoteSyncing"); addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); addItemBool("ShowSyncEvents",&mShowSyncEvents,false); addItemInt("LastSyncTime",&mLastSyncTime,0); #ifdef _WIN32_ QString hdp= locateLocal("data","korganizer")+"\\\\"; #else QString hdp= locateLocal("data","korganizer")+"/"; #endif KPrefs::setCurrentGroup("LoadSaveFileNames"); addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); KPrefs::setCurrentGroup("Locale"); addItemBool("ShortDateInViewer",&mShortDateInViewer,false); KPrefs::setCurrentGroup("Colors"); addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); addItemBool("MonthViewWeek",&mMonthViewWeek,false); addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); addItemBool("UseAppColors",&mUseAppColors,false); + KPrefs::setCurrentGroup("Conflicts"); + addItemBool("EnableAutoDetect",&mDetectConflicts,true); + addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false); + addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false); + addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false); + addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true); + addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" ); + addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" ); KPrefs::setCurrentGroup("Views"); addItemBool("Block Popup Menu",&mBlockPopupMenu,false); addItemBool("Show Date Navigator",&mShowDateNavigator,true); addItemInt("Hour Size",&mHourSize,8); addItemBool("Show Daily Recurrences",&mDailyRecur,true); addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); addItemBool("ShowShortMonthName",&mMonthShowShort,false); addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); #ifdef DESKTOP_VERION addItemBool("Enable ToolTips",&mEnableToolTips,true); #else addItemBool("Enable ToolTips",&mEnableToolTips,false); #endif addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false); addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); #ifdef DESKTOP_VERSION addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); #else addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); #endif addItemInt("Day Begins",&mDayBegins,7); addItemInt("Working Hours Start",&mWorkingHoursStart,8); addItemInt("Working Hours End",&mWorkingHoursEnd,17); addItemBool("Exclude Holidays",&mExcludeHolidays,true); addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 9749ba3..576edf9 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -304,62 +304,71 @@ class KOPrefs : public KPimPrefs bool mHighlightCurrentDay; bool mUseHighlightLightColor; bool mListViewMonthTimespan; bool mWNViewShowsParents; bool mWNViewShowsPast; bool mWNViewShowLocation; bool mTodoViewShowsPercentage; bool mTodoViewUsesCatColors; bool mMonthViewUsesBigFont; bool mTodoViewUsesSmallFont; bool mTodoViewUsesForegroundColor; bool mMonthViewUsesForegroundColor; bool mHightlightDateTimeEdit; bool mShortDateInViewer; bool mShowDateNavigator; QStringList mLocationDefaults; QStringList mEventSummaryUser; QStringList mTodoSummaryUser; QStringList mJournalSummaryUser; bool mUseInternalAlarmNotification; int mAlarmPlayBeeps; int mAlarmSuspendTime; int mAlarmSuspendCount; int mAlarmBeepInterval; int mOldLanguage; int mOldLoadedLanguage; QString mActiveSyncPort; QString mActiveSyncIP; // settings for eventviewer bool mEVshowDetails; bool mEVshowCreated; bool mEVshowChanged; bool mWTshowDetails; bool mWTshowCreated; bool mWTshowChanged; int mCurrentDisplayedView; QPtrList<KopiCalendarFile> mCalendars; int mNextAvailableCalendar; bool mGlobalUpdateDisabled; + + bool mDetectConflicts; + bool mCheckConflictsAllDayAllDay; + bool mCheckConflictsAllDayNonAD; + bool mCheckConflictsNonADAllDay; + bool mCheckConflictsNonADNonAD; + QString mFilterConflictEditItem; + QString mFilterConflictAllItem; + private: QDict<QColor> mCategoryColors; QArray<KopiCalendarFile*> mDefCalColors; QColor mDefaultCategoryColor; QFont mDefaultTimeBarFont; QFont mDefaultViewFont; QFont mDefaultMonthViewFont; QString mName; QString mEmail; }; #endif diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 9e2378a..bbdf508 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -877,96 +877,131 @@ dummy = topLayout->addWidget(wid,ii++,0); dummy = addWidBool(i18n("Colors are applied to text"), &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); topFrame = addPage(i18n("View Options"),0,0); topLayout = new QGridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; dummy = addWidBool(i18n("Show Sync Events"), &(KOPrefs::instance()->mShowSyncEvents),topFrame); topLayout->addWidget(dummy->checkBox(), ii++,0); lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); topLayout->addWidget(lab ,ii++,0); dummy = addWidBool(i18n("Details"), &(KOPrefs::instance()->mEVshowDetails),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Created time"), &(KOPrefs::instance()->mEVshowCreated),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Last modified time"), &(KOPrefs::instance()->mEVshowChanged),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); topLayout->addWidget(lab ,ii++,0); dummy = addWidBool(i18n("Details"), &(KOPrefs::instance()->mWTshowDetails),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Created time"), &(KOPrefs::instance()->mWTshowCreated),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Last modified time"), &(KOPrefs::instance()->mWTshowChanged),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); + topFrame = addPage(i18n("Conflict detection"),0,0); + + topLayout = new QGridLayout(topFrame,2,1); + topLayout->setSpacing(mSpacingHint); + topLayout->setMargin(mMarginHint); + ii = 0; + dummy = addWidBool(i18n("Enable conflict detection"), + &(KOPrefs::instance()->mDetectConflicts),topFrame); + topLayout->addWidget(dummy->checkBox(), ii++,0); + topFrame = new QFrame( topFrame ); + topLayout->addWidget(topFrame ,ii++,0); + topLayout = new QGridLayout(topFrame,4,1); + connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); + 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); + topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0); + mFilterEditItem = new QComboBox( topFrame ); + topLayout->addWidget(mFilterEditItem,ii++,0); + topLayout->addWidget( new QLabel ( i18n("Filter for other existing events"), topFrame ) , ii++,0); + mFilterAllItem = new QComboBox( topFrame ); + topLayout->addWidget(mFilterAllItem,ii++,0); + dummy = addWidBool(i18n("Check Allday with Allday"), + &(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame); + topLayout->addWidget(dummy->checkBox(), ii++,0); + dummy = addWidBool(i18n("Check Allday with NonAllday"), + &(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame); + topLayout->addWidget(dummy->checkBox(), ii++,0); + dummy = addWidBool(i18n("Check NonAllday with Allday"), + &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame); + topLayout->addWidget(dummy->checkBox(), ii++,0); + dummy = addWidBool(i18n("Check NonAllday with NonAllday"), + &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame); + topLayout->addWidget(dummy->checkBox(), ii++,0); + + + topFrame = addPage(i18n("Alarm"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); topLayout = new QGridLayout(topFrame,2,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; dummy = addWidBool(i18n("Use internal alarm notification"), &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); topLayout->addWidget(dummy->checkBox(),iii++,0); if ( QApplication::desktop()->height() > 240 ) { lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); topLayout->addWidget(lab ,iii++,0); } #ifndef DESKTOP_VERSION lab->setAlignment( AlignLeft|WordBreak|AlignTop); #else lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); #endif QHBox* dummyBox = new QHBox(topFrame); new QLabel(i18n("Play beeps count:"),dummyBox); mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); dummyBox = new QHBox(topFrame); new QLabel(i18n("Beeps interval in sec:"),dummyBox); mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); dummyBox = new QHBox(topFrame); new QLabel(i18n("Default suspend time in min:"),dummyBox); mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); dummyBox = new QHBox(topFrame); new QLabel(i18n("Auto suspend count:"),dummyBox); mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); @@ -1390,140 +1425,157 @@ void KOPrefsDialog::showPrinterTab() void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, const QStringList *tags) { if (tags) { int i = tags->findIndex(text); if (i > 0) combo->setCurrentItem(i); } else { for(int i=0;i<combo->count();++i) { if (combo->text(i) == text) { combo->setCurrentItem(i); break; } } } } void KOPrefsDialog::usrReadConfig() { mNameEdit->setText(KOPrefs::instance()->fullName()); mEmailEdit->setText(KOPrefs::instance()->email()); mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); // mAMails->clear(); // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { // QListViewItem *item = new QListViewItem(mAMails); // item->setText(0,*it); // mAMails->insertItem(item); // } //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); updateCategories(); mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); mCatDefaultColor = KOPrefs::instance()->mEventColor; + + + KConfig cfgko(locateLocal("config","korganizerrc")); + cfgko.setGroup("General"); + QStringList temp = cfgko.readListEntry("CalendarFilters"); + temp.prepend(i18n("No Filter") ); + mFilterEditItem->insertStringList( temp ); + mFilterAllItem->insertStringList( temp ); + int index = temp.findIndex( KOPrefs::instance()->mFilterConflictEditItem ); + if ( index >= 0 ) + mFilterEditItem->setCurrentItem( index ); + index = temp.findIndex( KOPrefs::instance()->mFilterConflictAllItem ); + if ( index >= 0 ) + mFilterAllItem->setCurrentItem( index ); } void KOPrefsDialog::usrWriteConfig() { KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); KOPrefs::instance()->setFullName(mNameEdit->text()); KOPrefs::instance()->setEmail(mEmailEdit->text()); KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) { QStringList cat = KOPrefs::instance()->mCustomCategories; int iii = 0; while ( iii < cat.count() ) { if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); ++iii; } } QDictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; } KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); KOPrefs::instance()->mAdditionalMails.clear(); // QListViewItem *item; // item = mAMails->firstChild(); // while (item) // { // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); // item = item->nextSibling(); // } KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; + + KOPrefs::instance()->mFilterConflictEditItem = mFilterEditItem->currentText(); + KOPrefs::instance()->mFilterConflictAllItem = mFilterAllItem->currentText(); } void KOPrefsDialog::updateCategories() { mCategoryCombo->clear(); mCategoryDict.clear(); mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); updateCategoryColor(); } void KOPrefsDialog::toggleEmailSettings(bool on) { if (on) { mEmailEdit->setEnabled(false); mNameEdit->setEnabled(false); mEmailLabel->setEnabled(false); mNameLabel->setEnabled(false); KEMailSettings settings; mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); } else { mEmailEdit->setEnabled(true); mNameEdit->setEnabled(true); mEmailLabel->setEnabled(true); mNameLabel->setEnabled(true); } } void KOPrefsDialog::addItem() { // aEmailsEdit->setEnabled(true); // QListViewItem *item = new QListViewItem(mAMails); // mAMails->insertItem(item); // mAMails->setSelected(item,true); // aEmailsEdit->setText(i18n("(EmptyEmail)")); } void KOPrefsDialog::removeItem() { // QListViewItem *item; // item = mAMails->selectedItem(); // if (!item) return; // mAMails->takeItem(item); // item = mAMails->selectedItem(); // if (!item) { // aEmailsEdit->setText(""); // aEmailsEdit->setEnabled(false); diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index baa6cf9..ee7a7aa 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -102,54 +102,56 @@ class KOPrefsDialog : public KPrefsDialog QComboBox *timeCombo; QComboBox *tzCombo; // widgets holding preferences data QLineEdit *mNameEdit; QLineEdit *mEmailEdit; QLabel *mNameLabel; QLabel *mEmailLabel; QLineEdit *mAdditionalEdit; QSpinBox *mAutoSaveIntervalSpin; QSpinBox *mPrioSpin; // QListView *mAMails; QLineEdit *aEmailsEdit; QComboBox *mTimeZoneCombo; QStringList tzonenames; QSpinBox *mStartTimeSpin; QSpinBox *mDefaultDurationSpin; QComboBox *mAlarmTimeCombo; QComboBox *mCategoryCombo; KColorButton *mCategoryButton; QDict<QColor> mCategoryDict; QSlider *mHourSizeSlider; QSpinBox *mNextXDaysSpin; QSpinBox *mWhatsNextSpin; QLineEdit * mRemoteIPEdit; QLineEdit * mRemoteUser; QLineEdit * mRemotePassWd; QLineEdit * mRemoteFile; QLineEdit * mLocalTempFile; QWidget* mSetupSyncAlgTab; QLineEdit * mUserDateFormatLong; QLineEdit * mUserDateFormatShort; QSpinBox *mTimezoneOffsetSpin; QSpinBox *mDaylightsavingStart; QSpinBox *mDaylightsavingEnd; KDateEdit* mStartDateSavingEdit; KDateEdit* mEndDateSavingEdit; QSpinBox * mAlarmPlayBeeps; QSpinBox * mAlarmSuspendTime; QSpinBox * mAlarmSuspendCount; QSpinBox * mAlarmBeepInterval; + QComboBox * mFilterEditItem, *mFilterAllItem; + QLineEdit * mDefaultAlarmFile; int mSpacingHint; int mMarginHint; }; #endif |