-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 52 | ||||
-rw-r--r-- | libkcal/event.cpp | 16 | ||||
-rw-r--r-- | libkcal/event.h | 2 |
4 files changed, 45 insertions, 29 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 43bc343..34e9b7f 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1309,209 +1309,209 @@ | |||
1309 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1309 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1310 | { "Print unscaled","Drucke unskaliert" }, | 1310 | { "Print unscaled","Drucke unskaliert" }, |
1311 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1311 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1312 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1312 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1313 | { "Printout Mode","Druck Modus" }, | 1313 | { "Printout Mode","Druck Modus" }, |
1314 | { "Filter menu icon","Filtermenu Icon" }, | 1314 | { "Filter menu icon","Filtermenu Icon" }, |
1315 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, | 1315 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, |
1316 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, | 1316 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, |
1317 | { "%1d","%1t" }, | 1317 | { "%1d","%1t" }, |
1318 | { "%1h","%1std" }, | 1318 | { "%1h","%1std" }, |
1319 | { "%1min","%1min" }, | 1319 | { "%1min","%1min" }, |
1320 | { "( %1 before )","( %1 vorher )" }, | 1320 | { "( %1 before )","( %1 vorher )" }, |
1321 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, | 1321 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, |
1322 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, | 1322 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, |
1323 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, | 1323 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, |
1324 | { "Show Sync Events","Zeige Sync-Ereignisse" }, | 1324 | { "Show Sync Events","Zeige Sync-Ereignisse" }, |
1325 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, | 1325 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, |
1326 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, | 1326 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, |
1327 | { " on "," am " }, | 1327 | { " on "," am " }, |
1328 | { "On: ","Am: " }, | 1328 | { "On: ","Am: " }, |
1329 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, | 1329 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, |
1330 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, | 1330 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, |
1331 | { "Color for running todos:","Farbe für laufende Todos:" }, | 1331 | { "Color for running todos:","Farbe für laufende Todos:" }, |
1332 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, | 1332 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, |
1333 | { "Todo is started","Todo ist gestartet" }, | 1333 | { "Todo is started","Todo ist gestartet" }, |
1334 | { "Stop todo","Stoppe Todo" }, | 1334 | { "Stop todo","Stoppe Todo" }, |
1335 | { "Todo is stopped","Todo ist gestoppt" }, | 1335 | { "Todo is stopped","Todo ist gestoppt" }, |
1336 | { "Start todo","Starte Todo" }, | 1336 | { "Start todo","Starte Todo" }, |
1337 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, | 1337 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, |
1338 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, | 1338 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, |
1339 | { "Todo has subtodos","Todo hat Untertodos" }, | 1339 | { "Todo has subtodos","Todo hat Untertodos" }, |
1340 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1340 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1341 | { "Colors","Farben" }, | 1341 | { "Colors","Farben" }, |
1342 | { "Click on new parent item","Klicke auf neues Übertodo" }, | 1342 | { "Click on new parent item","Klicke auf neues Übertodo" }, |
1343 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, | 1343 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, |
1344 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, | 1344 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, |
1345 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, | 1345 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, |
1346 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, | 1346 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, |
1347 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 1347 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
1348 | { "times","Zeiten" }, | 1348 | { "times","Zeiten" }, |
1349 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, | 1349 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, |
1350 | { "Backup enabled","Backup angeschaltet" }, | 1350 | { "Backup enabled","Backup angeschaltet" }, |
1351 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 1351 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
1352 | { "Number of Backups:","Anzahl der Backups" }, | 1352 | { "Number of Backups:","Anzahl der Backups" }, |
1353 | { "Make backup every ","Mache ein Backup alle " }, | 1353 | { "Make backup every ","Mache ein Backup alle " }, |
1354 | { " days"," Tage" }, | 1354 | { " days"," Tage" }, |
1355 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, | 1355 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, |
1356 | { "Backup Failed!","Backup Problem!" }, | 1356 | { "Backup Failed!","Backup Problem!" }, |
1357 | { "Try again now","Versuche jetzt nochmal" }, | 1357 | { "Try again now","Versuche jetzt nochmal" }, |
1358 | { "Try again later","Versuche später nochmal" }, | 1358 | { "Try again later","Versuche später nochmal" }, |
1359 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1359 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1360 | { "Disable backup","Schalte Backup ab" }, | 1360 | { "Disable backup","Schalte Backup ab" }, |
1361 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1361 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1362 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1362 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1363 | { "Choose action","Wähle Aktion" }, | 1363 | { "Choose action","Wähle Aktion" }, |
1364 | { "Comment for todo:","Kommentar zum Todo:" }, | 1364 | { "Comment for todo:","Kommentar zum Todo:" }, |
1365 | { "Stop+note","Stop+Notiz" }, | 1365 | { "Stop+note","Stop+Notiz" }, |
1366 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, | 1366 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, |
1367 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, | 1367 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, |
1368 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, | 1368 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1369 | { "Print complete list...","Drucke komplette Liste..." }, | 1369 | { "Print complete list...","Drucke komplette Liste..." }, |
1370 | { "Hide all selected","Verstecke Ausgewählte" }, | 1370 | { "Hide all selected","Verstecke Ausgewählte" }, |
1371 | { "Add items","hinzufügen" }, | 1371 | { "Add items","hinzufügen" }, |
1372 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, | 1372 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, |
1373 | { "Print List View...","Drucke Listenansicht..." }, | 1373 | { "Print List View...","Drucke Listenansicht..." }, |
1374 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, | 1374 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, |
1375 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, | 1375 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, |
1376 | { "Global Settings...","Globale Einstellungen..." }, | 1376 | { "Global Settings...","Globale Einstellungen..." }, |
1377 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, | 1377 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, |
1378 | { "(disabled)","(abgeschaltet)" }, | 1378 | { "(disabled)","(abgeschaltet)" }, |
1379 | { "New Calendar","Neuer Kalender" }, | 1379 | { "New Calendar","Neuer Kalender" }, |
1380 | { "Calendar","Kalender" }, | 1380 | { "Calendar","Kalender" }, |
1381 | { "Filter selector","Filterauswahl" }, | 1381 | { "Filter selector","Filterauswahl" }, |
1382 | { "Filtermenu","Filtermenu" }, | 1382 | { "Filtermenu","Filtermenu" }, |
1383 | { "Toggle Fullscreen","Vollbild umschalten" }, | 1383 | { "Toggle Fullscreen","Vollbild umschalten" }, |
1384 | { "Toggle Resource View","Resourcenansicht umschalten" }, | 1384 | { "Toggle Resource View","Resourcenansicht umschalten" }, |
1385 | { "Storage HowTo...","Speicherort HowTo..." }, | 1385 | { "Storage HowTo...","Speicherort HowTo..." }, |
1386 | { "Timetracking HowTo...","Timetracking HowTo..." }, | 1386 | { "Timetracking HowTo...","Timetracking HowTo..." }, |
1387 | { "Juni","Juni" }, | 1387 | { "Juni","Juni" }, |
1388 | { "Juli","Juli" }, | 1388 | { "Juli","Juli" }, |
1389 | { "ToDo:","ToDo:" }, | 1389 | { "ToDo:","ToDo:" }, |
1390 | { "Set Calendar","Setze Kalender" }, | 1390 | { "Set Calendar","Setze Kalender" }, |
1391 | { "Todo: %1","Todo: %1" }, | 1391 | { "Todo: %1","Todo: %1" }, |
1392 | { ": (Prio ",": (Prio " }, | 1392 | { ": (Prio ",": (Prio " }, |
1393 | { "Todos","Todos" }, | 1393 | { "Todos","Todos" }, |
1394 | { "Todo Viewer","Todo Anzeige" }, | 1394 | { "Todo Viewer","Todo Anzeige" }, |
1395 | { "Todo ","Todo " }, | 1395 | { "Todo ","Todo " }, |
1396 | { " Calendar \n Resource "," Kalender \n Resource " }, | 1396 | { " Calendar \n Resource "," Kalender \n Resource " }, |
1397 | { " Color "," Farbe " }, | 1397 | { " Color "," Farbe " }, |
1398 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, | 1398 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, |
1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, | 1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, |
1400 | { "Add new Calendar","Füge Kalender hinzu" }, | 1400 | { "Add new Calendar","Füge Kalender hinzu" }, |
1401 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, | 1401 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, |
1402 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, | 1402 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, |
1403 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, | 1403 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, |
1404 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, | 1404 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, |
1405 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, | 1405 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, |
1406 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, | 1406 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, |
1407 | { "Global application font for all apps:","Globale Schriftart:" }, | 1407 | { "Global application font for all apps:","Globale Schriftart:" }, |
1408 | { "Application Font","Applikationsschriftart" }, | 1408 | { "Application Font","Applikationsschriftart" }, |
1409 | { "Kx/Pi","Kx/Pi" }, | 1409 | { "Kx/Pi","Kx/Pi" }, |
1410 | { "Backup","Backup" }, | 1410 | { "Backup","Backup" }, |
1411 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, | 1411 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, |
1412 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, | 1412 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, |
1413 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, | 1413 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, |
1414 | { "Choose Color","Wähle Farbe" }, | 1414 | { "Choose Color","Wähle Farbe" }, |
1415 | { " OK "," OK " }, | 1415 | { " OK "," OK " }, |
1416 | { " Cancel "," Abbrechen " }, | 1416 | { " Cancel "," Abbrechen " }, |
1417 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, | 1417 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, |
1418 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, | 1418 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, |
1419 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, | 1419 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, |
1420 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, | 1420 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, |
1421 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, | 1421 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, |
1422 | { "%1\nis running!","%1\nist am Laufen!" }, | 1422 | { "%1\nis running!","%1\nist am Laufen!" }, |
1423 | { "Additional Comment:","Zusätzlicher Kommentar:" }, | 1423 | { "Additional Comment:","Zusätzlicher Kommentar:" }, |
1424 | { "Stop and save","Stopp und Speichern" }, | 1424 | { "Stop and save","Stopp und Speichern" }, |
1425 | { "Continue running","Weiter laufen lassen" }, | 1425 | { "Continue running","Weiter laufen lassen" }, |
1426 | { "Stop - do not save","Stopp - nicht Speichern" }, | 1426 | { "Stop - do not save","Stopp - nicht Speichern" }, |
1427 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, | 1427 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, |
1428 | { "Time mismatch!","Zeiten stimmen nicht!" }, | 1428 | { "Time mismatch!","Zeiten stimmen nicht!" }, |
1429 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, | 1429 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, |
1430 | { "Yes, stop todo","Ja, stoppe Todo" }, | 1430 | { "Yes, stop todo","Ja, stoppe Todo" }, |
1431 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, | 1431 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, |
1432 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, | 1432 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, |
1433 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, | 1433 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, |
1434 | { "Spouse","Ehegatte" }, | 1434 | { "Spouse","Ehegatte" }, |
1435 | { "Notes","Notizen" }, | 1435 | { "Notes","Notizen" }, |
1436 | { "Messanger","Messanger" }, | 1436 | { "Messanger","Messanger" }, |
1437 | { "Assistant","Assistent" }, | 1437 | { "Assistant","Assistent" }, |
1438 | { "Manager","Manager" }, | 1438 | { "Manager","Manager" }, |
1439 | { "Secrecy","Sichtbar" }, | 1439 | { "Secrecy","Sichtbar" }, |
1440 | { "male","männlich" }, | 1440 | { "male","männlich" }, |
1441 | { "female","weiblich" }, | 1441 | { "female","weiblich" }, |
1442 | { "Hide!","Verbergen!" }, | 1442 | { "Hide!","Verbergen!" }, |
1443 | { "Show!","Anzeigen!" }, | 1443 | { "Show!","Anzeigen!" }, |
1444 | { "Details","Details" }, | 1444 | { "Details","Details" }, |
1445 | { "Profession","Beruf" }, | 1445 | { "Profession","Beruf" }, |
1446 | { "Children","Kinder" }, | 1446 | { "Children","Kinder" }, |
1447 | { "Department","Abteilung" }, | 1447 | { "Department","Abteilung" }, |
1448 | { "Backup cancelled","Backup abgebrochen" }, | 1448 | { "Backup cancelled","Backup abgebrochen" }, |
1449 | { "Backup globally disabled","Backup global abgeschaltet" }, | 1449 | { "Backup globally disabled","Backup global abgeschaltet" }, |
1450 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1450 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1451 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1451 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1452 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, | 1452 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, |
1453 | { "Birthdays","Geburtstage" }, | 1453 | { "Birthdays","Geburtstage" }, |
1454 | { "KO/Pi import information!","KO/Pi Import Information!" }, | 1454 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1455 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, | 1455 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, |
1456 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, | 1456 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, |
1457 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, | 1457 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, |
1458 | { "Reload","Neu laden" }, | 1458 | { "Reload","Neu laden" }, |
1459 | { "Timezone settings","Zeitzoneneinstellung" }, | 1459 | { "Timezone settings","Zeitzoneneinstellung" }, |
1460 | { "Title: ","Titel: " }, | 1460 | { "Title: ","Titel: " }, |
1461 | { "Journal from: ","Journal vom: " }, | 1461 | { "Journal from: ","Journal vom: " }, |
1462 | { "Journal: %1 from ","Journal: %1 vom " }, | 1462 | { "Journal: %1 from ","Journal: %1 vom " }, |
1463 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, | 1463 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, |
1464 | { "Selected Item","Ausgewähltes Item" }, | 1464 | { "Selected Item","Ausgewähltes Item" }, |
1465 | { "Select Date...","Wähle Datum..." }, | 1465 | { "Select Date...","Wähle Datum..." }, |
1466 | { "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:" }, | 1466 | { "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:" }, |
1467 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, | 1467 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, |
1468 | { "Edit category list...","Ändere Kategorieliste..." }, | 1468 | { "Edit category list...","Ändere Kategorieliste..." }, |
1469 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, | 1469 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, |
1470 | { "Filepath: ","Dateipfad: " }, | 1470 | { "Filepath: ","Dateipfad: " }, |
1471 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, | 1471 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, |
1472 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, | 1472 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, |
1473 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, | 1473 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, |
1474 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, | 1474 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, |
1475 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, | 1475 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, |
1476 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, | 1476 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, |
1477 | { "Alarm Options","Alarm Einstellungen" }, | 1477 | { "Alarm Options","Alarm Einstellungen" }, |
1478 | { "Delete selected...","Lösche Ausgewählte..." }, | 1478 | { "Delete selected...","Lösche Ausgewählte..." }, |
1479 | { "None","Nichts" }, | 1479 | { "None","Nichts" }, |
1480 | { "Selection","Auswahl" }, | 1480 | { "Selection","Auswahl" }, |
1481 | { "Set categories","Setze Kategorien" }, | 1481 | { "Set categories","Setze Kategorien" }, |
1482 | { "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!" }, | 1482 | { "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!" }, |
1483 | { "Reset","Neu setzen" }, | 1483 | { "Reset","Neu setzen" }, |
1484 | { "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)?" }, | 1484 | { "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)?" }, |
1485 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, | 1485 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, |
1486 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, | 1486 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, |
1487 | { "\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" }, | 1487 | { "\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" }, |
1488 | { "\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" }, | 1488 | { "\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" }, |
1489 | { "Edit","Edit" }, | 1489 | { "Edit","Edit" }, |
1490 | { "Last Modified","Zuletzt geändert" }, | 1490 | { "Last Modified","Zuletzt geändert" }, |
1491 | { "Journal viewer","Journal Anzeige" }, | 1491 | { "Journal viewer","Journal Anzeige" }, |
1492 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, | 1492 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, |
1493 | { "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>." }, | 1493 | { "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>." }, |
1494 | { "Hide Completed","Verstecke erledigte Todos" }, | 1494 | { "Hide Completed","Verstecke erledigte Todos" }, |
1495 | { "Show not Running","Zeige nicht Laufende" }, | 1495 | { "Show not Running","Zeige nicht Laufende" }, |
1496 | { "Click to add new Todo","Klick für neues Todo!" }, | 1496 | { "Click to add new Todo","Klick für neues Todo!" }, |
1497 | { "Show next conflict for","Zeige nächsten Konflikt für" }, | 1497 | { "Show next conflict for","Zeige nächsten Konflikt für" }, |
1498 | { "All events","Alle Termine" }, | 1498 | { "All events","Alle Termine" }, |
1499 | { "Allday events","Ganztagestermine" }, | 1499 | { "Allday events","Ganztagestermine" }, |
1500 | { "Events with time","Termine mit Zeit" }, | 1500 | { "Events with time","Termine mit Zeit" }, |
1501 | { "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" }, | 1501 | { "No conflict found","Kein Konflikt gefunden" }, |
1502 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, | 1502 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, |
1503 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, | 1503 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, |
1504 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, | 1504 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, |
1505 | { "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" }, | 1505 | { "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" }, |
1506 | { "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" }, | 1506 | { "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" }, |
1507 | { "Show date","Zeige Datum" }, | 1507 | { "Show date","Zeige Datum" }, |
1508 | { "No problem!","Kein Problem!" }, | 1508 | { "No problem!","Null Problemo!" }, |
1509 | { "","" }, | 1509 | { "","" }, |
1510 | { "","" }, | 1510 | { "","" }, |
1511 | { "","" }, | 1511 | { "","" }, |
1512 | { "","" }, | 1512 | { "","" }, |
1513 | { "","" }, | 1513 | { "","" }, |
1514 | { "","" }, | 1514 | { "","" }, |
1515 | { "","" }, | 1515 | { "","" }, |
1516 | { "","" }, | 1516 | { "","" }, |
1517 | { "","" }, | 1517 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 65750af..426e8f9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -472,426 +472,441 @@ void CalendarView::init() | |||
472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | 477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); |
478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
479 | 479 | ||
480 | mTodoList->setNavigator( mNavigator ); | 480 | mTodoList->setNavigator( mNavigator ); |
481 | #if 0 | 481 | #if 0 |
482 | if ( QApplication::desktop()->width() < 480 ) { | 482 | if ( QApplication::desktop()->width() < 480 ) { |
483 | leftFrameLayout->addWidget(mFilterView); | 483 | leftFrameLayout->addWidget(mFilterView); |
484 | leftFrameLayout->addWidget(mTodoList, 2 ); | 484 | leftFrameLayout->addWidget(mTodoList, 2 ); |
485 | 485 | ||
486 | } else { | 486 | } else { |
487 | leftFrameLayout->addWidget(mTodoList,2 ); | 487 | leftFrameLayout->addWidget(mTodoList,2 ); |
488 | leftFrameLayout->addWidget(mFilterView ); | 488 | leftFrameLayout->addWidget(mFilterView ); |
489 | } | 489 | } |
490 | #endif | 490 | #endif |
491 | mFilterView->hide(); | 491 | mFilterView->hide(); |
492 | mCalEditView->hide(); | 492 | mCalEditView->hide(); |
493 | QWidget *rightBox = new QWidget( mMainFrame ); | 493 | QWidget *rightBox = new QWidget( mMainFrame ); |
494 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 494 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
495 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 495 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
496 | mRightFrame = new QWidgetStack( rightBox ); | 496 | mRightFrame = new QWidgetStack( rightBox ); |
497 | rightLayout->addWidget( mRightFrame, 10 ); | 497 | rightLayout->addWidget( mRightFrame, 10 ); |
498 | 498 | ||
499 | //mLeftFrame = (QWidget *)leftFrame; | 499 | //mLeftFrame = (QWidget *)leftFrame; |
500 | if ( KOPrefs::instance()->mVerticalScreen ) { | 500 | if ( KOPrefs::instance()->mVerticalScreen ) { |
501 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 501 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
502 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 502 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
503 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 503 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
504 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 504 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
505 | } else { | 505 | } else { |
506 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 506 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
507 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 507 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
508 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 508 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
509 | } | 509 | } |
510 | if ( !KOPrefs::instance()->mShowDateNavigator) | 510 | if ( !KOPrefs::instance()->mShowDateNavigator) |
511 | mDateNavigator->hide(); | 511 | mDateNavigator->hide(); |
512 | //qDebug("Calendarview Size %d %d ", width(), height()); | 512 | //qDebug("Calendarview Size %d %d ", width(), height()); |
513 | #endif | 513 | #endif |
514 | 514 | ||
515 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 515 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
516 | SLOT( showDates( const KCal::DateList & ) ) ); | 516 | SLOT( showDates( const KCal::DateList & ) ) ); |
517 | 517 | ||
518 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 518 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
519 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 519 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
520 | 520 | ||
521 | 521 | ||
522 | 522 | ||
523 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), | 523 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), |
524 | mViewManager, SLOT( showMonth( const QDate & ) ) ); | 524 | mViewManager, SLOT( showMonth( const QDate & ) ) ); |
525 | 525 | ||
526 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 526 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
527 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 527 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
528 | 528 | ||
529 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 529 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
530 | mNavigator, SLOT( selectPreviousYear() ) ); | 530 | mNavigator, SLOT( selectPreviousYear() ) ); |
531 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 531 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
532 | mNavigator, SLOT( selectNextYear() ) ); | 532 | mNavigator, SLOT( selectNextYear() ) ); |
533 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 533 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
534 | mNavigator, SLOT( selectPreviousMonth() ) ); | 534 | mNavigator, SLOT( selectPreviousMonth() ) ); |
535 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 535 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
536 | mNavigator, SLOT( selectNextMonth() ) ); | 536 | mNavigator, SLOT( selectNextMonth() ) ); |
537 | 537 | ||
538 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 538 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
539 | mNavigator, SLOT( selectPrevious() ) ); | 539 | mNavigator, SLOT( selectPrevious() ) ); |
540 | connect( mDateNavigator, SIGNAL( goNext() ), | 540 | connect( mDateNavigator, SIGNAL( goNext() ), |
541 | mNavigator, SLOT( selectNext() ) ); | 541 | mNavigator, SLOT( selectNext() ) ); |
542 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 542 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
543 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 543 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
544 | 544 | ||
545 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 545 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
546 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 546 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
547 | #if 0 | 547 | #if 0 |
548 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 548 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
549 | SLOT( incidenceAdded( Incidence *) ) ); | 549 | SLOT( incidenceAdded( Incidence *) ) ); |
550 | #endif | 550 | #endif |
551 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 551 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
552 | 552 | ||
553 | connect( this, SIGNAL( configChanged() ), | 553 | connect( this, SIGNAL( configChanged() ), |
554 | mDateNavigator, SLOT( updateConfig() ) ); | 554 | mDateNavigator, SLOT( updateConfig() ) ); |
555 | 555 | ||
556 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 556 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
557 | SLOT( newTodo() ) ); | 557 | SLOT( newTodo() ) ); |
558 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 558 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
559 | SLOT( newSubTodo( Todo * ) ) ); | 559 | SLOT( newSubTodo( Todo * ) ) ); |
560 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 560 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
561 | SLOT( editTodo( Todo * ) ) ); | 561 | SLOT( editTodo( Todo * ) ) ); |
562 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 562 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
563 | SLOT( showTodo( Todo *) ) ); | 563 | SLOT( showTodo( Todo *) ) ); |
564 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 564 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
565 | SLOT( deleteTodo( Todo *) ) ); | 565 | SLOT( deleteTodo( Todo *) ) ); |
566 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 566 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
567 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 567 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
568 | SLOT( purgeCompleted() ) ); | 568 | SLOT( purgeCompleted() ) ); |
569 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 569 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
570 | SIGNAL( todoModified( Todo *, int ) ) ); | 570 | SIGNAL( todoModified( Todo *, int ) ) ); |
571 | 571 | ||
572 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), | 572 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), |
573 | this, SLOT ( cloneIncidence( Incidence * ) ) ); | 573 | this, SLOT ( cloneIncidence( Incidence * ) ) ); |
574 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), | 574 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), |
575 | this, SLOT (cancelIncidence( Incidence * ) ) ); | 575 | this, SLOT (cancelIncidence( Incidence * ) ) ); |
576 | 576 | ||
577 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), | 577 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), |
578 | this, SLOT ( moveIncidence( Incidence * ) ) ); | 578 | this, SLOT ( moveIncidence( Incidence * ) ) ); |
579 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), | 579 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), |
580 | this, SLOT ( beamIncidence( Incidence * ) ) ); | 580 | this, SLOT ( beamIncidence( Incidence * ) ) ); |
581 | 581 | ||
582 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), | 582 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), |
583 | this, SLOT ( todo_unsub( Todo * ) ) ); | 583 | this, SLOT ( todo_unsub( Todo * ) ) ); |
584 | 584 | ||
585 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 585 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
586 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); | 586 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); |
587 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, | 587 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, |
588 | SLOT( updateTodo( Todo *, int ) ) ); | 588 | SLOT( updateTodo( Todo *, int ) ) ); |
589 | connect( this, SIGNAL( todoModified( Todo *, int )), this, | 589 | connect( this, SIGNAL( todoModified( Todo *, int )), this, |
590 | SLOT( changeTodoDisplay( Todo *, int ) ) ); | 590 | SLOT( changeTodoDisplay( Todo *, int ) ) ); |
591 | 591 | ||
592 | 592 | ||
593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); | 593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); |
594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); | 594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); |
595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); | 595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); |
596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); | 596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); |
597 | 597 | ||
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), | 602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), |
603 | SLOT(checkClipboard())); | 603 | SLOT(checkClipboard())); |
604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
605 | SLOT( processTodoListSelection( Incidence * ) ) ); | 605 | SLOT( processTodoListSelection( Incidence * ) ) ); |
606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
607 | 607 | ||
608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
609 | 609 | ||
610 | mDateFrame = new QVBox(0,0,WType_Popup); | 610 | mDateFrame = new QVBox(0,0,WType_Popup); |
611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
613 | mDateFrame->setLineWidth(3); | 613 | mDateFrame->setLineWidth(3); |
614 | mDateFrame->hide(); | 614 | mDateFrame->hide(); |
615 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 615 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
617 | 617 | ||
618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
619 | 619 | ||
620 | mEventEditor = mDialogManager->getEventEditor(); | 620 | mEventEditor = mDialogManager->getEventEditor(); |
621 | mTodoEditor = mDialogManager->getTodoEditor(); | 621 | mTodoEditor = mDialogManager->getTodoEditor(); |
622 | 622 | ||
623 | mFlagEditDescription = false; | 623 | mFlagEditDescription = false; |
624 | 624 | ||
625 | mSuspendTimer = new QTimer( this ); | 625 | mSuspendTimer = new QTimer( this ); |
626 | mAlarmTimer = new QTimer( this ); | 626 | mAlarmTimer = new QTimer( this ); |
627 | mRecheckAlarmTimer = new QTimer( this ); | 627 | mRecheckAlarmTimer = new QTimer( this ); |
628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
631 | mAlarmDialog = new AlarmDialog( this ); | 631 | mAlarmDialog = new AlarmDialog( this ); |
632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
633 | mAlarmDialog->setServerNotification( false ); | 633 | mAlarmDialog->setServerNotification( false ); |
634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
635 | 635 | ||
636 | 636 | ||
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | //US listen for arriving address resultsets | 638 | //US listen for arriving address resultsets |
639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
641 | #endif | 641 | #endif |
642 | mDateNavigator->setCalendar( mCalendar ); | 642 | mDateNavigator->setCalendar( mCalendar ); |
643 | } | 643 | } |
644 | 644 | ||
645 | 645 | ||
646 | CalendarView::~CalendarView() | 646 | CalendarView::~CalendarView() |
647 | { | 647 | { |
648 | // kdDebug() << "~CalendarView()" << endl; | 648 | // kdDebug() << "~CalendarView()" << endl; |
649 | //qDebug("CalendarView::~CalendarView() "); | 649 | //qDebug("CalendarView::~CalendarView() "); |
650 | delete mDialogManager; | 650 | delete mDialogManager; |
651 | delete mViewManager; | 651 | delete mViewManager; |
652 | delete mStorage; | 652 | delete mStorage; |
653 | delete mDateFrame ; | 653 | delete mDateFrame ; |
654 | delete mEventViewerDialog; | 654 | delete mEventViewerDialog; |
655 | //kdDebug() << "~CalendarView() done" << endl; | 655 | //kdDebug() << "~CalendarView() done" << endl; |
656 | } | 656 | } |
657 | void CalendarView::nextConflict( bool all, bool allday ) | 657 | void CalendarView::nextConflict( bool all, bool allday ) |
658 | { | 658 | { |
659 | 659 | ||
660 | QPtrList<Event> testlist = mCalendar->events(); | 660 | QPtrList<Event> testlist = mCalendar->events(); |
661 | Event * test = testlist.first(); | 661 | Event * test = testlist.first(); |
662 | while ( test ) { | 662 | while ( test ) { |
663 | test->setTagged( false ); | 663 | test->setTagged( false ); |
664 | test = testlist.next(); | ||
664 | } | 665 | } |
665 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); | 666 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); |
666 | QDateTime conflict; | 667 | QDateTime conflict; |
667 | QDateTime retVal; | 668 | QDateTime retVal; |
668 | bool found = false; | 669 | bool found = false; |
669 | Event * cE = 0; | 670 | Event * cE = 0; |
671 | Event * cE2 = 0; | ||
670 | QPtrList<Event> testlist2 = testlist; | 672 | QPtrList<Event> testlist2 = testlist; |
673 | test = testlist.first(); | ||
674 | bool skip = false; | ||
671 | while ( test ) { | 675 | while ( test ) { |
672 | Event * test2 = testlist2.first(); | 676 | skip = false; |
673 | while ( test2 ) { | 677 | if ( !all ) skip = ( allday != test->doesFloat() ); |
674 | if ( !test2->isTagged() ) { | 678 | if ( !skip ) { |
675 | if ( test->isOverlapping ( test2, &retVal, true ) ) { | 679 | Event * test2 = testlist2.first(); |
676 | if ( ! found ) { | 680 | while ( test2 ) { |
677 | if ( retVal >= startDT ) { | 681 | skip = false; |
678 | conflict = retVal; | 682 | if ( !all ) skip = ( allday != test2->doesFloat() ); |
679 | cE = test; | 683 | if ( !skip ) { |
680 | found = true; | 684 | if ( !test2->isTagged() ) { |
681 | } | 685 | if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { |
682 | } else { | 686 | //qDebug("overlap "); |
683 | if ( retVal >= startDT && retVal < conflict ) { | 687 | if ( ! found ) { |
684 | conflict = retVal; | 688 | if ( retVal >= startDT ) { |
685 | cE = test; | 689 | conflict = retVal; |
690 | cE = test; | ||
691 | cE2 = test2; | ||
692 | found = true; | ||
693 | } | ||
694 | } else { | ||
695 | if ( retVal >= startDT && retVal < conflict ) { | ||
696 | conflict = retVal; | ||
697 | cE = test; | ||
698 | cE2 = test2; | ||
699 | } | ||
700 | } | ||
686 | } | 701 | } |
687 | } | 702 | } |
688 | } | 703 | } |
704 | test2 = testlist2.next(); | ||
689 | } | 705 | } |
690 | test2 = testlist2.next(); | ||
691 | } | 706 | } |
692 | test->setTagged( true ); | 707 | test->setTagged( true ); |
693 | test = testlist.next(); | 708 | test = testlist.next(); |
694 | } | 709 | } |
695 | if ( found ) { | 710 | if ( found ) { |
696 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 711 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
697 | mViewManager->showDayView(); | 712 | mViewManager->showDayView(); |
698 | mNavigator->slotDaySelect( conflict.date() ); | 713 | mNavigator->slotDaySelect( conflict.date() ); |
699 | int hour = conflict.time().hour(); | 714 | int hour = conflict.time().hour(); |
700 | mViewManager->agendaView()->setStartHour( hour ); | 715 | mViewManager->agendaView()->setStartHour( hour ); |
701 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); | 716 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); |
702 | return; | 717 | return; |
703 | } | 718 | } |
704 | 719 | ||
705 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | 720 | topLevelWidget()->setCaption( i18n("No conflict found") ); |
706 | qDebug("No conflict found "); | 721 | qDebug("No conflict found "); |
707 | return; | 722 | return; |
708 | 723 | ||
709 | 724 | ||
710 | 725 | ||
711 | 726 | ||
712 | 727 | ||
713 | #if 0 | 728 | #if 0 |
714 | 729 | ||
715 | 730 | ||
716 | QDate end = start.addDays( 365*2); | 731 | QDate end = start.addDays( 365*2); |
717 | while ( start < end ) { | 732 | while ( start < end ) { |
718 | QPtrList<Event> eventList = calendar()->events( start ); | 733 | QPtrList<Event> eventList = calendar()->events( start ); |
719 | Event * ev = eventList.first(); | 734 | Event * ev = eventList.first(); |
720 | QPtrList<Event> test = eventList; | 735 | QPtrList<Event> test = eventList; |
721 | while ( ev ) { | 736 | while ( ev ) { |
722 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); | 737 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); |
723 | Event * t_ev = test.first(); | 738 | Event * t_ev = test.first(); |
724 | QDateTime es = ev->dtStart(); | 739 | QDateTime es = ev->dtStart(); |
725 | QDateTime ee = ev->dtEnd(); | 740 | QDateTime ee = ev->dtEnd(); |
726 | if ( ev->doesFloat() ) | 741 | if ( ev->doesFloat() ) |
727 | ee = ee.addDays( 1 ); | 742 | ee = ee.addDays( 1 ); |
728 | if ( ! all ) { | 743 | if ( ! all ) { |
729 | if ( ev->doesFloat() != allday ) | 744 | if ( ev->doesFloat() != allday ) |
730 | t_ev = 0; | 745 | t_ev = 0; |
731 | } | 746 | } |
732 | while ( t_ev ) { | 747 | while ( t_ev ) { |
733 | bool skip = false; | 748 | bool skip = false; |
734 | if ( ! all ) { | 749 | if ( ! all ) { |
735 | if ( t_ev->doesFloat() != allday ) | 750 | if ( t_ev->doesFloat() != allday ) |
736 | skip = true; | 751 | skip = true; |
737 | } | 752 | } |
738 | if ( !skip && ev != t_ev ) { | 753 | if ( !skip && ev != t_ev ) { |
739 | QDateTime ets = t_ev->dtStart(); | 754 | QDateTime ets = t_ev->dtStart(); |
740 | QDateTime ete = t_ev->dtEnd(); | 755 | QDateTime ete = t_ev->dtEnd(); |
741 | if ( t_ev->doesFloat() ) | 756 | if ( t_ev->doesFloat() ) |
742 | ete = ete.addDays( 1 ); | 757 | ete = ete.addDays( 1 ); |
743 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); | 758 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); |
744 | if ( es < ete && ets < ee ) { | 759 | if ( es < ete && ets < ee ) { |
745 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 760 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
746 | mViewManager->showDayView(); | 761 | mViewManager->showDayView(); |
747 | mNavigator->slotDaySelect( start ); | 762 | mNavigator->slotDaySelect( start ); |
748 | int hour = es.time().hour(); | 763 | int hour = es.time().hour(); |
749 | if ( ets > es ) | 764 | if ( ets > es ) |
750 | hour = ets.time().hour(); | 765 | hour = ets.time().hour(); |
751 | mViewManager->agendaView()->setStartHour( hour ); | 766 | mViewManager->agendaView()->setStartHour( hour ); |
752 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); | 767 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); |
753 | return; | 768 | return; |
754 | } | 769 | } |
755 | } | 770 | } |
756 | t_ev = test.next(); | 771 | t_ev = test.next(); |
757 | } | 772 | } |
758 | ev = eventList.next(); | 773 | ev = eventList.next(); |
759 | } | 774 | } |
760 | start = start.addDays( 1 ); | 775 | start = start.addDays( 1 ); |
761 | } | 776 | } |
762 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | 777 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); |
763 | qDebug("No conflict found "); | 778 | qDebug("No conflict found "); |
764 | #endif | 779 | #endif |
765 | } | 780 | } |
766 | 781 | ||
767 | void CalendarView::conflictAll() | 782 | void CalendarView::conflictAll() |
768 | { | 783 | { |
769 | nextConflict ( true, true ); | 784 | nextConflict ( true, true ); |
770 | } | 785 | } |
771 | void CalendarView::conflictAllday() | 786 | void CalendarView::conflictAllday() |
772 | { | 787 | { |
773 | nextConflict ( false, true ); | 788 | nextConflict ( false, true ); |
774 | } | 789 | } |
775 | void CalendarView::conflictNotAll() | 790 | void CalendarView::conflictNotAll() |
776 | { | 791 | { |
777 | nextConflict ( false, false ); | 792 | nextConflict ( false, false ); |
778 | } | 793 | } |
779 | 794 | ||
780 | void CalendarView::setCalReadOnly( int id, bool readO ) | 795 | void CalendarView::setCalReadOnly( int id, bool readO ) |
781 | { | 796 | { |
782 | if ( readO ) { | 797 | if ( readO ) { |
783 | emit save(); | 798 | emit save(); |
784 | } | 799 | } |
785 | mCalendar->setReadOnly( id, readO ); | 800 | mCalendar->setReadOnly( id, readO ); |
786 | } | 801 | } |
787 | void CalendarView::setScrollBarStep(int val ) | 802 | void CalendarView::setScrollBarStep(int val ) |
788 | { | 803 | { |
789 | #ifdef DESKTOP_VERSION | 804 | #ifdef DESKTOP_VERSION |
790 | mDateScrollBar->setLineStep ( val ); | 805 | mDateScrollBar->setLineStep ( val ); |
791 | #endif | 806 | #endif |
792 | } | 807 | } |
793 | void CalendarView::scrollBarValue(int val ) | 808 | void CalendarView::scrollBarValue(int val ) |
794 | { | 809 | { |
795 | #ifdef DESKTOP_VERSION | 810 | #ifdef DESKTOP_VERSION |
796 | if ( QApplication::desktop()->width() < 800 ) return; | 811 | if ( QApplication::desktop()->width() < 800 ) return; |
797 | static bool block = false; | 812 | static bool block = false; |
798 | if ( block ) return; | 813 | if ( block ) return; |
799 | block = true; | 814 | block = true; |
800 | int count = mNavigator->selectedDates().count(); | 815 | int count = mNavigator->selectedDates().count(); |
801 | int day = mNavigator->selectedDates().first().dayOfYear(); | 816 | int day = mNavigator->selectedDates().first().dayOfYear(); |
802 | int stepdays = val; | 817 | int stepdays = val; |
803 | if ( mDateScrollBar->lineStep () <= count ) { | 818 | if ( mDateScrollBar->lineStep () <= count ) { |
804 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 819 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
805 | //qDebug("VAL %d ",val ); | 820 | //qDebug("VAL %d ",val ); |
806 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 821 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
807 | stepdays = day+stepdays; | 822 | stepdays = day+stepdays; |
808 | if ( stepdays < 0 ) stepdays = 0; | 823 | if ( stepdays < 0 ) stepdays = 0; |
809 | } | 824 | } |
810 | if ( stepdays == day ) { | 825 | if ( stepdays == day ) { |
811 | block = false; | 826 | block = false; |
812 | return; | 827 | return; |
813 | } | 828 | } |
814 | int year = mNavigator->selectedDates().first().year(); | 829 | int year = mNavigator->selectedDates().first().year(); |
815 | QDate d ( year,1,1 ); | 830 | QDate d ( year,1,1 ); |
816 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); | 831 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); |
817 | block = false; | 832 | block = false; |
818 | #endif | 833 | #endif |
819 | 834 | ||
820 | } | 835 | } |
821 | void CalendarView::updateView(const QDate &start, const QDate &end) | 836 | void CalendarView::updateView(const QDate &start, const QDate &end) |
822 | { | 837 | { |
823 | #ifdef DESKTOP_VERSION | 838 | #ifdef DESKTOP_VERSION |
824 | if ( ! mDateScrollBar->draggingSlider () ) { | 839 | if ( ! mDateScrollBar->draggingSlider () ) { |
825 | int dof = start.dayOfYear(); | 840 | int dof = start.dayOfYear(); |
826 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); | 841 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); |
827 | if ( dof != mDateScrollBar->value() ) { | 842 | if ( dof != mDateScrollBar->value() ) { |
828 | mDateScrollBar->blockSignals( true ); | 843 | mDateScrollBar->blockSignals( true ); |
829 | mDateScrollBar->setValue( start.dayOfYear()); | 844 | mDateScrollBar->setValue( start.dayOfYear()); |
830 | mDateScrollBar->blockSignals( false ); | 845 | mDateScrollBar->blockSignals( false ); |
831 | } | 846 | } |
832 | } | 847 | } |
833 | #endif | 848 | #endif |
834 | mTodoList->updateView(); | 849 | mTodoList->updateView(); |
835 | mViewManager->updateView(start, end); | 850 | mViewManager->updateView(start, end); |
836 | //mDateNavigator->updateView(); | 851 | //mDateNavigator->updateView(); |
837 | } | 852 | } |
838 | 853 | ||
839 | 854 | ||
840 | 855 | ||
841 | void CalendarView::checkFiles() | 856 | void CalendarView::checkFiles() |
842 | { | 857 | { |
843 | QString message; | 858 | QString message; |
844 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 859 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
845 | KopiCalendarFile * cal = calendars.first(); | 860 | KopiCalendarFile * cal = calendars.first(); |
846 | while ( cal ) { | 861 | while ( cal ) { |
847 | if ( cal->mErrorOnLoad ) { | 862 | if ( cal->mErrorOnLoad ) { |
848 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; | 863 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; |
849 | } | 864 | } |
850 | cal = calendars.next(); | 865 | cal = calendars.next(); |
851 | } | 866 | } |
852 | if ( !message.isEmpty() ) { | 867 | if ( !message.isEmpty() ) { |
853 | message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); | 868 | message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); |
854 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); | 869 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); |
855 | } | 870 | } |
856 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); | 871 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); |
857 | } | 872 | } |
858 | void CalendarView::checkAlarms() | 873 | void CalendarView::checkAlarms() |
859 | { | 874 | { |
860 | 875 | ||
861 | 876 | ||
862 | KConfig *config = KOGlobals::config(); | 877 | KConfig *config = KOGlobals::config(); |
863 | config->setGroup( "AppRun" ); | 878 | config->setGroup( "AppRun" ); |
864 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 879 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
865 | int daysto = dt.daysTo( QDate::currentDate() ); | 880 | int daysto = dt.daysTo( QDate::currentDate() ); |
866 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); | 881 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); |
867 | dt = dt.addDays( days ); | 882 | dt = dt.addDays( days ); |
868 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 883 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
869 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; | 884 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; |
870 | //qDebug("KO: Reading program stop %d ", secs); | 885 | //qDebug("KO: Reading program stop %d ", secs); |
871 | //secs -= ( 3600 * 24*3 ); // debug only | 886 | //secs -= ( 3600 * 24*3 ); // debug only |
872 | QDateTime latest = dt.addSecs ( secs ); | 887 | QDateTime latest = dt.addSecs ( secs ); |
873 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | 888 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); |
874 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); | 889 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); |
875 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | 890 | QPtrList<Incidence> el = mCalendar->rawIncidences(); |
876 | QPtrList<Incidence> al; | 891 | QPtrList<Incidence> al; |
877 | Incidence* inL = el.first(); | 892 | Incidence* inL = el.first(); |
878 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); | 893 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); |
879 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); | 894 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); |
880 | while ( inL ) { | 895 | while ( inL ) { |
881 | bool ok = false; | 896 | bool ok = false; |
882 | int offset = 0; | 897 | int offset = 0; |
883 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | 898 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; |
884 | if ( ok ) { | 899 | if ( ok ) { |
885 | //qDebug("OK %s",next.toString().latin1()); | 900 | //qDebug("OK %s",next.toString().latin1()); |
886 | if ( next < cur ) { | 901 | if ( next < cur ) { |
887 | al.append( inL ); | 902 | al.append( inL ); |
888 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 903 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
889 | } | 904 | } |
890 | } | 905 | } |
891 | inL = el.next(); | 906 | inL = el.next(); |
892 | } | 907 | } |
893 | if ( al.count() ) { | 908 | if ( al.count() ) { |
894 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); | 909 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); |
895 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); | 910 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); |
896 | QVBoxLayout* lay = new QVBoxLayout( dia ); | 911 | QVBoxLayout* lay = new QVBoxLayout( dia ); |
897 | lay->setSpacing( 0 ); | 912 | lay->setSpacing( 0 ); |
@@ -2605,387 +2620,388 @@ void CalendarView::readFilterSettings(KConfig *config) | |||
2605 | config->setGroup("General"); | 2620 | config->setGroup("General"); |
2606 | QStringList filterList = config->readListEntry("CalendarFilters"); | 2621 | QStringList filterList = config->readListEntry("CalendarFilters"); |
2607 | 2622 | ||
2608 | QStringList::ConstIterator it = filterList.begin(); | 2623 | QStringList::ConstIterator it = filterList.begin(); |
2609 | QStringList::ConstIterator end = filterList.end(); | 2624 | QStringList::ConstIterator end = filterList.end(); |
2610 | while(it != end) { | 2625 | while(it != end) { |
2611 | // kdDebug() << " filter: " << (*it) << endl; | 2626 | // kdDebug() << " filter: " << (*it) << endl; |
2612 | 2627 | ||
2613 | CalFilter *filter; | 2628 | CalFilter *filter; |
2614 | filter = new CalFilter(*it); | 2629 | filter = new CalFilter(*it); |
2615 | config->setGroup("Filter_" + (*it).utf8()); | 2630 | config->setGroup("Filter_" + (*it).utf8()); |
2616 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 2631 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
2617 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 2632 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
2618 | filter->setCategoryList(config->readListEntry("CategoryList")); | 2633 | filter->setCategoryList(config->readListEntry("CategoryList")); |
2619 | mFilters.append(filter); | 2634 | mFilters.append(filter); |
2620 | 2635 | ||
2621 | ++it; | 2636 | ++it; |
2622 | } | 2637 | } |
2623 | 2638 | ||
2624 | if (mFilters.count() == 0) { | 2639 | if (mFilters.count() == 0) { |
2625 | CalFilter *filter = new CalFilter(i18n("Default")); | 2640 | CalFilter *filter = new CalFilter(i18n("Default")); |
2626 | mFilters.append(filter); | 2641 | mFilters.append(filter); |
2627 | } | 2642 | } |
2628 | mFilterView->updateFilters(); | 2643 | mFilterView->updateFilters(); |
2629 | config->setGroup("FilterView"); | 2644 | config->setGroup("FilterView"); |
2630 | 2645 | ||
2631 | mFilterView->blockSignals(true); | 2646 | mFilterView->blockSignals(true); |
2632 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 2647 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
2633 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 2648 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
2634 | mFilterView->blockSignals(false); | 2649 | mFilterView->blockSignals(false); |
2635 | // We do it manually to avoid it being done twice by the above calls | 2650 | // We do it manually to avoid it being done twice by the above calls |
2636 | updateFilter(); | 2651 | updateFilter(); |
2637 | } | 2652 | } |
2638 | 2653 | ||
2639 | void CalendarView::writeFilterSettings(KConfig *config) | 2654 | void CalendarView::writeFilterSettings(KConfig *config) |
2640 | { | 2655 | { |
2641 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 2656 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
2642 | 2657 | ||
2643 | QStringList filterList; | 2658 | QStringList filterList; |
2644 | 2659 | ||
2645 | CalFilter *filter = mFilters.first(); | 2660 | CalFilter *filter = mFilters.first(); |
2646 | while(filter) { | 2661 | while(filter) { |
2647 | // kdDebug() << " fn: " << filter->name() << endl; | 2662 | // kdDebug() << " fn: " << filter->name() << endl; |
2648 | filterList << filter->name(); | 2663 | filterList << filter->name(); |
2649 | config->setGroup("Filter_" + filter->name().utf8()); | 2664 | config->setGroup("Filter_" + filter->name().utf8()); |
2650 | config->writeEntry("Criteria",filter->criteria()); | 2665 | config->writeEntry("Criteria",filter->criteria()); |
2651 | config->writeEntry("CategoryList",filter->categoryList()); | 2666 | config->writeEntry("CategoryList",filter->categoryList()); |
2652 | filter = mFilters.next(); | 2667 | filter = mFilters.next(); |
2653 | } | 2668 | } |
2654 | config->setGroup("General"); | 2669 | config->setGroup("General"); |
2655 | config->writeEntry("CalendarFilters",filterList); | 2670 | config->writeEntry("CalendarFilters",filterList); |
2656 | 2671 | ||
2657 | config->setGroup("FilterView"); | 2672 | config->setGroup("FilterView"); |
2658 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 2673 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
2659 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2674 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2660 | } | 2675 | } |
2661 | 2676 | ||
2662 | 2677 | ||
2663 | void CalendarView::goToday() | 2678 | void CalendarView::goToday() |
2664 | { | 2679 | { |
2665 | if ( mViewManager->currentView()->isMonthView() ) | 2680 | if ( mViewManager->currentView()->isMonthView() ) |
2666 | mNavigator->selectTodayMonth(); | 2681 | mNavigator->selectTodayMonth(); |
2667 | else | 2682 | else |
2668 | mNavigator->selectToday(); | 2683 | mNavigator->selectToday(); |
2669 | } | 2684 | } |
2670 | 2685 | ||
2671 | void CalendarView::goNext() | 2686 | void CalendarView::goNext() |
2672 | { | 2687 | { |
2673 | mNavigator->selectNext(); | 2688 | mNavigator->selectNext(); |
2674 | } | 2689 | } |
2675 | 2690 | ||
2676 | void CalendarView::goPrevious() | 2691 | void CalendarView::goPrevious() |
2677 | { | 2692 | { |
2678 | mNavigator->selectPrevious(); | 2693 | mNavigator->selectPrevious(); |
2679 | } | 2694 | } |
2680 | void CalendarView::goNextMonth() | 2695 | void CalendarView::goNextMonth() |
2681 | { | 2696 | { |
2682 | mNavigator->selectNextMonth(); | 2697 | mNavigator->selectNextMonth(); |
2683 | } | 2698 | } |
2684 | 2699 | ||
2685 | void CalendarView::goPreviousMonth() | 2700 | void CalendarView::goPreviousMonth() |
2686 | { | 2701 | { |
2687 | mNavigator->selectPreviousMonth(); | 2702 | mNavigator->selectPreviousMonth(); |
2688 | } | 2703 | } |
2689 | 2704 | ||
2690 | void CalendarView::updateConfig() | 2705 | void CalendarView::updateConfig() |
2691 | { | 2706 | { |
2692 | if ( KOPrefs::instance()->mUseAppColors ) | 2707 | if ( KOPrefs::instance()->mUseAppColors ) |
2693 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2708 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2694 | emit configChanged(); | 2709 | emit configChanged(); |
2695 | mTodoList->updateConfig(); | 2710 | mTodoList->updateConfig(); |
2696 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2711 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2697 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2712 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2698 | // To make the "fill window" configurations work | 2713 | // To make the "fill window" configurations work |
2699 | //mViewManager->raiseCurrentView(); | 2714 | //mViewManager->raiseCurrentView(); |
2700 | } | 2715 | } |
2701 | 2716 | ||
2702 | 2717 | ||
2703 | void CalendarView::eventChanged(Event *event) | 2718 | void CalendarView::eventChanged(Event *event) |
2704 | { | 2719 | { |
2705 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2720 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2706 | //updateUnmanagedViews(); | 2721 | //updateUnmanagedViews(); |
2707 | } | 2722 | } |
2708 | 2723 | ||
2709 | void CalendarView::eventAdded(Event *event) | 2724 | void CalendarView::eventAdded(Event *event) |
2710 | { | 2725 | { |
2711 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2726 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2712 | } | 2727 | } |
2713 | 2728 | ||
2714 | void CalendarView::eventToBeDeleted(Event *) | 2729 | void CalendarView::eventToBeDeleted(Event *) |
2715 | { | 2730 | { |
2716 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2731 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2717 | } | 2732 | } |
2718 | 2733 | ||
2719 | void CalendarView::eventDeleted() | 2734 | void CalendarView::eventDeleted() |
2720 | { | 2735 | { |
2721 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2736 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2722 | } | 2737 | } |
2723 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2738 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2724 | { | 2739 | { |
2725 | changeIncidenceDisplay((Incidence *)which, action); | 2740 | changeIncidenceDisplay((Incidence *)which, action); |
2726 | mDateNavigator->updateView(); //LR | 2741 | mDateNavigator->updateView(); //LR |
2727 | //mDialogManager->updateSearchDialog(); | 2742 | //mDialogManager->updateSearchDialog(); |
2728 | 2743 | ||
2729 | if (which) { | 2744 | if (which) { |
2730 | mViewManager->updateWNview(); | 2745 | mViewManager->updateWNview(); |
2731 | //mTodoList->updateView(); | 2746 | //mTodoList->updateView(); |
2732 | } | 2747 | } |
2733 | 2748 | ||
2734 | } | 2749 | } |
2735 | 2750 | ||
2736 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2751 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2737 | { | 2752 | { |
2738 | updateUnmanagedViews(); | 2753 | updateUnmanagedViews(); |
2739 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2754 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2740 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2755 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2741 | mCalendar->checkAlarmForIncidence( 0, true ); | 2756 | mCalendar->checkAlarmForIncidence( 0, true ); |
2742 | if ( mEventViewerDialog ) | 2757 | if ( mEventViewerDialog ) |
2743 | mEventViewerDialog->hide(); | 2758 | mEventViewerDialog->hide(); |
2744 | } | 2759 | } |
2745 | else | 2760 | else |
2746 | mCalendar->checkAlarmForIncidence( which , false ); | 2761 | mCalendar->checkAlarmForIncidence( which , false ); |
2747 | } | 2762 | } |
2748 | 2763 | ||
2749 | // most of the changeEventDisplays() right now just call the view's | 2764 | // most of the changeEventDisplays() right now just call the view's |
2750 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2765 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2751 | void CalendarView::changeEventDisplay(Event *which, int action) | 2766 | void CalendarView::changeEventDisplay(Event *which, int action) |
2752 | { | 2767 | { |
2753 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2768 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2754 | changeIncidenceDisplay((Incidence *)which, action); | 2769 | changeIncidenceDisplay((Incidence *)which, action); |
2755 | static bool clearallviews = false; | 2770 | static bool clearallviews = false; |
2756 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | 2771 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { |
2757 | if ( clearallviews ) { | 2772 | if ( clearallviews ) { |
2758 | clearAllViews(); | 2773 | clearAllViews(); |
2759 | clearallviews = false; | 2774 | clearallviews = false; |
2760 | } | 2775 | } |
2761 | return; | 2776 | return; |
2762 | } | 2777 | } |
2763 | clearallviews = true; | 2778 | clearallviews = true; |
2764 | mDateNavigator->updateView(); | 2779 | mDateNavigator->updateView(); |
2765 | //mDialogManager->updateSearchDialog(); | 2780 | //mDialogManager->updateSearchDialog(); |
2766 | if (which) { | 2781 | if (which) { |
2767 | // If there is an event view visible update the display | 2782 | // If there is an event view visible update the display |
2768 | mViewManager->currentView()->changeEventDisplay(which,action); | 2783 | mViewManager->currentView()->changeEventDisplay(which,action); |
2769 | // TODO: check, if update needed | 2784 | // TODO: check, if update needed |
2770 | // if (which->getTodoStatus()) { | 2785 | // if (which->getTodoStatus()) { |
2771 | mTodoList->updateView(); | 2786 | mTodoList->updateView(); |
2772 | if ( action != KOGlobals::EVENTDELETED ) { | 2787 | if ( action != KOGlobals::EVENTDELETED ) { |
2773 | mConflictingEvent = which ; | 2788 | mConflictingEvent = which ; |
2774 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); | 2789 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); |
2775 | } | 2790 | } |
2776 | // } | 2791 | // } |
2777 | } else { | 2792 | } else { |
2778 | mViewManager->currentView()->updateView(); | 2793 | mViewManager->currentView()->updateView(); |
2779 | } | 2794 | } |
2780 | } | 2795 | } |
2781 | void CalendarView::checkConflictForEvent() | 2796 | void CalendarView::checkConflictForEvent() |
2782 | { | 2797 | { |
2783 | 2798 | ||
2784 | if (!KOPrefs::instance()->mConfirm) | 2799 | if (!KOPrefs::instance()->mConfirm) |
2785 | return; | 2800 | return; |
2786 | if ( ! mConflictingEvent ) return; | 2801 | if ( ! mConflictingEvent ) return; |
2787 | if ( mConflictingEvent->doesFloat() ) { | 2802 | if ( mConflictingEvent->doesFloat() ) { |
2788 | mConflictingEvent = 0; | 2803 | mConflictingEvent = 0; |
2789 | return; | 2804 | return; |
2790 | } | 2805 | } |
2791 | QPtrList<Event> testlist = mCalendar->events(); | 2806 | QPtrList<Event> testlist = mCalendar->events(); |
2792 | Event * test = testlist.first(); | 2807 | Event * test = testlist.first(); |
2793 | QDateTime conflict; | 2808 | QDateTime conflict; |
2794 | QDateTime retVal; | 2809 | QDateTime retVal; |
2795 | bool found = false; | 2810 | bool found = false; |
2796 | Event * cE = 0; | 2811 | Event * cE = 0; |
2812 | QDateTime current = QDateTime::currentDateTime(); | ||
2797 | while ( test ) { | 2813 | while ( test ) { |
2798 | if ( !test->doesFloat() ) { | 2814 | if ( !test->doesFloat() ) { |
2799 | if ( mConflictingEvent->isOverlapping ( test, &retVal, true ) ) { | 2815 | if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |
2800 | if ( ! found ) { | 2816 | if ( ! found ) { |
2801 | conflict = retVal; | 2817 | conflict = retVal; |
2802 | cE = test; | 2818 | cE = test; |
2803 | } else { | 2819 | } else { |
2804 | if ( retVal < conflict ) { | 2820 | if ( retVal < conflict ) { |
2805 | conflict = retVal; | 2821 | conflict = retVal; |
2806 | cE = test; | 2822 | cE = test; |
2807 | } | 2823 | } |
2808 | } | 2824 | } |
2809 | found = true; | 2825 | found = true; |
2810 | } | 2826 | } |
2811 | } | 2827 | } |
2812 | test = testlist.next(); | 2828 | test = testlist.next(); |
2813 | } | 2829 | } |
2814 | if ( found ) { | 2830 | if ( found ) { |
2815 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; | 2831 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; |
2816 | qApp->processEvents(); | 2832 | qApp->processEvents(); |
2817 | int km = KMessageBox::warningContinueCancel(this,mess, | 2833 | int km = KMessageBox::warningContinueCancel(this,mess, |
2818 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); | 2834 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); |
2819 | if ( km != KMessageBox::Continue ) | 2835 | if ( km != KMessageBox::Continue ) |
2820 | return; | 2836 | return; |
2821 | 2837 | ||
2822 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 2838 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
2823 | mViewManager->showDayView(); | 2839 | mViewManager->showDayView(); |
2824 | mNavigator->slotDaySelect( conflict.date() ); | 2840 | mNavigator->slotDaySelect( conflict.date() ); |
2825 | int hour = conflict.time().hour(); | 2841 | int hour = conflict.time().hour(); |
2826 | mViewManager->agendaView()->setStartHour( hour ); | 2842 | mViewManager->agendaView()->setStartHour( hour ); |
2827 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); | 2843 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); |
2828 | return; | 2844 | return; |
2829 | } | 2845 | } |
2830 | 2846 | ||
2831 | return; | 2847 | return; |
2832 | 2848 | ||
2833 | } | 2849 | } |
2834 | 2850 | ||
2835 | void CalendarView::updateTodoViews() | 2851 | void CalendarView::updateTodoViews() |
2836 | { | 2852 | { |
2837 | mTodoList->updateView(); | 2853 | mTodoList->updateView(); |
2838 | mViewManager->currentView()->updateView(); | 2854 | mViewManager->currentView()->updateView(); |
2839 | 2855 | ||
2840 | } | 2856 | } |
2841 | 2857 | ||
2842 | 2858 | ||
2843 | 2859 | ||
2844 | void CalendarView::clearAllViews() | 2860 | void CalendarView::clearAllViews() |
2845 | { | 2861 | { |
2846 | mTodoList->clearList(); | 2862 | mTodoList->clearList(); |
2847 | mViewManager->clearAllViews(); | 2863 | mViewManager->clearAllViews(); |
2848 | SearchDialog * sd = mDialogManager->getSearchDialog(); | 2864 | SearchDialog * sd = mDialogManager->getSearchDialog(); |
2849 | if ( sd ) { | 2865 | if ( sd ) { |
2850 | KOListView* kol = sd->listview(); | 2866 | KOListView* kol = sd->listview(); |
2851 | if ( kol ) | 2867 | if ( kol ) |
2852 | kol->clearList(); | 2868 | kol->clearList(); |
2853 | } | 2869 | } |
2854 | } | 2870 | } |
2855 | void CalendarView::updateView() | 2871 | void CalendarView::updateView() |
2856 | { | 2872 | { |
2857 | static bool clearallviews = false; | 2873 | static bool clearallviews = false; |
2858 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | 2874 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { |
2859 | if ( clearallviews ) { | 2875 | if ( clearallviews ) { |
2860 | clearAllViews(); | 2876 | clearAllViews(); |
2861 | clearallviews = false; | 2877 | clearallviews = false; |
2862 | } | 2878 | } |
2863 | return; | 2879 | return; |
2864 | } | 2880 | } |
2865 | clearallviews = true; | 2881 | clearallviews = true; |
2866 | DateList tmpList = mNavigator->selectedDates(); | 2882 | DateList tmpList = mNavigator->selectedDates(); |
2867 | 2883 | ||
2868 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2884 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2869 | mTodoList->updateView(); | 2885 | mTodoList->updateView(); |
2870 | // We assume that the navigator only selects consecutive days. | 2886 | // We assume that the navigator only selects consecutive days. |
2871 | updateView( tmpList.first(), tmpList.last() ); | 2887 | updateView( tmpList.first(), tmpList.last() ); |
2872 | } | 2888 | } |
2873 | 2889 | ||
2874 | void CalendarView::updateUnmanagedViews() | 2890 | void CalendarView::updateUnmanagedViews() |
2875 | { | 2891 | { |
2876 | mDateNavigator->updateDayMatrix(); | 2892 | mDateNavigator->updateDayMatrix(); |
2877 | } | 2893 | } |
2878 | 2894 | ||
2879 | int CalendarView::msgItemDelete(const QString name) | 2895 | int CalendarView::msgItemDelete(const QString name) |
2880 | { | 2896 | { |
2881 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2897 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2882 | i18n("This item will be\npermanently deleted."), | 2898 | i18n("This item will be\npermanently deleted."), |
2883 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2899 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2884 | } | 2900 | } |
2885 | 2901 | ||
2886 | 2902 | ||
2887 | void CalendarView::edit_cut() | 2903 | void CalendarView::edit_cut() |
2888 | { | 2904 | { |
2889 | Event *anEvent=0; | 2905 | Event *anEvent=0; |
2890 | 2906 | ||
2891 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2907 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2892 | 2908 | ||
2893 | if (mViewManager->currentView()->isEventView()) { | 2909 | if (mViewManager->currentView()->isEventView()) { |
2894 | if ( incidence && incidence->typeID() == eventID ) { | 2910 | if ( incidence && incidence->typeID() == eventID ) { |
2895 | anEvent = static_cast<Event *>(incidence); | 2911 | anEvent = static_cast<Event *>(incidence); |
2896 | } | 2912 | } |
2897 | } | 2913 | } |
2898 | 2914 | ||
2899 | if (!anEvent) { | 2915 | if (!anEvent) { |
2900 | KNotifyClient::beep(); | 2916 | KNotifyClient::beep(); |
2901 | return; | 2917 | return; |
2902 | } | 2918 | } |
2903 | DndFactory factory( mCalendar ); | 2919 | DndFactory factory( mCalendar ); |
2904 | factory.cutIncidence(anEvent); | 2920 | factory.cutIncidence(anEvent); |
2905 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2921 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2906 | } | 2922 | } |
2907 | 2923 | ||
2908 | void CalendarView::edit_copy() | 2924 | void CalendarView::edit_copy() |
2909 | { | 2925 | { |
2910 | Event *anEvent=0; | 2926 | Event *anEvent=0; |
2911 | 2927 | ||
2912 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2928 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2913 | 2929 | ||
2914 | if (mViewManager->currentView()->isEventView()) { | 2930 | if (mViewManager->currentView()->isEventView()) { |
2915 | if ( incidence && incidence->typeID() == eventID ) { | 2931 | if ( incidence && incidence->typeID() == eventID ) { |
2916 | anEvent = static_cast<Event *>(incidence); | 2932 | anEvent = static_cast<Event *>(incidence); |
2917 | } | 2933 | } |
2918 | } | 2934 | } |
2919 | 2935 | ||
2920 | if (!anEvent) { | 2936 | if (!anEvent) { |
2921 | KNotifyClient::beep(); | 2937 | KNotifyClient::beep(); |
2922 | return; | 2938 | return; |
2923 | } | 2939 | } |
2924 | DndFactory factory( mCalendar ); | 2940 | DndFactory factory( mCalendar ); |
2925 | factory.copyIncidence(anEvent); | 2941 | factory.copyIncidence(anEvent); |
2926 | } | 2942 | } |
2927 | 2943 | ||
2928 | void CalendarView::edit_paste() | 2944 | void CalendarView::edit_paste() |
2929 | { | 2945 | { |
2930 | QDate date = mNavigator->selectedDates().first(); | 2946 | QDate date = mNavigator->selectedDates().first(); |
2931 | 2947 | ||
2932 | DndFactory factory( mCalendar ); | 2948 | DndFactory factory( mCalendar ); |
2933 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); | 2949 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); |
2934 | 2950 | ||
2935 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2951 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2936 | } | 2952 | } |
2937 | void CalendarView::edit_global_options() | 2953 | void CalendarView::edit_global_options() |
2938 | { | 2954 | { |
2939 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; | 2955 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; |
2940 | emit save(); | 2956 | emit save(); |
2941 | emit saveStopTimer(); | 2957 | emit saveStopTimer(); |
2942 | mDialogManager->showGlobalOptionsDialog(); | 2958 | mDialogManager->showGlobalOptionsDialog(); |
2943 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { | 2959 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { |
2944 | emit saveStopTimer(); | 2960 | emit saveStopTimer(); |
2945 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), | 2961 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), |
2946 | i18n("Timezone settings"),i18n("Reload"))) { | 2962 | i18n("Timezone settings"),i18n("Reload"))) { |
2947 | qDebug("KO: TZ reload cancelled "); | 2963 | qDebug("KO: TZ reload cancelled "); |
2948 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2964 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2949 | return; | 2965 | return; |
2950 | } | 2966 | } |
2951 | qDebug("KO: Timezone change "); | 2967 | qDebug("KO: Timezone change "); |
2952 | loadCalendars(); | 2968 | loadCalendars(); |
2953 | setModified(true); | 2969 | setModified(true); |
2954 | } | 2970 | } |
2955 | else | 2971 | else |
2956 | qDebug("KO: No tz change "); | 2972 | qDebug("KO: No tz change "); |
2957 | } | 2973 | } |
2958 | void CalendarView::edit_options() | 2974 | void CalendarView::edit_options() |
2959 | { | 2975 | { |
2960 | mDialogManager->showOptionsDialog(); | 2976 | mDialogManager->showOptionsDialog(); |
2961 | } | 2977 | } |
2962 | 2978 | ||
2963 | 2979 | ||
2964 | void CalendarView::slotSelectPickerDate( QDate d) | 2980 | void CalendarView::slotSelectPickerDate( QDate d) |
2965 | { | 2981 | { |
2966 | mDateFrame->hide(); | 2982 | mDateFrame->hide(); |
2967 | if ( mDatePickerMode == 1 ) { | 2983 | if ( mDatePickerMode == 1 ) { |
2968 | mNavigator->slotDaySelect( d ); | 2984 | mNavigator->slotDaySelect( d ); |
2969 | } else if ( mDatePickerMode == 2 ) { | 2985 | } else if ( mDatePickerMode == 2 ) { |
2970 | if ( mMoveIncidence->typeID() == todoID ) { | 2986 | if ( mMoveIncidence->typeID() == todoID ) { |
2971 | Todo * to = (Todo *) mMoveIncidence; | 2987 | Todo * to = (Todo *) mMoveIncidence; |
2972 | QTime tim; | 2988 | QTime tim; |
2973 | int len = 0; | 2989 | int len = 0; |
2974 | if ( to->hasStartDate() && to->hasDueDate() ) | 2990 | if ( to->hasStartDate() && to->hasDueDate() ) |
2975 | len = to->dtStart().secsTo( to->dtDue()); | 2991 | len = to->dtStart().secsTo( to->dtDue()); |
2976 | if ( to->hasDueDate() ) | 2992 | if ( to->hasDueDate() ) |
2977 | tim = to->dtDue().time(); | 2993 | tim = to->dtDue().time(); |
2978 | else { | 2994 | else { |
2979 | tim = QTime ( 0,0,0 ); | 2995 | tim = QTime ( 0,0,0 ); |
2980 | to->setFloats( true ); | 2996 | to->setFloats( true ); |
2981 | to->setHasDueDate( true ); | 2997 | to->setHasDueDate( true ); |
2982 | } | 2998 | } |
2983 | QDateTime dt ( d,tim ); | 2999 | QDateTime dt ( d,tim ); |
2984 | to->setDtDue( dt ); | 3000 | to->setDtDue( dt ); |
2985 | 3001 | ||
2986 | if ( to->hasStartDate() ) { | 3002 | if ( to->hasStartDate() ) { |
2987 | if ( len>0 ) | 3003 | if ( len>0 ) |
2988 | to->setDtStart(to->dtDue().addSecs( -len )); | 3004 | to->setDtStart(to->dtDue().addSecs( -len )); |
2989 | else | 3005 | else |
2990 | if (to->dtStart() > to->dtDue() ) | 3006 | if (to->dtStart() > to->dtDue() ) |
2991 | to->setDtStart(to->dtDue().addDays( -3 )); | 3007 | to->setDtStart(to->dtDue().addDays( -3 )); |
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 235ae55..46e8174 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -1,338 +1,338 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <kglobal.h> | 21 | #include <kglobal.h> |
22 | #include <klocale.h> | 22 | #include <klocale.h> |
23 | #include <kdebug.h> | 23 | #include <kdebug.h> |
24 | 24 | ||
25 | #include "event.h" | 25 | #include "event.h" |
26 | 26 | ||
27 | using namespace KCal; | 27 | using namespace KCal; |
28 | 28 | ||
29 | Event::Event() : | 29 | Event::Event() : |
30 | mHasEndDate( false ), mTransparency( Opaque ) | 30 | mHasEndDate( false ), mTransparency( Opaque ) |
31 | { | 31 | { |
32 | } | 32 | } |
33 | 33 | ||
34 | Event::Event(const Event &e) : Incidence(e) | 34 | Event::Event(const Event &e) : Incidence(e) |
35 | { | 35 | { |
36 | mDtEnd = e.mDtEnd; | 36 | mDtEnd = e.mDtEnd; |
37 | mHasEndDate = e.mHasEndDate; | 37 | mHasEndDate = e.mHasEndDate; |
38 | mTransparency = e.mTransparency; | 38 | mTransparency = e.mTransparency; |
39 | } | 39 | } |
40 | 40 | ||
41 | Event::~Event() | 41 | Event::~Event() |
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
45 | Incidence *Event::clone() | 45 | Incidence *Event::clone() |
46 | { | 46 | { |
47 | return new Event(*this); | 47 | return new Event(*this); |
48 | } | 48 | } |
49 | 49 | ||
50 | bool KCal::operator==( const Event& e1, const Event& e2 ) | 50 | bool KCal::operator==( const Event& e1, const Event& e2 ) |
51 | { | 51 | { |
52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && | 52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && |
53 | e1.dtEnd() == e2.dtEnd() && | 53 | e1.dtEnd() == e2.dtEnd() && |
54 | e1.hasEndDate() == e2.hasEndDate() && | 54 | e1.hasEndDate() == e2.hasEndDate() && |
55 | e1.transparency() == e2.transparency(); | 55 | e1.transparency() == e2.transparency(); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | bool Event::contains ( Event* from ) | 59 | bool Event::contains ( Event* from ) |
60 | { | 60 | { |
61 | 61 | ||
62 | if ( !from->summary().isEmpty() ) | 62 | if ( !from->summary().isEmpty() ) |
63 | if ( !summary().startsWith( from->summary() )) | 63 | if ( !summary().startsWith( from->summary() )) |
64 | return false; | 64 | return false; |
65 | if ( from->dtStart().isValid() ) | 65 | if ( from->dtStart().isValid() ) |
66 | if (dtStart() != from->dtStart() ) | 66 | if (dtStart() != from->dtStart() ) |
67 | return false; | 67 | return false; |
68 | if ( from->dtEnd().isValid() ) | 68 | if ( from->dtEnd().isValid() ) |
69 | if ( dtEnd() != from->dtEnd() ) | 69 | if ( dtEnd() != from->dtEnd() ) |
70 | return false; | 70 | return false; |
71 | if ( !from->location().isEmpty() ) | 71 | if ( !from->location().isEmpty() ) |
72 | if ( !location().startsWith( from->location() ) ) | 72 | if ( !location().startsWith( from->location() ) ) |
73 | return false; | 73 | return false; |
74 | if ( !from->description().isEmpty() ) | 74 | if ( !from->description().isEmpty() ) |
75 | if ( !description().startsWith( from->description() )) | 75 | if ( !description().startsWith( from->description() )) |
76 | return false; | 76 | return false; |
77 | if ( from->alarms().count() ) { | 77 | if ( from->alarms().count() ) { |
78 | Alarm *a = from->alarms().first(); | 78 | Alarm *a = from->alarms().first(); |
79 | if ( a->enabled() ){ | 79 | if ( a->enabled() ){ |
80 | if ( !alarms().count() ) | 80 | if ( !alarms().count() ) |
81 | return false; | 81 | return false; |
82 | Alarm *b = alarms().first(); | 82 | Alarm *b = alarms().first(); |
83 | if( ! b->enabled() ) | 83 | if( ! b->enabled() ) |
84 | return false; | 84 | return false; |
85 | if ( ! (a->offset() == b->offset() )) | 85 | if ( ! (a->offset() == b->offset() )) |
86 | return false; | 86 | return false; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | QStringList cat = categories(); | 89 | QStringList cat = categories(); |
90 | QStringList catFrom = from->categories(); | 90 | QStringList catFrom = from->categories(); |
91 | QString nCat; | 91 | QString nCat; |
92 | unsigned int iii; | 92 | unsigned int iii; |
93 | for ( iii = 0; iii < catFrom.count();++iii ) { | 93 | for ( iii = 0; iii < catFrom.count();++iii ) { |
94 | nCat = catFrom[iii]; | 94 | nCat = catFrom[iii]; |
95 | if ( !nCat.isEmpty() ) | 95 | if ( !nCat.isEmpty() ) |
96 | if ( !cat.contains( nCat )) { | 96 | if ( !cat.contains( nCat )) { |
97 | return false; | 97 | return false; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | if ( from->doesRecur() ) | 100 | if ( from->doesRecur() ) |
101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) | 101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) |
102 | return false; | 102 | return false; |
103 | return true; | 103 | return true; |
104 | } | 104 | } |
105 | 105 | ||
106 | void Event::setDtEnd(const QDateTime &dtEnd) | 106 | void Event::setDtEnd(const QDateTime &dtEnd) |
107 | { | 107 | { |
108 | if (mReadOnly) return; | 108 | if (mReadOnly) return; |
109 | 109 | ||
110 | mDtEnd = getEvenTime( dtEnd ); | 110 | mDtEnd = getEvenTime( dtEnd ); |
111 | 111 | ||
112 | setHasEndDate(true); | 112 | setHasEndDate(true); |
113 | setHasDuration(false); | 113 | setHasDuration(false); |
114 | 114 | ||
115 | updated(); | 115 | updated(); |
116 | } | 116 | } |
117 | 117 | ||
118 | QDateTime Event::dtEnd() const | 118 | QDateTime Event::dtEnd() const |
119 | { | 119 | { |
120 | if (hasEndDate()) return mDtEnd; | 120 | if (hasEndDate()) return mDtEnd; |
121 | if (hasDuration()) return dtStart().addSecs(duration()); | 121 | if (hasDuration()) return dtStart().addSecs(duration()); |
122 | 122 | ||
123 | return dtStart(); | 123 | return dtStart(); |
124 | } | 124 | } |
125 | 125 | ||
126 | QString Event::dtEndTimeStr() const | 126 | QString Event::dtEndTimeStr() const |
127 | { | 127 | { |
128 | return KGlobal::locale()->formatTime(mDtEnd.time()); | 128 | return KGlobal::locale()->formatTime(mDtEnd.time()); |
129 | } | 129 | } |
130 | 130 | ||
131 | QString Event::dtEndDateStr(bool shortfmt) const | 131 | QString Event::dtEndDateStr(bool shortfmt) const |
132 | { | 132 | { |
133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); | 133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); |
134 | } | 134 | } |
135 | 135 | ||
136 | QString Event::dtEndStr(bool shortfmt) const | 136 | QString Event::dtEndStr(bool shortfmt) const |
137 | { | 137 | { |
138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); | 138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); |
139 | } | 139 | } |
140 | 140 | ||
141 | void Event::setHasEndDate(bool b) | 141 | void Event::setHasEndDate(bool b) |
142 | { | 142 | { |
143 | mHasEndDate = b; | 143 | mHasEndDate = b; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool Event::hasEndDate() const | 146 | bool Event::hasEndDate() const |
147 | { | 147 | { |
148 | return mHasEndDate; | 148 | return mHasEndDate; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Event::isMultiDay() const | 151 | bool Event::isMultiDay() const |
152 | { | 152 | { |
153 | bool multi = !(dtStart().date() == dtEnd().date()); | 153 | bool multi = !(dtStart().date() == dtEnd().date()); |
154 | return multi; | 154 | return multi; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Event::setTransparency(Event::Transparency transparency) | 157 | void Event::setTransparency(Event::Transparency transparency) |
158 | { | 158 | { |
159 | if (mReadOnly) return; | 159 | if (mReadOnly) return; |
160 | mTransparency = transparency; | 160 | mTransparency = transparency; |
161 | updated(); | 161 | updated(); |
162 | } | 162 | } |
163 | 163 | ||
164 | Event::Transparency Event::transparency() const | 164 | Event::Transparency Event::transparency() const |
165 | { | 165 | { |
166 | return mTransparency; | 166 | return mTransparency; |
167 | } | 167 | } |
168 | 168 | ||
169 | void Event::setDuration(int seconds) | 169 | void Event::setDuration(int seconds) |
170 | { | 170 | { |
171 | setHasEndDate(false); | 171 | setHasEndDate(false); |
172 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
173 | } | 173 | } |
174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFutureOnly ) | 174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) |
175 | { | 175 | { |
176 | if ( testEvent == this ) | 176 | if ( testEvent == this ) |
177 | return false; | 177 | return false; |
178 | if ( ! doesRecur() && !testEvent->doesRecur() ) { | 178 | if ( ! doesRecur() && !testEvent->doesRecur() ) { |
179 | QDateTime te; | 179 | QDateTime te; |
180 | if ( testEvent->doesFloat() ) | 180 | if ( testEvent->doesFloat() ) |
181 | te = testEvent->mDtEnd.addDays( 1 ); | 181 | te = testEvent->mDtEnd.addDays( 1 ); |
182 | else | 182 | else |
183 | te = testEvent->mDtEnd; | 183 | te = testEvent->mDtEnd; |
184 | QDateTime e; | 184 | QDateTime e; |
185 | if ( doesFloat() ) | 185 | if ( doesFloat() ) |
186 | e = mDtEnd.addDays( 1 ); | 186 | e = mDtEnd.addDays( 1 ); |
187 | else | 187 | else |
188 | e = mDtEnd; | 188 | e = mDtEnd; |
189 | if ( mDtStart < te && testEvent->mDtStart < e ) { | 189 | if ( mDtStart < te && testEvent->mDtStart < e ) { |
190 | if ( mDtStart < testEvent->mDtStart ) | 190 | if ( mDtStart < testEvent->mDtStart ) |
191 | *overlapDT = testEvent->mDtStart; | 191 | *overlapDT = testEvent->mDtStart; |
192 | else | 192 | else |
193 | *overlapDT = mDtStart; | 193 | *overlapDT = mDtStart; |
194 | if ( inFutureOnly ) | 194 | if ( startDT ) |
195 | return (*overlapDT >= QDateTime::currentDateTime() ); | 195 | return (*overlapDT >= *startDT ); |
196 | return true; | 196 | return true; |
197 | } | 197 | } |
198 | return false; | 198 | return false; |
199 | } | 199 | } |
200 | Event *nonRecur = 0; | 200 | Event *nonRecur = 0; |
201 | Event *recurEvent = 0; | 201 | Event *recurEvent = 0; |
202 | if ( ! doesRecur() ) { | 202 | if ( ! doesRecur() ) { |
203 | nonRecur = this; | 203 | nonRecur = this; |
204 | recurEvent = testEvent; | 204 | recurEvent = testEvent; |
205 | } | 205 | } |
206 | else if ( !testEvent->doesRecur() ) { | 206 | else if ( !testEvent->doesRecur() ) { |
207 | nonRecur = testEvent; | 207 | nonRecur = testEvent; |
208 | recurEvent = this; | 208 | recurEvent = this; |
209 | } | 209 | } |
210 | if ( nonRecur ) { | 210 | if ( nonRecur ) { |
211 | QDateTime enr; | 211 | QDateTime enr; |
212 | if ( nonRecur->doesFloat() ) | 212 | if ( nonRecur->doesFloat() ) |
213 | enr = nonRecur->mDtEnd.addDays( 1 ); | 213 | enr = nonRecur->mDtEnd.addDays( 1 ); |
214 | else | 214 | else |
215 | enr = nonRecur->mDtEnd; | 215 | enr = nonRecur->mDtEnd; |
216 | if ( enr < recurEvent->mDtStart ) | 216 | if ( enr < recurEvent->mDtStart ) |
217 | return false; | 217 | return false; |
218 | if ( inFutureOnly && enr < QDateTime::currentDateTime() ) | 218 | if ( startDT && enr < *startDT ) |
219 | return false; | 219 | return false; |
220 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); | 220 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); |
221 | if ( recurEvent->doesFloat() ) | 221 | if ( recurEvent->doesFloat() ) |
222 | recDuration += 86400; | 222 | recDuration += 86400; |
223 | bool ok = true; | 223 | bool ok = true; |
224 | QDateTime recStart = recurEvent->mDtStart.addSecs( -300);; | 224 | QDateTime recStart = recurEvent->mDtStart.addSecs( -300);; |
225 | while ( ok ) { | 225 | while ( ok ) { |
226 | recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok ); | 226 | recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok ); |
227 | if ( ok ) { | 227 | if ( ok ) { |
228 | if ( recStart > enr ) | 228 | if ( recStart > enr ) |
229 | return false; | 229 | return false; |
230 | QDateTime recEnd = recStart.addSecs( recDuration ); | 230 | QDateTime recEnd = recStart.addSecs( recDuration ); |
231 | if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) { | 231 | if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) { |
232 | if ( nonRecur->mDtStart < recStart ) | 232 | if ( nonRecur->mDtStart < recStart ) |
233 | *overlapDT = recStart; | 233 | *overlapDT = recStart; |
234 | else | 234 | else |
235 | *overlapDT = nonRecur->mDtStart; | 235 | *overlapDT = nonRecur->mDtStart; |
236 | if ( inFutureOnly ) { | 236 | if ( startDT ) { |
237 | if ( *overlapDT >= QDateTime::currentDateTime() ) | 237 | if ( *overlapDT >= *startDT ) |
238 | return true; | 238 | return true; |
239 | } else | 239 | } else |
240 | return true; | 240 | return true; |
241 | } | 241 | } |
242 | } | 242 | } |
243 | } | 243 | } |
244 | return false; | 244 | return false; |
245 | } | 245 | } |
246 | 246 | ||
247 | QDateTime incidenceStart = mDtStart; | 247 | QDateTime incidenceStart = mDtStart; |
248 | int duration = mDtStart.secsTo( mDtEnd ); | 248 | int duration = mDtStart.secsTo( mDtEnd ); |
249 | if ( doesFloat() ) | 249 | if ( doesFloat() ) |
250 | duration += 86400; | 250 | duration += 86400; |
251 | QDateTime testincidenceStart = testEvent->mDtStart; | 251 | QDateTime testincidenceStart = testEvent->mDtStart; |
252 | int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd ); | 252 | int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd ); |
253 | if ( testEvent->doesFloat() ) | 253 | if ( testEvent->doesFloat() ) |
254 | testduration += 86400; | 254 | testduration += 86400; |
255 | bool computeThis = false; | 255 | bool computeThis = false; |
256 | if ( incidenceStart < testincidenceStart ) | 256 | if ( incidenceStart < testincidenceStart ) |
257 | computeThis = true; | 257 | computeThis = true; |
258 | bool ok = true; | 258 | bool ok = true; |
259 | if ( computeThis ) | 259 | if ( computeThis ) |
260 | incidenceStart = incidenceStart.addSecs( -300 ); | 260 | incidenceStart = incidenceStart.addSecs( -300 ); |
261 | else | 261 | else |
262 | testincidenceStart = testincidenceStart.addSecs( -300 ); | 262 | testincidenceStart = testincidenceStart.addSecs( -300 ); |
263 | int count = 0; | 263 | int count = 0; |
264 | while ( ok ) { | 264 | while ( ok ) { |
265 | ++count; | 265 | ++count; |
266 | if ( count > 1000 ) break; | 266 | if ( count > 1000 ) break; |
267 | if ( computeThis ) | 267 | if ( computeThis ) |
268 | incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok ); | 268 | incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok ); |
269 | else | 269 | else |
270 | testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok ); | 270 | testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok ); |
271 | if ( ok ) { | 271 | if ( ok ) { |
272 | if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) { | 272 | if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) { |
273 | if ( incidenceStart < testincidenceStart ) | 273 | if ( incidenceStart < testincidenceStart ) |
274 | *overlapDT = testincidenceStart; | 274 | *overlapDT = testincidenceStart; |
275 | else | 275 | else |
276 | *overlapDT = incidenceStart; | 276 | *overlapDT = incidenceStart; |
277 | if ( inFutureOnly ) { | 277 | if ( startDT ) { |
278 | if ( *overlapDT >= QDateTime::currentDateTime() ) | 278 | if ( *overlapDT >= *startDT ) |
279 | return true; | 279 | return true; |
280 | } else | 280 | } else |
281 | return true; | 281 | return true; |
282 | } | 282 | } |
283 | computeThis = ( incidenceStart < testincidenceStart ); | 283 | computeThis = ( incidenceStart < testincidenceStart ); |
284 | } | 284 | } |
285 | 285 | ||
286 | } | 286 | } |
287 | return false; | 287 | return false; |
288 | } | 288 | } |
289 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const | 289 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const |
290 | { | 290 | { |
291 | *ok = false; | 291 | *ok = false; |
292 | if ( !alarmEnabled() ) | 292 | if ( !alarmEnabled() ) |
293 | return QDateTime (); | 293 | return QDateTime (); |
294 | bool yes; | 294 | bool yes; |
295 | QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); | 295 | QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); |
296 | if ( ! yes || cancelled() ) { | 296 | if ( ! yes || cancelled() ) { |
297 | *ok = false; | 297 | *ok = false; |
298 | return QDateTime (); | 298 | return QDateTime (); |
299 | } | 299 | } |
300 | 300 | ||
301 | bool enabled = false; | 301 | bool enabled = false; |
302 | Alarm* alarm; | 302 | Alarm* alarm; |
303 | int off = 0; | 303 | int off = 0; |
304 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 304 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
305 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 305 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
306 | // *ok = false; | 306 | // *ok = false; |
307 | // return incidenceStart; | 307 | // return incidenceStart; |
308 | // } | 308 | // } |
309 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 309 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
310 | if (alarm->enabled()) { | 310 | if (alarm->enabled()) { |
311 | if ( alarm->hasTime () ) { | 311 | if ( alarm->hasTime () ) { |
312 | if ( alarm->time() < alarmStart ) { | 312 | if ( alarm->time() < alarmStart ) { |
313 | alarmStart = alarm->time(); | 313 | alarmStart = alarm->time(); |
314 | enabled = true; | 314 | enabled = true; |
315 | off = alarmStart.secsTo( incidenceStart ); | 315 | off = alarmStart.secsTo( incidenceStart ); |
316 | } | 316 | } |
317 | 317 | ||
318 | } else { | 318 | } else { |
319 | int secs = alarm->startOffset().asSeconds(); | 319 | int secs = alarm->startOffset().asSeconds(); |
320 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 320 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
321 | alarmStart = incidenceStart.addSecs( secs ); | 321 | alarmStart = incidenceStart.addSecs( secs ); |
322 | enabled = true; | 322 | enabled = true; |
323 | off = -secs; | 323 | off = -secs; |
324 | } | 324 | } |
325 | } | 325 | } |
326 | } | 326 | } |
327 | } | 327 | } |
328 | if ( enabled ) { | 328 | if ( enabled ) { |
329 | if ( alarmStart > start_dt ) { | 329 | if ( alarmStart > start_dt ) { |
330 | *ok = true; | 330 | *ok = true; |
331 | * offset = off; | 331 | * offset = off; |
332 | return alarmStart; | 332 | return alarmStart; |
333 | } | 333 | } |
334 | } | 334 | } |
335 | *ok = false; | 335 | *ok = false; |
336 | return QDateTime (); | 336 | return QDateTime (); |
337 | 337 | ||
338 | } | 338 | } |
diff --git a/libkcal/event.h b/libkcal/event.h index 80c11c4..e6055a5 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -1,93 +1,93 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef EVENT_H | 21 | #ifndef EVENT_H |
22 | #define EVENT_H | 22 | #define EVENT_H |
23 | // | 23 | // |
24 | // Event component, representing a VEVENT object | 24 | // Event component, representing a VEVENT object |
25 | // | 25 | // |
26 | 26 | ||
27 | #include "incidence.h" | 27 | #include "incidence.h" |
28 | namespace KCal { | 28 | namespace KCal { |
29 | 29 | ||
30 | /** | 30 | /** |
31 | This class provides an Event in the sense of RFC2445. | 31 | This class provides an Event in the sense of RFC2445. |
32 | */ | 32 | */ |
33 | class Event : public Incidence | 33 | class Event : public Incidence |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | enum Transparency { Opaque, Transparent }; | 36 | enum Transparency { Opaque, Transparent }; |
37 | typedef ListBase<Event> List; | 37 | typedef ListBase<Event> List; |
38 | Event(); | 38 | Event(); |
39 | Event(const Event &); | 39 | Event(const Event &); |
40 | ~Event(); | 40 | ~Event(); |
41 | 41 | ||
42 | QCString type() const { return "Event"; } | 42 | QCString type() const { return "Event"; } |
43 | IncTypeID typeID() const { return eventID; } | 43 | IncTypeID typeID() const { return eventID; } |
44 | 44 | ||
45 | Incidence *clone(); | 45 | Incidence *clone(); |
46 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; | 46 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; |
47 | 47 | ||
48 | /** for setting an event's ending date/time with a QDateTime. */ | 48 | /** for setting an event's ending date/time with a QDateTime. */ |
49 | void setDtEnd(const QDateTime &dtEnd); | 49 | void setDtEnd(const QDateTime &dtEnd); |
50 | /** Return the event's ending date/time as a QDateTime. */ | 50 | /** Return the event's ending date/time as a QDateTime. */ |
51 | virtual QDateTime dtEnd() const; | 51 | virtual QDateTime dtEnd() const; |
52 | /** returns an event's end time as a string formatted according to the | 52 | /** returns an event's end time as a string formatted according to the |
53 | users locale settings */ | 53 | users locale settings */ |
54 | QString dtEndTimeStr() const; | 54 | QString dtEndTimeStr() const; |
55 | /** returns an event's end date as a string formatted according to the | 55 | /** returns an event's end date as a string formatted according to the |
56 | users locale settings */ | 56 | users locale settings */ |
57 | QString dtEndDateStr(bool shortfmt=true) const; | 57 | QString dtEndDateStr(bool shortfmt=true) const; |
58 | /** returns an event's end date and time as a string formatted according | 58 | /** returns an event's end date and time as a string formatted according |
59 | to the users locale settings */ | 59 | to the users locale settings */ |
60 | QString dtEndStr(bool shortfmt=true) const; | 60 | QString dtEndStr(bool shortfmt=true) const; |
61 | void setHasEndDate(bool); | 61 | void setHasEndDate(bool); |
62 | /** Return whether the event has an end date/time. */ | 62 | /** Return whether the event has an end date/time. */ |
63 | bool hasEndDate() const; | 63 | bool hasEndDate() const; |
64 | 64 | ||
65 | /** Return true if the event spans multiple days, otherwise return false. */ | 65 | /** Return true if the event spans multiple days, otherwise return false. */ |
66 | bool isMultiDay() const; | 66 | bool isMultiDay() const; |
67 | 67 | ||
68 | /** set the event's time transparency level. */ | 68 | /** set the event's time transparency level. */ |
69 | void setTransparency(Transparency transparency); | 69 | void setTransparency(Transparency transparency); |
70 | /** get the event's time transparency level. */ | 70 | /** get the event's time transparency level. */ |
71 | Transparency transparency() const; | 71 | Transparency transparency() const; |
72 | 72 | ||
73 | void setDuration(int seconds); | 73 | void setDuration(int seconds); |
74 | 74 | ||
75 | bool contains ( Event*); | 75 | bool contains ( Event*); |
76 | 76 | ||
77 | bool isOverlapping ( Event*, QDateTime*, bool inFutureOnly ); | 77 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); |
78 | 78 | ||
79 | private: | 79 | private: |
80 | bool accept(Visitor &v) { return v.visit(this); } | 80 | bool accept(Visitor &v) { return v.visit(this); } |
81 | 81 | ||
82 | QDateTime mDtEnd; | 82 | QDateTime mDtEnd; |
83 | bool mHasEndDate; | 83 | bool mHasEndDate; |
84 | Transparency mTransparency; | 84 | Transparency mTransparency; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | bool operator==( const Event&, const Event& ); | 87 | bool operator==( const Event&, const Event& ); |
88 | 88 | ||
89 | 89 | ||
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | #endif | 93 | #endif |