summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/kolistview.cpp35
-rw-r--r--korganizer/searchdialog.cpp25
-rw-r--r--korganizer/searchdialog.h1
-rw-r--r--libkcal/incidence.cpp11
-rw-r--r--libkcal/incidence.h2
6 files changed, 61 insertions, 15 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 8f28234..7fa63f4 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1185,197 +1185,197 @@
1185{ " (%1 y.)"," (%1 J.)" }, 1185{ " (%1 y.)"," (%1 J.)" },
1186{ "Allday:","Ganztägig:" }, 1186{ "Allday:","Ganztägig:" },
1187{ "compl.todos","erled.Todos" }, 1187{ "compl.todos","erled.Todos" },
1188{ "Day view","Tagesansicht" }, 1188{ "Day view","Tagesansicht" },
1189{ "Next days","Nächste Tage" }, 1189{ "Next days","Nächste Tage" },
1190{ "Next week","Nächste Woche" }, 1190{ "Next week","Nächste Woche" },
1191{ "Next two weeks","Nächste zwei Wochen" }, 1191{ "Next two weeks","Nächste zwei Wochen" },
1192{ "This month","Dieser Monat" }, 1192{ "This month","Dieser Monat" },
1193{ "Journal view","Journal" }, 1193{ "Journal view","Journal" },
1194{ "Display all opened","Zeige alle geöffnet" }, 1194{ "Display all opened","Zeige alle geöffnet" },
1195{ "Display all closed","Zeige alle geschlossen" }, 1195{ "Display all closed","Zeige alle geschlossen" },
1196{ "Display all flat","Zeige alle flach" }, 1196{ "Display all flat","Zeige alle flach" },
1197{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1197{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1198{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1198{ "Default todo done color:","Standard Todo erledigt Farbe" },
1199{ "Select week %1-%2","Wähle Woche %1-%2" }, 1199{ "Select week %1-%2","Wähle Woche %1-%2" },
1200{ "Select Week","Wähle Woche" }, 1200{ "Select Week","Wähle Woche" },
1201{ "Set alarm for selected...","Setze Alarm für Selekt..." }, 1201{ "Set alarm for selected...","Setze Alarm für Selekt..." },
1202{ "Set Alarm!","Setze Alarm!" }, 1202{ "Set Alarm!","Setze Alarm!" },
1203{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1203{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1204{ " and "," und " }, 1204{ " and "," und " },
1205{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1205{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1206{ "Mail to selected","Mail an Ausgewählte" }, 1206{ "Mail to selected","Mail an Ausgewählte" },
1207{ "Mail to all","Mail an Alle" }, 1207{ "Mail to all","Mail an Alle" },
1208{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1208{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1209{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1209{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1210{ " on"," am" }, 1210{ " on"," am" },
1211{ " completed on "," erledigt am " }, 1211{ " completed on "," erledigt am " },
1212{ "Save as Event template","Speichere als Vorlage" }, 1212{ "Save as Event template","Speichere als Vorlage" },
1213{ "Load Event template","Lade Termin Vorlage" }, 1213{ "Load Event template","Lade Termin Vorlage" },
1214{ "Save as Journal template","Speichere als Journal Vorlage" }, 1214{ "Save as Journal template","Speichere als Journal Vorlage" },
1215{ "Insert Journal template","Füge Journal Vorlage ein" }, 1215{ "Insert Journal template","Füge Journal Vorlage ein" },
1216{ "Sub todos:<br>","Unter Todos:<br>" }, 1216{ "Sub todos:<br>","Unter Todos:<br>" },
1217{ "Parent todo:<br>","Über Todo:<br>" }, 1217{ "Parent todo:<br>","Über Todo:<br>" },
1218{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1218{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1219{ " completed"," erledigt" }, 1219{ " completed"," erledigt" },
1220{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, 1220{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" },
1221{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1221{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1222{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1222{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1223{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1223{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1224{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, 1224{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" },
1225{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1225{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1226{ "Error","Fehler" }, 1226{ "Error","Fehler" },
1227{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1227{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1228{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1228{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1229{ "Warning","Warnung" }, 1229{ "Warning","Warnung" },
1230{ "Select week number","Wähle Wochen Nummer" }, 1230{ "Select week number","Wähle Wochen Nummer" },
1231{ "Februar","Februar" }, 1231{ "Februar","Februar" },
1232{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1232{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1233{ "W","W" }, 1233{ "W","W" },
1234{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1234{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1235{ "T: %1","T: %1" }, 1235{ "T: %1","T: %1" },
1236{ "Start: ","Start: " }, 1236{ "Start: ","Start: " },
1237{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1237{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1238{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1238{ "Password for remote access:","Passwort für fernen Zugriff:" },
1239{ "Remote IP address:","Ferne IP Adresse:" }, 1239{ "Remote IP address:","Ferne IP Adresse:" },
1240{ "Remote port number:","Ferne Port Nummer:" }, 1240{ "Remote port number:","Ferne Port Nummer:" },
1241{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1241{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1242{ "Remote from: ","Fern von: " }, 1242{ "Remote from: ","Fern von: " },
1243{ "Local from: ","Lokal von: " }, 1243{ "Local from: ","Lokal von: " },
1244{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, 1244{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
1245{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1245{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1246{ "Write back","Schreibe zurück" }, 1246{ "Write back","Schreibe zurück" },
1247{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1247{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1248{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1248{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1249{ "Received sync request","Sync Anfrage erhalten" }, 1249{ "Received sync request","Sync Anfrage erhalten" },
1250{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 1250{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
1251{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1251{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1252{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1252{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1253{ "Sending file...","Sende Datei..." }, 1253{ "Sending file...","Sende Datei..." },
1254{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1254{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1255{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1255{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1256{ "Received %1 bytes","%1 Bytes erhalten" }, 1256{ "Received %1 bytes","%1 Bytes erhalten" },
1257{ "Writing file to disk...","Speichere Datei..." }, 1257{ "Writing file to disk...","Speichere Datei..." },
1258{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1258{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1259{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1259{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1260{ "Synchronize!","Synchronisiere!" }, 1260{ "Synchronize!","Synchronisiere!" },
1261{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1261{ "High clock skew!","Großer Uhrzeitunterschied!" },
1262{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1262{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1263{ "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!" }, 1263{ "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!" },
1264{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1264{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1265{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1265{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1266{ "List week view","Listenwochenansicht" }, 1266{ "List week view","Listenwochenansicht" },
1267{ "List week","Listenwochenansicht" }, 1267{ "List week","Listenwochenansicht" },
1268{ "Next Week","Nächste Woche" }, 1268{ "Next Week","Nächste Woche" },
1269{ "Previous Week","Vorherige Woche" }, 1269{ "Previous Week","Vorherige Woche" },
1270{ "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." }, 1270{ "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." },
1271{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1271{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1272{ "Details","Details" }, 1272{ "Details","Details" },
1273{ "Created time","Erstellt Zeit" }, 1273{ "Created time","Erstellt Zeit" },
1274{ "Last modified time","Geändert Zeit" }, 1274{ "Last modified time","Geändert Zeit" },
1275{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1275{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1276{ "View Options","Anzeige Optionen" }, 1276{ "View Options","Anzeige Optionen" },
1277{ "<b>Created: ","<b>Erstellt am: " }, 1277{ "<b>Created: ","<b>Erstellt am: " },
1278{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1278{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1279{ "Journal: ","Journal: " }, 1279{ "Journal: ","Journal: " },
1280{ "yearly","jährlich" }, 1280{ "yearly","jährlich" },
1281{ "(%1) ","%1-" }, 1281{ "(%1) ","%1-" },
1282{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1282{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1283{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1283{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1284{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1284{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1285{ "Summary/Loc.","Titel/Ort" }, 1285{ "Summary/Loc.","Titel/Ort" },
1286{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1286{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1287{ "Week Number","Wochennummer" }, 1287{ "Week Number","Wochennummer" },
1288{ "Import","Importiere" }, 1288{ "Import","Importiere" },
1289{ "Export","Exportiere" }, 1289{ "Export","Exportiere" },
1290{ "Beam","Beame" }, 1290{ "Beam","Beame" },
1291{ "Export selected","Exportiere Selektierte" }, 1291{ "Export selected","Exportiere Selektierte" },
1292{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1292{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1293{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1293{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1294{ "Journal/Details...","Journale/Details..." }, 1294{ "Journal/Details...","Journale/Details..." },
1295{ "Agenda View","Agenda Ansicht" }, 1295{ "Agenda View","Agenda Ansicht" },
1296{ "Show current time","Zeige aktuelle Zeit" }, 1296{ "Show current time","Zeige aktuelle Zeit" },
1297{ "Edit new item","Bearbeite neuen Eintrag" }, 1297{ "Edit new item","Bearbeite neuen Eintrag" },
1298{ "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" }, 1298{ "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" },
1299{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1299{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1300{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1300{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1301{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1301{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1302{ "%1 days\n","%1 Tagen\n" }, 1302{ "%1 days\n","%1 Tagen\n" },
1303{ "1 day\n","1 Tag\n" }, 1303{ "1 day\n","1 Tag\n" },
1304{ "%1 hours\n","%1 Stunden\n" }, 1304{ "%1 hours\n","%1 Stunden\n" },
1305{ "1 hour\n","1 Stunde\n" }, 1305{ "1 hour\n","1 Stunde\n" },
1306{ "%1 minutes\n","%1 Minuten\n" }, 1306{ "%1 minutes\n","%1 Minuten\n" },
1307{ "1 minute\n","1 Minute\n" }, 1307{ "1 minute\n","1 Minute\n" },
1308{ "Only one toolbar","Nur eine Toolbar" }, 1308{ "Only one toolbar","Nur eine Toolbar" },
1309{ "Print","Drucke" }, 1309{ "Print","Drucke" },
1310{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1310{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1311{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1311{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1312{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1312{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1313{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1313{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1314{ "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" }, 1314{ "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" },
1315{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1315{ "KO/Pi Printout","KO/Pi Ausdruck" },
1316{ "Print unscaled","Drucke unskaliert" }, 1316{ "Print unscaled","Drucke unskaliert" },
1317{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1317{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1318{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1318{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1319{ "Printout Mode","Druck Modus" }, 1319{ "Printout Mode","Druck Modus" },
1320{ "Filter menu icon","Filtermenu Icon" }, 1320{ "Filter menu icon","Filtermenu Icon" },
1321{ "<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" }, 1321{ "<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" },
1322{ "<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" }, 1322{ "<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" },
1323{ "%1d","%1t" }, 1323{ "%1d","%1t" },
1324{ "%1h","%1std" }, 1324{ "%1h","%1std" },
1325{ "%1min","%1min" }, 1325{ "%1min","%1min" },
1326{ "( %1 before )","( %1 vorher )" }, 1326{ "( %1 before )","( %1 vorher )" },
1327{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1327{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1328{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1328{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1329{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1329{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1330{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1330{ "Show Sync Events","Zeige Sync-Ereignisse" },
1331{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1331{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1332{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1332{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1333{ " on "," am " }, 1333{ " on "," am " },
1334{ "On: ","Am: " }, 1334{ "On: ","Am: " },
1335{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1335{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1336{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1336{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1337{ "Color for running todos:","Farbe für laufende Todos:" }, 1337{ "Color for running todos:","Farbe für laufende Todos:" },
1338{ "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?" }, 1338{ "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?" },
1339{ "Todo is started","Todo ist gestartet" }, 1339{ "Todo is started","Todo ist gestartet" },
1340{ "Stop todo","Stoppe Todo" }, 1340{ "Stop todo","Stoppe Todo" },
1341{ "Todo is stopped","Todo ist gestoppt" }, 1341{ "Todo is stopped","Todo ist gestoppt" },
1342{ "Start todo","Starte Todo" }, 1342{ "Start todo","Starte Todo" },
1343{ "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?" }, 1343{ "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?" },
1344{ "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?" }, 1344{ "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?" },
1345{ "Todo has subtodos","Todo hat Untertodos" }, 1345{ "Todo has subtodos","Todo hat Untertodos" },
1346{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1346{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1347{ "Colors","Farben" }, 1347{ "Colors","Farben" },
1348{ "Click on new parent item","Klicke auf neues Übertodo" }, 1348{ "Click on new parent item","Klicke auf neues Übertodo" },
1349{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1349{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1350{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1350{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1351{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1351{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1352{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1352{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1353{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1353{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1354{ "times","Zeiten" }, 1354{ "times","Zeiten" },
1355{ "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?" }, 1355{ "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?" },
1356{ "Backup enabled","Backup angeschaltet" }, 1356{ "Backup enabled","Backup angeschaltet" },
1357{ "Use standard backup dir","Standard Backupverzeichnis" }, 1357{ "Use standard backup dir","Standard Backupverzeichnis" },
1358{ "Number of Backups:","Anzahl der Backups" }, 1358{ "Number of Backups:","Anzahl der Backups" },
1359{ "Make backup every ","Mache ein Backup alle " }, 1359{ "Make backup every ","Mache ein Backup alle " },
1360{ " days"," Tage" }, 1360{ " days"," Tage" },
1361{ "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, 1361{ "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." },
1362{ "Backup Failed!","Backup Problem!" }, 1362{ "Backup Failed!","Backup Problem!" },
1363{ "Try again now","Versuche jetzt nochmal" }, 1363{ "Try again now","Versuche jetzt nochmal" },
1364{ "Try again later","Versuche später nochmal" }, 1364{ "Try again later","Versuche später nochmal" },
1365{ "Try again tomorrow","Versuche morgen nochmal" }, 1365{ "Try again tomorrow","Versuche morgen nochmal" },
1366{ "Disable backup","Schalte Backup ab" }, 1366{ "Disable backup","Schalte Backup ab" },
1367{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1367{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1368{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1368{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1369{ "Choose action","Wähle Aktion" }, 1369{ "Choose action","Wähle Aktion" },
1370{ "Comment for todo:","Kommentar zum Todo:" }, 1370{ "Comment for todo:","Kommentar zum Todo:" },
1371{ "Stop+note","Stop+Notiz" }, 1371{ "Stop+note","Stop+Notiz" },
1372{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1372{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1373{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1373{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1374{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1374{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1375{ "Print complete list","Drucke komplette Liste" }, 1375{ "Print complete list","Drucke komplette Liste" },
1376{ "Hide all selected","Verstecke Selektierte" }, 1376{ "Hide all selected","Verstecke Selektierte" },
1377{ "","" }, 1377{ "Add items","hinzufügen" },
1378{ "","" }, 1378{ "","" },
1379{ "","" }, 1379{ "","" },
1380{ "","" }, 1380{ "","" },
1381{ "","" }, \ No newline at end of file 1381{ "","" }, \ No newline at end of file
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index be51694..5797d1b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -94,776 +94,803 @@ ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
94 94
95ListItemVisitor::~ListItemVisitor() 95ListItemVisitor::~ListItemVisitor()
96{ 96{
97} 97}
98 98
99bool ListItemVisitor::visit(Event *e) 99bool ListItemVisitor::visit(Event *e)
100{ 100{
101 bool ok = false; 101 bool ok = false;
102 QString start, end; 102 QString start, end;
103 QDate ds, de; 103 QDate ds, de;
104 if ( e->doesRecur() ) { 104 if ( e->doesRecur() ) {
105 ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); 105 ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
106 if ( ok ) { 106 if ( ok ) {
107 int days = e->dtStart().date().daysTo(e->dtEnd().date() ); 107 int days = e->dtStart().date().daysTo(e->dtEnd().date() );
108 start = KGlobal::locale()->formatDate(ds,true); 108 start = KGlobal::locale()->formatDate(ds,true);
109 de = ds.addDays( days); 109 de = ds.addDays( days);
110 end = KGlobal::locale()->formatDate(de,true); 110 end = KGlobal::locale()->formatDate(de,true);
111 } 111 }
112 112
113 } 113 }
114 if ( ! ok ) { 114 if ( ! ok ) {
115 start =e->dtStartDateStr(); 115 start =e->dtStartDateStr();
116 end = e->dtEndDateStr(); 116 end = e->dtEndDateStr();
117 ds = e->dtStart().date(); 117 ds = e->dtStart().date();
118 de = e->dtEnd().date(); 118 de = e->dtEnd().date();
119 } 119 }
120 mItem->setText(0,e->summary()); 120 mItem->setText(0,e->summary());
121 mItem->setText(1,start); 121 mItem->setText(1,start);
122 if ( e->doesFloat() ) 122 if ( e->doesFloat() )
123 mItem->setText(2,"---"); 123 mItem->setText(2,"---");
124 else 124 else
125 mItem->setText(2,e->dtStartTimeStr()); 125 mItem->setText(2,e->dtStartTimeStr());
126 mItem->setText(3,end); 126 mItem->setText(3,end);
127 if ( e->doesFloat() ) 127 if ( e->doesFloat() )
128 mItem->setText(4,"---"); 128 mItem->setText(4,"---");
129 else 129 else
130 mItem->setText(4,e->dtEndTimeStr()); 130 mItem->setText(4,e->dtEndTimeStr());
131 if ( e->isAlarmEnabled() ) { 131 if ( e->isAlarmEnabled() ) {
132 mItem->setText(5,e->alarms().first()->offsetText() ); 132 mItem->setText(5,e->alarms().first()->offsetText() );
133 } else { 133 } else {
134 mItem->setText(5, i18n("No")); 134 mItem->setText(5, i18n("No"));
135 } 135 }
136 mItem->setText(6, e->recurrence()->recurrenceText()); 136 mItem->setText(6, e->recurrence()->recurrenceText());
137 if( ! e->doesRecur() ) 137 if( ! e->doesRecur() )
138 mItem->setSortKey( 6, "-" ); 138 mItem->setSortKey( 6, "-" );
139 mItem->setText(7,"---"); 139 mItem->setText(7,"---");
140 mItem->setText(8,"---"); 140 mItem->setText(8,"---");
141 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); 141 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
142 mItem->setText(10,e->categoriesStr()); 142 mItem->setText(10,e->categoriesStr());
143 143
144 QString key; 144 QString key;
145 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); 145 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
146 key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); 146 key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
147 mItem->setSortKey(1,key); 147 mItem->setSortKey(1,key);
148 148
149 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); 149 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
150 key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); 150 key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
151 mItem->setSortKey(3,key); 151 mItem->setSortKey(3,key);
152 return true; 152 return true;
153} 153}
154 154
155bool ListItemVisitor::visit(Todo *t) 155bool ListItemVisitor::visit(Todo *t)
156{ 156{
157 mItem->setText(0,i18n("Todo: %1").arg(t->summary())); 157 mItem->setText(0,i18n("Todo: %1").arg(t->summary()));
158 if (t->hasStartDate()) { 158 if (t->hasStartDate()) {
159 mItem->setText(1,t->dtStartDateStr()); 159 mItem->setText(1,t->dtStartDateStr());
160 if (t->doesFloat()) { 160 if (t->doesFloat()) {
161 mItem->setText(2,"---"); 161 mItem->setText(2,"---");
162 } else { 162 } else {
163 mItem->setText(2,t->dtStartTimeStr()); 163 mItem->setText(2,t->dtStartTimeStr());
164 } 164 }
165 } else { 165 } else {
166 mItem->setText(1,"---"); 166 mItem->setText(1,"---");
167 mItem->setText(2,"---"); 167 mItem->setText(2,"---");
168 } 168 }
169 mItem->setText(3,"---"); 169 mItem->setText(3,"---");
170 mItem->setText(4,"---"); 170 mItem->setText(4,"---");
171 if ( t->isAlarmEnabled() ) { 171 if ( t->isAlarmEnabled() ) {
172 mItem->setText(5,t->alarms().first()->offsetText() ); 172 mItem->setText(5,t->alarms().first()->offsetText() );
173 } else { 173 } else {
174 mItem->setText(5, i18n("No")); 174 mItem->setText(5, i18n("No"));
175 } 175 }
176 mItem->setText(6, t->recurrence()->recurrenceText()); 176 mItem->setText(6, t->recurrence()->recurrenceText());
177 if( ! t->doesRecur() ) 177 if( ! t->doesRecur() )
178 mItem->setSortKey( 6, "-" ); 178 mItem->setSortKey( 6, "-" );
179 if (t->hasDueDate()) { 179 if (t->hasDueDate()) {
180 mItem->setText(7,t->dtDueDateStr()); 180 mItem->setText(7,t->dtDueDateStr());
181 if (t->doesFloat()) { 181 if (t->doesFloat()) {
182 mItem->setText(8,"---"); 182 mItem->setText(8,"---");
183 } else { 183 } else {
184 mItem->setText(8,t->dtDueTimeStr()); 184 mItem->setText(8,t->dtDueTimeStr());
185 } 185 }
186 } else { 186 } else {
187 mItem->setText(7,"---"); 187 mItem->setText(7,"---");
188 mItem->setText(8,"---"); 188 mItem->setText(8,"---");
189 } 189 }
190 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); 190 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
191 mItem->setText(10,t->categoriesStr()); 191 mItem->setText(10,t->categoriesStr());
192 192
193 QString key; 193 QString key;
194 QDate d; 194 QDate d;
195 if (t->hasDueDate()) { 195 if (t->hasDueDate()) {
196 d = t->dtDue().date(); 196 d = t->dtDue().date();
197 QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); 197 QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time();
198 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); 198 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
199 mItem->setSortKey(7,key); 199 mItem->setSortKey(7,key);
200 } 200 }
201 if ( t->hasStartDate() ) { 201 if ( t->hasStartDate() ) {
202 d = t->dtStart().date(); 202 d = t->dtStart().date();
203 QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); 203 QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time();
204 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); 204 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
205 mItem->setSortKey(1,key); 205 mItem->setSortKey(1,key);
206 } 206 }
207 return true; 207 return true;
208} 208}
209 209
210bool ListItemVisitor::visit(Journal * j) 210bool ListItemVisitor::visit(Journal * j)
211{ 211{
212 QString des = j->description().left(30); 212 QString des = j->description().left(30);
213 des = des.simplifyWhiteSpace (); 213 des = des.simplifyWhiteSpace ();
214 des.replace (QRegExp ("\\n"),"" ); 214 des.replace (QRegExp ("\\n"),"" );
215 des.replace (QRegExp ("\\r"),"" ); 215 des.replace (QRegExp ("\\r"),"" );
216 mItem->setText(0,i18n("Journal: ")+des.left(25)); 216 mItem->setText(0,i18n("Journal: ")+des.left(25));
217 mItem->setText(1,j->dtStartDateStr()); 217 mItem->setText(1,j->dtStartDateStr());
218 mItem->setText(2,"---"); 218 mItem->setText(2,"---");
219 mItem->setText(3,"---"); 219 mItem->setText(3,"---");
220 mItem->setText(4,"---"); 220 mItem->setText(4,"---");
221 mItem->setText(5,"---"); 221 mItem->setText(5,"---");
222 mItem->setText(6,"---"); 222 mItem->setText(6,"---");
223 mItem->setText(7,j->dtStartDateStr()); 223 mItem->setText(7,j->dtStartDateStr());
224 mItem->setText(8,"---"); 224 mItem->setText(8,"---");
225 mItem->setText(9,"---"); 225 mItem->setText(9,"---");
226 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); 226 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) );
227 227
228 QString key; 228 QString key;
229 QDate d = j->dtStart().date(); 229 QDate d = j->dtStart().date();
230 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 230 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
231 mItem->setSortKey(1,key); 231 mItem->setSortKey(1,key);
232 mItem->setSortKey(7,key); 232 mItem->setSortKey(7,key);
233 233
234 return true; 234 return true;
235} 235}
236 236
237KOListView::KOListView(Calendar *calendar, QWidget *parent, 237KOListView::KOListView(Calendar *calendar, QWidget *parent,
238 const char *name) 238 const char *name)
239 : KOEventView(calendar, parent, name) 239 : KOEventView(calendar, parent, name)
240{ 240{
241 mActiveItem = 0; 241 mActiveItem = 0;
242 mListView = new KOListViewListView(this); 242 mListView = new KOListViewListView(this);
243 mListView->addColumn(i18n("Summary")); 243 mListView->addColumn(i18n("Summary"));
244 mListView->addColumn(i18n("Start Date")); 244 mListView->addColumn(i18n("Start Date"));
245 mListView->addColumn(i18n("Start Time")); 245 mListView->addColumn(i18n("Start Time"));
246 mListView->addColumn(i18n("End Date")); 246 mListView->addColumn(i18n("End Date"));
247 mListView->addColumn(i18n("End Time")); 247 mListView->addColumn(i18n("End Time"));
248 mListView->addColumn(i18n("Alarm")); // alarm set? 248 mListView->addColumn(i18n("Alarm")); // alarm set?
249 mListView->addColumn(i18n("Recurs")); // recurs? 249 mListView->addColumn(i18n("Recurs")); // recurs?
250 mListView->addColumn(i18n("Due Date")); 250 mListView->addColumn(i18n("Due Date"));
251 mListView->addColumn(i18n("Due Time")); 251 mListView->addColumn(i18n("Due Time"));
252 mListView->addColumn(i18n("Cancelled")); 252 mListView->addColumn(i18n("Cancelled"));
253 mListView->addColumn(i18n("Categories")); 253 mListView->addColumn(i18n("Categories"));
254 254
255 mListView->setColumnAlignment(0,AlignLeft); 255 mListView->setColumnAlignment(0,AlignLeft);
256 mListView->setColumnAlignment(1,AlignLeft); 256 mListView->setColumnAlignment(1,AlignLeft);
257 mListView->setColumnAlignment(2,AlignHCenter); 257 mListView->setColumnAlignment(2,AlignHCenter);
258 mListView->setColumnAlignment(3,AlignLeft); 258 mListView->setColumnAlignment(3,AlignLeft);
259 mListView->setColumnAlignment(4,AlignHCenter); 259 mListView->setColumnAlignment(4,AlignHCenter);
260 mListView->setColumnAlignment(5,AlignLeft); 260 mListView->setColumnAlignment(5,AlignLeft);
261 mListView->setColumnAlignment(6,AlignLeft); 261 mListView->setColumnAlignment(6,AlignLeft);
262 mListView->setColumnAlignment(7,AlignLeft); 262 mListView->setColumnAlignment(7,AlignLeft);
263 mListView->setColumnAlignment(8,AlignLeft); 263 mListView->setColumnAlignment(8,AlignLeft);
264 mListView->setColumnAlignment(9,AlignLeft); 264 mListView->setColumnAlignment(9,AlignLeft);
265 mListView->setColumnAlignment(10,AlignLeft); 265 mListView->setColumnAlignment(10,AlignLeft);
266 mListView->setColumnWidthMode(10, QListView::Manual); 266 mListView->setColumnWidthMode(10, QListView::Manual);
267 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); 267 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this);
268 268
269 int iii = 0; 269 int iii = 0;
270 for ( iii = 0; iii< 10 ; ++iii ) 270 for ( iii = 0; iii< 10 ; ++iii )
271 mListView->setColumnWidthMode( iii, QListView::Manual ); 271 mListView->setColumnWidthMode( iii, QListView::Manual );
272 272
273 QBoxLayout *layoutTop = new QVBoxLayout(this); 273 QBoxLayout *layoutTop = new QVBoxLayout(this);
274 layoutTop->addWidget(mListView); 274 layoutTop->addWidget(mListView);
275 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 275 mListView->setFont ( KOPrefs::instance()->mListViewFont );
276 mPopupMenu = eventPopup(); 276 mPopupMenu = eventPopup();
277 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 277 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
278 i18n("Select all"),this, 278 i18n("Select all"),this,
279 SLOT(allSelection()),true); 279 SLOT(allSelection()),true);
280 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 280 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
281 i18n("Deselect all"),this, 281 i18n("Deselect all"),this,
282 SLOT(clearSelection()),true); 282 SLOT(clearSelection()),true);
283 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 283 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
284 i18n("Delete all selected"),this, 284 i18n("Delete all selected"),this,
285 SLOT(deleteAll()),true); 285 SLOT(deleteAll()),true);
286#ifdef DESKTOP_VERSION 286
287 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 287 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
288 i18n("Hide all selected"),this, 288 i18n("Hide all selected"),this,
289 SLOT(hideAll()),true); 289 SLOT(hideAll()),true);
290#endif 290
291 mPopupMenu->insertSeparator(); 291 mPopupMenu->insertSeparator();
292#ifdef DESKTOP_VERSION 292#ifdef DESKTOP_VERSION
293 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 293 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
294 i18n("Print complete list"),this, 294 i18n("Print complete list"),this,
295 SLOT(printList()),true); 295 SLOT(printList()),true);
296 mPopupMenu->insertSeparator(); 296 mPopupMenu->insertSeparator();
297#endif 297#endif
298 QPopupMenu * exportPO = new QPopupMenu ( this ); 298 QPopupMenu * exportPO = new QPopupMenu ( this );
299 mPopupMenu->insertItem( i18n("Export selected"), exportPO ); 299 mPopupMenu->insertItem( i18n("Export selected"), exportPO );
300 exportPO->insertItem( i18n("As iCal (ics) file..."),this, 300 exportPO->insertItem( i18n("As iCal (ics) file..."),this,
301 SLOT(saveToFile())); 301 SLOT(saveToFile()));
302 exportPO->insertItem( i18n("As vCal (vcs) file..."),this, 302 exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
303 SLOT(saveToFileVCS())); 303 SLOT(saveToFileVCS()));
304 exportPO->insertItem( i18n("Journal/Details..."),this, 304 exportPO->insertItem( i18n("Journal/Details..."),this,
305 SLOT(saveDescriptionToFile())); 305 SLOT(saveDescriptionToFile()));
306 // mPopupMenu->insertSeparator(); 306 // mPopupMenu->insertSeparator();
307 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 307 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
308 i18n("Add Categ. to selected..."),this, 308 i18n("Add Categ. to selected..."),this,
309 SLOT(addCat()),true); 309 SLOT(addCat()),true);
310 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 310 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
311 i18n("Set Categ. for selected..."),this, 311 i18n("Set Categ. for selected..."),this,
312 SLOT(setCat()),true); 312 SLOT(setCat()),true);
313 //mPopupMenu->insertSeparator(); 313 //mPopupMenu->insertSeparator();
314 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 314 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
315 i18n("Set alarm for selected..."),this, 315 i18n("Set alarm for selected..."),this,
316 SLOT(setAlarm()),true); 316 SLOT(setAlarm()),true);
317 317
318 318
319#ifndef DESKTOP_VERSION 319#ifndef DESKTOP_VERSION
320 mPopupMenu->insertSeparator(); 320 mPopupMenu->insertSeparator();
321 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 321 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
322 i18n("Beam selected via IR"),this, 322 i18n("Beam selected via IR"),this,
323 SLOT(beamSelected()),true); 323 SLOT(beamSelected()),true);
324#endif 324#endif
325 /* 325 /*
326 mPopupMenu = new QPopupMenu; 326 mPopupMenu = new QPopupMenu;
327 mPopupMenu->insertItem(i18n("Edit Event"), this, 327 mPopupMenu->insertItem(i18n("Edit Event"), this,
328 SLOT (editEvent())); 328 SLOT (editEvent()));
329 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, 329 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
330 SLOT (deleteEvent())); 330 SLOT (deleteEvent()));
331 mPopupMenu->insertSeparator(); 331 mPopupMenu->insertSeparator();
332 mPopupMenu->insertItem(i18n("Show Dates"), this, 332 mPopupMenu->insertItem(i18n("Show Dates"), this,
333 SLOT(showDates())); 333 SLOT(showDates()));
334 mPopupMenu->insertItem(i18n("Hide Dates"), this, 334 mPopupMenu->insertItem(i18n("Hide Dates"), this,
335 SLOT(hideDates())); 335 SLOT(hideDates()));
336 */ 336 */
337 QObject::connect(mListView,SIGNAL( newEvent()), 337 QObject::connect(mListView,SIGNAL( newEvent()),
338 this,SIGNAL(signalNewEvent())); 338 this,SIGNAL(signalNewEvent()));
339 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), 339 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
340 this,SLOT(defaultItemAction(QListViewItem *))); 340 this,SLOT(defaultItemAction(QListViewItem *)));
341 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, 341 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *,
342 const QPoint &, int )), 342 const QPoint &, int )),
343 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); 343 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
344 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 344 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
345 SLOT(processSelectionChange(QListViewItem *))); 345 SLOT(processSelectionChange(QListViewItem *)));
346 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 346 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
347 SIGNAL(showIncidenceSignal(Incidence *)) ); 347 SIGNAL(showIncidenceSignal(Incidence *)) );
348 348
349 readSettings(KOGlobals::config(),"KOListView Layout"); 349 readSettings(KOGlobals::config(),"KOListView Layout");
350} 350}
351 351
352KOListView::~KOListView() 352KOListView::~KOListView()
353{ 353{
354 delete mPopupMenu; 354 delete mPopupMenu;
355#if QT_VERSION >= 0x030000 355#if QT_VERSION >= 0x030000
356 356
357#else 357#else
358 delete mKOListViewWhatsThis; 358 delete mKOListViewWhatsThis;
359#endif 359#endif
360} 360}
361 361
362QString KOListView::getWhatsThisText(QPoint p) 362QString KOListView::getWhatsThisText(QPoint p)
363{ 363{
364 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); 364 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
365 if ( item ) 365 if ( item )
366 return KIncidenceFormatter::instance()->getFormattedText( item->data(), 366 return KIncidenceFormatter::instance()->getFormattedText( item->data(),
367 KOPrefs::instance()->mWTshowDetails, 367 KOPrefs::instance()->mWTshowDetails,
368 KOPrefs::instance()->mWTshowCreated, 368 KOPrefs::instance()->mWTshowCreated,
369 KOPrefs::instance()->mWTshowChanged); 369 KOPrefs::instance()->mWTshowChanged);
370 return i18n("That is the list view" ); 370 return i18n("That is the list view" );
371 371
372} 372}
373 373
374void KOListView::updateList() 374void KOListView::updateList()
375{ 375{
376 // qDebug(" KOListView::updateList() "); 376 // qDebug(" KOListView::updateList() ");
377 377
378} 378}
379 379
380void KOListView::clearList() 380void KOListView::clearList()
381{ 381{
382 clear (); 382 clear ();
383} 383}
384void KOListView::addCat( ) 384void KOListView::addCat( )
385{ 385{
386 setCategories( false ); 386 setCategories( false );
387} 387}
388void KOListView::setCat() 388void KOListView::setCat()
389{ 389{
390 setCategories( true ); 390 setCategories( true );
391} 391}
392void KOListView::setAlarm() 392void KOListView::setAlarm()
393{ 393{
394 KOAlarmPrefs kap( this); 394 KOAlarmPrefs kap( this);
395 if ( !kap.exec() ) 395 if ( !kap.exec() )
396 return; 396 return;
397 QStringList itemList; 397 QStringList itemList;
398 QPtrList<KOListViewItem> sel ; 398 QPtrList<KOListViewItem> sel ;
399 QListViewItem *qitem = mListView->firstChild (); 399 QListViewItem *qitem = mListView->firstChild ();
400 while ( qitem ) { 400 while ( qitem ) {
401 if ( qitem->isSelected() ) { 401 if ( qitem->isSelected() ) {
402 Incidence* inc = ((KOListViewItem *) qitem)->data(); 402 Incidence* inc = ((KOListViewItem *) qitem)->data();
403 if ( inc->typeID() != journalID ) { 403 if ( inc->typeID() != journalID ) {
404 if ( inc->typeID() == todoID ) { 404 if ( inc->typeID() == todoID ) {
405 if ( ((Todo*)inc)->hasDueDate() ) 405 if ( ((Todo*)inc)->hasDueDate() )
406 sel.append(((KOListViewItem *)qitem)); 406 sel.append(((KOListViewItem *)qitem));
407 } else 407 } else
408 sel.append(((KOListViewItem *)qitem)); 408 sel.append(((KOListViewItem *)qitem));
409 } 409 }
410 } 410 }
411 qitem = qitem->nextSibling(); 411 qitem = qitem->nextSibling();
412 } 412 }
413 int count = 0; 413 int count = 0;
414 KOListViewItem * item, *temp; 414 KOListViewItem * item, *temp;
415 item = sel.first(); 415 item = sel.first();
416 Incidence* inc; 416 Incidence* inc;
417 while ( item ) { 417 while ( item ) {
418 inc = item->data(); 418 inc = item->data();
419 ++count; 419 ++count;
420 if (kap.mAlarmButton->isChecked()) { 420 if (kap.mAlarmButton->isChecked()) {
421 if (inc->alarms().count() == 0) 421 if (inc->alarms().count() == 0)
422 inc->newAlarm(); 422 inc->newAlarm();
423 QPtrList<Alarm> alarms = inc->alarms(); 423 QPtrList<Alarm> alarms = inc->alarms();
424 Alarm *alarm; 424 Alarm *alarm;
425 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 425 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
426 alarm->setEnabled(true); 426 alarm->setEnabled(true);
427 int j = kap.mAlarmTimeEdit->value()* -60; 427 int j = kap.mAlarmTimeEdit->value()* -60;
428 if (kap.mAlarmIncrCombo->currentItem() == 1) 428 if (kap.mAlarmIncrCombo->currentItem() == 1)
429 j = j * 60; 429 j = j * 60;
430 else if (kap.mAlarmIncrCombo->currentItem() == 2) 430 else if (kap.mAlarmIncrCombo->currentItem() == 2)
431 j = j * (60 * 24); 431 j = j * (60 * 24);
432 alarm->setStartOffset( j ); 432 alarm->setStartOffset( j );
433 433
434 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { 434 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) {
435 alarm->setProcedureAlarm(kap.mAlarmProgram); 435 alarm->setProcedureAlarm(kap.mAlarmProgram);
436 } 436 }
437 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) 437 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn())
438 alarm->setAudioAlarm(kap.mAlarmSound); 438 alarm->setAudioAlarm(kap.mAlarmSound);
439 else 439 else
440 alarm->setType(Alarm::Invalid); 440 alarm->setType(Alarm::Invalid);
441 //alarm->setAudioAlarm("default"); 441 //alarm->setAudioAlarm("default");
442 // TODO: Deal with multiple alarms 442 // TODO: Deal with multiple alarms
443 break; // For now, stop after the first alarm 443 break; // For now, stop after the first alarm
444 } 444 }
445 } else { 445 } else {
446 Alarm* alarm = inc->alarms().first(); 446 Alarm* alarm = inc->alarms().first();
447 if ( alarm ) { 447 if ( alarm ) {
448 alarm->setEnabled(false); 448 alarm->setEnabled(false);
449 alarm->setType(Alarm::Invalid); 449 alarm->setType(Alarm::Invalid);
450 } 450 }
451 } 451 }
452 ListItemVisitor v(item, mStartDate ); 452 ListItemVisitor v(item, mStartDate );
453 inc->accept(v); 453 inc->accept(v);
454 item = sel.next(); 454 item = sel.next();
455 } 455 }
456 topLevelWidget()->setCaption( i18n("Changed alarm for %1 items").arg( count ) ); 456 topLevelWidget()->setCaption( i18n("Changed alarm for %1 items").arg( count ) );
457 qDebug("KO: Set alarm for %d items", count); 457 qDebug("KO: Set alarm for %d items", count);
458 calendar()->reInitAlarmSettings(); 458 calendar()->reInitAlarmSettings();
459 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 459 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
460} 460}
461void KOListView::setCategories( bool removeOld ) 461void KOListView::setCategories( bool removeOld )
462{ 462{
463 463
464 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 464 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
465 csd->setColorEnabled(); 465 csd->setColorEnabled();
466 if (! csd->exec()) { 466 if (! csd->exec()) {
467 delete csd; 467 delete csd;
468 return; 468 return;
469 } 469 }
470 QStringList catList = csd->selectedCategories(); 470 QStringList catList = csd->selectedCategories();
471 delete csd; 471 delete csd;
472 // if ( catList.count() == 0 ) 472 // if ( catList.count() == 0 )
473 // return; 473 // return;
474 //catList.sort(); 474 //catList.sort();
475 QString categoriesStr = catList.join(","); 475 QString categoriesStr = catList.join(",");
476 int i; 476 int i;
477 QStringList itemList; 477 QStringList itemList;
478 QPtrList<KOListViewItem> sel ; 478 QPtrList<KOListViewItem> sel ;
479 QListViewItem *qitem = mListView->firstChild (); 479 QListViewItem *qitem = mListView->firstChild ();
480 while ( qitem ) { 480 while ( qitem ) {
481 if ( qitem->isSelected() ) { 481 if ( qitem->isSelected() ) {
482 sel.append(((KOListViewItem *)qitem)); 482 sel.append(((KOListViewItem *)qitem));
483 } 483 }
484 qitem = qitem->nextSibling(); 484 qitem = qitem->nextSibling();
485 } 485 }
486 KOListViewItem * item, *temp; 486 KOListViewItem * item, *temp;
487 item = sel.first(); 487 item = sel.first();
488 if( item ) { 488 if( item ) {
489 Incidence* inc = item->data() ; 489 Incidence* inc = item->data() ;
490 bool setSub = false; 490 bool setSub = false;
491 if( inc->typeID() == todoID && sel.count() == 1 && inc->relations().count() > 0 ) { 491 if( inc->typeID() == todoID && sel.count() == 1 && inc->relations().count() > 0 ) {
492 int result = KMessageBox::warningYesNoCancel(this, 492 int result = KMessageBox::warningYesNoCancel(this,
493 i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ), 493 i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ),
494 i18n("Todo has subtodos"), 494 i18n("Todo has subtodos"),
495 i18n("Yes"), 495 i18n("Yes"),
496 i18n("No")); 496 i18n("No"));
497 if (result == KMessageBox::Cancel) item = 0; 497 if (result == KMessageBox::Cancel) item = 0;
498 if (result == KMessageBox::Yes) setSub = true; 498 if (result == KMessageBox::Yes) setSub = true;
499 } 499 }
500 while ( item ) { 500 while ( item ) {
501 inc = item->data(); 501 inc = item->data();
502 if ( removeOld ) { 502 if ( removeOld ) {
503 inc->setCategories( catList, setSub ); 503 inc->setCategories( catList, setSub );
504 } else { 504 } else {
505 inc->addCategories( catList, setSub ); 505 inc->addCategories( catList, setSub );
506 } 506 }
507 ListItemVisitor v(item, mStartDate ); 507 ListItemVisitor v(item, mStartDate );
508 inc->accept(v); 508 inc->accept(v);
509 item = sel.next(); 509 item = sel.next();
510 } 510 }
511 } 511 }
512 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 512 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
513} 513}
514 514
515void KOListView::beamSelected() 515void KOListView::beamSelected()
516{ 516{
517 int icount = 0; 517 int icount = 0;
518 QPtrList<Incidence> delSel ; 518 QPtrList<Incidence> delSel ;
519 QListViewItem *item = mListView->firstChild (); 519 QListViewItem *item = mListView->firstChild ();
520 while ( item ) { 520 while ( item ) {
521 if ( item->isSelected() ) { 521 if ( item->isSelected() ) {
522 delSel.append(((KOListViewItem *)item)->data()); 522 delSel.append(((KOListViewItem *)item)->data());
523 ++icount; 523 ++icount;
524 } 524 }
525 525
526 item = item->nextSibling(); 526 item = item->nextSibling();
527 } 527 }
528 if ( icount ) { 528 if ( icount ) {
529 emit beamIncidenceList( delSel ); 529 emit beamIncidenceList( delSel );
530 return; 530 return;
531 QString fn ; 531 QString fn ;
532 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs"; 532 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs";
533 QString mes; 533 QString mes;
534 bool createbup = true; 534 bool createbup = true;
535 if ( createbup ) { 535 if ( createbup ) {
536 QString description = "\n"; 536 QString description = "\n";
537 CalendarLocal* cal = new CalendarLocal(); 537 CalendarLocal* cal = new CalendarLocal();
538 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 538 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
539 Incidence *incidence = delSel.first(); 539 Incidence *incidence = delSel.first();
540 while ( incidence ) { 540 while ( incidence ) {
541 Incidence *in = incidence->clone(); 541 Incidence *in = incidence->clone();
542 description += in->summary() + "\n"; 542 description += in->summary() + "\n";
543 cal->addIncidence( in ); 543 cal->addIncidence( in );
544 incidence = delSel.next(); 544 incidence = delSel.next();
545 } 545 }
546 FileStorage storage( cal, fn, new VCalFormat ); 546 FileStorage storage( cal, fn, new VCalFormat );
547 storage.save(); 547 storage.save();
548 delete cal; 548 delete cal;
549 mes = i18n("KO/Pi: Ready for beaming"); 549 mes = i18n("KO/Pi: Ready for beaming");
550 topLevelWidget()->setCaption(mes); 550 topLevelWidget()->setCaption(mes);
551 551
552#ifndef DESKTOP_VERSION 552#ifndef DESKTOP_VERSION
553 Ir *ir = new Ir( this ); 553 Ir *ir = new Ir( this );
554 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 554 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
555 ir->send( fn, description, "text/x-vCalendar" ); 555 ir->send( fn, description, "text/x-vCalendar" );
556#endif 556#endif
557 } 557 }
558 } 558 }
559} 559}
560void KOListView::beamDone( Ir *ir ) 560void KOListView::beamDone( Ir *ir )
561{ 561{
562#ifndef DESKTOP_VERSION 562#ifndef DESKTOP_VERSION
563 delete ir; 563 delete ir;
564#endif 564#endif
565 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); 565 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done"));
566} 566}
567 567
568void KOListView::saveDescriptionToFile() 568void KOListView::saveDescriptionToFile()
569{ 569{
570 570
571 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 571 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
572 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), 572 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."),
573 i18n("Continue"), i18n("Cancel"), 0, 573 i18n("Continue"), i18n("Cancel"), 0,
574 0, 1 ); 574 0, 1 );
575 if ( result != 0 ) { 575 if ( result != 0 ) {
576 return; 576 return;
577 } 577 }
578 int icount = 0; 578 int icount = 0;
579 QPtrList<Incidence> delSel ; 579 QPtrList<Incidence> delSel ;
580 QListViewItem *item = mListView->firstChild (); 580 QListViewItem *item = mListView->firstChild ();
581 while ( item ) { 581 while ( item ) {
582 if ( item->isSelected() ) { 582 if ( item->isSelected() ) {
583 delSel.append(((KOListViewItem *)item)->data()); 583 delSel.append(((KOListViewItem *)item)->data());
584 ++icount; 584 ++icount;
585 } 585 }
586 586
587 item = item->nextSibling(); 587 item = item->nextSibling();
588 } 588 }
589 if ( icount ) { 589 if ( icount ) {
590 QString fn = KOPrefs::instance()->mLastSaveFile; 590 QString fn = KOPrefs::instance()->mLastSaveFile;
591 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 591 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
592 592
593 if ( fn == "" ) 593 if ( fn == "" )
594 return; 594 return;
595 QFileInfo info; 595 QFileInfo info;
596 info.setFile( fn ); 596 info.setFile( fn );
597 QString mes; 597 QString mes;
598 bool createbup = true; 598 bool createbup = true;
599 if ( info. exists() ) { 599 if ( info. exists() ) {
600 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 600 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
601 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 601 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
602 i18n("Overwrite!"), i18n("Cancel"), 0, 602 i18n("Overwrite!"), i18n("Cancel"), 0,
603 0, 1 ); 603 0, 1 );
604 if ( result != 0 ) { 604 if ( result != 0 ) {
605 createbup = false; 605 createbup = false;
606 } 606 }
607 } 607 }
608 if ( createbup ) { 608 if ( createbup ) {
609 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + 609 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
610 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); 610 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
611 Incidence *incidence = delSel.first(); 611 Incidence *incidence = delSel.first();
612 icount = 0; 612 icount = 0;
613 while ( incidence ) { 613 while ( incidence ) {
614 if ( incidence->typeID() == journalID ) { 614 if ( incidence->typeID() == journalID ) {
615 text += "\n************************************\n"; 615 text += "\n************************************\n";
616 text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); 616 text += i18n("Journal from: ") +incidence->dtStartDateStr( false );
617 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 617 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
618 text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); 618 text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
619 ++icount; 619 ++icount;
620 620
621 } else { 621 } else {
622 if ( !incidence->description().isEmpty() ) { 622 if ( !incidence->description().isEmpty() ) {
623 text += "\n************************************\n"; 623 text += "\n************************************\n";
624 if ( incidence->typeID() == todoID ) 624 if ( incidence->typeID() == todoID )
625 text += i18n("To-Do: "); 625 text += i18n("To-Do: ");
626 text += incidence->summary(); 626 text += incidence->summary();
627 if ( incidence->hasStartDate() ) 627 if ( incidence->hasStartDate() )
628 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); 628 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
629 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 629 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
630 if ( !incidence->location().isEmpty() ) 630 if ( !incidence->location().isEmpty() )
631 text += "\n" +i18n("Location: ") + incidence->location(); 631 text += "\n" +i18n("Location: ") + incidence->location();
632 text += "\n" + i18n("Description: ") + "\n" + incidence->description(); 632 text += "\n" + i18n("Description: ") + "\n" + incidence->description();
633 ++icount; 633 ++icount;
634 634
635 } 635 }
636 } 636 }
637 incidence = delSel.next(); 637 incidence = delSel.next();
638 } 638 }
639 QFile file( fn ); 639 QFile file( fn );
640 if (!file.open( IO_WriteOnly ) ) { 640 if (!file.open( IO_WriteOnly ) ) {
641 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); 641 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") );
642 return; 642 return;
643 } 643 }
644 QTextStream ts( &file ); 644 QTextStream ts( &file );
645 ts << text; 645 ts << text;
646 file.close(); 646 file.close();
647 //qDebug("%s ", text.latin1()); 647 //qDebug("%s ", text.latin1());
648 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); 648 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
649 KOPrefs::instance()->mLastSaveFile = fn; 649 KOPrefs::instance()->mLastSaveFile = fn;
650 topLevelWidget()->setCaption(mes); 650 topLevelWidget()->setCaption(mes);
651 } 651 }
652 } 652 }
653} 653}
654void KOListView::saveToFileVCS() 654void KOListView::saveToFileVCS()
655{ 655{
656 writeToFile( false ); 656 writeToFile( false );
657} 657}
658void KOListView::saveToFile() 658void KOListView::saveToFile()
659{ 659{
660 writeToFile( true ); 660 writeToFile( true );
661} 661}
662void KOListView::writeToFile( bool iCal ) 662void KOListView::writeToFile( bool iCal )
663{ 663{
664 664
665 int icount = 0; 665 int icount = 0;
666 QPtrList<Incidence> delSel ; 666 QPtrList<Incidence> delSel ;
667 QListViewItem *item = mListView->firstChild (); 667 QListViewItem *item = mListView->firstChild ();
668 bool journal = iCal; // warn only for vCal 668 bool journal = iCal; // warn only for vCal
669 bool addSubTodos = false;
670 bool askSubTodos = true;
669 while ( item ) { 671 while ( item ) {
670 if ( item->isSelected() ) { 672 if ( item->isSelected() ) {
671 if ( !journal ) 673 if ( !journal )
672 if ( ((KOListViewItem *)item)->data()->typeID() == journalID ) 674 if ( ((KOListViewItem *)item)->data()->typeID() == journalID )
673 journal = true; 675 journal = true;
674 delSel.append(((KOListViewItem *)item)->data()); 676 Incidence* inc = ((KOListViewItem *)item)->data();
677 if ( addSubTodos ) {
678 if ( delSel.findRef( inc ) == -1 )
679 delSel.append( inc );
680 } else
681 delSel.append(inc);
682 if ( inc->typeID() == todoID ) {
683 Todo * todo = (Todo*) inc;
684 if ( todo->relations().count() ) {
685 if ( askSubTodos ) {
686 int result = KMessageBox::warningYesNoCancel(this,
687 i18n("A selected todo has subtodos!\nDo you want to export\nall subtodos of all\nselected todos as well?"),
688 i18n("Todo has subtodos"),
689 i18n("Yes"),
690 i18n("No"));
691 if ( result == KMessageBox::Cancel ) {
692 return;
693 }
694 if (result == KMessageBox::Yes)
695 addSubTodos = true;
696 askSubTodos = false;
697 }
698 if ( addSubTodos ) {
699 inc->addRelationsToList( &delSel );
700 }
701 }
702 }
675 ++icount; 703 ++icount;
676 } 704 }
677
678 item = item->nextSibling(); 705 item = item->nextSibling();
679 } 706 }
680 if ( !iCal && journal ) { 707 if ( !iCal && journal ) {
681 int result = KMessageBox::warningContinueCancel(this, 708 int result = KMessageBox::warningContinueCancel(this,
682 i18n("The journal entries can not be\nexported to a vCalendar file."), 709 i18n("The journal entries can not be\nexported to a vCalendar file."),
683 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 710 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
684 true); 711 true);
685 if (result != KMessageBox::Continue) return; 712 if (result != KMessageBox::Continue) return;
686 } 713 }
687 if ( icount ) { 714 if ( icount ) {
688 QString fn = KOPrefs::instance()->mLastSaveFile; 715 QString fn = KOPrefs::instance()->mLastSaveFile;
689 QString extension; 716 QString extension;
690 if ( iCal ) { 717 if ( iCal ) {
691 if ( fn.right( 4 ).lower() == ".vcs" ) { 718 if ( fn.right( 4 ).lower() == ".vcs" ) {
692 fn = fn.left( fn.length() -3) + "ics"; 719 fn = fn.left( fn.length() -3) + "ics";
693 } 720 }
694 } else { 721 } else {
695 if ( fn.right( 4 ).lower() == ".ics" ) { 722 if ( fn.right( 4 ).lower() == ".ics" ) {
696 fn = fn.left( fn.length() -3) + "vcs"; 723 fn = fn.left( fn.length() -3) + "vcs";
697 } 724 }
698 } 725 }
699 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 726 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
700 727
701 if ( fn == "" ) 728 if ( fn == "" )
702 return; 729 return;
703 QFileInfo info; 730 QFileInfo info;
704 info.setFile( fn ); 731 info.setFile( fn );
705 QString mes; 732 QString mes;
706 bool createbup = true; 733 bool createbup = true;
707 if ( info. exists() ) { 734 if ( info. exists() ) {
708 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 735 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
709 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 736 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
710 i18n("Overwrite!"), i18n("Cancel"), 0, 737 i18n("Overwrite!"), i18n("Cancel"), 0,
711 0, 1 ); 738 0, 1 );
712 if ( result != 0 ) { 739 if ( result != 0 ) {
713 createbup = false; 740 createbup = false;
714 } 741 }
715 } 742 }
716 if ( createbup ) { 743 if ( createbup ) {
717 CalendarLocal cal; 744 CalendarLocal cal;
718 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 745 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
719 Incidence *incidence = delSel.first(); 746 Incidence *incidence = delSel.first();
720 while ( incidence ) { 747 while ( incidence ) {
721 cal.addIncidence( incidence->clone() ); 748 cal.addIncidence( incidence->clone() );
722 incidence = delSel.next(); 749 incidence = delSel.next();
723 } 750 }
724 if ( iCal ) { 751 if ( iCal ) {
725 ICalFormat format; 752 ICalFormat format;
726 format.save( &cal, fn ); 753 format.save( &cal, fn );
727 } else { 754 } else {
728 755
729 VCalFormat format; 756 VCalFormat format;
730 format.save( &cal, fn ); 757 format.save( &cal, fn );
731 } 758 }
732 mes = i18n("KO/Pi:Saved %1").arg(fn ); 759 mes = i18n("KO/Pi:Saved %1").arg(fn );
733 KOPrefs::instance()->mLastSaveFile = fn; 760 KOPrefs::instance()->mLastSaveFile = fn;
734 topLevelWidget()->setCaption(mes); 761 topLevelWidget()->setCaption(mes);
735 } 762 }
736 } 763 }
737 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 764 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
738} 765}
739void KOListView::hideAll() 766void KOListView::hideAll()
740{ 767{
741 QPtrList<QListViewItem> delSel ; 768 QPtrList<QListViewItem> delSel ;
742 QListViewItem *item = mListView->firstChild (); 769 QListViewItem *item = mListView->firstChild ();
743 while ( item ) { 770 while ( item ) {
744 if ( item->isSelected() ) { 771 if ( item->isSelected() ) {
745 delSel.append(item); 772 delSel.append(item);
746 } 773 }
747 item = item->nextSibling(); 774 item = item->nextSibling();
748 } 775 }
749 item = delSel.first() ; 776 item = delSel.first() ;
750 while ( item ) { 777 while ( item ) {
751 QListViewItem * del = item; 778 QListViewItem * del = item;
752 item = delSel.next(); 779 item = delSel.next();
753 delete del; 780 delete del;
754 } 781 }
755} 782}
756void KOListView::printList() 783void KOListView::printList()
757{ 784{
758 mListView->printList(); 785 mListView->printList();
759} 786}
760void KOListView::deleteAll() 787void KOListView::deleteAll()
761{ 788{
762 int icount = 0; 789 int icount = 0;
763 QPtrList<Incidence> delSel ; 790 QPtrList<Incidence> delSel ;
764 QListViewItem *item = mListView->firstChild (); 791 QListViewItem *item = mListView->firstChild ();
765 while ( item ) { 792 while ( item ) {
766 if ( item->isSelected() ) { 793 if ( item->isSelected() ) {
767 delSel.append(((KOListViewItem *)item)->data()); 794 delSel.append(((KOListViewItem *)item)->data());
768 ++icount; 795 ++icount;
769 } 796 }
770 797
771 item = item->nextSibling(); 798 item = item->nextSibling();
772 } 799 }
773 if ( icount ) { 800 if ( icount ) {
774 Incidence *incidence = delSel.first(); 801 Incidence *incidence = delSel.first();
775 Incidence *toDelete; 802 Incidence *toDelete;
776 KOPrefs *p = KOPrefs::instance(); 803 KOPrefs *p = KOPrefs::instance();
777 bool confirm = p->mConfirm; 804 bool confirm = p->mConfirm;
778 QString mess; 805 QString mess;
779 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); 806 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
780 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { 807 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
781 p->mConfirm = false; 808 p->mConfirm = false;
782 int delCounter = 0; 809 int delCounter = 0;
783 QDialog dia ( this, "p-dialog", true ); 810 QDialog dia ( this, "p-dialog", true );
784 QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); 811 QLabel lab (i18n("Close dialog to abort deletion!"), &dia );
785 QVBoxLayout lay( &dia ); 812 QVBoxLayout lay( &dia );
786 lay.setMargin(7); 813 lay.setMargin(7);
787 lay.setSpacing(7); 814 lay.setSpacing(7);
788 lay.addWidget( &lab); 815 lay.addWidget( &lab);
789 QProgressBar bar( icount, &dia ); 816 QProgressBar bar( icount, &dia );
790 lay.addWidget( &bar); 817 lay.addWidget( &bar);
791 int w = 220; 818 int w = 220;
792 int h = 50; 819 int h = 50;
793 int dw = QApplication::desktop()->width(); 820 int dw = QApplication::desktop()->width();
794 int dh = QApplication::desktop()->height(); 821 int dh = QApplication::desktop()->height();
795 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 822 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
796 //dia.resize( 240,50 ); 823 //dia.resize( 240,50 );
797 dia.show(); 824 dia.show();
798 825
799 while ( incidence ) { 826 while ( incidence ) {
800 bar.setProgress( delCounter ); 827 bar.setProgress( delCounter );
801 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); 828 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
802 dia.setCaption( mess ); 829 dia.setCaption( mess );
803 qApp->processEvents(); 830 qApp->processEvents();
804 toDelete = (incidence); 831 toDelete = (incidence);
805 incidence = delSel.next(); 832 incidence = delSel.next();
806 emit deleteIncidenceSignal(toDelete ); 833 emit deleteIncidenceSignal(toDelete );
807 if ( dia.result() != 0 ) 834 if ( dia.result() != 0 )
808 break; 835 break;
809 836
810 } 837 }
811 mess = mess.sprintf( i18n("%d items remaining in list."), count() ); 838 mess = mess.sprintf( i18n("%d items remaining in list."), count() );
812 topLevelWidget ()->setCaption( mess ); 839 topLevelWidget ()->setCaption( mess );
813 p->mConfirm = confirm; 840 p->mConfirm = confirm;
814 } 841 }
815 } 842 }
816 843
817 844
818} 845}
819int KOListView::maxDatesHint() 846int KOListView::maxDatesHint()
820{ 847{
821 return 0; 848 return 0;
822} 849}
823 850
824int KOListView::currentDateCount() 851int KOListView::currentDateCount()
825{ 852{
826 return 0; 853 return 0;
827} 854}
828 855
829QPtrList<Incidence> KOListView::selectedIncidences() 856QPtrList<Incidence> KOListView::selectedIncidences()
830{ 857{
831 QPtrList<Incidence> eventList; 858 QPtrList<Incidence> eventList;
832 QListViewItem *item = mListView->firstChild (); 859 QListViewItem *item = mListView->firstChild ();
833 while ( item ) { 860 while ( item ) {
834 if ( item->isSelected() ) { 861 if ( item->isSelected() ) {
835 eventList.append(((KOListViewItem *)item)->data()); 862 eventList.append(((KOListViewItem *)item)->data());
836 } 863 }
837 864
838 item = item->nextSibling(); 865 item = item->nextSibling();
839 } 866 }
840 867
841 // // QListViewItem *item = mListView->selectedItem(); 868 // // QListViewItem *item = mListView->selectedItem();
842 //if (item) eventList.append(((KOListViewItem *)item)->data()); 869 //if (item) eventList.append(((KOListViewItem *)item)->data());
843 870
844 return eventList; 871 return eventList;
845} 872}
846 873
847DateList KOListView::selectedDates() 874DateList KOListView::selectedDates()
848{ 875{
849 DateList eventList; 876 DateList eventList;
850 return eventList; 877 return eventList;
851} 878}
852 879
853void KOListView::showDates(bool show) 880void KOListView::showDates(bool show)
854{ 881{
855 // Shouldn't we set it to a value greater 0? When showDates is called with 882 // Shouldn't we set it to a value greater 0? When showDates is called with
856 // show == true at first, then the columnwidths are set to zero. 883 // show == true at first, then the columnwidths are set to zero.
857 static int oldColWidth1 = 0; 884 static int oldColWidth1 = 0;
858 static int oldColWidth3 = 0; 885 static int oldColWidth3 = 0;
859 886
860 if (!show) { 887 if (!show) {
861 oldColWidth1 = mListView->columnWidth(1); 888 oldColWidth1 = mListView->columnWidth(1);
862 oldColWidth3 = mListView->columnWidth(3); 889 oldColWidth3 = mListView->columnWidth(3);
863 mListView->setColumnWidth(1, 0); 890 mListView->setColumnWidth(1, 0);
864 mListView->setColumnWidth(3, 0); 891 mListView->setColumnWidth(3, 0);
865 } else { 892 } else {
866 mListView->setColumnWidth(1, oldColWidth1); 893 mListView->setColumnWidth(1, oldColWidth1);
867 mListView->setColumnWidth(3, oldColWidth3); 894 mListView->setColumnWidth(3, oldColWidth3);
868 } 895 }
869 mListView->repaint(); 896 mListView->repaint();
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 59bf1a2..ef2fc1c 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -1,464 +1,471 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qgroupbox.h> 27#include <qgroupbox.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlistview.h> 29#include <qlistview.h>
30#include <qwhatsthis.h> 30#include <qwhatsthis.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36 36
37#include <libkdepim/kdateedit.h> 37#include <libkdepim/kdateedit.h>
38 38
39#include "koglobals.h" 39#include "koglobals.h"
40#include "koprefs.h" 40#include "koprefs.h"
41#include "klineedit.h" 41#include "klineedit.h"
42 42
43#include "calendarview.h" 43#include "calendarview.h"
44#include "koviewmanager.h" 44#include "koviewmanager.h"
45#include "searchdialog.h" 45#include "searchdialog.h"
46 46
47SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) 47SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
48 : QVBox( 0 ) 48 : QVBox( 0 )
49 49
50{ 50{
51 mCalendar = calendar; 51 mCalendar = calendar;
52 QFrame *topFrame = new QFrame( this ) ;//plainPage(); 52 QFrame *topFrame = new QFrame( this ) ;//plainPage();
53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); 53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
54 54
55 // Search expression 55 // Search expression
56 QHBoxLayout *subLayout = new QHBoxLayout(); 56 QHBoxLayout *subLayout = new QHBoxLayout();
57 layout->addLayout(subLayout); 57 layout->addLayout(subLayout);
58 /*
58 searchLabel = new QLabel(topFrame); 59 searchLabel = new QLabel(topFrame);
59 searchLabel->setText(i18n("Search for:")); 60 searchLabel->setText(i18n("Search for:"));
60 subLayout->addWidget(searchLabel); 61 subLayout->addWidget(searchLabel);
61 62 */
62 searchEdit = new KLineEdit(topFrame); 63 QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame );
63 subLayout->addWidget(searchEdit);
64 QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame );
65 //OkButton->setDefault( true ); 64 //OkButton->setDefault( true );
66 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); 65 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
67 subLayout->addWidget(OkButton); 66 subLayout->addWidget(OkButton);
67 searchEdit = new KLineEdit(topFrame);
68 subLayout->addWidget(searchEdit);
69
70 mAddItems = new QCheckBox(i18n("Add items"),topFrame);
71 subLayout->addWidget(mAddItems);
72
68 searchEdit->setText("*"); // Find all events by default 73 searchEdit->setText("*"); // Find all events by default
69 searchEdit->setFocus(); 74 searchEdit->setFocus();
70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 75 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 76 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
72 // Subjects to search 77 // Subjects to search
73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 78 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
74 // topFrame); 79 // topFrame);
75 80
76 QHBox *incidenceGroup = new QHBox( topFrame ); 81 QHBox *incidenceGroup = new QHBox( topFrame );
77 layout->addWidget(incidenceGroup); 82 layout->addWidget(incidenceGroup);
78 83
79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 84 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
80 //mSearchEvent->setChecked(true); 85 //mSearchEvent->setChecked(true);
81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 86 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 87 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
83 88
84 QHBox *subjectGroup = new QHBox( topFrame ); 89 QHBox *subjectGroup = new QHBox( topFrame );
85 layout->addWidget(subjectGroup); 90 layout->addWidget(subjectGroup);
86 91
87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 92 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
88 mSummaryCheck->setChecked(true); 93 mSummaryCheck->setChecked(true);
89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 94 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 95 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
91 96
92 QHBox *attendeeGroup = new QHBox( topFrame ); 97 QHBox *attendeeGroup = new QHBox( topFrame );
93 layout->addWidget(attendeeGroup ); 98 layout->addWidget(attendeeGroup );
94 new QLabel( i18n("Attendee:"),attendeeGroup ); 99 new QLabel( i18n("Attendee:"),attendeeGroup );
95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 100 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 101 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
97 // Date range 102 // Date range
98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 103 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
99 // topFrame); 104 // topFrame);
100 // layout->addWidget(rangeGroup); 105 // layout->addWidget(rangeGroup);
101 106
102 QWidget *rangeWidget = new QWidget(topFrame); 107 QWidget *rangeWidget = new QWidget(topFrame);
103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 108 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 109 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
105 mStartDate = new KDateEdit(rangeWidget); 110 mStartDate = new KDateEdit(rangeWidget);
106 rangeLayout->addWidget(mStartDate); 111 rangeLayout->addWidget(mStartDate);
107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 112 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
108 mEndDate = new KDateEdit(rangeWidget); 113 mEndDate = new KDateEdit(rangeWidget);
109 mEndDate->setDate(QDate::currentDate().addDays(365)); 114 mEndDate->setDate(QDate::currentDate().addDays(365));
110 rangeLayout->addWidget(mEndDate); 115 rangeLayout->addWidget(mEndDate);
111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 116 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
112 rangeLayout->addWidget( (QWidget*)wt ); 117 rangeLayout->addWidget( (QWidget*)wt );
113 layout->addWidget(rangeWidget); 118 layout->addWidget(rangeWidget);
114 // Results list view 119 // Results list view
115 listView = new KOListView(mCalendar,topFrame); 120 listView = new KOListView(mCalendar,topFrame);
116 layout->addWidget(listView); 121 layout->addWidget(listView);
117 //layout->setStretchFactor( listView, 333 ); 122 //layout->setStretchFactor( listView, 333 );
118 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); 123 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
119 //listView->setMaximumHeight( 50 ); 124 //listView->setMaximumHeight( 50 );
120 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 125 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
121 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 126 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
122 127
123 setCaption( i18n("KO/Pi Find: ")); 128 setCaption( i18n("KO/Pi Find: "));
124#ifdef DESKTOP_VERSION 129#ifdef DESKTOP_VERSION
125 OkButton = new QPushButton( i18n("Close"), this ); 130 OkButton = new QPushButton( i18n("Close"), this );
126 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 131 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
127#endif 132#endif
128} 133}
129 134
130SearchDialog::~SearchDialog() 135SearchDialog::~SearchDialog()
131{ 136{
132 137
133} 138}
134void SearchDialog::raiseAndSelect() 139void SearchDialog::raiseAndSelect()
135{ 140{
136 141
137 static int currentState = 0; 142 static int currentState = 0;
138 143
139 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) 144 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() )
140 currentState = 0; 145 currentState = 0;
141 int newState = 0; 146 int newState = 0;
142 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 147 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
143 newState = VIEW_J_VIEW; 148 newState = VIEW_J_VIEW;
144 } 149 }
145 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 150 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
146 newState = VIEW_T_VIEW; 151 newState = VIEW_T_VIEW;
147 } 152 }
148 else { 153 else {
149 newState = VIEW_A_VIEW; 154 newState = VIEW_A_VIEW;
150 } 155 }
151 if ( newState != currentState ) { 156 if ( newState != currentState ) {
152 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 157 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
153 if ( ! mSearchJournal->isChecked() ) { 158 if ( ! mSearchJournal->isChecked() ) {
154 mSearchJournal->setChecked( true ); 159 mSearchJournal->setChecked( true );
155 mSearchTodo->setChecked( false ); 160 mSearchTodo->setChecked( false );
156 mSearchEvent->setChecked( false ); 161 mSearchEvent->setChecked( false );
157 } 162 }
158 } 163 }
159 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 164 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
160 if ( ! mSearchTodo->isChecked() ) { 165 if ( ! mSearchTodo->isChecked() ) {
161 mSearchTodo->setChecked( true ); 166 mSearchTodo->setChecked( true );
162 mSearchJournal->setChecked( false ); 167 mSearchJournal->setChecked( false );
163 mSearchEvent->setChecked( false ); 168 mSearchEvent->setChecked( false );
164 } 169 }
165 } 170 }
166 else { 171 else {
167 if ( ! mSearchEvent->isChecked() ) { 172 if ( ! mSearchEvent->isChecked() ) {
168 mSearchEvent->setChecked( true ); 173 mSearchEvent->setChecked( true );
169 mSearchJournal->setChecked( false ); 174 mSearchJournal->setChecked( false );
170 mSearchTodo->setChecked( false ); 175 mSearchTodo->setChecked( false );
171 } 176 }
172 } 177 }
173 } 178 }
174 currentState = newState; 179 currentState = newState;
175 raise(); 180 raise();
176} 181}
177void SearchDialog::setFocusToList() 182void SearchDialog::setFocusToList()
178{ 183{
179 listView->resetFocus(); 184 listView->resetFocus();
180} 185}
181void SearchDialog::accept() 186void SearchDialog::accept()
182{ 187{
183 doSearch(); 188 doSearch();
184} 189}
185void SearchDialog::updateList() 190void SearchDialog::updateList()
186{ 191{
187 //listView->updateList(); 192 //listView->updateList();
188 if ( isVisible() ) { 193 if ( isVisible() ) {
189 updateView(); 194 updateView();
190 //qDebug("SearchDialog::updated "); 195 //qDebug("SearchDialog::updated ");
191 } 196 }
192 else { 197 else {
193 listView->clear(); 198 listView->clear();
194 //qDebug("SearchDialog::cleared "); 199 //qDebug("SearchDialog::cleared ");
195 200
196 } 201 }
197} 202}
198void SearchDialog::searchTextChanged( const QString &_text ) 203void SearchDialog::searchTextChanged( const QString &_text )
199{ 204{
200#if 0 205#if 0
201 enableButton( KDialogBase::User1, !_text.isEmpty() ); 206 enableButton( KDialogBase::User1, !_text.isEmpty() );
202#endif 207#endif
203} 208}
204 209
205void SearchDialog::doSearch() 210void SearchDialog::doSearch()
206{ 211{
207 QRegExp re; 212 QRegExp re;
208 213
209 re.setWildcard(true); // most people understand these better. 214 re.setWildcard(true); // most people understand these better.
210 re.setCaseSensitive(false); 215 re.setCaseSensitive(false);
211 QString st = searchEdit->text(); 216 QString st = searchEdit->text();
212 if ( st.right(1) != "*") 217 if ( st.right(1) != "*")
213 st += "*"; 218 st += "*";
214 re.setPattern(st); 219 re.setPattern(st);
215 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { 220 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
216 KMessageBox::sorry(this, 221 KMessageBox::sorry(this,
217 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); 222 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
218 return; 223 return;
219 } 224 }
220 if (!re.isValid() ) { 225 if (!re.isValid() ) {
221 KMessageBox::sorry(this, 226 KMessageBox::sorry(this,
222 i18n("Invalid search expression,\ncannot perform " 227 i18n("Invalid search expression,\ncannot perform "
223 "the search.\nPlease enter a search expression\n" 228 "the search.\nPlease enter a search expression\n"
224 "using the wildcard characters\n '*' and '?'" 229 "using the wildcard characters\n '*' and '?'"
225 "where needed.")); 230 "where needed."));
226 return; 231 return;
227 } 232 }
228 search(re); 233 search(re);
229 listView->setStartDate( mStartDate->date() ); 234 listView->setStartDate( mStartDate->date() );
230 listView->showEvents(mMatchedEvents); 235 listView->showEvents(mMatchedEvents);
231 listView->addTodos(mMatchedTodos); 236 listView->addTodos(mMatchedTodos);
232 listView->addJournals(mMatchedJournals); 237 listView->addJournals(mMatchedJournals);
233 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 238 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
234 setCaption(i18n("No items found. Use '*' and '?' where needed.")); 239 setCaption(i18n("No items found. Use '*' and '?' where needed."));
235 } else { 240 } else {
236 QString mess; 241 QString mess;
237 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 242 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
238 setCaption( i18n("KO/Pi Find: ") + mess); 243 setCaption( i18n("KO/Pi Find: ") + mess);
239 244
240 } 245 }
241 searchEdit->setFocus(); 246 searchEdit->setFocus();
242} 247}
243void SearchDialog::updateConfig() 248void SearchDialog::updateConfig()
244{ 249{
245 listView->updateConfig(); 250 listView->updateConfig();
246} 251}
247void SearchDialog::updateView() 252void SearchDialog::updateView()
248{ 253{
249 //qDebug("SearchDialog::updateView() %d ", isVisible()); 254 //qDebug("SearchDialog::updateView() %d ", isVisible());
250 QRegExp re; 255 QRegExp re;
251 re.setWildcard(true); // most people understand these better. 256 re.setWildcard(true); // most people understand these better.
252 re.setCaseSensitive(false); 257 re.setCaseSensitive(false);
253 QString st = searchEdit->text(); 258 QString st = searchEdit->text();
254 if ( st.right(1) != "*") 259 if ( st.right(1) != "*")
255 st += "*"; 260 st += "*";
256 re.setPattern(st); 261 re.setPattern(st);
257 if (re.isValid()) { 262 if (re.isValid()) {
258 search(re); 263 search(re);
259 } else { 264 } else {
260 mMatchedEvents.clear(); 265 mMatchedEvents.clear();
261 mMatchedTodos.clear(); 266 mMatchedTodos.clear();
262 mMatchedJournals.clear(); 267 mMatchedJournals.clear();
263 } 268 }
264 listView->setStartDate( mStartDate->date() ); 269 listView->setStartDate( mStartDate->date() );
265 listView->showEvents(mMatchedEvents); 270 listView->showEvents(mMatchedEvents);
266 listView->addTodos(mMatchedTodos); 271 listView->addTodos(mMatchedTodos);
267 listView->addJournals(mMatchedJournals); 272 listView->addJournals(mMatchedJournals);
268} 273}
269 274
270void SearchDialog::search(const QRegExp &re) 275void SearchDialog::search(const QRegExp &re)
271{ 276{
272 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 277 QPtrList<Event> events = mCalendar->events( mStartDate->date(),
273 mEndDate->date(), 278 mEndDate->date(),
274 false /*mInclusiveCheck->isChecked()*/ ); 279 false /*mInclusiveCheck->isChecked()*/ );
275 280 if ( !mAddItems->isChecked() )
276 mMatchedEvents.clear(); 281 mMatchedEvents.clear();
277 if ( mSearchEvent->isChecked() ) { 282 if ( mSearchEvent->isChecked() ) {
278 Event *ev; 283 Event *ev;
279 for(ev=events.first();ev;ev=events.next()) { 284 for(ev=events.first();ev;ev=events.next()) {
280 if (mSummaryCheck->isChecked()) { 285 if (mSummaryCheck->isChecked()) {
281#if QT_VERSION >= 0x030000 286#if QT_VERSION >= 0x030000
282 if (re.search(ev->summary()) != -1) 287 if (re.search(ev->summary()) != -1)
283#else 288#else
284 if (re.match(ev->summary()) != -1) 289 if (re.match(ev->summary()) != -1)
285#endif 290#endif
286 { 291 {
287 mMatchedEvents.append(ev); 292 mMatchedEvents.append(ev);
288 continue; 293 continue;
289 } 294 }
290#if QT_VERSION >= 0x030000 295#if QT_VERSION >= 0x030000
291 if (re.search(ev->location()) != -1) 296 if (re.search(ev->location()) != -1)
292#else 297#else
293 if (re.match(ev->location()) != -1) 298 if (re.match(ev->location()) != -1)
294#endif 299#endif
295 { 300 {
296 mMatchedEvents.append(ev); 301 mMatchedEvents.append(ev);
297 continue; 302 continue;
298 } 303 }
299 } 304 }
300 if (mDescriptionCheck->isChecked()) { 305 if (mDescriptionCheck->isChecked()) {
301#if QT_VERSION >= 0x030000 306#if QT_VERSION >= 0x030000
302 if (re.search(ev->description()) != -1) 307 if (re.search(ev->description()) != -1)
303#else 308#else
304 if (re.match(ev->description()) != -1) 309 if (re.match(ev->description()) != -1)
305#endif 310#endif
306 { 311 {
307 mMatchedEvents.append(ev); 312 mMatchedEvents.append(ev);
308 continue; 313 continue;
309 } 314 }
310 } 315 }
311 if (mCategoryCheck->isChecked()) { 316 if (mCategoryCheck->isChecked()) {
312#if QT_VERSION >= 0x030000 317#if QT_VERSION >= 0x030000
313 if (re.search(ev->categoriesStr()) != -1) 318 if (re.search(ev->categoriesStr()) != -1)
314#else 319#else
315 if (re.match(ev->categoriesStr()) != -1) 320 if (re.match(ev->categoriesStr()) != -1)
316#endif 321#endif
317 { 322 {
318 mMatchedEvents.append(ev); 323 mMatchedEvents.append(ev);
319 continue; 324 continue;
320 } 325 }
321 } 326 }
322 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 327 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
323 QPtrList<Attendee> tmpAList = ev->attendees(); 328 QPtrList<Attendee> tmpAList = ev->attendees();
324 Attendee *a; 329 Attendee *a;
325 for (a = tmpAList.first(); a; a = tmpAList.next()) { 330 for (a = tmpAList.first(); a; a = tmpAList.next()) {
326 if (mSearchAName->isChecked()) { 331 if (mSearchAName->isChecked()) {
327#if QT_VERSION >= 0x030000 332#if QT_VERSION >= 0x030000
328 if (re.search(a->name()) != -1) 333 if (re.search(a->name()) != -1)
329#else 334#else
330 if (re.match(a->name()) != -1) 335 if (re.match(a->name()) != -1)
331#endif 336#endif
332 { 337 {
333 mMatchedEvents.append(ev); 338 mMatchedEvents.append(ev);
334 break; 339 break;
335 } 340 }
336 } 341 }
337 if (mSearchAEmail->isChecked()) { 342 if (mSearchAEmail->isChecked()) {
338#if QT_VERSION >= 0x030000 343#if QT_VERSION >= 0x030000
339 if (re.search(a->email()) != -1) 344 if (re.search(a->email()) != -1)
340#else 345#else
341 if (re.match(a->email()) != -1) 346 if (re.match(a->email()) != -1)
342#endif 347#endif
343 { 348 {
344 mMatchedEvents.append(ev); 349 mMatchedEvents.append(ev);
345 break; 350 break;
346 } 351 }
347 } 352 }
348 } 353 }
349 } 354 }
350 } 355 }
351 } 356 }
352 QPtrList<Todo> todos = mCalendar->todos( ); 357 QPtrList<Todo> todos = mCalendar->todos( );
353 mMatchedTodos.clear(); 358 if ( !mAddItems->isChecked() )
359 mMatchedTodos.clear();
354 if ( mSearchTodo->isChecked() ) { 360 if ( mSearchTodo->isChecked() ) {
355 Todo *tod; 361 Todo *tod;
356 for(tod=todos.first();tod;tod=todos.next()) { 362 for(tod=todos.first();tod;tod=todos.next()) {
357 if (mSummaryCheck->isChecked()) { 363 if (mSummaryCheck->isChecked()) {
358#if QT_VERSION >= 0x030000 364#if QT_VERSION >= 0x030000
359 if (re.search(tod->summary()) != -1) 365 if (re.search(tod->summary()) != -1)
360#else 366#else
361 if (re.match(tod->summary()) != -1) 367 if (re.match(tod->summary()) != -1)
362#endif 368#endif
363 { 369 {
364 mMatchedTodos.append(tod); 370 mMatchedTodos.append(tod);
365 continue; 371 continue;
366 } 372 }
367 } 373 }
368 if (mDescriptionCheck->isChecked()) { 374 if (mDescriptionCheck->isChecked()) {
369#if QT_VERSION >= 0x030000 375#if QT_VERSION >= 0x030000
370 if (re.search(tod->description()) != -1) 376 if (re.search(tod->description()) != -1)
371#else 377#else
372 if (re.match(tod->description()) != -1) 378 if (re.match(tod->description()) != -1)
373#endif 379#endif
374 { 380 {
375 mMatchedTodos.append(tod); 381 mMatchedTodos.append(tod);
376 continue; 382 continue;
377 } 383 }
378 } 384 }
379 if (mCategoryCheck->isChecked()) { 385 if (mCategoryCheck->isChecked()) {
380#if QT_VERSION >= 0x030000 386#if QT_VERSION >= 0x030000
381 if (re.search(tod->categoriesStr()) != -1) 387 if (re.search(tod->categoriesStr()) != -1)
382#else 388#else
383 if (re.match(tod->categoriesStr()) != -1) 389 if (re.match(tod->categoriesStr()) != -1)
384#endif 390#endif
385 { 391 {
386 mMatchedTodos.append(tod); 392 mMatchedTodos.append(tod);
387 continue; 393 continue;
388 } 394 }
389 } 395 }
390 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 396 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
391 QPtrList<Attendee> tmpAList = tod->attendees(); 397 QPtrList<Attendee> tmpAList = tod->attendees();
392 Attendee *a; 398 Attendee *a;
393 for (a = tmpAList.first(); a; a = tmpAList.next()) { 399 for (a = tmpAList.first(); a; a = tmpAList.next()) {
394 if (mSearchAName->isChecked()) { 400 if (mSearchAName->isChecked()) {
395#if QT_VERSION >= 0x030000 401#if QT_VERSION >= 0x030000
396 if (re.search(a->name()) != -1) 402 if (re.search(a->name()) != -1)
397#else 403#else
398 if (re.match(a->name()) != -1) 404 if (re.match(a->name()) != -1)
399#endif 405#endif
400 { 406 {
401 mMatchedTodos.append(tod); 407 mMatchedTodos.append(tod);
402 break; 408 break;
403 } 409 }
404 } 410 }
405 if (mSearchAEmail->isChecked()) { 411 if (mSearchAEmail->isChecked()) {
406#if QT_VERSION >= 0x030000 412#if QT_VERSION >= 0x030000
407 if (re.search(a->email()) != -1) 413 if (re.search(a->email()) != -1)
408#else 414#else
409 if (re.match(a->email()) != -1) 415 if (re.match(a->email()) != -1)
410#endif 416#endif
411 { 417 {
412 mMatchedTodos.append(tod); 418 mMatchedTodos.append(tod);
413 break; 419 break;
414 } 420 }
415 } 421 }
416 } 422 }
417 } 423 }
418 } 424 }
419 } 425 }
420 mMatchedJournals.clear(); 426 if ( !mAddItems->isChecked() )
427 mMatchedJournals.clear();
421 if (mSearchJournal->isChecked() ) { 428 if (mSearchJournal->isChecked() ) {
422 QPtrList<Journal> journals = mCalendar->journals( ); 429 QPtrList<Journal> journals = mCalendar->journals( );
423 Journal* journ; 430 Journal* journ;
424 431
425 for(journ=journals.first();journ;journ=journals.next()) { 432 for(journ=journals.first();journ;journ=journals.next()) {
426 if ( journ->dtStart().date() <= mEndDate->date() 433 if ( journ->dtStart().date() <= mEndDate->date()
427 &&journ->dtStart().date() >= mStartDate->date()) { 434 &&journ->dtStart().date() >= mStartDate->date()) {
428#if QT_VERSION >= 0x030000 435#if QT_VERSION >= 0x030000
429 if (re.search(journ->description()) != -1) 436 if (re.search(journ->description()) != -1)
430#else 437#else
431 if (re.match(journ->description()) != -1) 438 if (re.match(journ->description()) != -1)
432#endif 439#endif
433 { 440 {
434 mMatchedJournals.append(journ); 441 mMatchedJournals.append(journ);
435 continue; 442 continue;
436 } 443 }
437 } 444 }
438 } 445 }
439 } 446 }
440 447
441} 448}
442 449
443void SearchDialog::keyPressEvent ( QKeyEvent *e) 450void SearchDialog::keyPressEvent ( QKeyEvent *e)
444{ 451{
445 switch ( e->key() ) { 452 switch ( e->key() ) {
446 case Qt::Key_Escape: 453 case Qt::Key_Escape:
447 close(); 454 close();
448 break; 455 break;
449 case Qt::Key_F: 456 case Qt::Key_F:
450 if ( e->state() == Qt::ControlButton ) { 457 if ( e->state() == Qt::ControlButton ) {
451 458
452 } 459 }
453 break; 460 break;
454 case Qt::Key_Return: 461 case Qt::Key_Return:
455 case Qt::Key_Enter: 462 case Qt::Key_Enter:
456 doSearch(); 463 doSearch();
457 break; 464 break;
458 465
459 default: 466 default:
460 e->ignore(); 467 e->ignore();
461 } 468 }
462} 469}
463 470
464//mMatchedJournals; 471//mMatchedJournals;
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 4559d20..11ad2f0 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -1,95 +1,96 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30#include <qvbox.h> 30#include <qvbox.h>
31 31
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33 33
34#include "kolistview.h" 34#include "kolistview.h"
35 35
36class KDateEdit; 36class KDateEdit;
37class QCheckBox; 37class QCheckBox;
38class QLineEdit; 38class QLineEdit;
39class KLineEdit; 39class KLineEdit;
40class QLabel; 40class QLabel;
41class CalendarView; 41class CalendarView;
42 42
43using namespace KCal; 43using namespace KCal;
44class SearchDialog : public QVBox 44class SearchDialog : public QVBox
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 public: 47 public:
48 SearchDialog(Calendar *calendar,CalendarView *parent=0); 48 SearchDialog(Calendar *calendar,CalendarView *parent=0);
49 virtual ~SearchDialog(); 49 virtual ~SearchDialog();
50 KOListView *listview(){ return listView;} 50 KOListView *listview(){ return listView;}
51 void updateView(); 51 void updateView();
52 void raiseAndSelect(); 52 void raiseAndSelect();
53 53
54 public slots: 54 public slots:
55 void changeEventDisplay(Event *, int) { updateView(); } 55 void changeEventDisplay(Event *, int) { updateView(); }
56 void updateConfig(); 56 void updateConfig();
57 void updateList(); 57 void updateList();
58 protected slots: 58 protected slots:
59 void setFocusToList(); 59 void setFocusToList();
60 void accept(); 60 void accept();
61 void doSearch(); 61 void doSearch();
62 void searchTextChanged( const QString &_text ); 62 void searchTextChanged( const QString &_text );
63 63
64 signals: 64 signals:
65 void showEventSignal(Event *); 65 void showEventSignal(Event *);
66 void editEventSignal(Event *); 66 void editEventSignal(Event *);
67 void deleteEventSignal(Event *); 67 void deleteEventSignal(Event *);
68 68
69 private: 69 private:
70 void search(const QRegExp &); 70 void search(const QRegExp &);
71 71
72 Calendar *mCalendar; 72 Calendar *mCalendar;
73 73
74 QPtrList<Event> mMatchedEvents; 74 QPtrList<Event> mMatchedEvents;
75 QPtrList<Todo> mMatchedTodos; 75 QPtrList<Todo> mMatchedTodos;
76 QPtrList<Journal> mMatchedJournals; 76 QPtrList<Journal> mMatchedJournals;
77 77
78 QLabel *searchLabel; 78 QLabel *searchLabel;
79 KLineEdit *searchEdit; 79 KLineEdit *searchEdit;
80 KOListView *listView; 80 KOListView *listView;
81 81
82 KDateEdit *mStartDate; 82 KDateEdit *mStartDate;
83 KDateEdit *mEndDate; 83 KDateEdit *mEndDate;
84 QCheckBox *mSummaryCheck; 84 QCheckBox *mSummaryCheck;
85 QCheckBox *mDescriptionCheck; 85 QCheckBox *mDescriptionCheck;
86 QCheckBox *mCategoryCheck; 86 QCheckBox *mCategoryCheck;
87 QCheckBox *mSearchEvent; 87 QCheckBox *mSearchEvent;
88 QCheckBox *mSearchTodo; 88 QCheckBox *mSearchTodo;
89 QCheckBox *mSearchJournal; 89 QCheckBox *mSearchJournal;
90 QCheckBox *mSearchAName; 90 QCheckBox *mSearchAName;
91 QCheckBox *mSearchAEmail; 91 QCheckBox *mSearchAEmail;
92 QCheckBox *mAddItems;
92 void keyPressEvent ( QKeyEvent *e) ; 93 void keyPressEvent ( QKeyEvent *e) ;
93}; 94};
94 95
95#endif 96#endif
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index f446197..4382416 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -261,384 +261,395 @@ void Incidence::recreate()
261 261
262 setRevision(0); 262 setRevision(0);
263 setIDStr( ":" ); 263 setIDStr( ":" );
264 setLastModified(QDateTime::currentDateTime()); 264 setLastModified(QDateTime::currentDateTime());
265} 265}
266void Incidence::cloneRelations( Incidence * newInc ) 266void Incidence::cloneRelations( Incidence * newInc )
267{ 267{
268 // newInc is already a clone of this incidence 268 // newInc is already a clone of this incidence
269 Incidence * inc; 269 Incidence * inc;
270 Incidence * cloneInc; 270 Incidence * cloneInc;
271 QPtrList<Incidence> Relations = relations(); 271 QPtrList<Incidence> Relations = relations();
272 for (inc=Relations.first();inc;inc=Relations.next()) { 272 for (inc=Relations.first();inc;inc=Relations.next()) {
273 cloneInc = inc->clone(); 273 cloneInc = inc->clone();
274 cloneInc->recreate(); 274 cloneInc->recreate();
275 cloneInc->setRelatedTo( newInc ); 275 cloneInc->setRelatedTo( newInc );
276 inc->cloneRelations( cloneInc ); 276 inc->cloneRelations( cloneInc );
277 } 277 }
278} 278}
279void Incidence::setReadOnly( bool readOnly ) 279void Incidence::setReadOnly( bool readOnly )
280{ 280{
281 IncidenceBase::setReadOnly( readOnly ); 281 IncidenceBase::setReadOnly( readOnly );
282 recurrence()->setRecurReadOnly( readOnly); 282 recurrence()->setRecurReadOnly( readOnly);
283} 283}
284 284
285void Incidence::setCreated(QDateTime created) 285void Incidence::setCreated(QDateTime created)
286{ 286{
287 if (mReadOnly) return; 287 if (mReadOnly) return;
288 mCreated = getEvenTime(created); 288 mCreated = getEvenTime(created);
289} 289}
290 290
291QDateTime Incidence::created() const 291QDateTime Incidence::created() const
292{ 292{
293 return mCreated; 293 return mCreated;
294} 294}
295 295
296void Incidence::setRevision(int rev) 296void Incidence::setRevision(int rev)
297{ 297{
298 if (mReadOnly) return; 298 if (mReadOnly) return;
299 mRevision = rev; 299 mRevision = rev;
300 300
301 updated(); 301 updated();
302} 302}
303 303
304int Incidence::revision() const 304int Incidence::revision() const
305{ 305{
306 return mRevision; 306 return mRevision;
307} 307}
308 308
309void Incidence::setDtStart(const QDateTime &dtStart) 309void Incidence::setDtStart(const QDateTime &dtStart)
310{ 310{
311 311
312 QDateTime dt = getEvenTime(dtStart); 312 QDateTime dt = getEvenTime(dtStart);
313 recurrence()->setRecurStart( dt); 313 recurrence()->setRecurStart( dt);
314 IncidenceBase::setDtStart( dt ); 314 IncidenceBase::setDtStart( dt );
315} 315}
316 316
317void Incidence::setDescription(const QString &description) 317void Incidence::setDescription(const QString &description)
318{ 318{
319 if (mReadOnly) return; 319 if (mReadOnly) return;
320 mDescription = description; 320 mDescription = description;
321 updated(); 321 updated();
322} 322}
323 323
324QString Incidence::description() const 324QString Incidence::description() const
325{ 325{
326 return mDescription; 326 return mDescription;
327} 327}
328 328
329 329
330void Incidence::setSummary(const QString &summary) 330void Incidence::setSummary(const QString &summary)
331{ 331{
332 if (mReadOnly) return; 332 if (mReadOnly) return;
333 mSummary = summary; 333 mSummary = summary;
334 updated(); 334 updated();
335} 335}
336 336
337QString Incidence::summary() const 337QString Incidence::summary() const
338{ 338{
339 return mSummary; 339 return mSummary;
340} 340}
341void Incidence::checkCategories() 341void Incidence::checkCategories()
342{ 342{
343 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); 343 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday"));
344 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); 344 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday"));
345 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); 345 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary"));
346} 346}
347 347
348void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false 348void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false
349{ 349{
350 if (mReadOnly) return; 350 if (mReadOnly) return;
351 int i; 351 int i;
352 for( i = 0; i < categories.count(); ++i ) { 352 for( i = 0; i < categories.count(); ++i ) {
353 if ( !mCategories.contains (categories[i])) 353 if ( !mCategories.contains (categories[i]))
354 mCategories.append( categories[i] ); 354 mCategories.append( categories[i] );
355 } 355 }
356 checkCategories(); 356 checkCategories();
357 updated(); 357 updated();
358 if ( addToRelations ) { 358 if ( addToRelations ) {
359 Incidence * inc; 359 Incidence * inc;
360 QPtrList<Incidence> Relations = relations(); 360 QPtrList<Incidence> Relations = relations();
361 for (inc=Relations.first();inc;inc=Relations.next()) { 361 for (inc=Relations.first();inc;inc=Relations.next()) {
362 inc->addCategories( categories, true ); 362 inc->addCategories( categories, true );
363 } 363 }
364 } 364 }
365} 365}
366 366
367void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false 367void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false
368{ 368{
369 if (mReadOnly) return; 369 if (mReadOnly) return;
370 mCategories = categories; 370 mCategories = categories;
371 checkCategories(); 371 checkCategories();
372 updated(); 372 updated();
373 if ( setForRelations ) { 373 if ( setForRelations ) {
374 Incidence * inc; 374 Incidence * inc;
375 QPtrList<Incidence> Relations = relations(); 375 QPtrList<Incidence> Relations = relations();
376 for (inc=Relations.first();inc;inc=Relations.next()) { 376 for (inc=Relations.first();inc;inc=Relations.next()) {
377 inc->setCategories( categories, true ); 377 inc->setCategories( categories, true );
378 } 378 }
379 } 379 }
380} 380}
381 381
382// TODO: remove setCategories(QString) function 382// TODO: remove setCategories(QString) function
383void Incidence::setCategories(const QString &catStr) 383void Incidence::setCategories(const QString &catStr)
384{ 384{
385 if (mReadOnly) return; 385 if (mReadOnly) return;
386 mCategories.clear(); 386 mCategories.clear();
387 387
388 if (catStr.isEmpty()) return; 388 if (catStr.isEmpty()) return;
389 389
390 mCategories = QStringList::split(",",catStr); 390 mCategories = QStringList::split(",",catStr);
391 391
392 QStringList::Iterator it; 392 QStringList::Iterator it;
393 for(it = mCategories.begin();it != mCategories.end(); ++it) { 393 for(it = mCategories.begin();it != mCategories.end(); ++it) {
394 *it = (*it).stripWhiteSpace(); 394 *it = (*it).stripWhiteSpace();
395 } 395 }
396 checkCategories(); 396 checkCategories();
397 updated(); 397 updated();
398} 398}
399 399
400QStringList Incidence::categories() const 400QStringList Incidence::categories() const
401{ 401{
402 return mCategories; 402 return mCategories;
403} 403}
404 404
405QString Incidence::categoriesStr() 405QString Incidence::categoriesStr()
406{ 406{
407 return mCategories.join(","); 407 return mCategories.join(",");
408} 408}
409QString Incidence::categoriesStrWithSpace() 409QString Incidence::categoriesStrWithSpace()
410{ 410{
411 return mCategories.join(", "); 411 return mCategories.join(", ");
412} 412}
413 413
414void Incidence::setRelatedToUid(const QString &relatedToUid) 414void Incidence::setRelatedToUid(const QString &relatedToUid)
415{ 415{
416 if (mReadOnly) return; 416 if (mReadOnly) return;
417 mRelatedToUid = relatedToUid; 417 mRelatedToUid = relatedToUid;
418} 418}
419 419
420QString Incidence::relatedToUid() const 420QString Incidence::relatedToUid() const
421{ 421{
422 return mRelatedToUid; 422 return mRelatedToUid;
423} 423}
424 424
425void Incidence::setRelatedTo(Incidence *relatedTo) 425void Incidence::setRelatedTo(Incidence *relatedTo)
426{ 426{
427 //qDebug("Incidence::setRelatedTo %d ", relatedTo); 427 //qDebug("Incidence::setRelatedTo %d ", relatedTo);
428 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); 428 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() );
429 if (mReadOnly || mRelatedTo == relatedTo) return; 429 if (mReadOnly || mRelatedTo == relatedTo) return;
430 if(mRelatedTo) { 430 if(mRelatedTo) {
431 // updated(); 431 // updated();
432 mRelatedTo->removeRelation(this); 432 mRelatedTo->removeRelation(this);
433 } 433 }
434 mRelatedTo = relatedTo; 434 mRelatedTo = relatedTo;
435 if (mRelatedTo) { 435 if (mRelatedTo) {
436 mRelatedTo->addRelation(this); 436 mRelatedTo->addRelation(this);
437 mRelatedToUid = mRelatedTo->uid(); 437 mRelatedToUid = mRelatedTo->uid();
438 } else { 438 } else {
439 mRelatedToUid = ""; 439 mRelatedToUid = "";
440 } 440 }
441} 441}
442 442
443Incidence *Incidence::relatedTo() const 443Incidence *Incidence::relatedTo() const
444{ 444{
445 return mRelatedTo; 445 return mRelatedTo;
446} 446}
447 447
448QPtrList<Incidence> Incidence::relations() const 448QPtrList<Incidence> Incidence::relations() const
449{ 449{
450 return mRelations; 450 return mRelations;
451} 451}
452 452
453void Incidence::addRelationsToList(QPtrList<Incidence> *rel)
454{
455 Incidence* inc;
456 QPtrList<Incidence> Relations = relations();
457 for (inc=Relations.first();inc;inc=Relations.next()) {
458 inc->addRelationsToList( rel );
459 }
460 if ( rel->findRef( this ) == -1 )
461 rel->append( this );
462}
463
453void Incidence::addRelation(Incidence *event) 464void Incidence::addRelation(Incidence *event)
454{ 465{
455 if( mRelations.findRef( event ) == -1 ) { 466 if( mRelations.findRef( event ) == -1 ) {
456 mRelations.append(event); 467 mRelations.append(event);
457 //updated(); 468 //updated();
458 } 469 }
459} 470}
460 471
461void Incidence::removeRelation(Incidence *event) 472void Incidence::removeRelation(Incidence *event)
462{ 473{
463 474
464 mRelations.removeRef(event); 475 mRelations.removeRef(event);
465 476
466// if (event->getRelatedTo() == this) event->setRelatedTo(0); 477// if (event->getRelatedTo() == this) event->setRelatedTo(0);
467} 478}
468 479
469bool Incidence::recursOn(const QDate &qd) const 480bool Incidence::recursOn(const QDate &qd) const
470{ 481{
471 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; 482 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true;
472 else return false; 483 else return false;
473} 484}
474 485
475void Incidence::setExDates(const DateList &exDates) 486void Incidence::setExDates(const DateList &exDates)
476{ 487{
477 if (mReadOnly) return; 488 if (mReadOnly) return;
478 mExDates = exDates; 489 mExDates = exDates;
479 490
480 recurrence()->setRecurExDatesCount(mExDates.count()); 491 recurrence()->setRecurExDatesCount(mExDates.count());
481 492
482 updated(); 493 updated();
483} 494}
484 495
485void Incidence::addExDate(const QDate &date) 496void Incidence::addExDate(const QDate &date)
486{ 497{
487 if (mReadOnly) return; 498 if (mReadOnly) return;
488 mExDates.append(date); 499 mExDates.append(date);
489 500
490 recurrence()->setRecurExDatesCount(mExDates.count()); 501 recurrence()->setRecurExDatesCount(mExDates.count());
491 502
492 updated(); 503 updated();
493} 504}
494 505
495DateList Incidence::exDates() const 506DateList Incidence::exDates() const
496{ 507{
497 return mExDates; 508 return mExDates;
498} 509}
499 510
500bool Incidence::isException(const QDate &date) const 511bool Incidence::isException(const QDate &date) const
501{ 512{
502 DateList::ConstIterator it; 513 DateList::ConstIterator it;
503 for( it = mExDates.begin(); it != mExDates.end(); ++it ) { 514 for( it = mExDates.begin(); it != mExDates.end(); ++it ) {
504 if ( (*it) == date ) { 515 if ( (*it) == date ) {
505 return true; 516 return true;
506 } 517 }
507 } 518 }
508 519
509 return false; 520 return false;
510} 521}
511 522
512void Incidence::addAttachment(Attachment *attachment) 523void Incidence::addAttachment(Attachment *attachment)
513{ 524{
514 if (mReadOnly || !attachment) return; 525 if (mReadOnly || !attachment) return;
515 mAttachments.append(attachment); 526 mAttachments.append(attachment);
516 updated(); 527 updated();
517} 528}
518 529
519void Incidence::deleteAttachment(Attachment *attachment) 530void Incidence::deleteAttachment(Attachment *attachment)
520{ 531{
521 mAttachments.removeRef(attachment); 532 mAttachments.removeRef(attachment);
522} 533}
523 534
524void Incidence::deleteAttachments(const QString& mime) 535void Incidence::deleteAttachments(const QString& mime)
525{ 536{
526 Attachment *at = mAttachments.first(); 537 Attachment *at = mAttachments.first();
527 while (at) { 538 while (at) {
528 if (at->mimeType() == mime) 539 if (at->mimeType() == mime)
529 mAttachments.remove(); 540 mAttachments.remove();
530 else 541 else
531 at = mAttachments.next(); 542 at = mAttachments.next();
532 } 543 }
533} 544}
534 545
535QPtrList<Attachment> Incidence::attachments() const 546QPtrList<Attachment> Incidence::attachments() const
536{ 547{
537 return mAttachments; 548 return mAttachments;
538} 549}
539 550
540QPtrList<Attachment> Incidence::attachments(const QString& mime) const 551QPtrList<Attachment> Incidence::attachments(const QString& mime) const
541{ 552{
542 QPtrList<Attachment> attachments; 553 QPtrList<Attachment> attachments;
543 QPtrListIterator<Attachment> it( mAttachments ); 554 QPtrListIterator<Attachment> it( mAttachments );
544 Attachment *at; 555 Attachment *at;
545 while ( (at = it.current()) ) { 556 while ( (at = it.current()) ) {
546 if (at->mimeType() == mime) 557 if (at->mimeType() == mime)
547 attachments.append(at); 558 attachments.append(at);
548 ++it; 559 ++it;
549 } 560 }
550 561
551 return attachments; 562 return attachments;
552} 563}
553 564
554void Incidence::setResources(const QStringList &resources) 565void Incidence::setResources(const QStringList &resources)
555{ 566{
556 if (mReadOnly) return; 567 if (mReadOnly) return;
557 mResources = resources; 568 mResources = resources;
558 updated(); 569 updated();
559} 570}
560 571
561QStringList Incidence::resources() const 572QStringList Incidence::resources() const
562{ 573{
563 return mResources; 574 return mResources;
564} 575}
565 576
566 577
567void Incidence::setPriority(int priority) 578void Incidence::setPriority(int priority)
568{ 579{
569 if (mReadOnly) return; 580 if (mReadOnly) return;
570 mPriority = priority; 581 mPriority = priority;
571 updated(); 582 updated();
572} 583}
573 584
574int Incidence::priority() const 585int Incidence::priority() const
575{ 586{
576 return mPriority; 587 return mPriority;
577} 588}
578 589
579void Incidence::setSecrecy(int sec) 590void Incidence::setSecrecy(int sec)
580{ 591{
581 if (mReadOnly) return; 592 if (mReadOnly) return;
582 mSecrecy = sec; 593 mSecrecy = sec;
583 updated(); 594 updated();
584} 595}
585 596
586int Incidence::secrecy() const 597int Incidence::secrecy() const
587{ 598{
588 return mSecrecy; 599 return mSecrecy;
589} 600}
590 601
591QString Incidence::secrecyStr() const 602QString Incidence::secrecyStr() const
592{ 603{
593 return secrecyName(mSecrecy); 604 return secrecyName(mSecrecy);
594} 605}
595 606
596QString Incidence::secrecyName(int secrecy) 607QString Incidence::secrecyName(int secrecy)
597{ 608{
598 switch (secrecy) { 609 switch (secrecy) {
599 case SecrecyPublic: 610 case SecrecyPublic:
600 return i18n("Public"); 611 return i18n("Public");
601 break; 612 break;
602 case SecrecyPrivate: 613 case SecrecyPrivate:
603 return i18n("Private"); 614 return i18n("Private");
604 break; 615 break;
605 case SecrecyConfidential: 616 case SecrecyConfidential:
606 return i18n("Confidential"); 617 return i18n("Confidential");
607 break; 618 break;
608 default: 619 default:
609 return i18n("Undefined"); 620 return i18n("Undefined");
610 break; 621 break;
611 } 622 }
612} 623}
613 624
614QStringList Incidence::secrecyList() 625QStringList Incidence::secrecyList()
615{ 626{
616 QStringList list; 627 QStringList list;
617 list << secrecyName(SecrecyPublic); 628 list << secrecyName(SecrecyPublic);
618 list << secrecyName(SecrecyPrivate); 629 list << secrecyName(SecrecyPrivate);
619 list << secrecyName(SecrecyConfidential); 630 list << secrecyName(SecrecyConfidential);
620 631
621 return list; 632 return list;
622} 633}
623 634
624 635
625QPtrList<Alarm> Incidence::alarms() const 636QPtrList<Alarm> Incidence::alarms() const
626{ 637{
627 return mAlarms; 638 return mAlarms;
628} 639}
629 640
630Alarm* Incidence::newAlarm() 641Alarm* Incidence::newAlarm()
631{ 642{
632 Alarm* alarm = new Alarm(this); 643 Alarm* alarm = new Alarm(this);
633 mAlarms.append(alarm); 644 mAlarms.append(alarm);
634// updated(); 645// updated();
635 return alarm; 646 return alarm;
636} 647}
637 648
638void Incidence::addAlarm(Alarm *alarm) 649void Incidence::addAlarm(Alarm *alarm)
639{ 650{
640 mAlarms.append(alarm); 651 mAlarms.append(alarm);
641 updated(); 652 updated();
642} 653}
643 654
644void Incidence::removeAlarm(Alarm *alarm) 655void Incidence::removeAlarm(Alarm *alarm)
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index aa51e84..fc97ce9 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -1,308 +1,308 @@
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 INCIDENCE_H 20#ifndef INCIDENCE_H
21#define INCIDENCE_H 21#define INCIDENCE_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 29
30#include "recurrence.h" 30#include "recurrence.h"
31#include "alarm.h" 31#include "alarm.h"
32#include "attachment.h" 32#include "attachment.h"
33#include "listbase.h" 33#include "listbase.h"
34#include "incidencebase.h" 34#include "incidencebase.h"
35 35
36namespace KCal { 36namespace KCal {
37 37
38class Event; 38class Event;
39class Todo; 39class Todo;
40class Journal; 40class Journal;
41 41
42/** 42/**
43 This class provides the base class common to all calendar components. 43 This class provides the base class common to all calendar components.
44*/ 44*/
45class Incidence : public IncidenceBase 45class Incidence : public IncidenceBase
46{ 46{
47 public: 47 public:
48 /** 48 /**
49 This class provides the interface for a visitor of calendar components. It 49 This class provides the interface for a visitor of calendar components. It
50 serves as base class for concrete visitors, which implement certain actions on 50 serves as base class for concrete visitors, which implement certain actions on
51 calendar components. It allows to add functions, which operate on the concrete 51 calendar components. It allows to add functions, which operate on the concrete
52 types of calendar components, without changing the calendar component classes. 52 types of calendar components, without changing the calendar component classes.
53 */ 53 */
54 class Visitor 54 class Visitor
55 { 55 {
56 public: 56 public:
57 /** Destruct Incidence::Visitor */ 57 /** Destruct Incidence::Visitor */
58 virtual ~Visitor() {} 58 virtual ~Visitor() {}
59 59
60 /** 60 /**
61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
62 on an Event object. 62 on an Event object.
63 */ 63 */
64 virtual bool visit(Event *) { return false; } 64 virtual bool visit(Event *) { return false; }
65 /** 65 /**
66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
67 on an Todo object. 67 on an Todo object.
68 */ 68 */
69 virtual bool visit(Todo *) { return false; } 69 virtual bool visit(Todo *) { return false; }
70 /** 70 /**
71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
72 on an Journal object. 72 on an Journal object.
73 */ 73 */
74 virtual bool visit(Journal *) { return false; } 74 virtual bool visit(Journal *) { return false; }
75 75
76 protected: 76 protected:
77 /** Constructor is protected to prevent direct creation of visitor base class. */ 77 /** Constructor is protected to prevent direct creation of visitor base class. */
78 Visitor() {} 78 Visitor() {}
79 }; 79 };
80 80
81 /** 81 /**
82 This class implements a visitor for adding an Incidence to a resource 82 This class implements a visitor for adding an Incidence to a resource
83 supporting addEvent(), addTodo() and addJournal() calls. 83 supporting addEvent(), addTodo() and addJournal() calls.
84 */ 84 */
85 template<class T> 85 template<class T>
86 class AddVisitor : public Visitor 86 class AddVisitor : public Visitor
87 { 87 {
88 public: 88 public:
89 AddVisitor( T *r ) : mResource( r ) {} 89 AddVisitor( T *r ) : mResource( r ) {}
90 bool visit( Event *e ) { return mResource->addEvent( e ); } 90 bool visit( Event *e ) { return mResource->addEvent( e ); }
91 bool visit( Todo *t ) { return mResource->addTodo( t ); } 91 bool visit( Todo *t ) { return mResource->addTodo( t ); }
92 bool visit( Journal *j ) { return mResource->addJournal( j ); } 92 bool visit( Journal *j ) { return mResource->addJournal( j ); }
93 93
94 private: 94 private:
95 T *mResource; 95 T *mResource;
96 }; 96 };
97 97
98 /** enumeration for describing an event's secrecy. */ 98 /** enumeration for describing an event's secrecy. */
99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; 99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 };
100 typedef ListBase<Incidence> List; 100 typedef ListBase<Incidence> List;
101 Incidence(); 101 Incidence();
102 Incidence(const Incidence &); 102 Incidence(const Incidence &);
103 ~Incidence(); 103 ~Incidence();
104 104
105 /** 105 /**
106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to 106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to
107 provide this implementation: 107 provide this implementation:
108 <pre> 108 <pre>
109 bool accept(Visitor &v) { return v.visit(this); } 109 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 110 </pre>
111 */ 111 */
112 virtual bool accept(Visitor &) { return false; } 112 virtual bool accept(Visitor &) { return false; }
113 113
114 virtual Incidence *clone() = 0; 114 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 115 virtual void cloneRelations( Incidence * );
116 116 void addRelationsToList(QPtrList<Incidence> *rel);
117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
118 void setReadOnly( bool ); 118 void setReadOnly( bool );
119 119
120 /** 120 /**
121 Recreate event. The event is made a new unique event, but already stored 121 Recreate event. The event is made a new unique event, but already stored
122 event information is preserved. Sets uniquie id, creation date, last 122 event information is preserved. Sets uniquie id, creation date, last
123 modification date and revision number. 123 modification date and revision number.
124 */ 124 */
125 void recreate(); 125 void recreate();
126 Incidence* recreateCloneException(QDate); 126 Incidence* recreateCloneException(QDate);
127 127
128 /** set creation date */ 128 /** set creation date */
129 void setCreated(QDateTime); 129 void setCreated(QDateTime);
130 /** return time and date of creation. */ 130 /** return time and date of creation. */
131 QDateTime created() const; 131 QDateTime created() const;
132 132
133 /** set the number of revisions this event has seen */ 133 /** set the number of revisions this event has seen */
134 void setRevision(int rev); 134 void setRevision(int rev);
135 /** return the number of revisions this event has seen */ 135 /** return the number of revisions this event has seen */
136 int revision() const; 136 int revision() const;
137 137
138 /** Set starting date/time. */ 138 /** Set starting date/time. */
139 virtual void setDtStart(const QDateTime &dtStart); 139 virtual void setDtStart(const QDateTime &dtStart);
140 /** Return the incidence's ending date/time as a QDateTime. */ 140 /** Return the incidence's ending date/time as a QDateTime. */
141 virtual QDateTime dtEnd() const { return QDateTime(); } 141 virtual QDateTime dtEnd() const { return QDateTime(); }
142 142
143 /** sets the event's lengthy description. */ 143 /** sets the event's lengthy description. */
144 void setDescription(const QString &description); 144 void setDescription(const QString &description);
145 /** returns a reference to the event's description. */ 145 /** returns a reference to the event's description. */
146 QString description() const; 146 QString description() const;
147 147
148 /** sets the event's short summary. */ 148 /** sets the event's short summary. */
149 void setSummary(const QString &summary); 149 void setSummary(const QString &summary);
150 /** returns a reference to the event's summary. */ 150 /** returns a reference to the event's summary. */
151 QString summary() const; 151 QString summary() const;
152 152
153 /** set event's applicable categories */ 153 /** set event's applicable categories */
154 void setCategories(const QStringList &categories, bool setForRelations = false); 154 void setCategories(const QStringList &categories, bool setForRelations = false);
155 void addCategories(const QStringList &categories, bool addToRelations = false); 155 void addCategories(const QStringList &categories, bool addToRelations = false);
156 /** set event's categories based on a comma delimited string */ 156 /** set event's categories based on a comma delimited string */
157 void setCategories(const QString &catStr); 157 void setCategories(const QString &catStr);
158 /** return categories in a list */ 158 /** return categories in a list */
159 QStringList categories() const; 159 QStringList categories() const;
160 /** return categories as a comma separated string */ 160 /** return categories as a comma separated string */
161 QString categoriesStr(); 161 QString categoriesStr();
162 QString categoriesStrWithSpace(); 162 QString categoriesStrWithSpace();
163 163
164 /** point at some other event to which the event relates. This function should 164 /** point at some other event to which the event relates. This function should
165 * only be used when constructing a calendar before the related Event 165 * only be used when constructing a calendar before the related Event
166 * exists. */ 166 * exists. */
167 void setRelatedToUid(const QString &); 167 void setRelatedToUid(const QString &);
168 /** what event does this one relate to? This function should 168 /** what event does this one relate to? This function should
169 * only be used when constructing a calendar before the related Event 169 * only be used when constructing a calendar before the related Event
170 * exists. */ 170 * exists. */
171 QString relatedToUid() const; 171 QString relatedToUid() const;
172 /** point at some other event to which the event relates */ 172 /** point at some other event to which the event relates */
173 void setRelatedTo(Incidence *relatedTo); 173 void setRelatedTo(Incidence *relatedTo);
174 /** what event does this one relate to? */ 174 /** what event does this one relate to? */
175 Incidence *relatedTo() const; 175 Incidence *relatedTo() const;
176 /** All events that are related to this event */ 176 /** All events that are related to this event */
177 QPtrList<Incidence> relations() const; 177 QPtrList<Incidence> relations() const;
178 /** Add an event which is related to this event */ 178 /** Add an event which is related to this event */
179 void addRelation(Incidence *); 179 void addRelation(Incidence *);
180 /** Remove event that is related to this event */ 180 /** Remove event that is related to this event */
181 void removeRelation(Incidence *); 181 void removeRelation(Incidence *);
182 182
183 /** returns the list of dates which are exceptions to the recurrence rule */ 183 /** returns the list of dates which are exceptions to the recurrence rule */
184 DateList exDates() const; 184 DateList exDates() const;
185 /** sets the list of dates which are exceptions to the recurrence rule */ 185 /** sets the list of dates which are exceptions to the recurrence rule */
186 void setExDates(const DateList &_exDates); 186 void setExDates(const DateList &_exDates);
187 void setExDates(const char *dates); 187 void setExDates(const char *dates);
188 /** Add a date to the list of exceptions of the recurrence rule. */ 188 /** Add a date to the list of exceptions of the recurrence rule. */
189 void addExDate(const QDate &date); 189 void addExDate(const QDate &date);
190 190
191 /** returns true if there is an exception for this date in the recurrence 191 /** returns true if there is an exception for this date in the recurrence
192 rule set, or false otherwise. */ 192 rule set, or false otherwise. */
193 bool isException(const QDate &qd) const; 193 bool isException(const QDate &qd) const;
194 194
195 /** add attachment to this event */ 195 /** add attachment to this event */
196 void addAttachment(Attachment *attachment); 196 void addAttachment(Attachment *attachment);
197 /** remove and delete a specific attachment */ 197 /** remove and delete a specific attachment */
198 void deleteAttachment(Attachment *attachment); 198 void deleteAttachment(Attachment *attachment);
199 /** remove and delete all attachments with this mime type */ 199 /** remove and delete all attachments with this mime type */
200 void deleteAttachments(const QString& mime); 200 void deleteAttachments(const QString& mime);
201 /** return list of all associated attachments */ 201 /** return list of all associated attachments */
202 QPtrList<Attachment> attachments() const; 202 QPtrList<Attachment> attachments() const;
203 /** find a list of attachments with this mime type */ 203 /** find a list of attachments with this mime type */
204 QPtrList<Attachment> attachments(const QString& mime) const; 204 QPtrList<Attachment> attachments(const QString& mime) const;
205 205
206 /** sets the event's status the value specified. See the enumeration 206 /** sets the event's status the value specified. See the enumeration
207 * above for possible values. */ 207 * above for possible values. */
208 void setSecrecy(int); 208 void setSecrecy(int);
209 /** return the event's secrecy. */ 209 /** return the event's secrecy. */
210 int secrecy() const; 210 int secrecy() const;
211 /** return the event's secrecy in string format. */ 211 /** return the event's secrecy in string format. */
212 QString secrecyStr() const; 212 QString secrecyStr() const;
213 /** return list of all availbale secrecy classes */ 213 /** return list of all availbale secrecy classes */
214 static QStringList secrecyList(); 214 static QStringList secrecyList();
215 /** return human-readable name of secrecy class */ 215 /** return human-readable name of secrecy class */
216 static QString secrecyName(int); 216 static QString secrecyName(int);
217 217
218 /** returns TRUE if the date specified is one on which the event will 218 /** returns TRUE if the date specified is one on which the event will
219 * recur. */ 219 * recur. */
220 bool recursOn(const QDate &qd) const; 220 bool recursOn(const QDate &qd) const;
221 221
222 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?): 222 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?):
223 223
224 /** set resources used, such as Office, Car, etc. */ 224 /** set resources used, such as Office, Car, etc. */
225 void setResources(const QStringList &resources); 225 void setResources(const QStringList &resources);
226 /** return list of current resources */ 226 /** return list of current resources */
227 QStringList resources() const; 227 QStringList resources() const;
228 228
229 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ 229 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
230 void setPriority(int priority); 230 void setPriority(int priority);
231 /** get the event's priority */ 231 /** get the event's priority */
232 int priority() const; 232 int priority() const;
233 233
234 /** All alarms that are associated with this incidence */ 234 /** All alarms that are associated with this incidence */
235 QPtrList<Alarm> alarms() const; 235 QPtrList<Alarm> alarms() const;
236 /** Create a new alarm which is associated with this incidence */ 236 /** Create a new alarm which is associated with this incidence */
237 Alarm* newAlarm(); 237 Alarm* newAlarm();
238 /** Add an alarm which is associated with this incidence */ 238 /** Add an alarm which is associated with this incidence */
239 void addAlarm(Alarm*); 239 void addAlarm(Alarm*);
240 /** Remove an alarm that is associated with this incidence */ 240 /** Remove an alarm that is associated with this incidence */
241 void removeAlarm(Alarm*); 241 void removeAlarm(Alarm*);
242 /** Remove all alarms that are associated with this incidence */ 242 /** Remove all alarms that are associated with this incidence */
243 void clearAlarms(); 243 void clearAlarms();
244 /** return whether any alarm associated with this incidence is enabled */ 244 /** return whether any alarm associated with this incidence is enabled */
245 bool isAlarmEnabled() const; 245 bool isAlarmEnabled() const;
246 246
247 /** 247 /**
248 Return the recurrence rule associated with this incidence. If there is 248 Return the recurrence rule associated with this incidence. If there is
249 none, returns an appropriate (non-0) object. 249 none, returns an appropriate (non-0) object.
250 */ 250 */
251 Recurrence *recurrence() const; 251 Recurrence *recurrence() const;
252 void setRecurrence(Recurrence * r); 252 void setRecurrence(Recurrence * r);
253 /** 253 /**
254 Forward to Recurrence::doesRecur(). 254 Forward to Recurrence::doesRecur().
255 */ 255 */
256 ushort doesRecur() const; 256 ushort doesRecur() const;
257 257
258 /** set the event's/todo's location. Do _not_ use it with journal */ 258 /** set the event's/todo's location. Do _not_ use it with journal */
259 void setLocation(const QString &location); 259 void setLocation(const QString &location);
260 /** return the event's/todo's location. Do _not_ use it with journal */ 260 /** return the event's/todo's location. Do _not_ use it with journal */
261 QString location() const; 261 QString location() const;
262 /** returns TRUE or FALSE depending on whether the todo has a start date */ 262 /** returns TRUE or FALSE depending on whether the todo has a start date */
263 bool hasStartDate() const; 263 bool hasStartDate() const;
264 /** sets the event's hasStartDate value. */ 264 /** sets the event's hasStartDate value. */
265 void setHasStartDate(bool f); 265 void setHasStartDate(bool f);
266 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const; 266 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const;
267 bool cancelled() const; 267 bool cancelled() const;
268 void setCancelled( bool b ); 268 void setCancelled( bool b );
269 269
270 bool hasRecurrenceID() const; 270 bool hasRecurrenceID() const;
271 void setHasRecurrenceID( bool b ); 271 void setHasRecurrenceID( bool b );
272 272
273 void setRecurrenceID(QDateTime); 273 void setRecurrenceID(QDateTime);
274 QDateTime recurrenceID () const; 274 QDateTime recurrenceID () const;
275 QDateTime dtStart() const; 275 QDateTime dtStart() const;
276 bool isHoliday() const; 276 bool isHoliday() const;
277 bool isBirthday() const; 277 bool isBirthday() const;
278 bool isAnniversary() const; 278 bool isAnniversary() const;
279 279
280 280
281protected: 281protected:
282 QPtrList<Alarm> mAlarms; 282 QPtrList<Alarm> mAlarms;
283 QPtrList<Incidence> mRelations; 283 QPtrList<Incidence> mRelations;
284 QDateTime mRecurrenceID; 284 QDateTime mRecurrenceID;
285 bool mHasRecurrenceID; 285 bool mHasRecurrenceID;
286 private: 286 private:
287 void checkCategories(); 287 void checkCategories();
288 bool mHoliday, mBirthday, mAnniversary; 288 bool mHoliday, mBirthday, mAnniversary;
289 int mRevision; 289 int mRevision;
290 bool mCancelled; 290 bool mCancelled;
291 291
292 // base components of jounal, event and todo 292 // base components of jounal, event and todo
293 QDateTime mCreated; 293 QDateTime mCreated;
294 QString mDescription; 294 QString mDescription;
295 QString mSummary; 295 QString mSummary;
296 QStringList mCategories; 296 QStringList mCategories;
297 Incidence *mRelatedTo; 297 Incidence *mRelatedTo;
298 QString mRelatedToUid; 298 QString mRelatedToUid;
299 DateList mExDates; 299 DateList mExDates;
300 QPtrList<Attachment> mAttachments; 300 QPtrList<Attachment> mAttachments;
301 QStringList mResources; 301 QStringList mResources;
302 bool mHasStartDate; // if todo has associated start date 302 bool mHasStartDate; // if todo has associated start date
303 303
304 int mSecrecy; 304 int mSecrecy;
305 int mPriority; // 1 = highest, 2 = less, etc. 305 int mPriority; // 1 = highest, 2 = less, etc.
306 306
307 //QPtrList<Alarm> mAlarms; 307 //QPtrList<Alarm> mAlarms;
308 Recurrence *mRecurrence; 308 Recurrence *mRecurrence;