summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt13
-rw-r--r--korganizer/calendarview.cpp153
-rw-r--r--korganizer/kotodoview.cpp16
-rw-r--r--libkcal/event.cpp115
-rw-r--r--libkcal/event.h2
-rw-r--r--libkcal/incidencebase.cpp8
-rw-r--r--libkcal/incidencebase.h4
7 files changed, 243 insertions, 68 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index b225594..43bc343 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1248,273 +1248,270 @@
1248{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1248{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1249{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1249{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1250{ "Received %1 bytes","%1 Bytes erhalten" }, 1250{ "Received %1 bytes","%1 Bytes erhalten" },
1251{ "Writing file to disk...","Speichere Datei..." }, 1251{ "Writing file to disk...","Speichere Datei..." },
1252{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1252{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1253{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1253{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1254{ "Synchronize!","Synchronisiere!" }, 1254{ "Synchronize!","Synchronisiere!" },
1255{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1255{ "High clock skew!","Großer Uhrzeitunterschied!" },
1256{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1256{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1257{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 1257{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1258{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1258{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1259{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1259{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1260{ "List week view","Listenwochenansicht" }, 1260{ "List week view","Listenwochenansicht" },
1261{ "List week","Listenwochenansicht" }, 1261{ "List week","Listenwochenansicht" },
1262{ "Next Week","Nächste Woche" }, 1262{ "Next Week","Nächste Woche" },
1263{ "Previous Week","Vorherige Woche" }, 1263{ "Previous Week","Vorherige Woche" },
1264{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, 1264{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." },
1265{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1265{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1266{ "Details","Details" }, 1266{ "Details","Details" },
1267{ "Created time","Erstellt Zeit" }, 1267{ "Created time","Erstellt Zeit" },
1268{ "Last modified time","Geändert Zeit" }, 1268{ "Last modified time","Geändert Zeit" },
1269{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1269{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1270{ "View Options","Anzeige Optionen" }, 1270{ "View Options","Anzeige Optionen" },
1271{ "<b>Created: ","<b>Erstellt am: " }, 1271{ "<b>Created: ","<b>Erstellt am: " },
1272{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1272{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1273{ "Journal: ","Journal: " }, 1273{ "Journal: ","Journal: " },
1274{ "yearly","jährlich" }, 1274{ "yearly","jährlich" },
1275{ "(%1) ","%1-" }, 1275{ "(%1) ","%1-" },
1276{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1276{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1277{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1277{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1278{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1278{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1279{ "Summary/Loc.","Titel/Ort" }, 1279{ "Summary/Loc.","Titel/Ort" },
1280{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1280{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1281{ "Week Number","Wochennummer" }, 1281{ "Week Number","Wochennummer" },
1282{ "Import","Importiere" }, 1282{ "Import","Importiere" },
1283{ "Export","Exportiere" }, 1283{ "Export","Exportiere" },
1284{ "Beam","Beame" }, 1284{ "Beam","Beame" },
1285{ "Export","Exportiere" }, 1285{ "Export","Exportiere" },
1286{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1286{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1287{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1287{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1288{ "Journal/Details...","Journale/Details..." }, 1288{ "Journal/Details...","Journale/Details..." },
1289{ "Agenda View","Agenda Ansicht" }, 1289{ "Agenda View","Agenda Ansicht" },
1290{ "Show current time","Zeige aktuelle Zeit" }, 1290{ "Show current time","Zeige aktuelle Zeit" },
1291{ "Edit new item","Bearbeite neuen Eintrag" }, 1291{ "Edit new item","Bearbeite neuen Eintrag" },
1292{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, 1292{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" },
1293{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1293{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1294{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1294{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1295{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1295{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1296{ "%1 days\n","%1 Tagen\n" }, 1296{ "%1 days\n","%1 Tagen\n" },
1297{ "1 day\n","1 Tag\n" }, 1297{ "1 day\n","1 Tag\n" },
1298{ "%1 hours\n","%1 Stunden\n" }, 1298{ "%1 hours\n","%1 Stunden\n" },
1299{ "1 hour\n","1 Stunde\n" }, 1299{ "1 hour\n","1 Stunde\n" },
1300{ "%1 minutes\n","%1 Minuten\n" }, 1300{ "%1 minutes\n","%1 Minuten\n" },
1301{ "1 minute\n","1 Minute\n" }, 1301{ "1 minute\n","1 Minute\n" },
1302{ "Only one toolbar","Nur eine Toolbar" }, 1302{ "Only one toolbar","Nur eine Toolbar" },
1303{ "Print","Drucke" }, 1303{ "Print","Drucke" },
1304{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1304{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1305{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1305{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1306{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1306{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1307{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1307{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1308{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, 1308{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" },
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 within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre 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" },
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" },
1507{ "Show date","Zeige Datum" },
1508{ "No problem!","Kein Problem!" },
1504{ "","" }, 1509{ "","" },
1505{ "","" }, 1510{ "","" },
1506{ "","" }, 1511{ "","" },
1507{ "","" }, 1512{ "","" },
1508{ "","" }, 1513{ "","" },
1509{ "","" }, 1514{ "","" },
1510{ "","" }, 1515{ "","" },
1511{ "","" }, 1516{ "","" },
1512{ "","" }, 1517{ "","" },
1513{ "","" },
1514{ "","" },
1515{ "","" },
1516{ "","" },
1517{ "","" },
1518
1519
1520
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e766b8f..65750af 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -403,561 +403,618 @@ void CalendarView::init()
403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
405 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
407 407
408#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
409 mResourceView = 0; 409 mResourceView = 0;
410#else 410#else
411 if ( mResourceManager ) { 411 if ( mResourceManager ) {
412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
413 mResourceView->updateView(); 413 mResourceView->updateView();
414 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
415 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
416 } else { 416 } else {
417 mResourceView = 0; 417 mResourceView = 0;
418 } 418 }
419#endif 419#endif
420 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
422 422
423 mRightFrame = new QWidgetStack( rightBox ); 423 mRightFrame = new QWidgetStack( rightBox );
424 rightLayout->addWidget( mRightFrame, 1 ); 424 rightLayout->addWidget( mRightFrame, 1 );
425 425
426 mLeftFrame = mLeftSplitter; 426 mLeftFrame = mLeftSplitter;
427#else 427#else
428 //QWidget *mainBox = new QWidget( this ); 428 //QWidget *mainBox = new QWidget( this );
429 //QWidget *leftFrame = new QWidget( mainBox ); 429 //QWidget *leftFrame = new QWidget( mainBox );
430 //QBoxLayout * mainBoxLayout; 430 //QBoxLayout * mainBoxLayout;
431 if ( KOPrefs::instance()->mVerticalScreen ) { 431 if ( KOPrefs::instance()->mVerticalScreen ) {
432 //mainBoxLayout = new QVBoxLayout(mainBox); 432 //mainBoxLayout = new QVBoxLayout(mainBox);
433 //leftFrameLayout = new QHBoxLayout(leftFrame ); 433 //leftFrameLayout = new QHBoxLayout(leftFrame );
434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
438 } else { 438 } else {
439 //mainBoxLayout = new QHBoxLayout(mainBox); 439 //mainBoxLayout = new QHBoxLayout(mainBox);
440 //leftFrameLayout = new QVBoxLayout(leftFrame ); 440 //leftFrameLayout = new QVBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449#ifdef DESKTOP_VERSION 449#ifdef DESKTOP_VERSION
450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); 450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
451 topLayout->addWidget( mDateScrollBar ); 451 topLayout->addWidget( mDateScrollBar );
452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
453 if ( QApplication::desktop()->width() < 800 ) 453 if ( QApplication::desktop()->width() < 800 )
454 mDateScrollBar->hide(); 454 mDateScrollBar->hide();
455#endif 455#endif
456 //mainBoxLayout->addWidget (mLeftFrame); 456 //mainBoxLayout->addWidget (mLeftFrame);
457 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 457 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
458 "CalendarView::DateNavigator" ); 458 "CalendarView::DateNavigator" );
459#if 0 459#if 0
460 // FIXME 460 // FIXME
461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
462 "CalendarView::DateNavigator", QDate::currentDate()); 462 "CalendarView::DateNavigator", QDate::currentDate());
463#endif 463#endif
464 // mDateNavigator->blockSignals( true ); 464 // mDateNavigator->blockSignals( true );
465 //leftFrameLayout->addWidget( mDateNavigator ); 465 //leftFrameLayout->addWidget( mDateNavigator );
466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
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
646CalendarView::~CalendarView() 646CalendarView::~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}
657void CalendarView::nextConflict( bool all, bool allday ) 657void CalendarView::nextConflict( bool all, bool allday )
658{ 658{
659 QDate start = mNavigator->selectedDates().first().addDays(1); 659
660 QPtrList<Event> testlist = mCalendar->events();
661 Event * test = testlist.first();
662 while ( test ) {
663 test->setTagged( false );
664 }
665 QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0));
666 QDateTime conflict;
667 QDateTime retVal;
668 bool found = false;
669 Event * cE = 0;
670 QPtrList<Event> testlist2 = testlist;
671 while ( test ) {
672 Event * test2 = testlist2.first();
673 while ( test2 ) {
674 if ( !test2->isTagged() ) {
675 if ( test->isOverlapping ( test2, &retVal, true ) ) {
676 if ( ! found ) {
677 if ( retVal >= startDT ) {
678 conflict = retVal;
679 cE = test;
680 found = true;
681 }
682 } else {
683 if ( retVal >= startDT && retVal < conflict ) {
684 conflict = retVal;
685 cE = test;
686 }
687 }
688 }
689 }
690 test2 = testlist2.next();
691 }
692 test->setTagged( true );
693 test = testlist.next();
694 }
695 if ( found ) {
696 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
697 mViewManager->showDayView();
698 mNavigator->slotDaySelect( conflict.date() );
699 int hour = conflict.time().hour();
700 mViewManager->agendaView()->setStartHour( hour );
701 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
702 return;
703 }
704
705 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
706 qDebug("No conflict found ");
707 return;
708
709
710
711
712
713#if 0
714
715
660 QDate end = start.addDays( 365*2); 716 QDate end = start.addDays( 365*2);
661 while ( start < end ) { 717 while ( start < end ) {
662 QPtrList<Event> eventList = calendar()->events( start ); 718 QPtrList<Event> eventList = calendar()->events( start );
663 Event * ev = eventList.first(); 719 Event * ev = eventList.first();
664 QPtrList<Event> test = eventList; 720 QPtrList<Event> test = eventList;
665 while ( ev ) { 721 while ( ev ) {
666 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); 722 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
667 Event * t_ev = test.first(); 723 Event * t_ev = test.first();
668 QDateTime es = ev->dtStart(); 724 QDateTime es = ev->dtStart();
669 QDateTime ee = ev->dtEnd(); 725 QDateTime ee = ev->dtEnd();
670 if ( ev->doesFloat() ) 726 if ( ev->doesFloat() )
671 ee = ee.addDays( 1 ); 727 ee = ee.addDays( 1 );
672 if ( ! all ) { 728 if ( ! all ) {
673 if ( ev->doesFloat() != allday ) 729 if ( ev->doesFloat() != allday )
674 t_ev = 0; 730 t_ev = 0;
675 } 731 }
676 while ( t_ev ) { 732 while ( t_ev ) {
677 bool skip = false; 733 bool skip = false;
678 if ( ! all ) { 734 if ( ! all ) {
679 if ( t_ev->doesFloat() != allday ) 735 if ( t_ev->doesFloat() != allday )
680 skip = true; 736 skip = true;
681 } 737 }
682 if ( !skip && ev != t_ev ) { 738 if ( !skip && ev != t_ev ) {
683 QDateTime ets = t_ev->dtStart(); 739 QDateTime ets = t_ev->dtStart();
684 QDateTime ete = t_ev->dtEnd(); 740 QDateTime ete = t_ev->dtEnd();
685 if ( t_ev->doesFloat() ) 741 if ( t_ev->doesFloat() )
686 ete = ete.addDays( 1 ); 742 ete = ete.addDays( 1 );
687 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); 743 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
688 if ( es < ete && ets < ee ) { 744 if ( es < ete && ets < ee ) {
689 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 745 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
690 mViewManager->showDayView(); 746 mViewManager->showDayView();
691 mNavigator->slotDaySelect( start ); 747 mNavigator->slotDaySelect( start );
692 int hour = es.time().hour(); 748 int hour = es.time().hour();
693 if ( ets > es ) 749 if ( ets > es )
694 hour = ets.time().hour(); 750 hour = ets.time().hour();
695 mViewManager->agendaView()->setStartHour( hour ); 751 mViewManager->agendaView()->setStartHour( hour );
696 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); 752 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
697 return; 753 return;
698 } 754 }
699 } 755 }
700 t_ev = test.next(); 756 t_ev = test.next();
701 } 757 }
702 ev = eventList.next(); 758 ev = eventList.next();
703 } 759 }
704 start = start.addDays( 1 ); 760 start = start.addDays( 1 );
705 } 761 }
706 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); 762 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
707 qDebug("No conflict found "); 763 qDebug("No conflict found ");
764#endif
708} 765}
709 766
710void CalendarView::conflictAll() 767void CalendarView::conflictAll()
711{ 768{
712 nextConflict ( true, true ); 769 nextConflict ( true, true );
713} 770}
714void CalendarView::conflictAllday() 771void CalendarView::conflictAllday()
715{ 772{
716 nextConflict ( false, true ); 773 nextConflict ( false, true );
717} 774}
718void CalendarView::conflictNotAll() 775void CalendarView::conflictNotAll()
719{ 776{
720 nextConflict ( false, false ); 777 nextConflict ( false, false );
721} 778}
722 779
723void CalendarView::setCalReadOnly( int id, bool readO ) 780void CalendarView::setCalReadOnly( int id, bool readO )
724{ 781{
725 if ( readO ) { 782 if ( readO ) {
726 emit save(); 783 emit save();
727 } 784 }
728 mCalendar->setReadOnly( id, readO ); 785 mCalendar->setReadOnly( id, readO );
729} 786}
730void CalendarView::setScrollBarStep(int val ) 787void CalendarView::setScrollBarStep(int val )
731{ 788{
732#ifdef DESKTOP_VERSION 789#ifdef DESKTOP_VERSION
733 mDateScrollBar->setLineStep ( val ); 790 mDateScrollBar->setLineStep ( val );
734#endif 791#endif
735} 792}
736void CalendarView::scrollBarValue(int val ) 793void CalendarView::scrollBarValue(int val )
737{ 794{
738#ifdef DESKTOP_VERSION 795#ifdef DESKTOP_VERSION
739 if ( QApplication::desktop()->width() < 800 ) return; 796 if ( QApplication::desktop()->width() < 800 ) return;
740 static bool block = false; 797 static bool block = false;
741 if ( block ) return; 798 if ( block ) return;
742 block = true; 799 block = true;
743 int count = mNavigator->selectedDates().count(); 800 int count = mNavigator->selectedDates().count();
744 int day = mNavigator->selectedDates().first().dayOfYear(); 801 int day = mNavigator->selectedDates().first().dayOfYear();
745 int stepdays = val; 802 int stepdays = val;
746 if ( mDateScrollBar->lineStep () <= count ) { 803 if ( mDateScrollBar->lineStep () <= count ) {
747 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 804 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
748 //qDebug("VAL %d ",val ); 805 //qDebug("VAL %d ",val );
749 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 806 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
750 stepdays = day+stepdays; 807 stepdays = day+stepdays;
751 if ( stepdays < 0 ) stepdays = 0; 808 if ( stepdays < 0 ) stepdays = 0;
752 } 809 }
753 if ( stepdays == day ) { 810 if ( stepdays == day ) {
754 block = false; 811 block = false;
755 return; 812 return;
756 } 813 }
757 int year = mNavigator->selectedDates().first().year(); 814 int year = mNavigator->selectedDates().first().year();
758 QDate d ( year,1,1 ); 815 QDate d ( year,1,1 );
759 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 816 mNavigator->selectDates( d.addDays( stepdays-1) , count );
760 block = false; 817 block = false;
761#endif 818#endif
762 819
763} 820}
764void CalendarView::updateView(const QDate &start, const QDate &end) 821void CalendarView::updateView(const QDate &start, const QDate &end)
765{ 822{
766#ifdef DESKTOP_VERSION 823#ifdef DESKTOP_VERSION
767 if ( ! mDateScrollBar->draggingSlider () ) { 824 if ( ! mDateScrollBar->draggingSlider () ) {
768 int dof = start.dayOfYear(); 825 int dof = start.dayOfYear();
769 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); 826 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
770 if ( dof != mDateScrollBar->value() ) { 827 if ( dof != mDateScrollBar->value() ) {
771 mDateScrollBar->blockSignals( true ); 828 mDateScrollBar->blockSignals( true );
772 mDateScrollBar->setValue( start.dayOfYear()); 829 mDateScrollBar->setValue( start.dayOfYear());
773 mDateScrollBar->blockSignals( false ); 830 mDateScrollBar->blockSignals( false );
774 } 831 }
775 } 832 }
776#endif 833#endif
777 mTodoList->updateView(); 834 mTodoList->updateView();
778 mViewManager->updateView(start, end); 835 mViewManager->updateView(start, end);
779 //mDateNavigator->updateView(); 836 //mDateNavigator->updateView();
780} 837}
781 838
782 839
783 840
784void CalendarView::checkFiles() 841void CalendarView::checkFiles()
785{ 842{
786 QString message; 843 QString message;
787 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 844 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
788 KopiCalendarFile * cal = calendars.first(); 845 KopiCalendarFile * cal = calendars.first();
789 while ( cal ) { 846 while ( cal ) {
790 if ( cal->mErrorOnLoad ) { 847 if ( cal->mErrorOnLoad ) {
791 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 848 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
792 } 849 }
793 cal = calendars.next(); 850 cal = calendars.next();
794 } 851 }
795 if ( !message.isEmpty() ) { 852 if ( !message.isEmpty() ) {
796 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); 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);
797 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 854 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
798 } 855 }
799 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 856 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
800} 857}
801void CalendarView::checkAlarms() 858void CalendarView::checkAlarms()
802{ 859{
803 860
804 861
805 KConfig *config = KOGlobals::config(); 862 KConfig *config = KOGlobals::config();
806 config->setGroup( "AppRun" ); 863 config->setGroup( "AppRun" );
807 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 864 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
808 int daysto = dt.daysTo( QDate::currentDate() ); 865 int daysto = dt.daysTo( QDate::currentDate() );
809 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 866 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
810 dt = dt.addDays( days ); 867 dt = dt.addDays( days );
811 int secto = dt.secsTo( QDateTime::currentDateTime() ); 868 int secto = dt.secsTo( QDateTime::currentDateTime() );
812 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 869 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
813 //qDebug("KO: Reading program stop %d ", secs); 870 //qDebug("KO: Reading program stop %d ", secs);
814 //secs -= ( 3600 * 24*3 ); // debug only 871 //secs -= ( 3600 * 24*3 ); // debug only
815 QDateTime latest = dt.addSecs ( secs ); 872 QDateTime latest = dt.addSecs ( secs );
816 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 873 qDebug("KO: Last termination on %s ", latest.toString().latin1());
817 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 874 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
818 QPtrList<Incidence> el = mCalendar->rawIncidences(); 875 QPtrList<Incidence> el = mCalendar->rawIncidences();
819 QPtrList<Incidence> al; 876 QPtrList<Incidence> al;
820 Incidence* inL = el.first(); 877 Incidence* inL = el.first();
821 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 878 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
822 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 879 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
823 while ( inL ) { 880 while ( inL ) {
824 bool ok = false; 881 bool ok = false;
825 int offset = 0; 882 int offset = 0;
826 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 883 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
827 if ( ok ) { 884 if ( ok ) {
828 //qDebug("OK %s",next.toString().latin1()); 885 //qDebug("OK %s",next.toString().latin1());
829 if ( next < cur ) { 886 if ( next < cur ) {
830 al.append( inL ); 887 al.append( inL );
831 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 888 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
832 } 889 }
833 } 890 }
834 inL = el.next(); 891 inL = el.next();
835 } 892 }
836 if ( al.count() ) { 893 if ( al.count() ) {
837 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 894 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
838 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 895 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
839 QVBoxLayout* lay = new QVBoxLayout( dia ); 896 QVBoxLayout* lay = new QVBoxLayout( dia );
840 lay->setSpacing( 0 ); 897 lay->setSpacing( 0 );
841 lay->setMargin( 0 ); 898 lay->setMargin( 0 );
842 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 899 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
843 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 900 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
844 lay->addWidget( matb ); 901 lay->addWidget( matb );
845 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 902 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
846 int wid = 210; 903 int wid = 210;
847 int x = QApplication::desktop()->width() - wid - 7; 904 int x = QApplication::desktop()->width() - wid - 7;
848 int y = QApplication::desktop()->height() - wid - 70; 905 int y = QApplication::desktop()->height() - wid - 70;
849 dia->setGeometry ( x,y,wid,wid); 906 dia->setGeometry ( x,y,wid,wid);
850 } else { 907 } else {
851 int si = 220; 908 int si = 220;
852 if ( QApplication::desktop()->width() > 470 ) 909 if ( QApplication::desktop()->width() > 470 )
853 si = 400; 910 si = 400;
854 dia->resize(si,si/2); 911 dia->resize(si,si/2);
855 } 912 }
856 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 913 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
857 dia->show(); 914 dia->show();
858 915
859 } 916 }
860} 917}
861void CalendarView::showDay( QDate d ) 918void CalendarView::showDay( QDate d )
862{ 919{
863 dateNavigator()->blockSignals( true ); 920 dateNavigator()->blockSignals( true );
864 dateNavigator()->selectDate( d ); 921 dateNavigator()->selectDate( d );
865 dateNavigator()->blockSignals( false ); 922 dateNavigator()->blockSignals( false );
866 mViewManager->showDayView(); 923 mViewManager->showDayView();
867 //dateNavigator()->selectDate( d ); 924 //dateNavigator()->selectDate( d );
868} 925}
869void CalendarView::timerAlarm() 926void CalendarView::timerAlarm()
870{ 927{
871 //qDebug("CalendarView::timerAlarm() "); 928 //qDebug("CalendarView::timerAlarm() ");
872 computeAlarm(mAlarmNotification ); 929 computeAlarm(mAlarmNotification );
873} 930}
874 931
875void CalendarView::suspendAlarm() 932void CalendarView::suspendAlarm()
876{ 933{
877 //qDebug(" CalendarView::suspendAlarm() "); 934 //qDebug(" CalendarView::suspendAlarm() ");
878 computeAlarm(mSuspendAlarmNotification ); 935 computeAlarm(mSuspendAlarmNotification );
879 936
880} 937}
881 938
882void CalendarView::startAlarm( QString mess , QString filename) 939void CalendarView::startAlarm( QString mess , QString filename)
883{ 940{
884 941
885 topLevelWidget()->showNormal(); 942 topLevelWidget()->showNormal();
886 topLevelWidget()->setActiveWindow(); 943 topLevelWidget()->setActiveWindow();
887 topLevelWidget()->raise(); 944 topLevelWidget()->raise();
888 945
889 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 946 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
890 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); 947 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
891 948
892} 949}
893 950
894void CalendarView::checkNextTimerAlarm() 951void CalendarView::checkNextTimerAlarm()
895{ 952{
896 mCalendar->checkAlarmForIncidence( 0, true ); 953 mCalendar->checkAlarmForIncidence( 0, true );
897} 954}
898 955
899void CalendarView::computeAlarm( QString msg ) 956void CalendarView::computeAlarm( QString msg )
900{ 957{
901 958
902 QString mess = msg; 959 QString mess = msg;
903 QString mAlarmMessage = mess.mid( 9 ); 960 QString mAlarmMessage = mess.mid( 9 );
904 QString filename = MainWindow::resourcePath(); 961 QString filename = MainWindow::resourcePath();
905 filename += "koalarm.wav"; 962 filename += "koalarm.wav";
906 QString tempfilename; 963 QString tempfilename;
907 if ( mess.left( 13 ) == "suspend_alarm") { 964 if ( mess.left( 13 ) == "suspend_alarm") {
908 bool error = false; 965 bool error = false;
909 int len = mess.mid( 13 ).find("+++"); 966 int len = mess.mid( 13 ).find("+++");
910 if ( len < 2 ) 967 if ( len < 2 )
911 error = true; 968 error = true;
912 else { 969 else {
913 tempfilename = mess.mid( 13, len ); 970 tempfilename = mess.mid( 13, len );
914 if ( !QFile::exists( tempfilename ) ) 971 if ( !QFile::exists( tempfilename ) )
915 error = true; 972 error = true;
916 } 973 }
917 if ( ! error ) { 974 if ( ! error ) {
918 filename = tempfilename; 975 filename = tempfilename;
919 } 976 }
920 mAlarmMessage = mess.mid( 13+len+3 ); 977 mAlarmMessage = mess.mid( 13+len+3 );
921 //qDebug("suspend file %s ",tempfilename.latin1() ); 978 //qDebug("suspend file %s ",tempfilename.latin1() );
922 startAlarm( mAlarmMessage, filename); 979 startAlarm( mAlarmMessage, filename);
923 return; 980 return;
924 } 981 }
925 if ( mess.left( 11 ) == "timer_alarm") { 982 if ( mess.left( 11 ) == "timer_alarm") {
926 //mTimerTime = 0; 983 //mTimerTime = 0;
927 startAlarm( mess.mid( 11 ), filename ); 984 startAlarm( mess.mid( 11 ), filename );
928 return; 985 return;
929 } 986 }
930 if ( mess.left( 10 ) == "proc_alarm") { 987 if ( mess.left( 10 ) == "proc_alarm") {
931 bool error = false; 988 bool error = false;
932 int len = mess.mid( 10 ).find("+++"); 989 int len = mess.mid( 10 ).find("+++");
933 if ( len < 2 ) 990 if ( len < 2 )
934 error = true; 991 error = true;
935 else { 992 else {
936 tempfilename = mess.mid( 10, len ); 993 tempfilename = mess.mid( 10, len );
937 if ( !QFile::exists( tempfilename ) ) 994 if ( !QFile::exists( tempfilename ) )
938 error = true; 995 error = true;
939 } 996 }
940 if ( error ) { 997 if ( error ) {
941 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 998 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
942 mAlarmMessage += mess.mid( 10+len+3+9 ); 999 mAlarmMessage += mess.mid( 10+len+3+9 );
943 } else { 1000 } else {
944 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 1001 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
945 //qDebug("-----system command %s ",tempfilename.latin1() ); 1002 //qDebug("-----system command %s ",tempfilename.latin1() );
946#ifndef _WIN32_ 1003#ifndef _WIN32_
947 if ( vfork () == 0 ) { 1004 if ( vfork () == 0 ) {
948 execl ( tempfilename.latin1(), 0 ); 1005 execl ( tempfilename.latin1(), 0 );
949 return; 1006 return;
950 } 1007 }
951#else 1008#else
952 QProcess* p = new QProcess(); 1009 QProcess* p = new QProcess();
953 p->addArgument( tempfilename.latin1() ); 1010 p->addArgument( tempfilename.latin1() );
954 p->start(); 1011 p->start();
955 return; 1012 return;
956#endif 1013#endif
957 1014
958 return; 1015 return;
959 } 1016 }
960 1017
961 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 1018 //qDebug("+++++++system command %s ",tempfilename.latin1() );
962 } 1019 }
963 if ( mess.left( 11 ) == "audio_alarm") { 1020 if ( mess.left( 11 ) == "audio_alarm") {
@@ -2442,610 +2499,590 @@ void CalendarView::writeSettings()
2442 dt = dt.addDays( days ); 2499 dt = dt.addDays( days );
2443 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2500 int secs = dt.secsTo( QDateTime::currentDateTime() );
2444 config->writeEntry( "LatestProgramStopDays", days ); 2501 config->writeEntry( "LatestProgramStopDays", days );
2445 config->writeEntry( "LatestProgramStopSecs", secs ); 2502 config->writeEntry( "LatestProgramStopSecs", secs );
2446 //qDebug("KO: Writing stop time: %d ", secs); 2503 //qDebug("KO: Writing stop time: %d ", secs);
2447 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2504 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2448 //QDateTime latest = dt.addSecs ( secs ); 2505 //QDateTime latest = dt.addSecs ( secs );
2449 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2506 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2450 config->setGroup( "Views" ); 2507 config->setGroup( "Views" );
2451 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2508 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2452 2509
2453#if 0 2510#if 0
2454 qDebug("********************* "); 2511 qDebug("********************* ");
2455 qDebug("Testcode secsto "); 2512 qDebug("Testcode secsto ");
2456 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2513 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2457 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2514 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2458 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2515 int secsto = dt_nodaylight.secsTo( dt_daylight );
2459 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2516 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2460 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2517 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2461 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2518 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2462 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2519 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2463 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2520 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2464 qDebug("********************* testcode end"); 2521 qDebug("********************* testcode end");
2465 2522
2466#endif 2523#endif
2467 2524
2468 QValueList<int> listINT = mLeftFrame->sizes(); 2525 QValueList<int> listINT = mLeftFrame->sizes();
2469 config->writeEntry("Left Splitter Frame",listINT); 2526 config->writeEntry("Left Splitter Frame",listINT);
2470 QValueList<int> listINT2 = mMainFrame->sizes(); 2527 QValueList<int> listINT2 = mMainFrame->sizes();
2471 config->writeEntry("Main Splitter Frame",listINT2); 2528 config->writeEntry("Main Splitter Frame",listINT2);
2472#ifdef DESKTOP_VERSION 2529#ifdef DESKTOP_VERSION
2473 config->setGroup("WidgetLayout"); 2530 config->setGroup("WidgetLayout");
2474 QStringList list ;//= config->readListEntry("MainLayout"); 2531 QStringList list ;//= config->readListEntry("MainLayout");
2475 int x,y,w,h; 2532 int x,y,w,h;
2476 QWidget* wid; 2533 QWidget* wid;
2477 wid = topLevelWidget(); 2534 wid = topLevelWidget();
2478 x = wid->geometry().x(); 2535 x = wid->geometry().x();
2479 y = wid->geometry().y(); 2536 y = wid->geometry().y();
2480 w = wid->width(); 2537 w = wid->width();
2481 h = wid->height(); 2538 h = wid->height();
2482 list.clear(); 2539 list.clear();
2483 list << QString::number( x ); 2540 list << QString::number( x );
2484 list << QString::number( y ); 2541 list << QString::number( y );
2485 list << QString::number( w ); 2542 list << QString::number( w );
2486 list << QString::number( h ); 2543 list << QString::number( h );
2487 config->writeEntry("MainLayout",list ); 2544 config->writeEntry("MainLayout",list );
2488 2545
2489 wid = mEventEditor; 2546 wid = mEventEditor;
2490 x = wid->geometry().x(); 2547 x = wid->geometry().x();
2491 y = wid->geometry().y(); 2548 y = wid->geometry().y();
2492 w = wid->width(); 2549 w = wid->width();
2493 h = wid->height(); 2550 h = wid->height();
2494 list.clear(); 2551 list.clear();
2495 list << QString::number( x ); 2552 list << QString::number( x );
2496 list << QString::number( y ); 2553 list << QString::number( y );
2497 list << QString::number( w ); 2554 list << QString::number( w );
2498 list << QString::number( h ); 2555 list << QString::number( h );
2499 config->writeEntry("EditEventLayout",list ); 2556 config->writeEntry("EditEventLayout",list );
2500 2557
2501 wid = mTodoEditor; 2558 wid = mTodoEditor;
2502 x = wid->geometry().x(); 2559 x = wid->geometry().x();
2503 y = wid->geometry().y(); 2560 y = wid->geometry().y();
2504 w = wid->width(); 2561 w = wid->width();
2505 h = wid->height(); 2562 h = wid->height();
2506 list.clear(); 2563 list.clear();
2507 list << QString::number( x ); 2564 list << QString::number( x );
2508 list << QString::number( y ); 2565 list << QString::number( y );
2509 list << QString::number( w ); 2566 list << QString::number( w );
2510 list << QString::number( h ); 2567 list << QString::number( h );
2511 config->writeEntry("EditTodoLayout",list ); 2568 config->writeEntry("EditTodoLayout",list );
2512 wid = getEventViewerDialog(); 2569 wid = getEventViewerDialog();
2513 x = wid->geometry().x(); 2570 x = wid->geometry().x();
2514 y = wid->geometry().y(); 2571 y = wid->geometry().y();
2515 w = wid->width(); 2572 w = wid->width();
2516 h = wid->height(); 2573 h = wid->height();
2517 list.clear(); 2574 list.clear();
2518 list << QString::number( x ); 2575 list << QString::number( x );
2519 list << QString::number( y ); 2576 list << QString::number( y );
2520 list << QString::number( w ); 2577 list << QString::number( w );
2521 list << QString::number( h ); 2578 list << QString::number( h );
2522 config->writeEntry("ViewerLayout",list ); 2579 config->writeEntry("ViewerLayout",list );
2523 wid = mDialogManager->getSearchDialog(); 2580 wid = mDialogManager->getSearchDialog();
2524 if ( wid ) { 2581 if ( wid ) {
2525 x = wid->geometry().x(); 2582 x = wid->geometry().x();
2526 y = wid->geometry().y(); 2583 y = wid->geometry().y();
2527 w = wid->width(); 2584 w = wid->width();
2528 h = wid->height(); 2585 h = wid->height();
2529 list.clear(); 2586 list.clear();
2530 list << QString::number( x ); 2587 list << QString::number( x );
2531 list << QString::number( y ); 2588 list << QString::number( y );
2532 list << QString::number( w ); 2589 list << QString::number( w );
2533 list << QString::number( h ); 2590 list << QString::number( h );
2534 config->writeEntry("SearchLayout",list ); 2591 config->writeEntry("SearchLayout",list );
2535 } 2592 }
2536#endif 2593#endif
2537 2594
2538 2595
2539 config->sync(); 2596 config->sync();
2540} 2597}
2541 2598
2542void CalendarView::readFilterSettings(KConfig *config) 2599void CalendarView::readFilterSettings(KConfig *config)
2543{ 2600{
2544 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2601 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2545 2602
2546 mFilters.clear(); 2603 mFilters.clear();
2547 2604
2548 config->setGroup("General"); 2605 config->setGroup("General");
2549 QStringList filterList = config->readListEntry("CalendarFilters"); 2606 QStringList filterList = config->readListEntry("CalendarFilters");
2550 2607
2551 QStringList::ConstIterator it = filterList.begin(); 2608 QStringList::ConstIterator it = filterList.begin();
2552 QStringList::ConstIterator end = filterList.end(); 2609 QStringList::ConstIterator end = filterList.end();
2553 while(it != end) { 2610 while(it != end) {
2554 // kdDebug() << " filter: " << (*it) << endl; 2611 // kdDebug() << " filter: " << (*it) << endl;
2555 2612
2556 CalFilter *filter; 2613 CalFilter *filter;
2557 filter = new CalFilter(*it); 2614 filter = new CalFilter(*it);
2558 config->setGroup("Filter_" + (*it).utf8()); 2615 config->setGroup("Filter_" + (*it).utf8());
2559 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2616 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2560 filter->setCriteria(config->readNumEntry("Criteria",0)); 2617 filter->setCriteria(config->readNumEntry("Criteria",0));
2561 filter->setCategoryList(config->readListEntry("CategoryList")); 2618 filter->setCategoryList(config->readListEntry("CategoryList"));
2562 mFilters.append(filter); 2619 mFilters.append(filter);
2563 2620
2564 ++it; 2621 ++it;
2565 } 2622 }
2566 2623
2567 if (mFilters.count() == 0) { 2624 if (mFilters.count() == 0) {
2568 CalFilter *filter = new CalFilter(i18n("Default")); 2625 CalFilter *filter = new CalFilter(i18n("Default"));
2569 mFilters.append(filter); 2626 mFilters.append(filter);
2570 } 2627 }
2571 mFilterView->updateFilters(); 2628 mFilterView->updateFilters();
2572 config->setGroup("FilterView"); 2629 config->setGroup("FilterView");
2573 2630
2574 mFilterView->blockSignals(true); 2631 mFilterView->blockSignals(true);
2575 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2632 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2576 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2633 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2577 mFilterView->blockSignals(false); 2634 mFilterView->blockSignals(false);
2578 // We do it manually to avoid it being done twice by the above calls 2635 // We do it manually to avoid it being done twice by the above calls
2579 updateFilter(); 2636 updateFilter();
2580} 2637}
2581 2638
2582void CalendarView::writeFilterSettings(KConfig *config) 2639void CalendarView::writeFilterSettings(KConfig *config)
2583{ 2640{
2584 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2641 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2585 2642
2586 QStringList filterList; 2643 QStringList filterList;
2587 2644
2588 CalFilter *filter = mFilters.first(); 2645 CalFilter *filter = mFilters.first();
2589 while(filter) { 2646 while(filter) {
2590 // kdDebug() << " fn: " << filter->name() << endl; 2647 // kdDebug() << " fn: " << filter->name() << endl;
2591 filterList << filter->name(); 2648 filterList << filter->name();
2592 config->setGroup("Filter_" + filter->name().utf8()); 2649 config->setGroup("Filter_" + filter->name().utf8());
2593 config->writeEntry("Criteria",filter->criteria()); 2650 config->writeEntry("Criteria",filter->criteria());
2594 config->writeEntry("CategoryList",filter->categoryList()); 2651 config->writeEntry("CategoryList",filter->categoryList());
2595 filter = mFilters.next(); 2652 filter = mFilters.next();
2596 } 2653 }
2597 config->setGroup("General"); 2654 config->setGroup("General");
2598 config->writeEntry("CalendarFilters",filterList); 2655 config->writeEntry("CalendarFilters",filterList);
2599 2656
2600 config->setGroup("FilterView"); 2657 config->setGroup("FilterView");
2601 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2658 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2602 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2659 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2603} 2660}
2604 2661
2605 2662
2606void CalendarView::goToday() 2663void CalendarView::goToday()
2607{ 2664{
2608 if ( mViewManager->currentView()->isMonthView() ) 2665 if ( mViewManager->currentView()->isMonthView() )
2609 mNavigator->selectTodayMonth(); 2666 mNavigator->selectTodayMonth();
2610 else 2667 else
2611 mNavigator->selectToday(); 2668 mNavigator->selectToday();
2612} 2669}
2613 2670
2614void CalendarView::goNext() 2671void CalendarView::goNext()
2615{ 2672{
2616 mNavigator->selectNext(); 2673 mNavigator->selectNext();
2617} 2674}
2618 2675
2619void CalendarView::goPrevious() 2676void CalendarView::goPrevious()
2620{ 2677{
2621 mNavigator->selectPrevious(); 2678 mNavigator->selectPrevious();
2622} 2679}
2623void CalendarView::goNextMonth() 2680void CalendarView::goNextMonth()
2624{ 2681{
2625 mNavigator->selectNextMonth(); 2682 mNavigator->selectNextMonth();
2626} 2683}
2627 2684
2628void CalendarView::goPreviousMonth() 2685void CalendarView::goPreviousMonth()
2629{ 2686{
2630 mNavigator->selectPreviousMonth(); 2687 mNavigator->selectPreviousMonth();
2631} 2688}
2632 2689
2633void CalendarView::updateConfig() 2690void CalendarView::updateConfig()
2634{ 2691{
2635 if ( KOPrefs::instance()->mUseAppColors ) 2692 if ( KOPrefs::instance()->mUseAppColors )
2636 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2693 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2637 emit configChanged(); 2694 emit configChanged();
2638 mTodoList->updateConfig(); 2695 mTodoList->updateConfig();
2639 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2696 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2640 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2697 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2641 // To make the "fill window" configurations work 2698 // To make the "fill window" configurations work
2642 //mViewManager->raiseCurrentView(); 2699 //mViewManager->raiseCurrentView();
2643} 2700}
2644 2701
2645 2702
2646void CalendarView::eventChanged(Event *event) 2703void CalendarView::eventChanged(Event *event)
2647{ 2704{
2648 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2705 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2649 //updateUnmanagedViews(); 2706 //updateUnmanagedViews();
2650} 2707}
2651 2708
2652void CalendarView::eventAdded(Event *event) 2709void CalendarView::eventAdded(Event *event)
2653{ 2710{
2654 changeEventDisplay(event,KOGlobals::EVENTADDED); 2711 changeEventDisplay(event,KOGlobals::EVENTADDED);
2655} 2712}
2656 2713
2657void CalendarView::eventToBeDeleted(Event *) 2714void CalendarView::eventToBeDeleted(Event *)
2658{ 2715{
2659 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2716 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2660} 2717}
2661 2718
2662void CalendarView::eventDeleted() 2719void CalendarView::eventDeleted()
2663{ 2720{
2664 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2721 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2665} 2722}
2666void CalendarView::changeTodoDisplay(Todo *which, int action) 2723void CalendarView::changeTodoDisplay(Todo *which, int action)
2667{ 2724{
2668 changeIncidenceDisplay((Incidence *)which, action); 2725 changeIncidenceDisplay((Incidence *)which, action);
2669 mDateNavigator->updateView(); //LR 2726 mDateNavigator->updateView(); //LR
2670 //mDialogManager->updateSearchDialog(); 2727 //mDialogManager->updateSearchDialog();
2671 2728
2672 if (which) { 2729 if (which) {
2673 mViewManager->updateWNview(); 2730 mViewManager->updateWNview();
2674 //mTodoList->updateView(); 2731 //mTodoList->updateView();
2675 } 2732 }
2676 2733
2677} 2734}
2678 2735
2679void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2736void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2680{ 2737{
2681 updateUnmanagedViews(); 2738 updateUnmanagedViews();
2682 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2739 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2683 if ( action == KOGlobals::EVENTDELETED ) { //delete 2740 if ( action == KOGlobals::EVENTDELETED ) { //delete
2684 mCalendar->checkAlarmForIncidence( 0, true ); 2741 mCalendar->checkAlarmForIncidence( 0, true );
2685 if ( mEventViewerDialog ) 2742 if ( mEventViewerDialog )
2686 mEventViewerDialog->hide(); 2743 mEventViewerDialog->hide();
2687 } 2744 }
2688 else 2745 else
2689 mCalendar->checkAlarmForIncidence( which , false ); 2746 mCalendar->checkAlarmForIncidence( which , false );
2690} 2747}
2691 2748
2692// most of the changeEventDisplays() right now just call the view's 2749// most of the changeEventDisplays() right now just call the view's
2693// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2750// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2694void CalendarView::changeEventDisplay(Event *which, int action) 2751void CalendarView::changeEventDisplay(Event *which, int action)
2695{ 2752{
2696 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2753 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2697 changeIncidenceDisplay((Incidence *)which, action); 2754 changeIncidenceDisplay((Incidence *)which, action);
2698
2699
2700 static bool clearallviews = false; 2755 static bool clearallviews = false;
2701 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2756 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2702 if ( clearallviews ) { 2757 if ( clearallviews ) {
2703 clearAllViews(); 2758 clearAllViews();
2704 clearallviews = false; 2759 clearallviews = false;
2705 } 2760 }
2706 return; 2761 return;
2707 } 2762 }
2708 clearallviews = true; 2763 clearallviews = true;
2709
2710
2711
2712 mDateNavigator->updateView(); 2764 mDateNavigator->updateView();
2713 //mDialogManager->updateSearchDialog(); 2765 //mDialogManager->updateSearchDialog();
2714
2715 if (which) { 2766 if (which) {
2716 // If there is an event view visible update the display 2767 // If there is an event view visible update the display
2717 mViewManager->currentView()->changeEventDisplay(which,action); 2768 mViewManager->currentView()->changeEventDisplay(which,action);
2718 // TODO: check, if update needed 2769 // TODO: check, if update needed
2719 // if (which->getTodoStatus()) { 2770 // if (which->getTodoStatus()) {
2720 mTodoList->updateView(); 2771 mTodoList->updateView();
2721 if ( action != KOGlobals::EVENTDELETED ) { 2772 if ( action != KOGlobals::EVENTDELETED ) {
2722 mConflictingEvent = which ; 2773 mConflictingEvent = which ;
2723 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); 2774 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) );
2724 } 2775 }
2725 // } 2776 // }
2726 } else { 2777 } else {
2727 mViewManager->currentView()->updateView(); 2778 mViewManager->currentView()->updateView();
2728 } 2779 }
2729} 2780}
2730void CalendarView::checkConflictForEvent() 2781void CalendarView::checkConflictForEvent()
2731{ 2782{
2732 2783
2733 if (!KOPrefs::instance()->mConfirm) 2784 if (!KOPrefs::instance()->mConfirm)
2734 return; 2785 return;
2735 if ( ! mConflictingEvent ) return; 2786 if ( ! mConflictingEvent ) return;
2736 if ( mConflictingEvent->doesFloat() ) { 2787 if ( mConflictingEvent->doesFloat() ) {
2737 mConflictingEvent = 0; 2788 mConflictingEvent = 0;
2738 return; 2789 return;
2739 } 2790 }
2740 bool all = false; 2791 QPtrList<Event> testlist = mCalendar->events();
2741 bool allday = false; 2792 Event * test = testlist.first();
2742 Event * ev = mConflictingEvent; 2793 QDateTime conflict;
2743 mConflictingEvent = 0; 2794 QDateTime retVal;
2744 QDate start = ev->dtStart().date(); 2795 bool found = false;
2745 QDate end = ev->dtEnd().date().addDays(1); 2796 Event * cE = 0;
2746 while ( start < end ) { 2797 while ( test ) {
2747 QPtrList<Event> test = calendar()->events( start ); 2798 if ( !test->doesFloat() ) {
2748 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); 2799 if ( mConflictingEvent->isOverlapping ( test, &retVal, true ) ) {
2749 Event * t_ev = test.first(); 2800 if ( ! found ) {
2750 QDateTime es = ev->dtStart(); 2801 conflict = retVal;
2751 QDateTime ee = ev->dtEnd(); 2802 cE = test;
2752 if ( ev->doesFloat() ) 2803 } else {
2753 ee = ee.addDays( 1 ); 2804 if ( retVal < conflict ) {
2754 if ( ! all ) { 2805 conflict = retVal;
2755 if ( ev->doesFloat() != allday ) 2806 cE = test;
2756 t_ev = 0; 2807 }
2757 }
2758 while ( t_ev ) {
2759 bool skip = false;
2760 if ( ! all ) {
2761 if ( t_ev->doesFloat() != allday )
2762 skip = true;
2763 }
2764 if ( !skip && ev != t_ev ) {
2765 QDateTime ets = t_ev->dtStart();
2766 QDateTime ete = t_ev->dtEnd();
2767 if ( t_ev->doesFloat() )
2768 ete = ete.addDays( 1 );
2769 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
2770 if ( es < ete && ets < ee ) {
2771 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( ev->summary(),0 ) ).arg( KGlobal::formatMessage ( t_ev->summary(),0 )).arg(KGlobal::locale()->formatDate(start) ) ;
2772 qApp->processEvents();
2773 int km = KMessageBox::warningContinueCancel(this,mess,
2774 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2775 if ( km != KMessageBox::Continue )
2776 return;
2777
2778 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2779 mViewManager->showDayView();
2780 mNavigator->slotDaySelect( start );
2781 int hour = es.time().hour();
2782 if ( ets > es )
2783 hour = ets.time().hour();
2784 mViewManager->agendaView()->setStartHour( hour );
2785 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
2786 return;
2787 } 2808 }
2809 found = true;
2788 } 2810 }
2789 t_ev = test.next();
2790 } 2811 }
2791 start = start.addDays( 1 ); 2812 test = testlist.next();
2792 } 2813 }
2793 qDebug("No conflict found "); 2814 if ( found ) {
2794 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()) ) ;
2816 qApp->processEvents();
2817 int km = KMessageBox::warningContinueCancel(this,mess,
2818 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2819 if ( km != KMessageBox::Continue )
2820 return;
2795 2821
2822 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2823 mViewManager->showDayView();
2824 mNavigator->slotDaySelect( conflict.date() );
2825 int hour = conflict.time().hour();
2826 mViewManager->agendaView()->setStartHour( hour );
2827 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
2828 return;
2829 }
2830
2831 return;
2832
2796} 2833}
2797 2834
2798void CalendarView::updateTodoViews() 2835void CalendarView::updateTodoViews()
2799{ 2836{
2800 mTodoList->updateView(); 2837 mTodoList->updateView();
2801 mViewManager->currentView()->updateView(); 2838 mViewManager->currentView()->updateView();
2802 2839
2803} 2840}
2804 2841
2805 2842
2806 2843
2807void CalendarView::clearAllViews() 2844void CalendarView::clearAllViews()
2808{ 2845{
2809 mTodoList->clearList(); 2846 mTodoList->clearList();
2810 mViewManager->clearAllViews(); 2847 mViewManager->clearAllViews();
2811 SearchDialog * sd = mDialogManager->getSearchDialog(); 2848 SearchDialog * sd = mDialogManager->getSearchDialog();
2812 if ( sd ) { 2849 if ( sd ) {
2813 KOListView* kol = sd->listview(); 2850 KOListView* kol = sd->listview();
2814 if ( kol ) 2851 if ( kol )
2815 kol->clearList(); 2852 kol->clearList();
2816 } 2853 }
2817} 2854}
2818void CalendarView::updateView() 2855void CalendarView::updateView()
2819{ 2856{
2820 static bool clearallviews = false; 2857 static bool clearallviews = false;
2821 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2858 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2822 if ( clearallviews ) { 2859 if ( clearallviews ) {
2823 clearAllViews(); 2860 clearAllViews();
2824 clearallviews = false; 2861 clearallviews = false;
2825 } 2862 }
2826 return; 2863 return;
2827 } 2864 }
2828 clearallviews = true; 2865 clearallviews = true;
2829 DateList tmpList = mNavigator->selectedDates(); 2866 DateList tmpList = mNavigator->selectedDates();
2830 2867
2831 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2868 if ( KOPrefs::instance()->mHideNonStartedTodos )
2832 mTodoList->updateView(); 2869 mTodoList->updateView();
2833 // We assume that the navigator only selects consecutive days. 2870 // We assume that the navigator only selects consecutive days.
2834 updateView( tmpList.first(), tmpList.last() ); 2871 updateView( tmpList.first(), tmpList.last() );
2835} 2872}
2836 2873
2837void CalendarView::updateUnmanagedViews() 2874void CalendarView::updateUnmanagedViews()
2838{ 2875{
2839 mDateNavigator->updateDayMatrix(); 2876 mDateNavigator->updateDayMatrix();
2840} 2877}
2841 2878
2842int CalendarView::msgItemDelete(const QString name) 2879int CalendarView::msgItemDelete(const QString name)
2843{ 2880{
2844 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2881 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2845 i18n("This item will be\npermanently deleted."), 2882 i18n("This item will be\npermanently deleted."),
2846 i18n("KO/Pi Confirmation"),i18n("Delete")); 2883 i18n("KO/Pi Confirmation"),i18n("Delete"));
2847} 2884}
2848 2885
2849 2886
2850void CalendarView::edit_cut() 2887void CalendarView::edit_cut()
2851{ 2888{
2852 Event *anEvent=0; 2889 Event *anEvent=0;
2853 2890
2854 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2891 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2855 2892
2856 if (mViewManager->currentView()->isEventView()) { 2893 if (mViewManager->currentView()->isEventView()) {
2857 if ( incidence && incidence->typeID() == eventID ) { 2894 if ( incidence && incidence->typeID() == eventID ) {
2858 anEvent = static_cast<Event *>(incidence); 2895 anEvent = static_cast<Event *>(incidence);
2859 } 2896 }
2860 } 2897 }
2861 2898
2862 if (!anEvent) { 2899 if (!anEvent) {
2863 KNotifyClient::beep(); 2900 KNotifyClient::beep();
2864 return; 2901 return;
2865 } 2902 }
2866 DndFactory factory( mCalendar ); 2903 DndFactory factory( mCalendar );
2867 factory.cutIncidence(anEvent); 2904 factory.cutIncidence(anEvent);
2868 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2905 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2869} 2906}
2870 2907
2871void CalendarView::edit_copy() 2908void CalendarView::edit_copy()
2872{ 2909{
2873 Event *anEvent=0; 2910 Event *anEvent=0;
2874 2911
2875 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2912 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2876 2913
2877 if (mViewManager->currentView()->isEventView()) { 2914 if (mViewManager->currentView()->isEventView()) {
2878 if ( incidence && incidence->typeID() == eventID ) { 2915 if ( incidence && incidence->typeID() == eventID ) {
2879 anEvent = static_cast<Event *>(incidence); 2916 anEvent = static_cast<Event *>(incidence);
2880 } 2917 }
2881 } 2918 }
2882 2919
2883 if (!anEvent) { 2920 if (!anEvent) {
2884 KNotifyClient::beep(); 2921 KNotifyClient::beep();
2885 return; 2922 return;
2886 } 2923 }
2887 DndFactory factory( mCalendar ); 2924 DndFactory factory( mCalendar );
2888 factory.copyIncidence(anEvent); 2925 factory.copyIncidence(anEvent);
2889} 2926}
2890 2927
2891void CalendarView::edit_paste() 2928void CalendarView::edit_paste()
2892{ 2929{
2893 QDate date = mNavigator->selectedDates().first(); 2930 QDate date = mNavigator->selectedDates().first();
2894 2931
2895 DndFactory factory( mCalendar ); 2932 DndFactory factory( mCalendar );
2896 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2933 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2897 2934
2898 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2935 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2899} 2936}
2900void CalendarView::edit_global_options() 2937void CalendarView::edit_global_options()
2901{ 2938{
2902 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2939 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2903 emit save(); 2940 emit save();
2904 emit saveStopTimer(); 2941 emit saveStopTimer();
2905 mDialogManager->showGlobalOptionsDialog(); 2942 mDialogManager->showGlobalOptionsDialog();
2906 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2943 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2907 emit saveStopTimer(); 2944 emit saveStopTimer();
2908 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!"), 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!"),
2909 i18n("Timezone settings"),i18n("Reload"))) { 2946 i18n("Timezone settings"),i18n("Reload"))) {
2910 qDebug("KO: TZ reload cancelled "); 2947 qDebug("KO: TZ reload cancelled ");
2911 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2948 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2912 return; 2949 return;
2913 } 2950 }
2914 qDebug("KO: Timezone change "); 2951 qDebug("KO: Timezone change ");
2915 loadCalendars(); 2952 loadCalendars();
2916 setModified(true); 2953 setModified(true);
2917 } 2954 }
2918 else 2955 else
2919 qDebug("KO: No tz change "); 2956 qDebug("KO: No tz change ");
2920} 2957}
2921void CalendarView::edit_options() 2958void CalendarView::edit_options()
2922{ 2959{
2923 mDialogManager->showOptionsDialog(); 2960 mDialogManager->showOptionsDialog();
2924} 2961}
2925 2962
2926 2963
2927void CalendarView::slotSelectPickerDate( QDate d) 2964void CalendarView::slotSelectPickerDate( QDate d)
2928{ 2965{
2929 mDateFrame->hide(); 2966 mDateFrame->hide();
2930 if ( mDatePickerMode == 1 ) { 2967 if ( mDatePickerMode == 1 ) {
2931 mNavigator->slotDaySelect( d ); 2968 mNavigator->slotDaySelect( d );
2932 } else if ( mDatePickerMode == 2 ) { 2969 } else if ( mDatePickerMode == 2 ) {
2933 if ( mMoveIncidence->typeID() == todoID ) { 2970 if ( mMoveIncidence->typeID() == todoID ) {
2934 Todo * to = (Todo *) mMoveIncidence; 2971 Todo * to = (Todo *) mMoveIncidence;
2935 QTime tim; 2972 QTime tim;
2936 int len = 0; 2973 int len = 0;
2937 if ( to->hasStartDate() && to->hasDueDate() ) 2974 if ( to->hasStartDate() && to->hasDueDate() )
2938 len = to->dtStart().secsTo( to->dtDue()); 2975 len = to->dtStart().secsTo( to->dtDue());
2939 if ( to->hasDueDate() ) 2976 if ( to->hasDueDate() )
2940 tim = to->dtDue().time(); 2977 tim = to->dtDue().time();
2941 else { 2978 else {
2942 tim = QTime ( 0,0,0 ); 2979 tim = QTime ( 0,0,0 );
2943 to->setFloats( true ); 2980 to->setFloats( true );
2944 to->setHasDueDate( true ); 2981 to->setHasDueDate( true );
2945 } 2982 }
2946 QDateTime dt ( d,tim ); 2983 QDateTime dt ( d,tim );
2947 to->setDtDue( dt ); 2984 to->setDtDue( dt );
2948 2985
2949 if ( to->hasStartDate() ) { 2986 if ( to->hasStartDate() ) {
2950 if ( len>0 ) 2987 if ( len>0 )
2951 to->setDtStart(to->dtDue().addSecs( -len )); 2988 to->setDtStart(to->dtDue().addSecs( -len ));
2952 else 2989 else
2953 if (to->dtStart() > to->dtDue() ) 2990 if (to->dtStart() > to->dtDue() )
2954 to->setDtStart(to->dtDue().addDays( -3 )); 2991 to->setDtStart(to->dtDue().addDays( -3 ));
2955 } 2992 }
2956 2993
2957 todoChanged( to ); 2994 todoChanged( to );
2958 } else if ( mMoveIncidence->typeID() == eventID ) { 2995 } else if ( mMoveIncidence->typeID() == eventID ) {
2959 if ( mMoveIncidence->doesRecur() ) { 2996 if ( mMoveIncidence->doesRecur() ) {
2960#if 0 2997#if 0
2961 // PENDING implement this 2998 // PENDING implement this
2962 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2999 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2963 mCalendar()->addIncidence( newInc ); 3000 mCalendar()->addIncidence( newInc );
2964 if ( mMoveIncidence->typeID() == todoID ) 3001 if ( mMoveIncidence->typeID() == todoID )
2965 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 3002 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2966 else 3003 else
2967 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 3004 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2968 mMoveIncidence = newInc; 3005 mMoveIncidence = newInc;
2969 3006
2970#endif 3007#endif
2971 } 3008 }
2972 QTime tim = mMoveIncidence->dtStart().time(); 3009 QTime tim = mMoveIncidence->dtStart().time();
2973 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 3010 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2974 QDateTime dt ( d,tim ); 3011 QDateTime dt ( d,tim );
2975 mMoveIncidence->setDtStart( dt ); 3012 mMoveIncidence->setDtStart( dt );
2976 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 3013 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2977 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 3014 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2978 } else if ( mMoveIncidence->typeID() == journalID ) { 3015 } else if ( mMoveIncidence->typeID() == journalID ) {
2979 QTime tim = mMoveIncidence->dtStart().time(); 3016 QTime tim = mMoveIncidence->dtStart().time();
2980 QDateTime dt ( d,tim ); 3017 QDateTime dt ( d,tim );
2981 mMoveIncidence->setDtStart( dt ); 3018 mMoveIncidence->setDtStart( dt );
2982 updateView(); 3019 updateView();
2983 } 3020 }
2984 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3021 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2985 } 3022 }
2986} 3023}
2987 3024
2988void CalendarView::removeCategories() 3025void CalendarView::removeCategories()
2989{ 3026{
2990 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3027 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2991 QStringList catList = KOPrefs::instance()->mCustomCategories; 3028 QStringList catList = KOPrefs::instance()->mCustomCategories;
2992 QStringList catIncList; 3029 QStringList catIncList;
2993 QStringList newCatList; 3030 QStringList newCatList;
2994 Incidence* inc = incList.first(); 3031 Incidence* inc = incList.first();
2995 uint i; 3032 uint i;
2996 while ( inc ) { 3033 while ( inc ) {
2997 newCatList.clear(); 3034 newCatList.clear();
2998 catIncList = inc->categories() ; 3035 catIncList = inc->categories() ;
2999 for( i = 0; i< catIncList.count(); ++i ) { 3036 for( i = 0; i< catIncList.count(); ++i ) {
3000 if ( catList.contains (catIncList[i])) 3037 if ( catList.contains (catIncList[i]))
3001 newCatList.append( catIncList[i] ); 3038 newCatList.append( catIncList[i] );
3002 } 3039 }
3003 newCatList.sort(); 3040 newCatList.sort();
3004 inc->setCategories( newCatList.join(",") ); 3041 inc->setCategories( newCatList.join(",") );
3005 inc = incList.next(); 3042 inc = incList.next();
3006 } 3043 }
3007} 3044}
3008 3045
3009int CalendarView::addCategories() 3046int CalendarView::addCategories()
3010{ 3047{
3011 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3048 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3012 QStringList catList = KOPrefs::instance()->mCustomCategories; 3049 QStringList catList = KOPrefs::instance()->mCustomCategories;
3013 QStringList catIncList; 3050 QStringList catIncList;
3014 Incidence* inc = incList.first(); 3051 Incidence* inc = incList.first();
3015 uint i; 3052 uint i;
3016 int count = 0; 3053 int count = 0;
3017 while ( inc ) { 3054 while ( inc ) {
3018 catIncList = inc->categories() ; 3055 catIncList = inc->categories() ;
3019 for( i = 0; i< catIncList.count(); ++i ) { 3056 for( i = 0; i< catIncList.count(); ++i ) {
3020 if ( !catList.contains (catIncList[i])) { 3057 if ( !catList.contains (catIncList[i])) {
3021 catList.append( catIncList[i] ); 3058 catList.append( catIncList[i] );
3022 //qDebug("add cat %s ", catIncList[i].latin1()); 3059 //qDebug("add cat %s ", catIncList[i].latin1());
3023 ++count; 3060 ++count;
3024 } 3061 }
3025 } 3062 }
3026 inc = incList.next(); 3063 inc = incList.next();
3027 } 3064 }
3028 catList.sort(); 3065 catList.sort();
3029 KOPrefs::instance()->mCustomCategories = catList; 3066 KOPrefs::instance()->mCustomCategories = catList;
3030 return count; 3067 return count;
3031} 3068}
3032 3069
3033void CalendarView::editCategories() 3070void CalendarView::editCategories()
3034{ 3071{
3035 qDebug("CalendarView::editCategories() "); 3072 qDebug("CalendarView::editCategories() ");
3036 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 3073 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
3037 ced.exec(); 3074 ced.exec();
3038} 3075}
3039void CalendarView::manageCategories() 3076void CalendarView::manageCategories()
3040{ 3077{
3041 KOCatPrefs* cp = new KOCatPrefs(); 3078 KOCatPrefs* cp = new KOCatPrefs();
3042 cp->show(); 3079 cp->show();
3043 int w =cp->sizeHint().width() ; 3080 int w =cp->sizeHint().width() ;
3044 int h = cp->sizeHint().height() ; 3081 int h = cp->sizeHint().height() ;
3045 int dw = QApplication::desktop()->width(); 3082 int dw = QApplication::desktop()->width();
3046 int dh = QApplication::desktop()->height(); 3083 int dh = QApplication::desktop()->height();
3047 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 3084 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
3048 if ( !cp->exec() ) { 3085 if ( !cp->exec() ) {
3049 delete cp; 3086 delete cp;
3050 return; 3087 return;
3051 } 3088 }
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2c017e1..c2ad886 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -149,512 +149,516 @@ void KOStopTodoPrefs::accept()
149 KMessageBox::sorry(this, 149 KMessageBox::sorry(this,
150 i18n("The start time is\nafter the end time!"), 150 i18n("The start time is\nafter the end time!"),
151 i18n("Time mismatch!")); 151 i18n("Time mismatch!"));
152 return; 152 return;
153 } 153 }
154 mTodo->saveRunningInfo( mComment->text(), start, stop ); 154 mTodo->saveRunningInfo( mComment->text(), start, stop );
155 QDialog::accept(); 155 QDialog::accept();
156} 156}
157void KOStopTodoPrefs::doNotSave() 157void KOStopTodoPrefs::doNotSave()
158{ 158{
159 int result = KMessageBox::warningContinueCancel(this, 159 int result = KMessageBox::warningContinueCancel(this,
160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") ); 160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") );
161 if (result != KMessageBox::Continue) return; 161 if (result != KMessageBox::Continue) return;
162 mTodo->stopRunning(); 162 mTodo->stopRunning();
163 QDialog::accept(); 163 QDialog::accept();
164} 164}
165 165
166 166
167class KOTodoViewWhatsThis :public QWhatsThis 167class KOTodoViewWhatsThis :public QWhatsThis
168{ 168{
169public: 169public:
170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; 170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
171 171
172protected: 172protected:
173 virtual QString text( const QPoint& p) 173 virtual QString text( const QPoint& p)
174 { 174 {
175 return _view->getWhatsThisText(p) ; 175 return _view->getWhatsThisText(p) ;
176 } 176 }
177private: 177private:
178 QWidget* _wid; 178 QWidget* _wid;
179 KOTodoView * _view; 179 KOTodoView * _view;
180}; 180};
181 181
182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
183 const char *name) : 183 const char *name) :
184 KListView(parent,name) 184 KListView(parent,name)
185{ 185{
186 mName = QString ( name ); 186 mName = QString ( name );
187 mCalendar = calendar; 187 mCalendar = calendar;
188#ifndef DESKTOP_VERSION 188#ifndef DESKTOP_VERSION
189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
190#endif 190#endif
191 mOldCurrent = 0; 191 mOldCurrent = 0;
192 mMousePressed = false; 192 mMousePressed = false;
193 193
194 setAcceptDrops(true); 194 setAcceptDrops(true);
195 viewport()->setAcceptDrops(true); 195 viewport()->setAcceptDrops(true);
196 int size = 16; 196 int size = 16;
197 if (qApp->desktop()->width() < 300 ) 197 if (qApp->desktop()->width() < 300 )
198 size = 12; 198 size = 12;
199 setTreeStepSize( size + 6 ); 199 setTreeStepSize( size + 6 );
200 200
201} 201}
202 202
203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) 203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e)
204{ 204{
205#ifndef KORG_NODND 205#ifndef KORG_NODND
206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; 206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl;
207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
208 !QTextDrag::canDecode( e ) ) { 208 !QTextDrag::canDecode( e ) ) {
209 e->ignore(); 209 e->ignore();
210 return; 210 return;
211 } 211 }
212 212
213 mOldCurrent = currentItem(); 213 mOldCurrent = currentItem();
214#endif 214#endif
215} 215}
216 216
217 217
218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) 218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e)
219{ 219{
220#ifndef KORG_NODND 220#ifndef KORG_NODND
221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; 221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl;
222 222
223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
224 !QTextDrag::canDecode( e ) ) { 224 !QTextDrag::canDecode( e ) ) {
225 e->ignore(); 225 e->ignore();
226 return; 226 return;
227 } 227 }
228 228
229 e->accept(); 229 e->accept();
230#endif 230#endif
231} 231}
232 232
233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) 233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *)
234{ 234{
235#ifndef KORG_NODND 235#ifndef KORG_NODND
236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; 236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl;
237 237
238 setCurrentItem(mOldCurrent); 238 setCurrentItem(mOldCurrent);
239 setSelected(mOldCurrent,true); 239 setSelected(mOldCurrent,true);
240#endif 240#endif
241} 241}
242 242
243void KOTodoListView::contentsDropEvent(QDropEvent *e) 243void KOTodoListView::contentsDropEvent(QDropEvent *e)
244{ 244{
245#ifndef KORG_NODND 245#ifndef KORG_NODND
246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl; 246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl;
247 247
248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
249 !QTextDrag::canDecode( e ) ) { 249 !QTextDrag::canDecode( e ) ) {
250 e->ignore(); 250 e->ignore();
251 return; 251 return;
252 } 252 }
253 253
254 DndFactory factory( mCalendar ); 254 DndFactory factory( mCalendar );
255 Todo *todo = factory.createDropTodo(e); 255 Todo *todo = factory.createDropTodo(e);
256 256
257 if (todo) { 257 if (todo) {
258 e->acceptAction(); 258 e->acceptAction();
259 259
260 KOTodoViewItem *destination = 260 KOTodoViewItem *destination =
261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); 261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
262 Todo *destinationEvent = 0; 262 Todo *destinationEvent = 0;
263 if (destination) destinationEvent = destination->todo(); 263 if (destination) destinationEvent = destination->todo();
264 264
265 Todo *existingTodo = mCalendar->todo(todo->uid()); 265 Todo *existingTodo = mCalendar->todo(todo->uid());
266 266
267 if(existingTodo) { 267 if(existingTodo) {
268 Incidence *to = destinationEvent; 268 Incidence *to = destinationEvent;
269 while(to) { 269 while(to) {
270 if (to->uid() == todo->uid()) { 270 if (to->uid() == todo->uid()) {
271 KMessageBox::sorry(this, 271 KMessageBox::sorry(this,
272 i18n("Cannot move Todo to itself\nor a child of itself"), 272 i18n("Cannot move Todo to itself\nor a child of itself"),
273 i18n("Drop Todo")); 273 i18n("Drop Todo"));
274 delete todo; 274 delete todo;
275 return; 275 return;
276 } 276 }
277 to = to->relatedTo(); 277 to = to->relatedTo();
278 } 278 }
279 internalDrop = true; 279 internalDrop = true;
280 if ( destinationEvent ) 280 if ( destinationEvent )
281 reparentTodoSignal( destinationEvent, existingTodo ); 281 reparentTodoSignal( destinationEvent, existingTodo );
282 else 282 else
283 unparentTodoSignal(existingTodo); 283 unparentTodoSignal(existingTodo);
284 delete todo; 284 delete todo;
285 } else { 285 } else {
286 mCalendar->addTodo(todo); 286 mCalendar->addTodo(todo);
287 emit todoDropped(todo, KOGlobals::EVENTADDED); 287 emit todoDropped(todo, KOGlobals::EVENTADDED);
288 if ( destinationEvent ) 288 if ( destinationEvent )
289 reparentTodoSignal( destinationEvent, todo ); 289 reparentTodoSignal( destinationEvent, todo );
290 } 290 }
291 } 291 }
292 else { 292 else {
293 QString text; 293 QString text;
294 if (QTextDrag::decode(e,text)) { 294 if (QTextDrag::decode(e,text)) {
295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); 295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); 296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
297 qDebug("Dropped : " + text); 297 qDebug("Dropped : " + text);
298 QStringList emails = QStringList::split(",",text); 298 QStringList emails = QStringList::split(",",text);
299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
300 int pos = (*it).find("<"); 300 int pos = (*it).find("<");
301 QString name = (*it).left(pos); 301 QString name = (*it).left(pos);
302 QString email = (*it).mid(pos); 302 QString email = (*it).mid(pos);
303 if (!email.isEmpty() && todoi) { 303 if (!email.isEmpty() && todoi) {
304 todoi->todo()->addAttendee(new Attendee(name,email)); 304 todoi->todo()->addAttendee(new Attendee(name,email));
305 } 305 }
306 } 306 }
307 } 307 }
308 else { 308 else {
309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); 309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable ");
310 e->ignore(); 310 e->ignore();
311 } 311 }
312 } 312 }
313#endif 313#endif
314} 314}
315void KOTodoListView::wheelEvent (QWheelEvent *e) 315void KOTodoListView::wheelEvent (QWheelEvent *e)
316{ 316{
317 QListView::wheelEvent (e); 317 QListView::wheelEvent (e);
318} 318}
319 319
320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) 320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
321{ 321{
322 322
323 QPoint p(contentsToViewport(e->pos())); 323 QPoint p(contentsToViewport(e->pos()));
324 QListViewItem *i = itemAt(p); 324 QListViewItem *i = itemAt(p);
325 bool rootClicked = true; 325 bool rootClicked = true;
326 if (i) { 326 if (i) {
327 // if the user clicked into the root decoration of the item, don't 327 // if the user clicked into the root decoration of the item, don't
328 // try to start a drag! 328 // try to start a drag!
329 int X = p.x(); 329 int X = p.x();
330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
331 if (X > header()->sectionPos(0) + 331 if (X > header()->sectionPos(0) +
332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
333 itemMargin() +i->height()|| 333 itemMargin() +i->height()||
334 X < header()->sectionPos(0)) { 334 X < header()->sectionPos(0)) {
335 rootClicked = false; 335 rootClicked = false;
336 } 336 }
337 } else { 337 } else {
338 rootClicked = false; 338 rootClicked = false;
339 } 339 }
340#ifndef KORG_NODND 340#ifndef KORG_NODND
341 mMousePressed = false; 341 mMousePressed = false;
342 if (! rootClicked && !( e->button() == RightButton) ) { 342 if (! rootClicked && !( e->button() == RightButton) ) {
343 mPressPos = e->pos(); 343 mPressPos = e->pos();
344 mMousePressed = true; 344 mMousePressed = true;
345 } else { 345 } else {
346 mMousePressed = false; 346 mMousePressed = false;
347 } 347 }
348#endif 348#endif
349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); 349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
350#ifndef DESKTOP_VERSION 350#ifndef DESKTOP_VERSION
351 if (!( e->button() == RightButton && rootClicked) ) 351 if (!( e->button() == RightButton && rootClicked) )
352 QListView::contentsMousePressEvent(e); 352 QListView::contentsMousePressEvent(e);
353#else 353#else
354 QListView::contentsMousePressEvent(e); 354 QListView::contentsMousePressEvent(e);
355#endif 355#endif
356} 356}
357void KOTodoListView::paintEvent(QPaintEvent* e) 357void KOTodoListView::paintEvent(QPaintEvent* e)
358{ 358{
359 emit paintNeeded(); 359 emit paintNeeded();
360 QListView::paintEvent( e); 360 QListView::paintEvent( e);
361} 361}
362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
363{ 363{
364 364
365#ifndef KORG_NODND 365#ifndef KORG_NODND
366 //QListView::contentsMouseMoveEvent(e); 366 //QListView::contentsMouseMoveEvent(e);
367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
368 QApplication::startDragDistance()*3) { 368 QApplication::startDragDistance()*3) {
369 mMousePressed = false; 369 mMousePressed = false;
370 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 370 QListViewItem *item = itemAt(contentsToViewport(mPressPos));
371 if (item) { 371 if (item) {
372 DndFactory factory( mCalendar ); 372 DndFactory factory( mCalendar );
373 ICalDrag *vd = factory.createDrag( 373 ICalDrag *vd = factory.createDrag(
374 ((KOTodoViewItem *)item)->todo(),viewport()); 374 ((KOTodoViewItem *)item)->todo(),viewport());
375 internalDrop = false; 375 internalDrop = false;
376 // we cannot do any senseful here, because the DnD is still broken in Qt 376 // we cannot do any senseful here, because the DnD is still broken in Qt
377 if (vd->drag()) { 377 if (vd->drag()) {
378 if ( !internalDrop ) { 378 if ( !internalDrop ) {
379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
380 qDebug("Dnd: External move: Delete drag source "); 380 qDebug("Dnd: External move: Delete drag source ");
381 } else 381 } else
382 qDebug("Dnd: Internal move "); 382 qDebug("Dnd: Internal move ");
383 383
384 } else { 384 } else {
385 if ( !internalDrop ) { 385 if ( !internalDrop ) {
386 qDebug("Dnd: External Copy"); 386 qDebug("Dnd: External Copy");
387 } else 387 } else
388 qDebug("DnD: Internal copy: Copy pending"); 388 qDebug("DnD: Internal copy: Copy pending");
389 } 389 }
390 } 390 }
391 } 391 }
392#endif 392#endif
393} 393}
394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
395{ 395{
396 if ( !e->isAutoRepeat() ) { 396 if ( !e->isAutoRepeat() ) {
397 mFlagKeyPressed = false; 397 mFlagKeyPressed = false;
398 } 398 }
399} 399}
400 400
401 401
402void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 402void KOTodoListView::keyPressEvent ( QKeyEvent * e )
403{ 403{
404 qApp->processEvents(); 404 qApp->processEvents();
405 if ( !isVisible() ) {
406 e->ignore();
407 return;
408 }
405 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
406 e->ignore(); 410 e->ignore();
407 // qDebug(" ignore %d",e->isAutoRepeat() ); 411 // qDebug(" ignore %d",e->isAutoRepeat() );
408 return; 412 return;
409 } 413 }
410 if (! e->isAutoRepeat() ) 414 if (! e->isAutoRepeat() )
411 mFlagKeyPressed = true; 415 mFlagKeyPressed = true;
412 QListViewItem* cn; 416 QListViewItem* cn;
413 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 417 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
414 cn = currentItem(); 418 cn = currentItem();
415 if ( cn ) { 419 if ( cn ) {
416 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
417 if ( ci ){ 421 if ( ci ){
418 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
419 ci->setOn( false ); 423 ci->setOn( false );
420 else 424 else
421 ci->setOn( true ); 425 ci->setOn( true );
422 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
423 if ( cn ) { 427 if ( cn ) {
424 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
425 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
426 } 430 }
427 431
428 } 432 }
429 } 433 }
430 434
431 return; 435 return;
432 } 436 }
433 437
434 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 438 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
435 switch ( e->key() ) { 439 switch ( e->key() ) {
436 case Qt::Key_Down: 440 case Qt::Key_Down:
437 case Qt::Key_Up: 441 case Qt::Key_Up:
438 QListView::keyPressEvent ( e ); 442 QListView::keyPressEvent ( e );
439 break; 443 break;
440 case Qt::Key_Left: 444 case Qt::Key_Left:
441 case Qt::Key_Right: 445 case Qt::Key_Right:
442 QListView::keyPressEvent ( e ); 446 QListView::keyPressEvent ( e );
443 e->accept(); 447 e->accept();
444 return; 448 return;
445 break; 449 break;
446 default: 450 default:
447 e->ignore(); 451 e->ignore();
448 break; 452 break;
449 } 453 }
450 return; 454 return;
451 } 455 }
452 e->ignore(); 456 e->ignore();
453} 457}
454void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 458void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
455{ 459{
456 QListView::contentsMouseReleaseEvent(e); 460 QListView::contentsMouseReleaseEvent(e);
457 mMousePressed = false; 461 mMousePressed = false;
458} 462}
459 463
460void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 464void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
461{ 465{
462 if (!e) return; 466 if (!e) return;
463 467
464 QPoint vp = contentsToViewport(e->pos()); 468 QPoint vp = contentsToViewport(e->pos());
465 469
466 QListViewItem *item = itemAt(vp); 470 QListViewItem *item = itemAt(vp);
467 471
468 emit double_Clicked(item); 472 emit double_Clicked(item);
469 if (!item) return; 473 if (!item) return;
470 474
471 emit doubleClicked(item,vp,0); 475 emit doubleClicked(item,vp,0);
472} 476}
473 477
474///////////////////////////////////////////////////////////////////////////// 478/////////////////////////////////////////////////////////////////////////////
475 479
476KOQuickTodo::KOQuickTodo(QWidget *parent) : 480KOQuickTodo::KOQuickTodo(QWidget *parent) :
477 QLineEdit(parent) 481 QLineEdit(parent)
478{ 482{
479 setText(i18n("Click to add new Todo")); 483 setText(i18n("Click to add new Todo"));
480} 484}
481 485
482void KOQuickTodo::focusInEvent(QFocusEvent *ev) 486void KOQuickTodo::focusInEvent(QFocusEvent *ev)
483{ 487{
484 if ( text()==i18n("Click to add new Todo") ) 488 if ( text()==i18n("Click to add new Todo") )
485 setText(""); 489 setText("");
486 QLineEdit::focusInEvent(ev); 490 QLineEdit::focusInEvent(ev);
487} 491}
488 492
489void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 493void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
490{ 494{
491 setText(i18n("Click to add new Todo")); 495 setText(i18n("Click to add new Todo"));
492 QLineEdit::focusOutEvent(ev); 496 QLineEdit::focusOutEvent(ev);
493} 497}
494 498
495///////////////////////////////////////////////////////////////////////////// 499/////////////////////////////////////////////////////////////////////////////
496 500
497KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 501KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
498 KOrg::BaseView(calendar,parent,name) 502 KOrg::BaseView(calendar,parent,name)
499{ 503{
500 mCategoryPopupMenu = 0; 504 mCategoryPopupMenu = 0;
501 mPendingUpdateBeforeRepaint = false; 505 mPendingUpdateBeforeRepaint = false;
502 isFlatDisplay = false; 506 isFlatDisplay = false;
503 mNavigator = 0; 507 mNavigator = 0;
504 QBoxLayout *topLayout = new QVBoxLayout(this); 508 QBoxLayout *topLayout = new QVBoxLayout(this);
505 mName = QString ( name ); 509 mName = QString ( name );
506 mBlockUpdate = false; 510 mBlockUpdate = false;
507 mQuickBar = new QWidget( this ); 511 mQuickBar = new QWidget( this );
508 topLayout->addWidget(mQuickBar); 512 topLayout->addWidget(mQuickBar);
509 513
510 mQuickAdd = new KOQuickTodo(mQuickBar); 514 mQuickAdd = new KOQuickTodo(mQuickBar);
511 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 515 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
512 quickLayout->addWidget( mQuickAdd ); 516 quickLayout->addWidget( mQuickAdd );
513 QPushButton * flat = new QPushButton( "F",mQuickBar ); 517 QPushButton * flat = new QPushButton( "F",mQuickBar );
514 int fixwid = flat->sizeHint().height(); 518 int fixwid = flat->sizeHint().height();
515 if ( QApplication::desktop()->width() > 320 ) 519 if ( QApplication::desktop()->width() > 320 )
516 fixwid *= 2; 520 fixwid *= 2;
517 flat->setFixedWidth( fixwid ); 521 flat->setFixedWidth( fixwid );
518 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 522 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
519 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 523 QPushButton * allopen = new QPushButton( "O",mQuickBar );
520 allopen->setFixedWidth( fixwid ); 524 allopen->setFixedWidth( fixwid );
521 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 525 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
522 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 526 QPushButton * allclose = new QPushButton( "C",mQuickBar );
523 allclose->setFixedWidth( fixwid ); 527 allclose->setFixedWidth( fixwid );
524 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 528 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
525 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 529 QPushButton * s_done = new QPushButton( "D",mQuickBar );
526 s_done->setPixmap( SmallIcon("greenhook16")); 530 s_done->setPixmap( SmallIcon("greenhook16"));
527 s_done->setFixedWidth( fixwid ); 531 s_done->setFixedWidth( fixwid );
528 s_done->setFixedHeight( flat->sizeHint().height() ); 532 s_done->setFixedHeight( flat->sizeHint().height() );
529 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 533 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
530 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 534 QPushButton * s_run = new QPushButton( "R",mQuickBar );
531 s_run->setPixmap( SmallIcon("ko16old")); 535 s_run->setPixmap( SmallIcon("ko16old"));
532 s_run->setFixedWidth( fixwid ); 536 s_run->setFixedWidth( fixwid );
533 s_run->setFixedHeight( flat->sizeHint().height() ); 537 s_run->setFixedHeight( flat->sizeHint().height() );
534 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 538 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
535 539
536 mNewSubBut = new QPushButton( "sub",mQuickBar ); 540 mNewSubBut = new QPushButton( "sub",mQuickBar );
537 mNewSubBut->setFixedWidth( fixwid*3/2 ); 541 mNewSubBut->setFixedWidth( fixwid*3/2 );
538 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 542 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
539 mNewSubBut->setEnabled( false ); 543 mNewSubBut->setEnabled( false );
540 quickLayout->addWidget( mNewSubBut ); 544 quickLayout->addWidget( mNewSubBut );
541 quickLayout->addWidget( s_done ); 545 quickLayout->addWidget( s_done );
542 quickLayout->addWidget( s_run ); 546 quickLayout->addWidget( s_run );
543 547
544 quickLayout->addWidget( allopen ); 548 quickLayout->addWidget( allopen );
545 quickLayout->addWidget( allclose ); 549 quickLayout->addWidget( allclose );
546 quickLayout->addWidget( flat ); 550 quickLayout->addWidget( flat );
547 551
548 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 552 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
549 553
550 mTodoListView = new KOTodoListView(calendar,this, name ); 554 mTodoListView = new KOTodoListView(calendar,this, name );
551 topLayout->addWidget(mTodoListView); 555 topLayout->addWidget(mTodoListView);
552 //mTodoListView->header()->setMaximumHeight(30); 556 //mTodoListView->header()->setMaximumHeight(30);
553 mTodoListView->setRootIsDecorated(true); 557 mTodoListView->setRootIsDecorated(true);
554 mTodoListView->setAllColumnsShowFocus(true); 558 mTodoListView->setAllColumnsShowFocus(true);
555 559
556 mTodoListView->setShowSortIndicator(true); 560 mTodoListView->setShowSortIndicator(true);
557 561
558 mTodoListView->addColumn(i18n("Todo")); 562 mTodoListView->addColumn(i18n("Todo"));
559 mTodoListView->addColumn(i18n("Prio")); 563 mTodoListView->addColumn(i18n("Prio"));
560 mTodoListView->setColumnAlignment(1,AlignHCenter); 564 mTodoListView->setColumnAlignment(1,AlignHCenter);
561 mTodoListView->addColumn(i18n("Complete")); 565 mTodoListView->addColumn(i18n("Complete"));
562 mTodoListView->setColumnAlignment(2,AlignCenter); 566 mTodoListView->setColumnAlignment(2,AlignCenter);
563 567
564 mTodoListView->addColumn(i18n("Due Date")); 568 mTodoListView->addColumn(i18n("Due Date"));
565 mTodoListView->setColumnAlignment(3,AlignLeft); 569 mTodoListView->setColumnAlignment(3,AlignLeft);
566 mTodoListView->addColumn(i18n("Due Time")); 570 mTodoListView->addColumn(i18n("Due Time"));
567 mTodoListView->setColumnAlignment(4,AlignHCenter); 571 mTodoListView->setColumnAlignment(4,AlignHCenter);
568 572
569 mTodoListView->addColumn(i18n("Start Date")); 573 mTodoListView->addColumn(i18n("Start Date"));
570 mTodoListView->setColumnAlignment(5,AlignLeft); 574 mTodoListView->setColumnAlignment(5,AlignLeft);
571 mTodoListView->addColumn(i18n("Start Time")); 575 mTodoListView->addColumn(i18n("Start Time"));
572 mTodoListView->setColumnAlignment(6,AlignHCenter); 576 mTodoListView->setColumnAlignment(6,AlignHCenter);
573 577
574 mTodoListView->addColumn(i18n("Cancelled")); 578 mTodoListView->addColumn(i18n("Cancelled"));
575 mTodoListView->addColumn(i18n("Categories")); 579 mTodoListView->addColumn(i18n("Categories"));
576 mTodoListView->addColumn(i18n("Calendar")); 580 mTodoListView->addColumn(i18n("Calendar"));
577#if 0 581#if 0
578 mTodoListView->addColumn(i18n("Sort Id")); 582 mTodoListView->addColumn(i18n("Sort Id"));
579 mTodoListView->setColumnAlignment(4,AlignHCenter); 583 mTodoListView->setColumnAlignment(4,AlignHCenter);
580#endif 584#endif
581 585
582 mTodoListView->setMinimumHeight( 60 ); 586 mTodoListView->setMinimumHeight( 60 );
583 mTodoListView->setItemsRenameable( true ); 587 mTodoListView->setItemsRenameable( true );
584 mTodoListView->setRenameable( 0 ); 588 mTodoListView->setRenameable( 0 );
585 mTodoListView->setColumnWidth( 0, 120 ); 589 mTodoListView->setColumnWidth( 0, 120 );
586 int iii = 0; 590 int iii = 0;
587 for ( iii = 0; iii< 10 ; ++iii ) 591 for ( iii = 0; iii< 10 ; ++iii )
588 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 592 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
589 593
590 594
591 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 595 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
592 596
593 mPriorityPopupMenu = new QPopupMenu(this); 597 mPriorityPopupMenu = new QPopupMenu(this);
594 for (int i = 1; i <= 5; i++) { 598 for (int i = 1; i <= 5; i++) {
595 QString label = QString ("%1").arg (i); 599 QString label = QString ("%1").arg (i);
596 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 600 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
597 } 601 }
598 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 602 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
599 603
600 mPercentageCompletedPopupMenu = new QPopupMenu(this); 604 mPercentageCompletedPopupMenu = new QPopupMenu(this);
601 for (int i = 0; i <= 100; i+=20) { 605 for (int i = 0; i <= 100; i+=20) {
602 QString label = QString ("%1 %").arg (i); 606 QString label = QString ("%1 %").arg (i);
603 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 607 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
604 } 608 }
605 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 609 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
606 610
607 611
608 mCategoryPopupMenu = new QPopupMenu (this); 612 mCategoryPopupMenu = new QPopupMenu (this);
609 mCategoryPopupMenu->setCheckable (true); 613 mCategoryPopupMenu->setCheckable (true);
610 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 614 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
611 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 615 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
612 616
613 mCalPopupMenu = new QPopupMenu (this); 617 mCalPopupMenu = new QPopupMenu (this);
614 mCalPopupMenu->setCheckable (true); 618 mCalPopupMenu->setCheckable (true);
615 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 619 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
616 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 620 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
617 621
618 622
619 623
620 624
621 mItemPopupMenu = new QPopupMenu(this); 625 mItemPopupMenu = new QPopupMenu(this);
622 mItemPopupMenu->insertItem(i18n("Show"), this, 626 mItemPopupMenu->insertItem(i18n("Show"), this,
623 SLOT (showTodo())); 627 SLOT (showTodo()));
624 mItemPopupMenu->insertItem(i18n("Edit..."), this, 628 mItemPopupMenu->insertItem(i18n("Edit..."), this,
625 SLOT (editTodo())); 629 SLOT (editTodo()));
626 mItemPopupMenu->insertItem( i18n("Delete..."), this, 630 mItemPopupMenu->insertItem( i18n("Delete..."), this,
627 SLOT (deleteTodo())); 631 SLOT (deleteTodo()));
628 mItemPopupMenu->insertItem( i18n("Clone..."), this, 632 mItemPopupMenu->insertItem( i18n("Clone..."), this,
629 SLOT (cloneTodo())); 633 SLOT (cloneTodo()));
630 mItemPopupMenu->insertItem( i18n("Move..."), this, 634 mItemPopupMenu->insertItem( i18n("Move..."), this,
631 SLOT (moveTodo())); 635 SLOT (moveTodo()));
632#ifndef DESKTOP_VERSION 636#ifndef DESKTOP_VERSION
633 mItemPopupMenu->insertItem( i18n("Beam..."), this, 637 mItemPopupMenu->insertItem( i18n("Beam..."), this,
634 SLOT (beamTodo())); 638 SLOT (beamTodo()));
635#endif 639#endif
636 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 640 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
637 SLOT (cancelTodo())); 641 SLOT (cancelTodo()));
638 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); 642 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
639 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); 643 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
640 mItemPopupMenu->insertSeparator(); 644 mItemPopupMenu->insertSeparator();
641 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 645 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
642 SLOT (toggleRunningItem())); 646 SLOT (toggleRunningItem()));
643 mItemPopupMenu->insertSeparator(); 647 mItemPopupMenu->insertSeparator();
644 /* 648 /*
645 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 649 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
646 SLOT (newTodo())); 650 SLOT (newTodo()));
647 */ 651 */
648 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 652 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
649 SLOT (newSubTodo())); 653 SLOT (newSubTodo()));
650 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 654 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
651 SLOT (unparentTodo()),0,21); 655 SLOT (unparentTodo()),0,21);
652 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 656 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
653 SLOT (reparentTodo()),0,22); 657 SLOT (reparentTodo()),0,22);
654 mItemPopupMenu->insertSeparator(); 658 mItemPopupMenu->insertSeparator();
655#if 0 659#if 0
656 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 660 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
657 this, SLOT( purgeCompleted() ) ); 661 this, SLOT( purgeCompleted() ) );
658 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 662 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
659 this, SLOT( toggleCompleted() ),0, 33 ); 663 this, SLOT( toggleCompleted() ),0, 33 );
660 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 664 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
@@ -1346,352 +1350,362 @@ void KOTodoView::toggleRunningItem()
1346 if (QApplication::desktop()->width() <= 800 ){ 1350 if (QApplication::desktop()->width() <= 800 ){
1347 int wid = tp.width(); 1351 int wid = tp.width();
1348 int hei = tp.height(); 1352 int hei = tp.height();
1349 int xx = (QApplication::desktop()->width()-wid)/2; 1353 int xx = (QApplication::desktop()->width()-wid)/2;
1350 int yy = (QApplication::desktop()->height()-hei)/2; 1354 int yy = (QApplication::desktop()->height()-hei)/2;
1351 tp.setGeometry( xx,yy,wid,hei ); 1355 tp.setGeometry( xx,yy,wid,hei );
1352 } 1356 }
1353 if ( !tp.exec() ) return; 1357 if ( !tp.exec() ) return;
1354 if ( tp.stopAll() ) { 1358 if ( tp.stopAll() ) {
1355 mCalendar->stopAllTodos(); 1359 mCalendar->stopAllTodos();
1356 t->setRunning( true ); 1360 t->setRunning( true );
1357 updateView(); 1361 updateView();
1358 } else { 1362 } else {
1359 t->setRunning( true ); 1363 t->setRunning( true );
1360 mActiveItem->construct(); 1364 mActiveItem->construct();
1361 } 1365 }
1362 } 1366 }
1363} 1367}
1364 1368
1365void KOTodoView::itemClicked(QListViewItem *item) 1369void KOTodoView::itemClicked(QListViewItem *item)
1366{ 1370{
1367 //qDebug("KOTodoView::itemClicked %d", item); 1371 //qDebug("KOTodoView::itemClicked %d", item);
1368 if (!item) { 1372 if (!item) {
1369 if ( pendingSubtodo != 0 ) { 1373 if ( pendingSubtodo != 0 ) {
1370 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1374 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1371 } 1375 }
1372 pendingSubtodo = 0; 1376 pendingSubtodo = 0;
1373 return; 1377 return;
1374 } 1378 }
1375 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1379 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1376 if ( pendingSubtodo != 0 ) { 1380 if ( pendingSubtodo != 0 ) {
1377 bool allowReparent = true; 1381 bool allowReparent = true;
1378 QListViewItem *par = item; 1382 QListViewItem *par = item;
1379 while ( par ) { 1383 while ( par ) {
1380 if ( par == pendingSubtodo ) { 1384 if ( par == pendingSubtodo ) {
1381 allowReparent = false; 1385 allowReparent = false;
1382 break; 1386 break;
1383 } 1387 }
1384 par = par->parent(); 1388 par = par->parent();
1385 } 1389 }
1386 if ( !allowReparent ) { 1390 if ( !allowReparent ) {
1387 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 1391 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
1388 pendingSubtodo = 0; 1392 pendingSubtodo = 0;
1389 } else { 1393 } else {
1390 Todo* newParent = todoItem->todo(); 1394 Todo* newParent = todoItem->todo();
1391 Todo* newSub = pendingSubtodo->todo(); 1395 Todo* newSub = pendingSubtodo->todo();
1392 pendingSubtodo = 0; 1396 pendingSubtodo = 0;
1393 emit reparentTodoSignal( newParent,newSub ); 1397 emit reparentTodoSignal( newParent,newSub );
1394 return; 1398 return;
1395 } 1399 }
1396 } 1400 }
1397 1401
1398} 1402}
1399 1403
1400void KOTodoView::setDocumentId( const QString &id ) 1404void KOTodoView::setDocumentId( const QString &id )
1401{ 1405{
1402 1406
1403 mDocPrefs->setDoc( id ); 1407 mDocPrefs->setDoc( id );
1404} 1408}
1405 1409
1406void KOTodoView::itemStateChanged( QListViewItem *item ) 1410void KOTodoView::itemStateChanged( QListViewItem *item )
1407{ 1411{
1408 if (!item) return; 1412 if (!item) return;
1409 1413
1410 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1414 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1411 1415
1412// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 1416// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
1413 1417
1414 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 1418 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
1415} 1419}
1416 1420
1417void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1421void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1418{ 1422{
1419 mTodoListView->saveLayout(config,group); 1423 mTodoListView->saveLayout(config,group);
1420} 1424}
1421 1425
1422void KOTodoView::restoreLayout(KConfig *config, const QString &group) 1426void KOTodoView::restoreLayout(KConfig *config, const QString &group)
1423{ 1427{
1424 mTodoListView->restoreLayout(config,group); 1428 mTodoListView->restoreLayout(config,group);
1425} 1429}
1426 1430
1427void KOTodoView::processSelectionChange() 1431void KOTodoView::processSelectionChange()
1428{ 1432{
1429// kdDebug() << "KOTodoView::processSelectionChange()" << endl; 1433// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
1430 1434
1431 KOTodoViewItem *item = 1435 KOTodoViewItem *item =
1432 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); 1436 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
1433 1437
1434 if ( !item ) { 1438 if ( !item ) {
1435 emit incidenceSelected( 0 ); 1439 emit incidenceSelected( 0 );
1436 mNewSubBut->setEnabled( false ); 1440 mNewSubBut->setEnabled( false );
1437 } else { 1441 } else {
1438 emit incidenceSelected( item->todo() ); 1442 emit incidenceSelected( item->todo() );
1439 mNewSubBut->setEnabled( true ); 1443 mNewSubBut->setEnabled( true );
1440 } 1444 }
1441} 1445}
1442 1446
1443void KOTodoView::modified(bool b) 1447void KOTodoView::modified(bool b)
1444{ 1448{
1445 emit isModified(b); 1449 emit isModified(b);
1446} 1450}
1447void KOTodoView::setTodoModified( Todo* todo ) 1451void KOTodoView::setTodoModified( Todo* todo )
1448{ 1452{
1449 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 1453 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
1450} 1454}
1451void KOTodoView::clearSelection() 1455void KOTodoView::clearSelection()
1452{ 1456{
1453 mTodoListView->selectAll( false ); 1457 mTodoListView->selectAll( false );
1454} 1458}
1455void KOTodoView::setAllOpen() 1459void KOTodoView::setAllOpen()
1456{ 1460{
1457 if ( isFlatDisplay ) { 1461 if ( isFlatDisplay ) {
1458 isFlatDisplay = false; 1462 isFlatDisplay = false;
1459 mPopupMenu->setItemChecked( 8,false ); 1463 mPopupMenu->setItemChecked( 8,false );
1460 updateView(); 1464 updateView();
1461 } else { 1465 } else {
1462 storeCurrentItem(); 1466 storeCurrentItem();
1463 } 1467 }
1464 setOpen(mTodoListView->firstChild(), true); 1468 setOpen(mTodoListView->firstChild(), true);
1465 resetCurrentItem(); 1469 resetCurrentItem();
1466} 1470}
1467void KOTodoView::setAllClose() 1471void KOTodoView::setAllClose()
1468{ 1472{
1469 if ( isFlatDisplay ) { 1473 if ( isFlatDisplay ) {
1470 isFlatDisplay = false; 1474 isFlatDisplay = false;
1471 mPopupMenu->setItemChecked( 8,false ); 1475 mPopupMenu->setItemChecked( 8,false );
1472 updateView(); 1476 updateView();
1473 } else { 1477 } else {
1474 storeCurrentItem(); 1478 storeCurrentItem();
1475 } 1479 }
1476 setOpen(mTodoListView->firstChild(), false); 1480 setOpen(mTodoListView->firstChild(), false);
1477 resetCurrentItem(); 1481 resetCurrentItem();
1478} 1482}
1479void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1483void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
1480{ 1484{
1481 1485
1482 while ( item ) { 1486 while ( item ) {
1483 setOpen( item->firstChild(), setOpenI ); 1487 setOpen( item->firstChild(), setOpenI );
1484 item->setOpen( setOpenI ); 1488 item->setOpen( setOpenI );
1485 item = item->nextSibling(); 1489 item = item->nextSibling();
1486 } 1490 }
1487} 1491}
1488 1492
1489void KOTodoView::displayAllFlat() 1493void KOTodoView::displayAllFlat()
1490{ 1494{
1491 storeCurrentItem(); 1495 storeCurrentItem();
1492 pendingSubtodo = 0; 1496 pendingSubtodo = 0;
1493 if ( mBlockUpdate ) { 1497 if ( mBlockUpdate ) {
1494 return; 1498 return;
1495 } 1499 }
1496 mPopupMenu->setItemChecked( 8,true ); 1500 mPopupMenu->setItemChecked( 8,true );
1497 isFlatDisplay = true; 1501 isFlatDisplay = true;
1498 QPtrList<Todo> todoList = calendar()->todos(); 1502 QPtrList<Todo> todoList = calendar()->todos();
1499 mTodoMap.clear(); 1503 mTodoMap.clear();
1500 mTodoListView->clear(); 1504 mTodoListView->clear();
1501 Todo *todo; 1505 Todo *todo;
1502 for(todo = todoList.first(); todo; todo = todoList.next()) { 1506 for(todo = todoList.first(); todo; todo = todoList.next()) {
1503 if ( checkTodo( todo ) ) { 1507 if ( checkTodo( todo ) ) {
1504 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1508 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1505 mTodoMap.insert(todo,todoItem); 1509 mTodoMap.insert(todo,todoItem);
1506 } 1510 }
1507 } 1511 }
1508 resetCurrentItem(); 1512 resetCurrentItem();
1509} 1513}
1510 1514
1511void KOTodoView::setAllFlat() 1515void KOTodoView::setAllFlat()
1512{ 1516{
1513 if ( isFlatDisplay ) { 1517 if ( isFlatDisplay ) {
1514 isFlatDisplay = false; 1518 isFlatDisplay = false;
1515 mPopupMenu->setItemChecked( 8,false ); 1519 mPopupMenu->setItemChecked( 8,false );
1516 updateView(); 1520 updateView();
1517 return; 1521 return;
1518 } 1522 }
1519 displayAllFlat(); 1523 displayAllFlat();
1520} 1524}
1521 1525
1522void KOTodoView::purgeCompleted() 1526void KOTodoView::purgeCompleted()
1523{ 1527{
1524 emit purgeCompletedSignal(); 1528 emit purgeCompletedSignal();
1525 1529
1526} 1530}
1527void KOTodoView::toggleQuickTodo() 1531void KOTodoView::toggleQuickTodo()
1528{ 1532{
1529 if ( mQuickBar->isVisible() ) { 1533 if ( mQuickBar->isVisible() ) {
1530 mQuickBar->hide(); 1534 mQuickBar->hide();
1531 KOPrefs::instance()->mEnableQuickTodo = false; 1535 KOPrefs::instance()->mEnableQuickTodo = false;
1532 } 1536 }
1533 else { 1537 else {
1534 mQuickBar->show(); 1538 mQuickBar->show();
1535 KOPrefs::instance()->mEnableQuickTodo = true; 1539 KOPrefs::instance()->mEnableQuickTodo = true;
1536 } 1540 }
1537 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1541 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
1538 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1542 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
1539} 1543}
1540 1544
1541void KOTodoView::toggleRunning() 1545void KOTodoView::toggleRunning()
1542{ 1546{
1543 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; 1547 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1544 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 1548 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1545 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 1549 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1546 updateView(); 1550 updateView();
1547 if ( KOPrefs::instance()->mHideNonStartedTodos ) 1551 if ( KOPrefs::instance()->mHideNonStartedTodos )
1548 topLevelWidget()->setCaption(i18n("Hide not Running")); 1552 topLevelWidget()->setCaption(i18n("Hide not Running"));
1549 else 1553 else
1550 topLevelWidget()->setCaption(i18n("Show not Running")); 1554 topLevelWidget()->setCaption(i18n("Show not Running"));
1551} 1555}
1552 1556
1553void KOTodoView::toggleCompleted() 1557void KOTodoView::toggleCompleted()
1554{ 1558{
1555 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1559 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1556 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1560 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1557 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1561 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1558 updateView(); 1562 updateView();
1559 if ( KOPrefs::instance()->mShowCompletedTodo ) 1563 if ( KOPrefs::instance()->mShowCompletedTodo )
1560 topLevelWidget()->setCaption(i18n("Show Completed")); 1564 topLevelWidget()->setCaption(i18n("Show Completed"));
1561 else 1565 else
1562 topLevelWidget()->setCaption(i18n("Hide Completed")); 1566 topLevelWidget()->setCaption(i18n("Hide Completed"));
1563} 1567}
1564 1568
1565void KOTodoView::addQuickTodo() 1569void KOTodoView::addQuickTodo()
1566{ 1570{
1567 addQuickTodoPar( 0 ); 1571 addQuickTodoPar( 0 );
1568} 1572}
1569void KOTodoView::addQuickTodoPar( Todo * parentTodo) 1573void KOTodoView::addQuickTodoPar( Todo * parentTodo)
1570{ 1574{
1571 Todo *todo = new Todo(); 1575 Todo *todo = new Todo();
1572 todo->setSummary(mQuickAdd->text()); 1576 todo->setSummary(mQuickAdd->text());
1573 todo->setOrganizer(KOPrefs::instance()->email()); 1577 todo->setOrganizer(KOPrefs::instance()->email());
1574 if ( parentTodo ) { 1578 if ( parentTodo ) {
1575 todo->setRelatedTo(parentTodo); 1579 todo->setRelatedTo(parentTodo);
1576 1580
1577 todo->setCategories (parentTodo->categoriesStr ()); 1581 todo->setCategories (parentTodo->categoriesStr ());
1578 todo->setSecrecy (parentTodo->secrecy ()); 1582 todo->setSecrecy (parentTodo->secrecy ());
1579 if ( parentTodo->priority() < 3 ) 1583 if ( parentTodo->priority() < 3 )
1580 todo->setPriority( parentTodo->priority() ); 1584 todo->setPriority( parentTodo->priority() );
1581 todo->setCalID( parentTodo->calID() ); 1585 todo->setCalID( parentTodo->calID() );
1582 } else { 1586 } else {
1583 CalFilter * cf = mCalendar->filter(); 1587 CalFilter * cf = mCalendar->filter();
1584 if ( cf ) { 1588 if ( cf ) {
1585 if ( cf->isEnabled()&& cf->showCategories()) { 1589 if ( cf->isEnabled()&& cf->showCategories()) {
1586 todo->setCategories(cf->categoryList()); 1590 todo->setCategories(cf->categoryList());
1587 } 1591 }
1588 if ( cf->isEnabled() ) 1592 if ( cf->isEnabled() )
1589 todo->setSecrecy( cf->getSecrecy()); 1593 todo->setSecrecy( cf->getSecrecy());
1590 } 1594 }
1591 } 1595 }
1592 mCalendar->addTodo(todo); 1596 mCalendar->addTodo(todo);
1593 mQuickAdd->setText(""); 1597 mQuickAdd->setText("");
1594 todoModified (todo, KOGlobals::EVENTADDED ); 1598 todoModified (todo, KOGlobals::EVENTADDED );
1595 updateView(); 1599 updateView();
1596 1600
1597} 1601}
1598void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1602void KOTodoView::keyPressEvent ( QKeyEvent * e )
1599{ 1603{
1600 // e->ignore(); 1604 // e->ignore();
1601 //return; 1605 //return;
1602 //qDebug("KOTodoView::keyPressEvent "); 1606 //qDebug("KOTodoView::keyPressEvent ");
1607 if ( !isVisible() ) {
1608 e->ignore();
1609 return;
1610 }
1603 switch ( e->key() ) { 1611 switch ( e->key() ) {
1604 case Qt::Key_Down: 1612 case Qt::Key_Down:
1605 case Qt::Key_Up: 1613 case Qt::Key_Up:
1606 QWidget::keyPressEvent ( e ); 1614 QWidget::keyPressEvent ( e );
1607 break; 1615 break;
1608 1616
1609 case Qt::Key_Q: 1617 case Qt::Key_Q:
1618
1619
1620 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
1621 e->ignore();
1622 break;
1623 }
1610 toggleQuickTodo(); 1624 toggleQuickTodo();
1611 break; 1625 break;
1612 case Qt::Key_U: 1626 case Qt::Key_U:
1613 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1627 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1614 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1628 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1615 unparentTodo(); 1629 unparentTodo();
1616 e->accept(); 1630 e->accept();
1617 } else 1631 } else
1618 e->ignore(); 1632 e->ignore();
1619 break; 1633 break;
1620 case Qt::Key_S: 1634 case Qt::Key_S:
1621 if ( e->state() == Qt::ControlButton ) { 1635 if ( e->state() == Qt::ControlButton ) {
1622 e->ignore(); 1636 e->ignore();
1623 break; 1637 break;
1624 } 1638 }
1625 if ( e->state() == Qt::ShiftButton ) { 1639 if ( e->state() == Qt::ShiftButton ) {
1626 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1640 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1627 reparentTodo(); 1641 reparentTodo();
1628 e->accept(); 1642 e->accept();
1629 } else 1643 } else
1630 e->ignore(); 1644 e->ignore();
1631 break; 1645 break;
1632 case Qt::Key_P: 1646 case Qt::Key_P:
1633 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1647 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1634 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1648 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1635 if ( pendingSubtodo ) 1649 if ( pendingSubtodo )
1636 itemClicked(mActiveItem); 1650 itemClicked(mActiveItem);
1637 e->accept(); 1651 e->accept();
1638 } else 1652 } else
1639 e->ignore(); 1653 e->ignore();
1640 break; 1654 break;
1641 case Qt::Key_Escape: 1655 case Qt::Key_Escape:
1642 if ( pendingSubtodo ) { 1656 if ( pendingSubtodo ) {
1643 itemClicked(0); 1657 itemClicked(0);
1644 e->accept(); 1658 e->accept();
1645 } else 1659 } else
1646 e->ignore(); 1660 e->ignore();
1647 break; 1661 break;
1648 default: 1662 default:
1649 e->ignore(); 1663 e->ignore();
1650 } 1664 }
1651 1665
1652 if ( true ) { 1666 if ( true ) {
1653 if ( e->key() == Qt::Key_I ) { 1667 if ( e->key() == Qt::Key_I ) {
1654 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1668 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1655 if ( cn ) { 1669 if ( cn ) {
1656 mActiveItem = cn; 1670 mActiveItem = cn;
1657 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1671 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1658 if ( ci ){ 1672 if ( ci ){
1659 showTodo(); 1673 showTodo();
1660 cn = (KOTodoViewItem*)cn->itemBelow(); 1674 cn = (KOTodoViewItem*)cn->itemBelow();
1661 if ( cn ) { 1675 if ( cn ) {
1662 mTodoListView->setCurrentItem ( cn ); 1676 mTodoListView->setCurrentItem ( cn );
1663 mTodoListView->ensureItemVisible ( cn ); 1677 mTodoListView->ensureItemVisible ( cn );
1664 } 1678 }
1665 1679
1666 } 1680 }
1667 } 1681 }
1668 e->accept(); 1682 e->accept();
1669 1683
1670 } 1684 }
1671 1685
1672 } 1686 }
1673 1687
1674} 1688}
1675void KOTodoView::updateTodo( Todo * t, int type ) 1689void KOTodoView::updateTodo( Todo * t, int type )
1676{ 1690{
1677 if ( mBlockUpdate) 1691 if ( mBlockUpdate)
1678 return; 1692 return;
1679 1693
1680 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1694 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1681 itemIterator = mTodoMap.find(t); 1695 itemIterator = mTodoMap.find(t);
1682 if (itemIterator != mTodoMap.end()) { 1696 if (itemIterator != mTodoMap.end()) {
1683 (*itemIterator)->construct(); 1697 (*itemIterator)->construct();
1684 } else { 1698 } else {
1685 if ( type == KOGlobals::EVENTADDED ) { 1699 if ( type == KOGlobals::EVENTADDED ) {
1686 insertTodoItem( t ); 1700 insertTodoItem( t );
1687 } 1701 }
1688 } 1702 }
1689 1703
1690} 1704}
1691 1705
1692void KOTodoView::todoModified(Todo * t , int p ) 1706void KOTodoView::todoModified(Todo * t , int p )
1693{ 1707{
1694 mBlockUpdate = true; 1708 mBlockUpdate = true;
1695 emit todoModifiedSignal ( t, p ); 1709 emit todoModifiedSignal ( t, p );
1696 mBlockUpdate = false; 1710 mBlockUpdate = false;
1697} 1711}
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index 7cd81fa..235ae55 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -1,223 +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
27using namespace KCal; 27using namespace KCal;
28 28
29Event::Event() : 29Event::Event() :
30 mHasEndDate( false ), mTransparency( Opaque ) 30 mHasEndDate( false ), mTransparency( Opaque )
31{ 31{
32} 32}
33 33
34Event::Event(const Event &e) : Incidence(e) 34Event::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
41Event::~Event() 41Event::~Event()
42{ 42{
43} 43}
44 44
45Incidence *Event::clone() 45Incidence *Event::clone()
46{ 46{
47 return new Event(*this); 47 return new Event(*this);
48} 48}
49 49
50bool KCal::operator==( const Event& e1, const Event& e2 ) 50bool 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
59bool Event::contains ( Event* from ) 59bool 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
106void Event::setDtEnd(const QDateTime &dtEnd) 106void 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
118QDateTime Event::dtEnd() const 118QDateTime 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
126QString Event::dtEndTimeStr() const 126QString Event::dtEndTimeStr() const
127{ 127{
128 return KGlobal::locale()->formatTime(mDtEnd.time()); 128 return KGlobal::locale()->formatTime(mDtEnd.time());
129} 129}
130 130
131QString Event::dtEndDateStr(bool shortfmt) const 131QString 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
136QString Event::dtEndStr(bool shortfmt) const 136QString 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
141void Event::setHasEndDate(bool b) 141void Event::setHasEndDate(bool b)
142{ 142{
143 mHasEndDate = b; 143 mHasEndDate = b;
144} 144}
145 145
146bool Event::hasEndDate() const 146bool Event::hasEndDate() const
147{ 147{
148 return mHasEndDate; 148 return mHasEndDate;
149} 149}
150 150
151bool Event::isMultiDay() const 151bool 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
157void Event::setTransparency(Event::Transparency transparency) 157void 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
164Event::Transparency Event::transparency() const 164Event::Transparency Event::transparency() const
165{ 165{
166 return mTransparency; 166 return mTransparency;
167} 167}
168 168
169void Event::setDuration(int seconds) 169void Event::setDuration(int seconds)
170{ 170{
171 setHasEndDate(false); 171 setHasEndDate(false);
172 Incidence::setDuration(seconds); 172 Incidence::setDuration(seconds);
173} 173}
174bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFutureOnly )
175{
176 if ( testEvent == this )
177 return false;
178 if ( ! doesRecur() && !testEvent->doesRecur() ) {
179 QDateTime te;
180 if ( testEvent->doesFloat() )
181 te = testEvent->mDtEnd.addDays( 1 );
182 else
183 te = testEvent->mDtEnd;
184 QDateTime e;
185 if ( doesFloat() )
186 e = mDtEnd.addDays( 1 );
187 else
188 e = mDtEnd;
189 if ( mDtStart < te && testEvent->mDtStart < e ) {
190 if ( mDtStart < testEvent->mDtStart )
191 *overlapDT = testEvent->mDtStart;
192 else
193 *overlapDT = mDtStart;
194 if ( inFutureOnly )
195 return (*overlapDT >= QDateTime::currentDateTime() );
196 return true;
197 }
198 return false;
199 }
200 Event *nonRecur = 0;
201 Event *recurEvent = 0;
202 if ( ! doesRecur() ) {
203 nonRecur = this;
204 recurEvent = testEvent;
205 }
206 else if ( !testEvent->doesRecur() ) {
207 nonRecur = testEvent;
208 recurEvent = this;
209 }
210 if ( nonRecur ) {
211 QDateTime enr;
212 if ( nonRecur->doesFloat() )
213 enr = nonRecur->mDtEnd.addDays( 1 );
214 else
215 enr = nonRecur->mDtEnd;
216 if ( enr < recurEvent->mDtStart )
217 return false;
218 if ( inFutureOnly && enr < QDateTime::currentDateTime() )
219 return false;
220 int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd );
221 if ( recurEvent->doesFloat() )
222 recDuration += 86400;
223 bool ok = true;
224 QDateTime recStart = recurEvent->mDtStart.addSecs( -300);;
225 while ( ok ) {
226 recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok );
227 if ( ok ) {
228 if ( recStart > enr )
229 return false;
230 QDateTime recEnd = recStart.addSecs( recDuration );
231 if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) {
232 if ( nonRecur->mDtStart < recStart )
233 *overlapDT = recStart;
234 else
235 *overlapDT = nonRecur->mDtStart;
236 if ( inFutureOnly ) {
237 if ( *overlapDT >= QDateTime::currentDateTime() )
238 return true;
239 } else
240 return true;
241 }
242 }
243 }
244 return false;
245 }
246
247 QDateTime incidenceStart = mDtStart;
248 int duration = mDtStart.secsTo( mDtEnd );
249 if ( doesFloat() )
250 duration += 86400;
251 QDateTime testincidenceStart = testEvent->mDtStart;
252 int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd );
253 if ( testEvent->doesFloat() )
254 testduration += 86400;
255 bool computeThis = false;
256 if ( incidenceStart < testincidenceStart )
257 computeThis = true;
258 bool ok = true;
259 if ( computeThis )
260 incidenceStart = incidenceStart.addSecs( -300 );
261 else
262 testincidenceStart = testincidenceStart.addSecs( -300 );
263 int count = 0;
264 while ( ok ) {
265 ++count;
266 if ( count > 1000 ) break;
267 if ( computeThis )
268 incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok );
269 else
270 testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok );
271 if ( ok ) {
272 if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) {
273 if ( incidenceStart < testincidenceStart )
274 *overlapDT = testincidenceStart;
275 else
276 *overlapDT = incidenceStart;
277 if ( inFutureOnly ) {
278 if ( *overlapDT >= QDateTime::currentDateTime() )
279 return true;
280 } else
281 return true;
282 }
283 computeThis = ( incidenceStart < testincidenceStart );
284 }
285
286 }
287 return false;
288}
174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const 289QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
175{ 290{
176 *ok = false; 291 *ok = false;
177 if ( !alarmEnabled() ) 292 if ( !alarmEnabled() )
178 return QDateTime (); 293 return QDateTime ();
179 bool yes; 294 bool yes;
180 QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); 295 QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
181 if ( ! yes || cancelled() ) { 296 if ( ! yes || cancelled() ) {
182 *ok = false; 297 *ok = false;
183 return QDateTime (); 298 return QDateTime ();
184 } 299 }
185 300
186 bool enabled = false; 301 bool enabled = false;
187 Alarm* alarm; 302 Alarm* alarm;
188 int off = 0; 303 int off = 0;
189 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 304 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
190 // if ( QDateTime::currentDateTime() > incidenceStart ){ 305 // if ( QDateTime::currentDateTime() > incidenceStart ){
191// *ok = false; 306// *ok = false;
192// return incidenceStart; 307// return incidenceStart;
193// } 308// }
194 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 309 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
195 if (alarm->enabled()) { 310 if (alarm->enabled()) {
196 if ( alarm->hasTime () ) { 311 if ( alarm->hasTime () ) {
197 if ( alarm->time() < alarmStart ) { 312 if ( alarm->time() < alarmStart ) {
198 alarmStart = alarm->time(); 313 alarmStart = alarm->time();
199 enabled = true; 314 enabled = true;
200 off = alarmStart.secsTo( incidenceStart ); 315 off = alarmStart.secsTo( incidenceStart );
201 } 316 }
202 317
203 } else { 318 } else {
204 int secs = alarm->startOffset().asSeconds(); 319 int secs = alarm->startOffset().asSeconds();
205 if ( incidenceStart.addSecs( secs ) < alarmStart ) { 320 if ( incidenceStart.addSecs( secs ) < alarmStart ) {
206 alarmStart = incidenceStart.addSecs( secs ); 321 alarmStart = incidenceStart.addSecs( secs );
207 enabled = true; 322 enabled = true;
208 off = -secs; 323 off = -secs;
209 } 324 }
210 } 325 }
211 } 326 }
212 } 327 }
213 if ( enabled ) { 328 if ( enabled ) {
214 if ( alarmStart > start_dt ) { 329 if ( alarmStart > start_dt ) {
215 *ok = true; 330 *ok = true;
216 * offset = off; 331 * offset = off;
217 return alarmStart; 332 return alarmStart;
218 } 333 }
219 } 334 }
220 *ok = false; 335 *ok = false;
221 return QDateTime (); 336 return QDateTime ();
222 337
223} 338}
diff --git a/libkcal/event.h b/libkcal/event.h
index 287d403..80c11c4 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -1,91 +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"
28namespace KCal { 28namespace 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*/
33class Event : public Incidence 33class 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 );
78
77 private: 79 private:
78 bool accept(Visitor &v) { return v.visit(this); } 80 bool accept(Visitor &v) { return v.visit(this); }
79 81
80 QDateTime mDtEnd; 82 QDateTime mDtEnd;
81 bool mHasEndDate; 83 bool mHasEndDate;
82 Transparency mTransparency; 84 Transparency mTransparency;
83}; 85};
84 86
85bool operator==( const Event&, const Event& ); 87bool operator==( const Event&, const Event& );
86 88
87 89
88} 90}
89 91
90 92
91#endif 93#endif
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 96039df..dcead02 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -1,397 +1,405 @@
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#include <kidmanager.h> 24#include <kidmanager.h>
25 25
26#include "calformat.h" 26#include "calformat.h"
27#include "syncdefines.h" 27#include "syncdefines.h"
28 28
29#include "incidencebase.h" 29#include "incidencebase.h"
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33IncidenceBase::IncidenceBase() : 33IncidenceBase::IncidenceBase() :
34 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), 34 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false),
35 mPilotId(0), mSyncStatus(SYNCMOD) 35 mPilotId(0), mSyncStatus(SYNCMOD)
36{ 36{
37 setUid(CalFormat::createUniqueId()); 37 setUid(CalFormat::createUniqueId());
38 mOrganizer = ""; 38 mOrganizer = "";
39 mFloats = false; 39 mFloats = false;
40 mDuration = 0; 40 mDuration = 0;
41 mHasDuration = false; 41 mHasDuration = false;
42 mPilotId = 0; 42 mPilotId = 0;
43 mExternalId = ":"; 43 mExternalId = ":";
44 mTempSyncStat = SYNC_TEMPSTATE_INITIAL; 44 mTempSyncStat = SYNC_TEMPSTATE_INITIAL;
45 mSyncStatus = 0; 45 mSyncStatus = 0;
46 mAttendees.setAutoDelete( true ); 46 mAttendees.setAutoDelete( true );
47 mCalEnabled = true; 47 mCalEnabled = true;
48 mAlarmEnabled = true; 48 mAlarmEnabled = true;
49 mCalID = 0; 49 mCalID = 0;
50} 50}
51 51
52IncidenceBase::IncidenceBase(const IncidenceBase &i) : 52IncidenceBase::IncidenceBase(const IncidenceBase &i) :
53 CustomProperties( i ) 53 CustomProperties( i )
54{ 54{
55 55
56 mReadOnly = i.mReadOnly; 56 mReadOnly = i.mReadOnly;
57 mDtStart = i.mDtStart; 57 mDtStart = i.mDtStart;
58 mDuration = i.mDuration; 58 mDuration = i.mDuration;
59 mHasDuration = i.mHasDuration; 59 mHasDuration = i.mHasDuration;
60 mOrganizer = i.mOrganizer; 60 mOrganizer = i.mOrganizer;
61 mUid = i.mUid; 61 mUid = i.mUid;
62 mCalEnabled = i.mCalEnabled; 62 mCalEnabled = i.mCalEnabled;
63 mAlarmEnabled = i.mAlarmEnabled; 63 mAlarmEnabled = i.mAlarmEnabled;
64 mCalID = i.mCalID; 64 mCalID = i.mCalID;
65 QPtrList<Attendee> attendees = i.attendees(); 65 QPtrList<Attendee> attendees = i.attendees();
66 for( Attendee *a = attendees.first(); a; a = attendees.next() ) { 66 for( Attendee *a = attendees.first(); a; a = attendees.next() ) {
67 mAttendees.append( new Attendee( *a ) ); 67 mAttendees.append( new Attendee( *a ) );
68 } 68 }
69 mFloats = i.mFloats; 69 mFloats = i.mFloats;
70 mLastModified = i.mLastModified; 70 mLastModified = i.mLastModified;
71 mPilotId = i.mPilotId; 71 mPilotId = i.mPilotId;
72 mTempSyncStat = i.mTempSyncStat; 72 mTempSyncStat = i.mTempSyncStat;
73 mSyncStatus = i.mSyncStatus; 73 mSyncStatus = i.mSyncStatus;
74 mExternalId = i.mExternalId; 74 mExternalId = i.mExternalId;
75 // The copied object is a new one, so it isn't observed by the observer 75 // The copied object is a new one, so it isn't observed by the observer
76 // of the original object. 76 // of the original object.
77 mObservers.clear(); 77 mObservers.clear();
78 78
79 mAttendees.setAutoDelete( true ); 79 mAttendees.setAutoDelete( true );
80} 80}
81 81
82IncidenceBase::~IncidenceBase() 82IncidenceBase::~IncidenceBase()
83{ 83{
84} 84}
85 85
86 86
87bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) 87bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 )
88{ 88{
89 // do not compare mSyncStatus and mExternalId 89 // do not compare mSyncStatus and mExternalId
90 if( i1.attendees().count() != i2.attendees().count() ) { 90 if( i1.attendees().count() != i2.attendees().count() ) {
91 return false; // no need to check further 91 return false; // no need to check further
92 } 92 }
93 if ( i1.attendees().count() > 0 ) { 93 if ( i1.attendees().count() > 0 ) {
94 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 94 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
95 while ( a1 ) { 95 while ( a1 ) {
96 if ( !( (*a1) == (*a2)) ) 96 if ( !( (*a1) == (*a2)) )
97 { 97 {
98 //qDebug("Attendee not equal "); 98 //qDebug("Attendee not equal ");
99 return false; 99 return false;
100 } 100 }
101 a1 = i1.attendees().next(); 101 a1 = i1.attendees().next();
102 a2 = i2.attendees().next(); 102 a2 = i2.attendees().next();
103 } 103 }
104 } 104 }
105 //if ( i1.dtStart() != i2.dtStart() ) 105 //if ( i1.dtStart() != i2.dtStart() )
106 // return false; 106 // return false;
107#if 0 107#if 0
108 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 108 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
109 qDebug("1 %d ",i1.duration() == i2.duration() ); 109 qDebug("1 %d ",i1.duration() == i2.duration() );
110 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 110 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
111 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 111 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
112 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 112 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
113 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 113 qDebug("6 %d ",i1.organizer() == i2.organizer() );
114 114
115#endif 115#endif
116 if ( i1.hasDuration() == i2.hasDuration() ) { 116 if ( i1.hasDuration() == i2.hasDuration() ) {
117 if ( i1.hasDuration() ) { 117 if ( i1.hasDuration() ) {
118 if ( i1.duration() != i2.duration() ) 118 if ( i1.duration() != i2.duration() )
119 return false; 119 return false;
120 } 120 }
121 } else { 121 } else {
122 return false; 122 return false;
123 } 123 }
124 124
125 return ( i1.organizer() == i2.organizer() && 125 return ( i1.organizer() == i2.organizer() &&
126 // i1.uid() == i2.uid() && 126 // i1.uid() == i2.uid() &&
127 // Don't compare lastModified, otherwise the operator is not 127 // Don't compare lastModified, otherwise the operator is not
128 // of much use. We are not comparing for identity, after all. 128 // of much use. We are not comparing for identity, after all.
129 i1.doesFloat() == i2.doesFloat() && 129 i1.doesFloat() == i2.doesFloat() &&
130 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 130 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
131 // no need to compare mObserver 131 // no need to compare mObserver
132} 132}
133 133
134 134
135QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 135QDateTime IncidenceBase::getEvenTime( QDateTime dt )
136{ 136{
137 QTime t = dt.time(); 137 QTime t = dt.time();
138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
139 return dt; 139 return dt;
140} 140}
141 141
142bool IncidenceBase::isTagged() const
143{
144 return mIsTagged;
145}
146void IncidenceBase::setTagged( bool b)
147{
148 mIsTagged = b;
149}
142void IncidenceBase::setCalID( int id ) 150void IncidenceBase::setCalID( int id )
143{ 151{
144 if ( mCalID > 0 ) 152 if ( mCalID > 0 )
145 updated(); 153 updated();
146 mCalID = id; 154 mCalID = id;
147} 155}
148int IncidenceBase::calID() const 156int IncidenceBase::calID() const
149{ 157{
150 return mCalID; 158 return mCalID;
151} 159}
152void IncidenceBase::setCalEnabled( bool b ) 160void IncidenceBase::setCalEnabled( bool b )
153{ 161{
154 mCalEnabled = b; 162 mCalEnabled = b;
155} 163}
156bool IncidenceBase::calEnabled() const 164bool IncidenceBase::calEnabled() const
157{ 165{
158 return mCalEnabled; 166 return mCalEnabled;
159} 167}
160 168
161void IncidenceBase::setAlarmEnabled( bool b ) 169void IncidenceBase::setAlarmEnabled( bool b )
162{ 170{
163 mAlarmEnabled = b; 171 mAlarmEnabled = b;
164} 172}
165bool IncidenceBase::alarmEnabled() const 173bool IncidenceBase::alarmEnabled() const
166{ 174{
167 return mAlarmEnabled; 175 return mAlarmEnabled;
168} 176}
169 177
170 178
171void IncidenceBase::setUid(const QString &uid) 179void IncidenceBase::setUid(const QString &uid)
172{ 180{
173 mUid = uid; 181 mUid = uid;
174 updated(); 182 updated();
175} 183}
176 184
177QString IncidenceBase::uid() const 185QString IncidenceBase::uid() const
178{ 186{
179 return mUid; 187 return mUid;
180} 188}
181 189
182void IncidenceBase::setLastModified(const QDateTime &lm) 190void IncidenceBase::setLastModified(const QDateTime &lm)
183{ 191{
184 // DON'T! updated() because we call this from 192 // DON'T! updated() because we call this from
185 // Calendar::updateEvent(). 193 // Calendar::updateEvent().
186 mLastModified = getEvenTime(lm); 194 mLastModified = getEvenTime(lm);
187 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 195 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
188} 196}
189 197
190QDateTime IncidenceBase::lastModified() const 198QDateTime IncidenceBase::lastModified() const
191{ 199{
192 return mLastModified; 200 return mLastModified;
193} 201}
194 202
195void IncidenceBase::setOrganizer(const QString &o) 203void IncidenceBase::setOrganizer(const QString &o)
196{ 204{
197 // we don't check for readonly here, because it is 205 // we don't check for readonly here, because it is
198 // possible that by setting the organizer we are changing 206 // possible that by setting the organizer we are changing
199 // the event's readonly status... 207 // the event's readonly status...
200 mOrganizer = o; 208 mOrganizer = o;
201 if (mOrganizer.left(7).upper() == "MAILTO:") 209 if (mOrganizer.left(7).upper() == "MAILTO:")
202 mOrganizer = mOrganizer.remove(0,7); 210 mOrganizer = mOrganizer.remove(0,7);
203 211
204 updated(); 212 updated();
205} 213}
206 214
207QString IncidenceBase::organizer() const 215QString IncidenceBase::organizer() const
208{ 216{
209 return mOrganizer; 217 return mOrganizer;
210} 218}
211 219
212void IncidenceBase::setReadOnly( bool readOnly ) 220void IncidenceBase::setReadOnly( bool readOnly )
213{ 221{
214 mReadOnly = readOnly; 222 mReadOnly = readOnly;
215} 223}
216 224
217void IncidenceBase::setDtStart(const QDateTime &dtStart) 225void IncidenceBase::setDtStart(const QDateTime &dtStart)
218{ 226{
219// if (mReadOnly) return; 227// if (mReadOnly) return;
220 mDtStart = getEvenTime(dtStart); 228 mDtStart = getEvenTime(dtStart);
221 updated(); 229 updated();
222} 230}
223 231
224 232
225QDateTime IncidenceBase::dtStart() const 233QDateTime IncidenceBase::dtStart() const
226{ 234{
227 return mDtStart; 235 return mDtStart;
228} 236}
229 237
230QString IncidenceBase::dtStartTimeStr() const 238QString IncidenceBase::dtStartTimeStr() const
231{ 239{
232 return KGlobal::locale()->formatTime(dtStart().time()); 240 return KGlobal::locale()->formatTime(dtStart().time());
233} 241}
234 242
235QString IncidenceBase::dtStartDateStr(bool shortfmt) const 243QString IncidenceBase::dtStartDateStr(bool shortfmt) const
236{ 244{
237 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 245 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
238} 246}
239 247
240QString IncidenceBase::dtStartStr(bool shortfmt) const 248QString IncidenceBase::dtStartStr(bool shortfmt) const
241{ 249{
242 if ( doesFloat() ) 250 if ( doesFloat() )
243 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 251 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
244 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); 252 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt);
245} 253}
246 254
247 255
248bool IncidenceBase::doesFloat() const 256bool IncidenceBase::doesFloat() const
249{ 257{
250 return mFloats; 258 return mFloats;
251} 259}
252 260
253void IncidenceBase::setFloats(bool f) 261void IncidenceBase::setFloats(bool f)
254{ 262{
255 if (mReadOnly) return; 263 if (mReadOnly) return;
256 mFloats = f; 264 mFloats = f;
257 updated(); 265 updated();
258} 266}
259 267
260 268
261bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) 269bool IncidenceBase::addAttendee(Attendee *a, bool doupdate)
262{ 270{
263 if (mReadOnly) return false; 271 if (mReadOnly) return false;
264 if (a->name().left(7).upper() == "MAILTO:") 272 if (a->name().left(7).upper() == "MAILTO:")
265 a->setName(a->name().remove(0,7)); 273 a->setName(a->name().remove(0,7));
266 274
267 QPtrListIterator<Attendee> qli(mAttendees); 275 QPtrListIterator<Attendee> qli(mAttendees);
268 276
269 qli.toFirst(); 277 qli.toFirst();
270 while (qli) { 278 while (qli) {
271 if (*qli.current() == *a) 279 if (*qli.current() == *a)
272 return false; 280 return false;
273 ++qli; 281 ++qli;
274 } 282 }
275 mAttendees.append(a); 283 mAttendees.append(a);
276 if (doupdate) updated(); 284 if (doupdate) updated();
277 return true; 285 return true;
278} 286}
279 287
280#if 0 288#if 0
281void IncidenceBase::removeAttendee(Attendee *a) 289void IncidenceBase::removeAttendee(Attendee *a)
282{ 290{
283 if (mReadOnly) return; 291 if (mReadOnly) return;
284 mAttendees.removeRef(a); 292 mAttendees.removeRef(a);
285 updated(); 293 updated();
286} 294}
287 295
288void IncidenceBase::removeAttendee(const char *n) 296void IncidenceBase::removeAttendee(const char *n)
289{ 297{
290 Attendee *a; 298 Attendee *a;
291 299
292 if (mReadOnly) return; 300 if (mReadOnly) return;
293 for (a = mAttendees.first(); a; a = mAttendees.next()) 301 for (a = mAttendees.first(); a; a = mAttendees.next())
294 if (a->getName() == n) { 302 if (a->getName() == n) {
295 mAttendees.remove(); 303 mAttendees.remove();
296 break; 304 break;
297 } 305 }
298} 306}
299#endif 307#endif
300 308
301void IncidenceBase::clearAttendees() 309void IncidenceBase::clearAttendees()
302{ 310{
303 if (mReadOnly) return; 311 if (mReadOnly) return;
304 mAttendees.clear(); 312 mAttendees.clear();
305} 313}
306 314
307#if 0 315#if 0
308Attendee *IncidenceBase::getAttendee(const char *n) const 316Attendee *IncidenceBase::getAttendee(const char *n) const
309{ 317{
310 QPtrListIterator<Attendee> qli(mAttendees); 318 QPtrListIterator<Attendee> qli(mAttendees);
311 319
312 qli.toFirst(); 320 qli.toFirst();
313 while (qli) { 321 while (qli) {
314 if (qli.current()->getName() == n) 322 if (qli.current()->getName() == n)
315 return qli.current(); 323 return qli.current();
316 ++qli; 324 ++qli;
317 } 325 }
318 return 0L; 326 return 0L;
319} 327}
320#endif 328#endif
321 329
322Attendee *IncidenceBase::attendeeByMail(const QString &email) 330Attendee *IncidenceBase::attendeeByMail(const QString &email)
323{ 331{
324 QPtrListIterator<Attendee> qli(mAttendees); 332 QPtrListIterator<Attendee> qli(mAttendees);
325 333
326 qli.toFirst(); 334 qli.toFirst();
327 while (qli) { 335 while (qli) {
328 if (qli.current()->email().lower() == email.lower()) 336 if (qli.current()->email().lower() == email.lower())
329 return qli.current(); 337 return qli.current();
330 ++qli; 338 ++qli;
331 } 339 }
332 return 0L; 340 return 0L;
333} 341}
334 342
335Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 343Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
336{ 344{
337 QPtrListIterator<Attendee> qli(mAttendees); 345 QPtrListIterator<Attendee> qli(mAttendees);
338 346
339 QStringList mails = emails; 347 QStringList mails = emails;
340 if (!email.isEmpty()) { 348 if (!email.isEmpty()) {
341 mails.append(email); 349 mails.append(email);
342 } 350 }
343 qli.toFirst(); 351 qli.toFirst();
344 while (qli) { 352 while (qli) {
345 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 353 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
346 if (qli.current()->email().lower() == (*it).lower()) 354 if (qli.current()->email().lower() == (*it).lower())
347 return qli.current(); 355 return qli.current();
348 } 356 }
349 357
350 ++qli; 358 ++qli;
351 } 359 }
352 return 0L; 360 return 0L;
353} 361}
354 362
355void IncidenceBase::setDuration(int seconds) 363void IncidenceBase::setDuration(int seconds)
356{ 364{
357 mDuration = seconds; 365 mDuration = seconds;
358 setHasDuration(true); 366 setHasDuration(true);
359} 367}
360 368
361int IncidenceBase::duration() const 369int IncidenceBase::duration() const
362{ 370{
363 return mDuration; 371 return mDuration;
364} 372}
365 373
366void IncidenceBase::setHasDuration(bool b) 374void IncidenceBase::setHasDuration(bool b)
367{ 375{
368 mHasDuration = b; 376 mHasDuration = b;
369} 377}
370 378
371bool IncidenceBase::hasDuration() const 379bool IncidenceBase::hasDuration() const
372{ 380{
373 return mHasDuration; 381 return mHasDuration;
374} 382}
375 383
376void IncidenceBase::setSyncStatus(int stat) 384void IncidenceBase::setSyncStatus(int stat)
377{ 385{
378 if (mReadOnly) return; 386 if (mReadOnly) return;
379 mSyncStatus = stat; 387 mSyncStatus = stat;
380} 388}
381 389
382int IncidenceBase::syncStatus() const 390int IncidenceBase::syncStatus() const
383{ 391{
384 return mSyncStatus; 392 return mSyncStatus;
385} 393}
386 394
387void IncidenceBase::setPilotId( int id ) 395void IncidenceBase::setPilotId( int id )
388{ 396{
389 if (mReadOnly) return; 397 if (mReadOnly) return;
390 mPilotId = id; 398 mPilotId = id;
391} 399}
392 400
393int IncidenceBase::pilotId() const 401int IncidenceBase::pilotId() const
394{ 402{
395 return mPilotId; 403 return mPilotId;
396} 404}
397 405
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index dc6024a..bccf287 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -1,183 +1,185 @@
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#ifndef KCAL_INCIDENCEBASE_H 20#ifndef KCAL_INCIDENCEBASE_H
21#define KCAL_INCIDENCEBASE_H 21#define KCAL_INCIDENCEBASE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <qvaluelist.h>
29#include <qptrlist.h> 29#include <qptrlist.h>
30 30
31#include "customproperties.h" 31#include "customproperties.h"
32#include "attendee.h" 32#include "attendee.h"
33 33
34namespace KCal { 34namespace KCal {
35 35
36typedef QValueList<QDate> DateList; 36typedef QValueList<QDate> DateList;
37 enum IncTypeID { eventID,todoID,journalID,freebusyID }; 37 enum IncTypeID { eventID,todoID,journalID,freebusyID };
38 38
39/** 39/**
40 This class provides the base class common to all calendar components. 40 This class provides the base class common to all calendar components.
41*/ 41*/
42class IncidenceBase : public CustomProperties 42class IncidenceBase : public CustomProperties
43{ 43{
44 public: 44 public:
45 class Observer { 45 class Observer {
46 public: 46 public:
47 virtual void incidenceUpdated( IncidenceBase * ) = 0; 47 virtual void incidenceUpdated( IncidenceBase * ) = 0;
48 }; 48 };
49 49
50 IncidenceBase(); 50 IncidenceBase();
51 IncidenceBase(const IncidenceBase &); 51 IncidenceBase(const IncidenceBase &);
52 virtual ~IncidenceBase(); 52 virtual ~IncidenceBase();
53 53
54 virtual QCString type() const = 0; 54 virtual QCString type() const = 0;
55 virtual IncTypeID typeID() const = 0; 55 virtual IncTypeID typeID() const = 0;
56 56
57 /** Set the unique id for the event */ 57 /** Set the unique id for the event */
58 void setUid(const QString &); 58 void setUid(const QString &);
59 /** Return the unique id for the event */ 59 /** Return the unique id for the event */
60 QString uid() const; 60 QString uid() const;
61 61
62 /** Sets the time the incidence was last modified. */ 62 /** Sets the time the incidence was last modified. */
63 void setLastModified(const QDateTime &lm); 63 void setLastModified(const QDateTime &lm);
64 /** Return the time the incidence was last modified. */ 64 /** Return the time the incidence was last modified. */
65 QDateTime lastModified() const; 65 QDateTime lastModified() const;
66 66
67 /** sets the organizer for the event */ 67 /** sets the organizer for the event */
68 void setOrganizer(const QString &o); 68 void setOrganizer(const QString &o);
69 QString organizer() const; 69 QString organizer() const;
70 70
71 /** Set readonly status. */ 71 /** Set readonly status. */
72 virtual void setReadOnly( bool ); 72 virtual void setReadOnly( bool );
73 /** Return if the object is read-only. */ 73 /** Return if the object is read-only. */
74 bool isReadOnly() const { return mReadOnly; } 74 bool isReadOnly() const { return mReadOnly; }
75 75
76 /** for setting the event's starting date/time with a QDateTime. */ 76 /** for setting the event's starting date/time with a QDateTime. */
77 virtual void setDtStart(const QDateTime &dtStart); 77 virtual void setDtStart(const QDateTime &dtStart);
78 /** returns an event's starting date/time as a QDateTime. */ 78 /** returns an event's starting date/time as a QDateTime. */
79 virtual QDateTime dtStart() const; 79 virtual QDateTime dtStart() const;
80 /** returns an event's starting time as a string formatted according to the 80 /** returns an event's starting time as a string formatted according to the
81 users locale settings */ 81 users locale settings */
82 QString dtStartTimeStr() const; 82 QString dtStartTimeStr() const;
83 /** returns an event's starting date as a string formatted according to the 83 /** returns an event's starting date as a string formatted according to the
84 users locale settings */ 84 users locale settings */
85 QString dtStartDateStr(bool shortfmt=true) const; 85 QString dtStartDateStr(bool shortfmt=true) const;
86 /** returns an event's starting date and time as a string formatted according 86 /** returns an event's starting date and time as a string formatted according
87 to the users locale settings */ 87 to the users locale settings */
88 QString dtStartStr(bool shortfmt=true) const; 88 QString dtStartStr(bool shortfmt=true) const;
89 89
90 virtual void setDuration(int seconds); 90 virtual void setDuration(int seconds);
91 int duration() const; 91 int duration() const;
92 void setHasDuration(bool); 92 void setHasDuration(bool);
93 bool hasDuration() const; 93 bool hasDuration() const;
94 94
95 /** Return true or false depending on whether the incidence "floats," 95 /** Return true or false depending on whether the incidence "floats,"
96 * i.e. has a date but no time attached to it. */ 96 * i.e. has a date but no time attached to it. */
97 bool doesFloat() const; 97 bool doesFloat() const;
98 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */ 98 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */
99 void setFloats(bool f); 99 void setFloats(bool f);
100 100
101 /** 101 /**
102 Add Attendee to this incidence. IncidenceBase takes ownership of the 102 Add Attendee to this incidence. IncidenceBase takes ownership of the
103 Attendee object. 103 Attendee object.
104 */ 104 */
105 bool addAttendee(Attendee *a, bool doupdate=true ); 105 bool addAttendee(Attendee *a, bool doupdate=true );
106// void removeAttendee(Attendee *a); 106// void removeAttendee(Attendee *a);
107// void removeAttendee(const char *n); 107// void removeAttendee(const char *n);
108 /** Remove all Attendees. */ 108 /** Remove all Attendees. */
109 void clearAttendees(); 109 void clearAttendees();
110 /** Return list of attendees. */ 110 /** Return list of attendees. */
111 QPtrList<Attendee> attendees() const { return mAttendees; }; 111 QPtrList<Attendee> attendees() const { return mAttendees; };
112 /** Return number of attendees. */ 112 /** Return number of attendees. */
113 int attendeeCount() const { return mAttendees.count(); }; 113 int attendeeCount() const { return mAttendees.count(); };
114 /** Return the Attendee with this email */ 114 /** Return the Attendee with this email */
115 Attendee* attendeeByMail(const QString &); 115 Attendee* attendeeByMail(const QString &);
116 /** Return first Attendee with one of this emails */ 116 /** Return first Attendee with one of this emails */
117 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); 117 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null);
118 118
119 /** pilot syncronization states */ 119 /** pilot syncronization states */
120 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; 120 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 };
121 /** Set synchronisation satus. */ 121 /** Set synchronisation satus. */
122 void setSyncStatus(int stat); 122 void setSyncStatus(int stat);
123 /** Return synchronisation status. */ 123 /** Return synchronisation status. */
124 int syncStatus() const; 124 int syncStatus() const;
125 125
126 /** Set Pilot Id. */ 126 /** Set Pilot Id. */
127 void setPilotId(int id); 127 void setPilotId(int id);
128 /** Return Pilot Id. */ 128 /** Return Pilot Id. */
129 int pilotId() const; 129 int pilotId() const;
130 130
131 void setTempSyncStat(int id); 131 void setTempSyncStat(int id);
132 int tempSyncStat() const; 132 int tempSyncStat() const;
133 void setIDStr( const QString & ); 133 void setIDStr( const QString & );
134 QString IDStr() const; 134 QString IDStr() const;
135 void setID( const QString &, const QString & ); 135 void setID( const QString &, const QString & );
136 QString getID( const QString & ); 136 QString getID( const QString & );
137 void setCsum( const QString &, const QString & ); 137 void setCsum( const QString &, const QString & );
138 QString getCsum( const QString & ); 138 QString getCsum( const QString & );
139 void removeID(const QString &); 139 void removeID(const QString &);
140 140
141 void registerObserver( Observer * ); 141 void registerObserver( Observer * );
142 void unRegisterObserver( Observer * ); 142 void unRegisterObserver( Observer * );
143 void updated(); 143 void updated();
144 void setCalID( int id ); 144 void setCalID( int id );
145 int calID() const; 145 int calID() const;
146 void setCalEnabled( bool ); 146 void setCalEnabled( bool );
147 bool calEnabled() const; 147 bool calEnabled() const;
148 void setAlarmEnabled( bool ); 148 void setAlarmEnabled( bool );
149 bool alarmEnabled() const; 149 bool alarmEnabled() const;
150 150 bool isTagged() const;
151 void setTagged( bool );
151 protected: 152 protected:
153 bool mIsTagged;
152 QDateTime mDtStart; 154 QDateTime mDtStart;
153 bool mReadOnly; 155 bool mReadOnly;
154 QDateTime getEvenTime( QDateTime ); 156 QDateTime getEvenTime( QDateTime );
155 157
156 private: 158 private:
157 // base components 159 // base components
158 QString mOrganizer; 160 QString mOrganizer;
159 QString mUid; 161 QString mUid;
160 int mCalID; 162 int mCalID;
161 bool mCalEnabled; 163 bool mCalEnabled;
162 bool mAlarmEnabled; 164 bool mAlarmEnabled;
163 QDateTime mLastModified; 165 QDateTime mLastModified;
164 QPtrList<Attendee> mAttendees; 166 QPtrList<Attendee> mAttendees;
165 167
166 bool mFloats; 168 bool mFloats;
167 169
168 int mDuration; 170 int mDuration;
169 bool mHasDuration; 171 bool mHasDuration;
170 QString mExternalId; 172 QString mExternalId;
171 int mTempSyncStat; 173 int mTempSyncStat;
172 174
173 // PILOT SYNCHRONIZATION STUFF 175 // PILOT SYNCHRONIZATION STUFF
174 int mPilotId; // unique id for pilot sync 176 int mPilotId; // unique id for pilot sync
175 int mSyncStatus; // status (for sync) 177 int mSyncStatus; // status (for sync)
176 178
177 QPtrList<Observer> mObservers; 179 QPtrList<Observer> mObservers;
178}; 180};
179 181
180bool operator==( const IncidenceBase&, const IncidenceBase& ); 182bool operator==( const IncidenceBase&, const IncidenceBase& );
181} 183}
182 184
183#endif 185#endif