summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-08-23 12:55:50 (UTC)
committer zautrix <zautrix>2005-08-23 12:55:50 (UTC)
commit72d600e2c3b3405e5f37615a56560811c0cf9a78 (patch) (unidiff)
tree0f3eeb3ae34822149ba8b6d62990725e59a29187
parente34e096c0e1b799904643c753591833f3ff2ab95 (diff)
downloadkdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.zip
kdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.tar.gz
kdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.tar.bz2
kopi load change
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/kotodoview.cpp5
-rw-r--r--korganizer/main.cpp4
-rw-r--r--korganizer/mainwindow.cpp64
-rw-r--r--korganizer/mainwindow.h6
6 files changed, 62 insertions, 23 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index fcfa282..fbd262c 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1174,389 +1174,389 @@
1174{ "Tomorrow","Morgen" }, 1174{ "Tomorrow","Morgen" },
1175{ "Day before yesterday","Vorgestern" }, 1175{ "Day before yesterday","Vorgestern" },
1176{ "Size %1","Größe %1" }, 1176{ "Size %1","Größe %1" },
1177{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1177{ "New Agendasize: %1","Neue Agendagröße: %1" },
1178{ " (%1 y.)"," (%1 J.)" }, 1178{ " (%1 y.)"," (%1 J.)" },
1179{ "Allday:","Ganztägig:" }, 1179{ "Allday:","Ganztägig:" },
1180{ "compl.todos","erled.Todos" }, 1180{ "compl.todos","erled.Todos" },
1181{ "Day view","Tagesansicht" }, 1181{ "Day view","Tagesansicht" },
1182{ "Next days","Nächste Tage" }, 1182{ "Next days","Nächste Tage" },
1183{ "Next week","Nächste Woche" }, 1183{ "Next week","Nächste Woche" },
1184{ "Next two weeks","Nächste zwei Wochen" }, 1184{ "Next two weeks","Nächste zwei Wochen" },
1185{ "This month","Dieser Monat" }, 1185{ "This month","Dieser Monat" },
1186{ "Journal view","Journal" }, 1186{ "Journal view","Journal" },
1187{ "Display all opened","Zeige alle geöffnet" }, 1187{ "Display all opened","Zeige alle geöffnet" },
1188{ "Display all closed","Zeige alle geschlossen" }, 1188{ "Display all closed","Zeige alle geschlossen" },
1189{ "Display all flat","Zeige alle flach" }, 1189{ "Display all flat","Zeige alle flach" },
1190{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1190{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1191{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1191{ "Default todo done color:","Standard Todo erledigt Farbe" },
1192{ "Select week %1-%2","Wähle Woche %1-%2" }, 1192{ "Select week %1-%2","Wähle Woche %1-%2" },
1193{ "Select Week","Wähle Woche" }, 1193{ "Select Week","Wähle Woche" },
1194{ "Set alarm...","Setze Alarm..." }, 1194{ "Set alarm...","Setze Alarm..." },
1195{ "Set Alarm!","Setze Alarm!" }, 1195{ "Set Alarm!","Setze Alarm!" },
1196{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1196{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1197{ " and "," und " }, 1197{ " and "," und " },
1198{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1198{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1199{ "Mail to selected","Mail an Ausgewählte" }, 1199{ "Mail to selected","Mail an Ausgewählte" },
1200{ "Mail to all","Mail an Alle" }, 1200{ "Mail to all","Mail an Alle" },
1201{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1201{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1202{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1202{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1203{ " on"," am" }, 1203{ " on"," am" },
1204{ " completed on "," erledigt am " }, 1204{ " completed on "," erledigt am " },
1205{ "Save as Event template","Speichere als Vorlage" }, 1205{ "Save as Event template","Speichere als Vorlage" },
1206{ "Load Event template","Lade Termin Vorlage" }, 1206{ "Load Event template","Lade Termin Vorlage" },
1207{ "Save as Journal template","Speichere als Journal Vorlage" }, 1207{ "Save as Journal template","Speichere als Journal Vorlage" },
1208{ "Insert Journal template","Füge Journal Vorlage ein" }, 1208{ "Insert Journal template","Füge Journal Vorlage ein" },
1209{ "Sub todos:<br>","Unter-Todos:<br>" }, 1209{ "Sub todos:<br>","Unter-Todos:<br>" },
1210{ "Parent todo:<br>","Über-Todo:<br>" }, 1210{ "Parent todo:<br>","Über-Todo:<br>" },
1211{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1211{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1212{ " completed"," erledigt" }, 1212{ " completed"," erledigt" },
1213{ "(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!" }, 1213{ "(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!" },
1214{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1214{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1215{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1215{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1216{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1216{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1217{ "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?" }, 1217{ "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?" },
1218{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1218{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1219{ "Error","Fehler" }, 1219{ "Error","Fehler" },
1220{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1220{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1221{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1221{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1222{ "Warning","Warnung" }, 1222{ "Warning","Warnung" },
1223{ "Select week number","Wähle Wochen Nummer" }, 1223{ "Select week number","Wähle Wochen Nummer" },
1224{ "Februar","Februar" }, 1224{ "Februar","Februar" },
1225{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1225{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1226{ "W","W" }, 1226{ "W","W" },
1227{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1227{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1228{ "T: %1","T: %1" }, 1228{ "T: %1","T: %1" },
1229{ "Start: ","Start: " }, 1229{ "Start: ","Start: " },
1230{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1230{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1231{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1231{ "Password for remote access:","Passwort für fernen Zugriff:" },
1232{ "Remote IP address:","Ferne IP Adresse:" }, 1232{ "Remote IP address:","Ferne IP Adresse:" },
1233{ "Remote port number:","Ferne Port Nummer:" }, 1233{ "Remote port number:","Ferne Port Nummer:" },
1234{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1234{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1235{ "Remote from: ","Fern von: " }, 1235{ "Remote from: ","Fern von: " },
1236{ "Local from: ","Lokal von: " }, 1236{ "Local from: ","Lokal von: " },
1237{ "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" }, 1237{ "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" },
1238{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1238{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1239{ "Write back","Schreibe zurück" }, 1239{ "Write back","Schreibe zurück" },
1240{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1240{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1241{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1241{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1242{ "Received sync request","Sync Anfrage erhalten" }, 1242{ "Received sync request","Sync Anfrage erhalten" },
1243{ "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." }, 1243{ "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." },
1244{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1244{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1245{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1245{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1246{ "Sending file...","Sende Datei..." }, 1246{ "Sending file...","Sende Datei..." },
1247{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1247{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1248{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1248{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1249{ "Received %1 bytes","%1 Bytes erhalten" }, 1249{ "Received %1 bytes","%1 Bytes erhalten" },
1250{ "Writing file to disk...","Speichere Datei..." }, 1250{ "Writing file to disk...","Speichere Datei..." },
1251{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1251{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1252{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1252{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1253{ "Synchronize!","Synchronisiere!" }, 1253{ "Synchronize!","Synchronisiere!" },
1254{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1254{ "High clock skew!","Großer Uhrzeitunterschied!" },
1255{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1255{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1256{ "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!" }, 1256{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1257{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1257{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1258{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1258{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1259{ "List week view","Listenwochenansicht" }, 1259{ "List week view","Listenwochenansicht" },
1260{ "List week","Listenwochenansicht" }, 1260{ "List week","Listenwochenansicht" },
1261{ "Next Week","Nächste Woche" }, 1261{ "Next Week","Nächste Woche" },
1262{ "Previous Week","Vorherige Woche" }, 1262{ "Previous Week","Vorherige Woche" },
1263{ "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." }, 1263{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." },
1264{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1264{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1265{ "Details","Details" }, 1265{ "Details","Details" },
1266{ "Created time","Erstellt Zeit" }, 1266{ "Created time","Erstellt Zeit" },
1267{ "Last modified time","Geändert Zeit" }, 1267{ "Last modified time","Geändert Zeit" },
1268{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1268{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1269{ "View Options","Anzeige Optionen" }, 1269{ "View Options","Anzeige Optionen" },
1270{ "<b>Created: ","<b>Erstellt am: " }, 1270{ "<b>Created: ","<b>Erstellt am: " },
1271{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1271{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1272{ "Journal: ","Journal: " }, 1272{ "Journal: ","Journal: " },
1273{ "yearly","jährlich" }, 1273{ "yearly","jährlich" },
1274{ "(%1) ","%1-" }, 1274{ "(%1) ","%1-" },
1275{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1275{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1276{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1276{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1277{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1277{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1278{ "Summary/Loc.","Titel/Ort" }, 1278{ "Summary/Loc.","Titel/Ort" },
1279{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1279{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1280{ "Week Number","Wochennummer" }, 1280{ "Week Number","Wochennummer" },
1281{ "Import","Importiere" }, 1281{ "Import","Importiere" },
1282{ "Export","Exportiere" }, 1282{ "Export","Exportiere" },
1283{ "Beam","Beame" }, 1283{ "Beam","Beame" },
1284{ "Export","Exportiere" }, 1284{ "Export","Exportiere" },
1285{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1285{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1286{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1286{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1287{ "Journal/Details...","Journale/Details..." }, 1287{ "Journal/Details...","Journale/Details..." },
1288{ "Agenda View","Agenda Ansicht" }, 1288{ "Agenda View","Agenda Ansicht" },
1289{ "Show current time","Zeige aktuelle Zeit" }, 1289{ "Show current time","Zeige aktuelle Zeit" },
1290{ "Edit new item","Bearbeite neuen Eintrag" }, 1290{ "Edit new item","Bearbeite neuen Eintrag" },
1291{ "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" }, 1291{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" },
1292{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1292{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1293{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1293{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1294{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1294{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1295{ "%1 days\n","%1 Tagen\n" }, 1295{ "%1 days\n","%1 Tagen\n" },
1296{ "1 day\n","1 Tag\n" }, 1296{ "1 day\n","1 Tag\n" },
1297{ "%1 hours\n","%1 Stunden\n" }, 1297{ "%1 hours\n","%1 Stunden\n" },
1298{ "1 hour\n","1 Stunde\n" }, 1298{ "1 hour\n","1 Stunde\n" },
1299{ "%1 minutes\n","%1 Minuten\n" }, 1299{ "%1 minutes\n","%1 Minuten\n" },
1300{ "1 minute\n","1 Minute\n" }, 1300{ "1 minute\n","1 Minute\n" },
1301{ "Only one toolbar","Nur eine Toolbar" }, 1301{ "Only one toolbar","Nur eine Toolbar" },
1302{ "Print","Drucke" }, 1302{ "Print","Drucke" },
1303{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1303{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1304{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1304{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1305{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1305{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1306{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1306{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1307{ "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" }, 1307{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" },
1308{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1308{ "KO/Pi Printout","KO/Pi Ausdruck" },
1309{ "Print unscaled","Drucke unskaliert" }, 1309{ "Print unscaled","Drucke unskaliert" },
1310{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1310{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1311{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1311{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1312{ "Printout Mode","Druck Modus" }, 1312{ "Printout Mode","Druck Modus" },
1313{ "Filter menu icon","Filtermenu Icon" }, 1313{ "Filter menu icon","Filtermenu Icon" },
1314{ "<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" }, 1314{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" },
1315{ "<p><b>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" }, 1315{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" },
1316{ "%1d","%1t" }, 1316{ "%1d","%1t" },
1317{ "%1h","%1std" }, 1317{ "%1h","%1std" },
1318{ "%1min","%1min" }, 1318{ "%1min","%1min" },
1319{ "( %1 before )","( %1 vorher )" }, 1319{ "( %1 before )","( %1 vorher )" },
1320{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1320{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1321{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1321{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1322{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1322{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1323{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1323{ "Show Sync Events","Zeige Sync-Ereignisse" },
1324{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1324{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1325{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1325{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1326{ " on "," am " }, 1326{ " on "," am " },
1327{ "On: ","Am: " }, 1327{ "On: ","Am: " },
1328{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1328{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1329{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1329{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1330{ "Color for running todos:","Farbe für laufende Todos:" }, 1330{ "Color for running todos:","Farbe für laufende Todos:" },
1331{ "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?" }, 1331{ "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" },
1332{ "Todo is started","Todo ist gestartet" }, 1332{ "Todo is started","Todo ist gestartet" },
1333{ "Stop todo","Stoppe Todo" }, 1333{ "Stop todo","Stoppe Todo" },
1334{ "Todo is stopped","Todo ist gestoppt" }, 1334{ "Todo is stopped","Todo ist gestoppt" },
1335{ "Start todo","Starte Todo" }, 1335{ "Start todo","Starte Todo" },
1336{ "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?" }, 1336{ "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" },
1337{ "The todo\n%1\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?" }, 1337{ "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" },
1338{ "Todo has subtodos","Todo hat Untertodos" }, 1338{ "Todo has subtodos","Todo hat Untertodos" },
1339{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1339{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1340{ "Colors","Farben" }, 1340{ "Colors","Farben" },
1341{ "Click on new parent item","Klicke auf neues Übertodo" }, 1341{ "Click on new parent item","Klicke auf neues Übertodo" },
1342{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1342{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1343{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1343{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1344{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1344{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1345{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1345{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1346{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1346{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1347{ "times","Zeiten" }, 1347{ "times","Zeiten" },
1348{ "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?" }, 1348{ "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" },
1349{ "Backup enabled","Backup angeschaltet" }, 1349{ "Backup enabled","Backup angeschaltet" },
1350{ "Use standard backup dir","Standard Backupverzeichnis" }, 1350{ "Use standard backup dir","Standard Backupverzeichnis" },
1351{ "Number of Backups:","Anzahl der Backups" }, 1351{ "Number of Backups:","Anzahl der Backups" },
1352{ "Make backup every ","Mache ein Backup alle " }, 1352{ "Make backup every ","Mache ein Backup alle " },
1353{ " days"," Tage" }, 1353{ " days"," Tage" },
1354{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1354{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1355{ "Backup Failed!","Backup Problem!" }, 1355{ "Backup Failed!","Backup Problem!" },
1356{ "Try again now","Versuche jetzt nochmal" }, 1356{ "Try again now","Versuche jetzt nochmal" },
1357{ "Try again later","Versuche später nochmal" }, 1357{ "Try again later","Versuche später nochmal" },
1358{ "Try again tomorrow","Versuche morgen nochmal" }, 1358{ "Try again tomorrow","Versuche morgen nochmal" },
1359{ "Disable backup","Schalte Backup ab" }, 1359{ "Disable backup","Schalte Backup ab" },
1360{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1360{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1361{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1361{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1362{ "Choose action","Wähle Aktion" }, 1362{ "Choose action","Wähle Aktion" },
1363{ "Comment for todo:","Kommentar zum Todo:" }, 1363{ "Comment for todo:","Kommentar zum Todo:" },
1364{ "Stop+note","Stop+Notiz" }, 1364{ "Stop+note","Stop+Notiz" },
1365{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1365{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1366{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1366{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1367{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1367{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1368{ "Print complete list...","Drucke komplette Liste..." }, 1368{ "Print complete list...","Drucke komplette Liste..." },
1369{ "Hide all selected","Verstecke Ausgewählte" }, 1369{ "Hide all selected","Verstecke Ausgewählte" },
1370{ "Add items","hinzufügen" }, 1370{ "Add items","hinzufügen" },
1371{ "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, 1371{ "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" },
1372{ "Print List View...","Drucke Listenansicht..." }, 1372{ "Print List View...","Drucke Listenansicht..." },
1373{ "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, 1373{ "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." },
1374{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1374{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1375{ "Global Settings...","Globale Einstellungen..." }, 1375{ "Global Settings...","Globale Einstellungen..." },
1376{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, 1376{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" },
1377{ "(disabled)","(abgeschaltet)" }, 1377{ "(disabled)","(abgeschaltet)" },
1378{ "New Calendar","Neuer Kalender" }, 1378{ "New Calendar","Neuer Kalender" },
1379{ "Calendar","Kalender" }, 1379{ "Calendar","Kalender" },
1380{ "Filter selector","Filterauswahl" }, 1380{ "Filter selector","Filterauswahl" },
1381{ "Filtermenu","Filtermenu" }, 1381{ "Filtermenu","Filtermenu" },
1382{ "Toggle Fullscreen","Vollbild umschalten" }, 1382{ "Toggle Fullscreen","Vollbild umschalten" },
1383{ "Toggle Resource View","Resourcenansicht umschalten" }, 1383{ "Toggle Resource View","Resourcenansicht umschalten" },
1384{ "Storage HowTo...","Speicherort HowTo..." }, 1384{ "Storage HowTo...","Speicherort HowTo..." },
1385{ "Timetracking HowTo...","Timetracking HowTo..." }, 1385{ "Timetracking HowTo...","Timetracking HowTo..." },
1386{ "Juni","Juni" }, 1386{ "Juni","Juni" },
1387{ "Juli","Juli" }, 1387{ "Juli","Juli" },
1388{ "ToDo:","ToDo:" }, 1388{ "ToDo:","ToDo:" },
1389{ "Set Calendar","Setze Kalender" }, 1389{ "Set Calendar","Setze Kalender" },
1390{ "Todo: %1","Todo: %1" }, 1390{ "Todo: %1","Todo: %1" },
1391{ ": (Prio ",": (Prio " }, 1391{ ": (Prio ",": (Prio " },
1392{ "Todos","Todos" }, 1392{ "Todos","Todos" },
1393{ "Todo Viewer","Todo Anzeige" }, 1393{ "Todo Viewer","Todo Anzeige" },
1394{ "Todo ","Todo " }, 1394{ "Todo ","Todo " },
1395{ " Calendar \n Resource "," Kalender \n Resource " }, 1395{ " Calendar \n Resource "," Kalender \n Resource " },
1396{ " Color "," Farbe " }, 1396{ " Color "," Farbe " },
1397{ "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, 1397{ "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" },
1398{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1398{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1399{ "Add new Calendar","Füge Kalender hinzu" }, 1399{ "Add new Calendar","Füge Kalender hinzu" },
1400{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1400{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1401{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1401{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1402{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1402{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1403{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1403{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1404{ "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, 1404{ "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" },
1405{ "Global application font for all apps:","Globale Schriftart:" }, 1405{ "Global application font for all apps:","Globale Schriftart:" },
1406{ "Application Font","Applikationsschriftart" }, 1406{ "Application Font","Applikationsschriftart" },
1407{ "Kx/Pi","Kx/Pi" }, 1407{ "Kx/Pi","Kx/Pi" },
1408{ "Backup","Backup" }, 1408{ "Backup","Backup" },
1409{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1409{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1410{ "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, 1410{ "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" },
1411{ "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, 1411{ "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" },
1412{ "Choose Color","Wähle Farbe" }, 1412{ "Choose Color","Wähle Farbe" },
1413{ " OK "," OK " }, 1413{ " OK "," OK " },
1414{ " Cancel "," Abbrechen " }, 1414{ " Cancel "," Abbrechen " },
1415{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1415{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1416{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1416{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1417{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1417{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1418{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1418{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1419{ "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, 1419{ "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" },
1420{ "%1\nis running!","%1\nist am Laufen!" }, 1420{ "%1\nis running!","%1\nist am Laufen!" },
1421{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1421{ "Additional Comment:","Zusätzlicher Kommentar:" },
1422{ "Stop and save","Stopp und Speichern" }, 1422{ "Stop and save","Stopp und Speichern" },
1423{ "Continue running","Weiter laufen lassen" }, 1423{ "Continue running","Weiter laufen lassen" },
1424{ "Stop - do not save","Stopp - nicht Speichern" }, 1424{ "Stop - do not save","Stopp - nicht Speichern" },
1425{ "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, 1425{ "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" },
1426{ "Time mismatch!","Zeiten stimmen nicht!" }, 1426{ "Time mismatch!","Zeiten stimmen nicht!" },
1427{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1427{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1428{ "Yes, stop todo","Ja, stoppe Todo" }, 1428{ "Yes, stop todo","Ja, stoppe Todo" },
1429{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1429{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1430{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1430{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1431{ "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, 1431{ "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." },
1432{ "Spouse","Ehegatte" }, 1432{ "Spouse","Ehegatte" },
1433{ "Notes","Notizen" }, 1433{ "Notes","Notizen" },
1434{ "Messanger","Messanger" }, 1434{ "Messanger","Messanger" },
1435{ "Assistant","Assistent" }, 1435{ "Assistant","Assistent" },
1436{ "Manager","Manager" }, 1436{ "Manager","Manager" },
1437{ "Secrecy","Sichtbar" }, 1437{ "Secrecy","Sichtbar" },
1438{ "male","männlich" }, 1438{ "male","männlich" },
1439{ "female","weiblich" }, 1439{ "female","weiblich" },
1440{ "Hide!","Verbergen!" }, 1440{ "Hide!","Verbergen!" },
1441{ "Show!","Anzeigen!" }, 1441{ "Show!","Anzeigen!" },
1442{ "Details","Details" }, 1442{ "Details","Details" },
1443{ "Profession","Beruf" }, 1443{ "Profession","Beruf" },
1444{ "Children","Kinder" }, 1444{ "Children","Kinder" },
1445{ "Department","Abteilung" }, 1445{ "Department","Abteilung" },
1446{ "Backup cancelled","Backup abgebrochen" }, 1446{ "Backup cancelled","Backup abgebrochen" },
1447{ "Backup globally disabled","Backup global abgeschaltet" }, 1447{ "Backup globally disabled","Backup global abgeschaltet" },
1448{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1448{ "Backup succesfully finished","Backup erfolgreich beendet" },
1449{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1449{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1450{ "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, 1450{ "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" },
1451{ "Birthdays","Geburtstage" }, 1451{ "Birthdays","Geburtstage" },
1452{ "KO/Pi import information!","KO/Pi Import Information!" }, 1452{ "KO/Pi import information!","KO/Pi Import Information!" },
1453{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1453{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1454{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1454{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1455{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, 1455{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" },
1456{ "Reload","Neu laden" }, 1456{ "Reload","Neu laden" },
1457{ "Timezone settings","Zeitzoneneinstellung" }, 1457{ "Timezone settings","Zeitzoneneinstellung" },
1458{ "Title: ","Titel: " }, 1458{ "Title: ","Titel: " },
1459{ "Journal from: ","Journal vom: " }, 1459{ "Journal from: ","Journal vom: " },
1460{ "Journal: %1 from ","Journal: %1 vom " }, 1460{ "Journal: %1 from ","Journal: %1 vom " },
1461{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1461{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1462{ "Selected Item","Ausgewähltes Item" }, 1462{ "Selected Item","Ausgewähltes Item" },
1463{ "Select Date...","Wähle Datum..." }, 1463{ "Select Date...","Wähle Datum..." },
1464{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, 1464{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" },
1465{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1465{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1466{ "Edit category list...","Ändere Kategorieliste..." }, 1466{ "Edit category list...","Ändere Kategorieliste..." },
1467{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1467{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1468{ "Filepath: ","Dateipfad: " }, 1468{ "Filepath: ","Dateipfad: " },
1469{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, 1469{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1470{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, 1470{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
1471{ "Pending Suspend Alarm","Laufender Suspend Alarm" }, 1471{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
1472{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, 1472{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
1473{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, 1473{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
1474{ "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, 1474{ "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
1475{ "Alarm Options","Alarm Einstellungen" }, 1475{ "Alarm Options","Alarm Einstellungen" },
1476{ "Delete selected...","Lösche Ausgewählte..." }, 1476{ "Delete selected...","Lösche Ausgewählte..." },
1477{ "None","Nichts" }, 1477{ "None","Nichts" },
1478{ "Selection","Auswahl" }, 1478{ "Selection","Auswahl" },
1479{ "Set categories","Setze Kategorien" }, 1479{ "Set categories","Setze Kategorien" },
1480{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, 1480{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" },
1481{ "Reset","Neu setzen" }, 1481{ "Reset","Neu setzen" },
1482{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, 1482{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" },
1483{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, 1483{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
1484{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, 1484{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
1485{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, 1485{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" },
1486{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, 1486{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
1487{ "Edit","Edit" }, 1487{ "Edit","Edit" },
1488{ "Last Modified","Zuletzt geändert" }, 1488{ "Last Modified","Zuletzt geändert" },
1489{ "Journal viewer","Journal Anzeige" }, 1489{ "Journal viewer","Journal Anzeige" },
1490{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, 1490{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
1491{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, 1491{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." },
1492{ "Hide Completed","Verstecke erledigte Todos" }, 1492{ "Hide Completed","Verstecke erledigte Todos" },
1493{ "Show not Running","Zeige nicht Laufende" }, 1493{ "Show not Running","Zeige nicht Laufende" },
1494{ "Click to add new Todo","Klick für neues Todo!" }, 1494{ "Click to add new Todo","Klick für neues Todo!" },
1495{ "Show next conflict for","Zeige nächsten Konflikt für" }, 1495{ "Show next conflict for","Zeige nächsten Konflikt für" },
1496{ "All events","Alle Termine" }, 1496{ "All events","Alle Termine" },
1497{ "Allday events","Ganztagestermine" }, 1497{ "Allday events","Ganztagestermine" },
1498{ "Events with time","Termine mit Zeit" }, 1498{ "Events with time","Termine mit Zeit" },
1499{ "No conflict found","Kein Konflikt gefunden" }, 1499{ "No conflict found","Kein Konflikt gefunden" },
1500{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, 1500{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
1501{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, 1501{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
1502{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, 1502{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" },
1503{ "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, 1503{ "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" },
1504{ "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, 1504{ "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" },
1505{ "Show date","Zeige Datum" }, 1505{ "Show date","Zeige Datum" },
1506{ "No problem!","Null Problemo!" }, 1506{ "No problem!","Null Problemo!" },
1507{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, 1507{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
1508{ "Pi-Sync Port Error","Pi-Sync Port Fehler" }, 1508{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
1509{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, 1509{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
1510{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, 1510{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
1511{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, 1511{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
1512{ "Pi-Sync Error","Pi-Sync Fehler" }, 1512{ "Pi-Sync Error","Pi-Sync Fehler" },
1513{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, 1513{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
1514{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, 1514{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
1515{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, 1515{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
1516{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, 1516{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
1517{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, 1517{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
1518{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, 1518{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
1519{ "Receiving file from remote...","Empfange entfernte Datei..." }, 1519{ "Receiving file from remote...","Empfange entfernte Datei..." },
1520{ "Sending back synced file...","Sende synchronisierte Datei zurück..." }, 1520{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
1521{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, 1521{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
1522{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, 1522{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
1523{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, 1523{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
1524{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, 1524{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
1525{ "Writing back file ...","Schreibe Datei zurück..." }, 1525{ "Writing back file ...","Schreibe Datei zurück..." },
1526{ "Sending back file ...","Sende Datei zurück..." }, 1526{ "Sending back file ...","Sende Datei zurück..." },
1527{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, 1527{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" },
1528{ "Created","Angelegt" }, 1528{ "Created","Angelegt" },
1529{ "Last Modified Sub","Zuletzt geändertes Sub" }, 1529{ "Last Modified Sub","Zuletzt geändertes Sub" },
1530{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, 1530{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" },
1531{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, 1531{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" },
1532{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, 1532{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
1533{ "Duration","Dauer" }, 1533{ "Duration","Dauer" },
1534{ " day"," Tag" }, 1534{ " day"," Tag" },
1535{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, 1535{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" },
1536{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, 1536{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" },
1537{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, 1537{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" },
1538{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, 1538{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" },
1539{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, 1539{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" },
1540{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, 1540{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" },
1541{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, 1541{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." },
1542{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, 1542{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." },
1543{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, 1543{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." },
1544{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, 1544{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." },
1545{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, 1545{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." },
1546{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, 1546{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" },
1547{ "Error saving data","Fehler beim Abspeichern" }, 1547{ "Error saving data","Fehler beim Abspeichern" },
1548{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, 1548{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" },
1549{ "Enable conflict detection","Schalte Konflikterkennung an" }, 1549{ "Enable conflict detection","Schalte Konflikterkennung an" },
1550{ "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, 1550{ "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" },
1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" }, 1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" },
1552{ "Filter for other existing events","Filter für die anderen Termine" }, 1552{ "Filter for other existing events","Filter für die anderen Termine" },
1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, 1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" },
1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, 1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" },
1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, 1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" },
1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, 1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" },
1557{ "Conflict detection","Konflikterkennung" }, 1557{ "Conflict detection","Konflikterkennung" },
1558{ "","" }, 1558{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" },
1559{ "","" }, 1559{ "","" },
1560{ "","" }, 1560{ "","" },
1561{ "","" }, 1561{ "","" },
1562{ "","" }, 1562{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e3b62de..9928b48 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2010,770 +2010,770 @@ void CalendarView::syncExternal( int mode )
2010 if ( mSyncManager->mWriteBackFile ) 2010 if ( mSyncManager->mWriteBackFile )
2011 { 2011 {
2012 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 2012 QPtrList<Incidence> iL = mCalendar->rawIncidences();
2013 Incidence* inc = iL.first(); 2013 Incidence* inc = iL.first();
2014 if ( phoneFormat ) { 2014 if ( phoneFormat ) {
2015 while ( inc ) { 2015 while ( inc ) {
2016 inc->removeID(mCurrentSyncDevice); 2016 inc->removeID(mCurrentSyncDevice);
2017 inc = iL.next(); 2017 inc = iL.next();
2018 } 2018 }
2019 } 2019 }
2020#ifndef DESKTOP_VERSION 2020#ifndef DESKTOP_VERSION
2021 if ( sharpFormat ) 2021 if ( sharpFormat )
2022 sharpFormat->save(calendar); 2022 sharpFormat->save(calendar);
2023#endif 2023#endif
2024 if ( phoneFormat ) 2024 if ( phoneFormat )
2025 phoneFormat->save(calendar); 2025 phoneFormat->save(calendar);
2026 iL = calendar->rawIncidences(); 2026 iL = calendar->rawIncidences();
2027 inc = iL.first(); 2027 inc = iL.first();
2028 Incidence* loc; 2028 Incidence* loc;
2029 while ( inc ) { 2029 while ( inc ) {
2030 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 2030 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
2031 loc = mCalendar->incidence(inc->uid() ); 2031 loc = mCalendar->incidence(inc->uid() );
2032 if ( loc ) { 2032 if ( loc ) {
2033 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 2033 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
2034 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 2034 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
2035 } 2035 }
2036 } 2036 }
2037 inc = iL.next(); 2037 inc = iL.next();
2038 } 2038 }
2039 Incidence* lse = getLastSyncEvent(); 2039 Incidence* lse = getLastSyncEvent();
2040 if ( lse ) { 2040 if ( lse ) {
2041 lse->setReadOnly( false ); 2041 lse->setReadOnly( false );
2042 lse->setDescription( "" ); 2042 lse->setDescription( "" );
2043 lse->setReadOnly( true ); 2043 lse->setReadOnly( true );
2044 } 2044 }
2045 } 2045 }
2046 } else { 2046 } else {
2047 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 2047 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
2048 } 2048 }
2049 setModified( true ); 2049 setModified( true );
2050 } else { 2050 } else {
2051 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 2051 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
2052 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 2052 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
2053 question, i18n("Ok")) ; 2053 question, i18n("Ok")) ;
2054 2054
2055 } 2055 }
2056 delete calendar; 2056 delete calendar;
2057 updateView(); 2057 updateView();
2058 emit tempDisableBR(false); 2058 emit tempDisableBR(false);
2059 return ;//syncOK; 2059 return ;//syncOK;
2060 2060
2061} 2061}
2062 2062
2063bool CalendarView::importBday() 2063bool CalendarView::importBday()
2064{ 2064{
2065#ifndef KORG_NOKABC 2065#ifndef KORG_NOKABC
2066 2066
2067#ifdef DESKTOP_VERSION 2067#ifdef DESKTOP_VERSION
2068 int curCal = mCalendar->defaultCalendar(); 2068 int curCal = mCalendar->defaultCalendar();
2069 int bd = mCalEditView->getBirtdayID(); 2069 int bd = mCalEditView->getBirtdayID();
2070 if ( bd == 0 ) 2070 if ( bd == 0 )
2071 return false; 2071 return false;
2072 mCalendar->setDefaultCalendar( bd ); 2072 mCalendar->setDefaultCalendar( bd );
2073 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 2073 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
2074 KABC::AddressBook::Iterator it; 2074 KABC::AddressBook::Iterator it;
2075 int count = 0; 2075 int count = 0;
2076 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 2076 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
2077 ++count; 2077 ++count;
2078 } 2078 }
2079 QProgressBar bar(count,0 ); 2079 QProgressBar bar(count,0 );
2080 int w = 300; 2080 int w = 300;
2081 if ( QApplication::desktop()->width() < 320 ) 2081 if ( QApplication::desktop()->width() < 320 )
2082 w = 220; 2082 w = 220;
2083 int h = bar.sizeHint().height() ; 2083 int h = bar.sizeHint().height() ;
2084 int dw = QApplication::desktop()->width(); 2084 int dw = QApplication::desktop()->width();
2085 int dh = QApplication::desktop()->height(); 2085 int dh = QApplication::desktop()->height();
2086 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2086 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2087 bar.show(); 2087 bar.show();
2088 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 2088 bar.setCaption (i18n("Reading addressbook - close to abort!") );
2089 qApp->processEvents(); 2089 qApp->processEvents();
2090 count = 0; 2090 count = 0;
2091 int addCount = 0; 2091 int addCount = 0;
2092 KCal::Attendee* a = 0; 2092 KCal::Attendee* a = 0;
2093 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 2093 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
2094 if ( ! bar.isVisible() ) 2094 if ( ! bar.isVisible() )
2095 return false; 2095 return false;
2096 bar.setProgress( count++ ); 2096 bar.setProgress( count++ );
2097 qApp->processEvents(); 2097 qApp->processEvents();
2098 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 2098 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
2099 if ( (*it).birthday().date().isValid() ){ 2099 if ( (*it).birthday().date().isValid() ){
2100 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 2100 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
2101 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 2101 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
2102 ++addCount; 2102 ++addCount;
2103 } 2103 }
2104 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 2104 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
2105 if ( anni.isValid() ){ 2105 if ( anni.isValid() ){
2106 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 2106 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
2107 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 2107 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
2108 ++addCount; 2108 ++addCount;
2109 } 2109 }
2110 } 2110 }
2111 mCalendar->setDefaultCalendar( curCal ); 2111 mCalendar->setDefaultCalendar( curCal );
2112 updateView(); 2112 updateView();
2113 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 2113 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
2114#else //DESKTOP_VERSION 2114#else //DESKTOP_VERSION
2115 2115
2116 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 2116 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
2117 // the result should now arrive through method insertBirthdays 2117 // the result should now arrive through method insertBirthdays
2118 2118
2119#endif //DESKTOP_VERSION 2119#endif //DESKTOP_VERSION
2120 2120
2121#endif //KORG_NOKABC 2121#endif //KORG_NOKABC
2122 2122
2123 2123
2124 return true; 2124 return true;
2125} 2125}
2126 2126
2127// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 2127// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
2128void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 2128void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
2129 const QStringList& anniversaryList, const QStringList& realNameList, 2129 const QStringList& anniversaryList, const QStringList& realNameList,
2130 const QStringList& emailList, const QStringList& assembledNameList, 2130 const QStringList& emailList, const QStringList& assembledNameList,
2131 const QStringList& uidList) 2131 const QStringList& uidList)
2132{ 2132{
2133 2133
2134 //qDebug("KO::CalendarView::insertBirthdays"); 2134 //qDebug("KO::CalendarView::insertBirthdays");
2135 if (uid == this->name()) 2135 if (uid == this->name())
2136 { 2136 {
2137 int curCal = mCalendar->defaultCalendar(); 2137 int curCal = mCalendar->defaultCalendar();
2138 int bd = mCalEditView->getBirtdayID(); 2138 int bd = mCalEditView->getBirtdayID();
2139 if ( bd == 0 ) 2139 if ( bd == 0 )
2140 return; 2140 return;
2141 mCalendar->setDefaultCalendar( bd ); 2141 mCalendar->setDefaultCalendar( bd );
2142 2142
2143 2143
2144 int count = birthdayList.count(); 2144 int count = birthdayList.count();
2145 int addCount = 0; 2145 int addCount = 0;
2146 KCal::Attendee* a = 0; 2146 KCal::Attendee* a = 0;
2147 2147
2148 //qDebug("CalView 1 %i", count); 2148 //qDebug("CalView 1 %i", count);
2149 2149
2150 QProgressBar bar(count,0 ); 2150 QProgressBar bar(count,0 );
2151 int w = 300; 2151 int w = 300;
2152 if ( QApplication::desktop()->width() < 320 ) 2152 if ( QApplication::desktop()->width() < 320 )
2153 w = 220; 2153 w = 220;
2154 int h = bar.sizeHint().height() ; 2154 int h = bar.sizeHint().height() ;
2155 int dw = QApplication::desktop()->width(); 2155 int dw = QApplication::desktop()->width();
2156 int dh = QApplication::desktop()->height(); 2156 int dh = QApplication::desktop()->height();
2157 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2157 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2158 bar.show(); 2158 bar.show();
2159 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 2159 bar.setCaption (i18n("inserting birthdays - close to abort!") );
2160 qApp->processEvents(); 2160 qApp->processEvents();
2161 2161
2162 QDate birthday; 2162 QDate birthday;
2163 QDate anniversary; 2163 QDate anniversary;
2164 QString realName; 2164 QString realName;
2165 QString email; 2165 QString email;
2166 QString assembledName; 2166 QString assembledName;
2167 QString uid; 2167 QString uid;
2168 bool ok = true; 2168 bool ok = true;
2169 for ( int i = 0; i < count; i++) 2169 for ( int i = 0; i < count; i++)
2170 { 2170 {
2171 if ( ! bar.isVisible() ) 2171 if ( ! bar.isVisible() )
2172 return; 2172 return;
2173 bar.setProgress( i ); 2173 bar.setProgress( i );
2174 qApp->processEvents(); 2174 qApp->processEvents();
2175 2175
2176 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 2176 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
2177 if (!ok) { 2177 if (!ok) {
2178 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 2178 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
2179 } 2179 }
2180 2180
2181 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 2181 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
2182 if (!ok) { 2182 if (!ok) {
2183 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 2183 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
2184 } 2184 }
2185 realName = realNameList[i]; 2185 realName = realNameList[i];
2186 email = emailList[i]; 2186 email = emailList[i];
2187 assembledName = assembledNameList[i]; 2187 assembledName = assembledNameList[i];
2188 uid = uidList[i]; 2188 uid = uidList[i];
2189 //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() ); 2189 //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() );
2190 2190
2191 if ( birthday.isValid() ){ 2191 if ( birthday.isValid() ){
2192 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 2192 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
2193 KCal::Attendee::ReqParticipant,uid) ; 2193 KCal::Attendee::ReqParticipant,uid) ;
2194 if ( addAnniversary( birthday, assembledName, a, true ) ) 2194 if ( addAnniversary( birthday, assembledName, a, true ) )
2195 ++addCount; 2195 ++addCount;
2196 } 2196 }
2197 2197
2198 if ( anniversary.isValid() ){ 2198 if ( anniversary.isValid() ){
2199 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 2199 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
2200 KCal::Attendee::ReqParticipant,uid) ; 2200 KCal::Attendee::ReqParticipant,uid) ;
2201 if ( addAnniversary( anniversary, assembledName, a, false ) ) 2201 if ( addAnniversary( anniversary, assembledName, a, false ) )
2202 ++addCount; 2202 ++addCount;
2203 } 2203 }
2204 } 2204 }
2205 2205
2206 mCalendar->setDefaultCalendar( curCal ); 2206 mCalendar->setDefaultCalendar( curCal );
2207 updateView(); 2207 updateView();
2208 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 2208 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
2209 2209
2210 } 2210 }
2211 2211
2212} 2212}
2213 2213
2214 2214
2215 2215
2216bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 2216bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
2217{ 2217{
2218 //qDebug("addAnni "); 2218 //qDebug("addAnni ");
2219 Event * ev = new Event(); 2219 Event * ev = new Event();
2220 ev->setOrganizer(KOPrefs::instance()->email()); 2220 ev->setOrganizer(KOPrefs::instance()->email());
2221 if ( a ) { 2221 if ( a ) {
2222 ev->addAttendee( a ); 2222 ev->addAttendee( a );
2223 } 2223 }
2224 QString kind; 2224 QString kind;
2225 if ( birthday ) { 2225 if ( birthday ) {
2226 kind = i18n( "Birthday" ); 2226 kind = i18n( "Birthday" );
2227 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 2227 ev->setSummary( name + " (" + QString::number(date.year()) +")");
2228 } 2228 }
2229 else { 2229 else {
2230 kind = i18n( "Anniversary" ); 2230 kind = i18n( "Anniversary" );
2231 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 2231 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
2232 } 2232 }
2233 ev->setCategories( kind ); 2233 ev->setCategories( kind );
2234 ev->setDtStart( QDateTime(date) ); 2234 ev->setDtStart( QDateTime(date) );
2235 ev->setDtEnd( QDateTime(date) ); 2235 ev->setDtEnd( QDateTime(date) );
2236 ev->setFloats( true ); 2236 ev->setFloats( true );
2237 Recurrence * rec = ev->recurrence(); 2237 Recurrence * rec = ev->recurrence();
2238 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 2238 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
2239 rec->addYearlyNum( date.month() ); 2239 rec->addYearlyNum( date.month() );
2240 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 2240 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
2241 delete ev; 2241 delete ev;
2242 return false; 2242 return false;
2243 } 2243 }
2244 return true; 2244 return true;
2245 2245
2246} 2246}
2247bool CalendarView::importQtopia( const QString &categories, 2247bool CalendarView::importQtopia( const QString &categories,
2248 const QString &datebook, 2248 const QString &datebook,
2249 const QString &todolist ) 2249 const QString &todolist )
2250{ 2250{
2251 2251
2252 QtopiaFormat qtopiaFormat; 2252 QtopiaFormat qtopiaFormat;
2253 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2253 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
2254 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 2254 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
2255 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 2255 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
2256 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 2256 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
2257 2257
2258 updateView(); 2258 updateView();
2259 return true; 2259 return true;
2260 2260
2261#if 0 2261#if 0
2262 mGlobalSyncMode = SYNC_MODE_QTOPIA; 2262 mGlobalSyncMode = SYNC_MODE_QTOPIA;
2263 mCurrentSyncDevice = "qtopia-XML"; 2263 mCurrentSyncDevice = "qtopia-XML";
2264 if ( mSyncManager->mAskForPreferences ) 2264 if ( mSyncManager->mAskForPreferences )
2265 edit_sync_options(); 2265 edit_sync_options();
2266 qApp->processEvents(); 2266 qApp->processEvents();
2267 CalendarLocal* calendar = new CalendarLocal(); 2267 CalendarLocal* calendar = new CalendarLocal();
2268 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2268 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2269 bool syncOK = false; 2269 bool syncOK = false;
2270 QtopiaFormat qtopiaFormat; 2270 QtopiaFormat qtopiaFormat;
2271 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2271 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
2272 bool loadOk = true; 2272 bool loadOk = true;
2273 if ( !categories.isEmpty() ) 2273 if ( !categories.isEmpty() )
2274 loadOk = qtopiaFormat.load( calendar, categories ); 2274 loadOk = qtopiaFormat.load( calendar, categories );
2275 if ( loadOk && !datebook.isEmpty() ) 2275 if ( loadOk && !datebook.isEmpty() )
2276 loadOk = qtopiaFormat.load( calendar, datebook ); 2276 loadOk = qtopiaFormat.load( calendar, datebook );
2277 if ( loadOk && !todolist.isEmpty() ) 2277 if ( loadOk && !todolist.isEmpty() )
2278 loadOk = qtopiaFormat.load( calendar, todolist ); 2278 loadOk = qtopiaFormat.load( calendar, todolist );
2279 2279
2280 if ( loadOk ) { 2280 if ( loadOk ) {
2281 getEventViewerDialog()->setSyncMode( true ); 2281 getEventViewerDialog()->setSyncMode( true );
2282 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2282 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
2283 getEventViewerDialog()->setSyncMode( false ); 2283 getEventViewerDialog()->setSyncMode( false );
2284 qApp->processEvents(); 2284 qApp->processEvents();
2285 if ( syncOK ) { 2285 if ( syncOK ) {
2286 if ( mSyncManager->mWriteBackFile ) 2286 if ( mSyncManager->mWriteBackFile )
2287 { 2287 {
2288 // write back XML file 2288 // write back XML file
2289 2289
2290 } 2290 }
2291 setModified( true ); 2291 setModified( true );
2292 } 2292 }
2293 } else { 2293 } else {
2294 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 2294 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
2295 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 2295 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
2296 question, i18n("Ok")) ; 2296 question, i18n("Ok")) ;
2297 } 2297 }
2298 delete calendar; 2298 delete calendar;
2299 updateView(); 2299 updateView();
2300 return syncOK; 2300 return syncOK;
2301 2301
2302 2302
2303#endif 2303#endif
2304 2304
2305} 2305}
2306 2306
2307void CalendarView::setSyncEventsReadOnly() 2307void CalendarView::setSyncEventsReadOnly()
2308{ 2308{
2309 mCalendar->setSyncEventsReadOnly(); 2309 mCalendar->setSyncEventsReadOnly();
2310} 2310}
2311 2311
2312bool CalendarView::loadCalendars() 2312bool CalendarView::loadCalendars()
2313{ 2313{
2314 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2314 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2315 KopiCalendarFile * cal = calendars.first(); 2315 KopiCalendarFile * cal = calendars.first();
2316 mCalendar->setDefaultCalendar( 1 ); 2316 mCalendar->setDefaultCalendar( 1 );
2317 openCalendar( MainWindow::defaultFileName(), false ); 2317 openCalendar( MainWindow::defaultFileName(), false );
2318 cal = calendars.next(); 2318 cal = calendars.next();
2319 while ( cal ) { 2319 while ( cal ) {
2320 addCalendar( cal ); 2320 addCalendar( cal );
2321 cal = calendars.next(); 2321 cal = calendars.next();
2322 } 2322 }
2323 restoreCalendarSettings(); 2323 restoreCalendarSettings();
2324 return true; 2324 return true;
2325} 2325}
2326bool CalendarView::restoreCalendarSettings() 2326bool CalendarView::restoreCalendarSettings()
2327{ 2327{
2328 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2328 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2329 KopiCalendarFile * cal = calendars.first(); 2329 KopiCalendarFile * cal = calendars.first();
2330 while ( cal ) { 2330 while ( cal ) {
2331 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 2331 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
2332 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 2332 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
2333 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 2333 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
2334 if ( cal->isStandard ) 2334 if ( cal->isStandard )
2335 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2335 mCalendar->setDefaultCalendar( cal->mCalNumber );
2336 cal = calendars.next(); 2336 cal = calendars.next();
2337 } 2337 }
2338 setSyncEventsReadOnly(); 2338 setSyncEventsReadOnly();
2339 mCalendar->reInitAlarmSettings(); 2339 mCalendar->reInitAlarmSettings();
2340 updateUnmanagedViews(); 2340 updateUnmanagedViews();
2341 updateView(); 2341 updateView();
2342 return true; 2342 return true;
2343} 2343}
2344void CalendarView::addCalendarId( int id ) 2344void CalendarView::addCalendarId( int id )
2345{ 2345{
2346 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 2346 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
2347 if ( cal ) 2347 if ( cal )
2348 addCalendar( cal ); 2348 addCalendar( cal );
2349} 2349}
2350bool CalendarView::addCalendar( KopiCalendarFile * cal ) 2350bool CalendarView::addCalendar( KopiCalendarFile * cal )
2351{ 2351{
2352 cal->mErrorOnLoad = false; 2352 cal->mErrorOnLoad = false;
2353 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 2353 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
2354 cal->mLoadDt = QDateTime::currentDateTime(); 2354 cal->mLoadDt = QDateTime::currentDateTime();
2355 return true; 2355 return true;
2356 } 2356 }
2357 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); 2357 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
2358 cal->mErrorOnLoad = true; 2358 cal->mErrorOnLoad = true;
2359 return false; 2359 return false;
2360} 2360}
2361bool CalendarView::openCalendar(QString filename, bool merge) 2361bool CalendarView::openCalendar(QString filename, bool merge)
2362{ 2362{
2363 2363
2364 if (filename.isEmpty()) { 2364 if (filename.isEmpty()) {
2365 return false; 2365 return false;
2366 } 2366 }
2367 2367
2368 if (!QFile::exists(filename)) { 2368 if (!QFile::exists(filename)) {
2369 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 2369 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
2370 return false; 2370 return false;
2371 } 2371 }
2372 2372
2373 globalFlagBlockAgenda = 1; 2373 globalFlagBlockAgenda = 1;
2374 clearAllViews(); 2374 clearAllViews();
2375 if (!merge) { 2375 if (!merge) {
2376 mViewManager->setDocumentId( filename ); 2376 mViewManager->setDocumentId( filename );
2377 mCalendar->close(); 2377 mCalendar->close();
2378 } 2378 }
2379 mStorage->setFileName( filename ); 2379 mStorage->setFileName( filename );
2380 2380
2381 if ( mStorage->load() ) { 2381 if ( mStorage->load() ) {
2382 if ( merge ) ;//setModified( true ); 2382 if ( merge ) ;//setModified( true );
2383 else { 2383 else {
2384 //setModified( true ); 2384 //setModified( true );
2385 mViewManager->setDocumentId( filename ); 2385 mViewManager->setDocumentId( filename );
2386 mDialogManager->setDocumentId( filename ); 2386 mDialogManager->setDocumentId( filename );
2387 mTodoList->setDocumentId( filename ); 2387 mTodoList->setDocumentId( filename );
2388 } 2388 }
2389 globalFlagBlockAgenda = 2; 2389 globalFlagBlockAgenda = 2;
2390 // if ( getLastSyncEvent() ) 2390 // if ( getLastSyncEvent() )
2391 // getLastSyncEvent()->setReadOnly( true ); 2391 // getLastSyncEvent()->setReadOnly( true );
2392 mCalendar->reInitAlarmSettings(); 2392 mCalendar->reInitAlarmSettings();
2393 setSyncEventsReadOnly(); 2393 setSyncEventsReadOnly();
2394 updateUnmanagedViews(); 2394 //updateUnmanagedViews();
2395 updateView(); 2395 //updateView();
2396 if ( filename != MainWindow::defaultFileName() ) { 2396 if ( filename != MainWindow::defaultFileName() ) {
2397 saveCalendar( MainWindow::defaultFileName() ); 2397 saveCalendar( MainWindow::defaultFileName() );
2398 } else { 2398 } else {
2399 QFileInfo finf ( MainWindow::defaultFileName()); 2399 QFileInfo finf ( MainWindow::defaultFileName());
2400 if ( finf.exists() ) { 2400 if ( finf.exists() ) {
2401 setLoadedFileVersion( finf.lastModified () ); 2401 setLoadedFileVersion( finf.lastModified () );
2402 } 2402 }
2403 } 2403 }
2404 return true; 2404 return true;
2405 } else { 2405 } else {
2406 // while failing to load, the calendar object could 2406 // while failing to load, the calendar object could
2407 // have become partially populated. Clear it out. 2407 // have become partially populated. Clear it out.
2408 if ( !merge ) { 2408 if ( !merge ) {
2409 mCalendar->close(); 2409 mCalendar->close();
2410 mViewManager->setDocumentId( filename ); 2410 mViewManager->setDocumentId( filename );
2411 mDialogManager->setDocumentId( filename ); 2411 mDialogManager->setDocumentId( filename );
2412 mTodoList->setDocumentId( filename ); 2412 mTodoList->setDocumentId( filename );
2413 } 2413 }
2414 2414
2415 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2415 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
2416 2416
2417 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2417 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
2418 globalFlagBlockAgenda = 2; 2418 globalFlagBlockAgenda = 2;
2419 mCalendar->reInitAlarmSettings(); 2419 mCalendar->reInitAlarmSettings();
2420 setSyncEventsReadOnly(); 2420 setSyncEventsReadOnly();
2421 updateUnmanagedViews(); 2421 updateUnmanagedViews();
2422 updateView(); 2422 updateView();
2423 } 2423 }
2424 return false; 2424 return false;
2425} 2425}
2426void CalendarView::mergeFile( QString fn ) 2426void CalendarView::mergeFile( QString fn )
2427{ 2427{
2428 clearAllViews(); 2428 clearAllViews();
2429 mCalendar->mergeCalendarFile( fn ); 2429 mCalendar->mergeCalendarFile( fn );
2430 mCalendar->reInitAlarmSettings(); 2430 mCalendar->reInitAlarmSettings();
2431 setSyncEventsReadOnly(); 2431 setSyncEventsReadOnly();
2432 updateUnmanagedViews(); 2432 updateUnmanagedViews();
2433 updateView(); 2433 updateView();
2434} 2434}
2435void CalendarView::showOpenError() 2435void CalendarView::showOpenError()
2436{ 2436{
2437 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2437 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2438} 2438}
2439void CalendarView::setLoadedFileVersion(QDateTime dt) 2439void CalendarView::setLoadedFileVersion(QDateTime dt)
2440{ 2440{
2441 loadedFileVersion = dt; 2441 loadedFileVersion = dt;
2442} 2442}
2443bool CalendarView::checkFileChanged(QString fn) 2443bool CalendarView::checkFileChanged(QString fn)
2444{ 2444{
2445 QFileInfo finf ( fn ); 2445 QFileInfo finf ( fn );
2446 if ( !finf.exists() ) 2446 if ( !finf.exists() )
2447 return true; 2447 return true;
2448 QDateTime dt = finf.lastModified (); 2448 QDateTime dt = finf.lastModified ();
2449 if ( dt <= loadedFileVersion ) 2449 if ( dt <= loadedFileVersion )
2450 return false; 2450 return false;
2451 return true; 2451 return true;
2452 2452
2453} 2453}
2454void CalendarView::watchSavedFile() 2454void CalendarView::watchSavedFile()
2455{ 2455{
2456 QFileInfo finf ( MainWindow::defaultFileName()); 2456 QFileInfo finf ( MainWindow::defaultFileName());
2457 if ( !finf.exists() ) 2457 if ( !finf.exists() )
2458 return; 2458 return;
2459 QDateTime dt = finf.lastModified (); 2459 QDateTime dt = finf.lastModified ();
2460 if ( dt < loadedFileVersion ) { 2460 if ( dt < loadedFileVersion ) {
2461 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2461 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2462 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2462 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2463 return; 2463 return;
2464 } 2464 }
2465 loadedFileVersion = dt; 2465 loadedFileVersion = dt;
2466} 2466}
2467bool CalendarView::checkAllFileVersions() 2467bool CalendarView::checkAllFileVersions()
2468{ 2468{
2469 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2469 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2470 KopiCalendarFile * cal = calendars.first(); 2470 KopiCalendarFile * cal = calendars.first();
2471 mCalendar->setDefaultCalendar( 1 ); 2471 mCalendar->setDefaultCalendar( 1 );
2472 mCalendar->setDefaultCalendarEnabledOnly(); 2472 mCalendar->setDefaultCalendarEnabledOnly();
2473 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2473 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2474 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2474 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2475 restoreCalendarSettings(); 2475 restoreCalendarSettings();
2476 return false; 2476 return false;
2477 } 2477 }
2478 } 2478 }
2479 cal = calendars.next(); 2479 cal = calendars.next();
2480 QDateTime storeTemp = loadedFileVersion; 2480 QDateTime storeTemp = loadedFileVersion;
2481 while ( cal ) { 2481 while ( cal ) {
2482 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2482 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2483 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2483 mCalendar->setDefaultCalendar( cal->mCalNumber );
2484 mCalendar->setDefaultCalendarEnabledOnly(); 2484 mCalendar->setDefaultCalendarEnabledOnly();
2485 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2485 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2486 if ( !checkFileVersion(cal->mFileName )) { 2486 if ( !checkFileVersion(cal->mFileName )) {
2487 loadedFileVersion = storeTemp; 2487 loadedFileVersion = storeTemp;
2488 restoreCalendarSettings(); 2488 restoreCalendarSettings();
2489 return false; 2489 return false;
2490 } 2490 }
2491 } 2491 }
2492 cal = calendars.next(); 2492 cal = calendars.next();
2493 } 2493 }
2494 loadedFileVersion = storeTemp; 2494 loadedFileVersion = storeTemp;
2495 return true; 2495 return true;
2496} 2496}
2497bool CalendarView::checkFileVersion(QString fn) 2497bool CalendarView::checkFileVersion(QString fn)
2498{ 2498{
2499 QFileInfo finf ( fn ); 2499 QFileInfo finf ( fn );
2500 if ( !finf.exists() ) 2500 if ( !finf.exists() )
2501 return true; 2501 return true;
2502 QDateTime dt = finf.lastModified (); 2502 QDateTime dt = finf.lastModified ();
2503 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2503 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2504 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2504 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2505 if ( dt <= loadedFileVersion ) 2505 if ( dt <= loadedFileVersion )
2506 return true; 2506 return true;
2507 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 2507 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
2508 i18n("KO/Pi Warning"),i18n("Overwrite"), 2508 i18n("KO/Pi Warning"),i18n("Overwrite"),
2509 i18n("Sync+save")); 2509 i18n("Sync+save"));
2510 2510
2511 if ( km == KMessageBox::Cancel ) 2511 if ( km == KMessageBox::Cancel )
2512 return false; 2512 return false;
2513 if ( km == KMessageBox::Yes ) 2513 if ( km == KMessageBox::Yes )
2514 return true; 2514 return true;
2515 2515
2516 setSyncDevice("deleteaftersync" ); 2516 setSyncDevice("deleteaftersync" );
2517 mSyncManager->mAskForPreferences = true; 2517 mSyncManager->mAskForPreferences = true;
2518 mSyncManager->mSyncAlgoPrefs = 3; 2518 mSyncManager->mSyncAlgoPrefs = 3;
2519 mSyncManager->mWriteBackFile = false; 2519 mSyncManager->mWriteBackFile = false;
2520 mSyncManager->mWriteBackExistingOnly = false; 2520 mSyncManager->mWriteBackExistingOnly = false;
2521 mSyncManager->mShowSyncSummary = false; 2521 mSyncManager->mShowSyncSummary = false;
2522 syncCalendar( fn, 3 ); 2522 syncCalendar( fn, 3 );
2523 Event * e = getLastSyncEvent(); 2523 Event * e = getLastSyncEvent();
2524 if ( e ) 2524 if ( e )
2525 mCalendar->deleteEvent( e ); 2525 mCalendar->deleteEvent( e );
2526 return true; 2526 return true;
2527} 2527}
2528bool CalendarView::saveCalendars() 2528bool CalendarView::saveCalendars()
2529{ 2529{
2530 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2530 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2531 KopiCalendarFile * cal = calendars.first(); 2531 KopiCalendarFile * cal = calendars.first();
2532 mCalendar->setDefaultCalendar( 1 ); 2532 mCalendar->setDefaultCalendar( 1 );
2533 mCalendar->setDefaultCalendarEnabledOnly(); 2533 mCalendar->setDefaultCalendarEnabledOnly();
2534 QString saveError; 2534 QString saveError;
2535 if ( !saveCalendar( MainWindow::defaultFileName() ) ) 2535 if ( !saveCalendar( MainWindow::defaultFileName() ) )
2536 saveError = cal->mName +"\n"; 2536 saveError = cal->mName +"\n";
2537 cal = calendars.next(); 2537 cal = calendars.next();
2538 while ( cal ) { 2538 while ( cal ) {
2539 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2539 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2540 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2540 mCalendar->setDefaultCalendar( cal->mCalNumber );
2541 mCalendar->setDefaultCalendarEnabledOnly(); 2541 mCalendar->setDefaultCalendarEnabledOnly();
2542 if ( saveCalendar( cal->mFileName ) ) 2542 if ( saveCalendar( cal->mFileName ) )
2543 cal->mLoadDt = QDateTime::currentDateTime(); 2543 cal->mLoadDt = QDateTime::currentDateTime();
2544 else 2544 else
2545 saveError += cal->mName + "\n"; 2545 saveError += cal->mName + "\n";
2546 } 2546 }
2547 cal = calendars.next(); 2547 cal = calendars.next();
2548 } 2548 }
2549 restoreCalendarSettings(); 2549 restoreCalendarSettings();
2550 if ( !saveError.isEmpty() ) { 2550 if ( !saveError.isEmpty() ) {
2551 saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; 2551 saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError;
2552 KMessageBox::error(this, saveError, i18n("Error saving data")); 2552 KMessageBox::error(this, saveError, i18n("Error saving data"));
2553 return false; 2553 return false;
2554 } 2554 }
2555 return true; 2555 return true;
2556} 2556}
2557bool CalendarView::saveCalendar( QString filename ) 2557bool CalendarView::saveCalendar( QString filename )
2558{ 2558{
2559 2559
2560 // Store back all unsaved data into calendar object 2560 // Store back all unsaved data into calendar object
2561 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2561 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2562 if ( mViewManager->currentView() ) 2562 if ( mViewManager->currentView() )
2563 mViewManager->currentView()->flushView(); 2563 mViewManager->currentView()->flushView();
2564 2564
2565 2565
2566 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2566 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2567 mStorage->setSaveFormat( new ICalFormat() ); 2567 mStorage->setSaveFormat( new ICalFormat() );
2568 mStorage->setFileName( filename ); 2568 mStorage->setFileName( filename );
2569 bool success; 2569 bool success;
2570 success = mStorage->save(); 2570 success = mStorage->save();
2571 if ( !success ) { 2571 if ( !success ) {
2572 return false; 2572 return false;
2573 } 2573 }
2574 if ( filename == MainWindow::defaultFileName() ) { 2574 if ( filename == MainWindow::defaultFileName() ) {
2575 setLoadedFileVersion( lfv ); 2575 setLoadedFileVersion( lfv );
2576 watchSavedFile(); 2576 watchSavedFile();
2577 } 2577 }
2578 return true; 2578 return true;
2579} 2579}
2580 2580
2581void CalendarView::closeCalendar() 2581void CalendarView::closeCalendar()
2582{ 2582{
2583 2583
2584 // child windows no longer valid 2584 // child windows no longer valid
2585 clearAllViews(); 2585 clearAllViews();
2586 emit closingDown(); 2586 emit closingDown();
2587 2587
2588 mCalendar->close(); 2588 mCalendar->close();
2589 setModified(false); 2589 setModified(false);
2590 updateView(); 2590 updateView();
2591} 2591}
2592 2592
2593void CalendarView::archiveCalendar() 2593void CalendarView::archiveCalendar()
2594{ 2594{
2595 mDialogManager->showArchiveDialog(); 2595 mDialogManager->showArchiveDialog();
2596} 2596}
2597 2597
2598 2598
2599void CalendarView::readSettings() 2599void CalendarView::readSettings()
2600{ 2600{
2601 2601
2602 2602
2603 // mViewManager->showAgendaView(); 2603 // mViewManager->showAgendaView();
2604 QString str; 2604 QString str;
2605 //qDebug("CalendarView::readSettings() "); 2605 //qDebug("CalendarView::readSettings() ");
2606 // read settings from the KConfig, supplying reasonable 2606 // read settings from the KConfig, supplying reasonable
2607 // defaults where none are to be found 2607 // defaults where none are to be found
2608 KConfig *config = KOGlobals::config(); 2608 KConfig *config = KOGlobals::config();
2609#ifndef KORG_NOSPLITTER 2609#ifndef KORG_NOSPLITTER
2610 config->setGroup("KOrganizer Geometry"); 2610 config->setGroup("KOrganizer Geometry");
2611 2611
2612 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2612 QValueList<int> sizes = config->readIntListEntry("Separator1");
2613 if (sizes.count() != 2) { 2613 if (sizes.count() != 2) {
2614 sizes << mDateNavigator->minimumSizeHint().width(); 2614 sizes << mDateNavigator->minimumSizeHint().width();
2615 sizes << 300; 2615 sizes << 300;
2616 } 2616 }
2617 mPanner->setSizes(sizes); 2617 mPanner->setSizes(sizes);
2618 2618
2619 sizes = config->readIntListEntry("Separator2"); 2619 sizes = config->readIntListEntry("Separator2");
2620 if ( ( mResourceView && sizes.count() == 4 ) || 2620 if ( ( mResourceView && sizes.count() == 4 ) ||
2621 ( !mResourceView && sizes.count() == 3 ) ) { 2621 ( !mResourceView && sizes.count() == 3 ) ) {
2622 mLeftSplitter->setSizes(sizes); 2622 mLeftSplitter->setSizes(sizes);
2623 } 2623 }
2624#endif 2624#endif
2625 globalFlagBlockAgenda = 1; 2625 globalFlagBlockAgenda = 1;
2626 mViewManager->showAgendaView(); 2626 mViewManager->showAgendaView();
2627 //mViewManager->readSettings( config ); 2627 //mViewManager->readSettings( config );
2628 mTodoList->restoreLayout(config,QString("Todo Layout")); 2628 mTodoList->restoreLayout(config,QString("Todo Layout"));
2629 readFilterSettings(config); 2629 readFilterSettings(config);
2630 2630
2631#ifdef DESKTOP_VERSION 2631#ifdef DESKTOP_VERSION
2632 config->setGroup("WidgetLayout"); 2632 config->setGroup("WidgetLayout");
2633 QStringList list; 2633 QStringList list;
2634 list = config->readListEntry("MainLayout"); 2634 list = config->readListEntry("MainLayout");
2635 int x,y,w,h; 2635 int x,y,w,h;
2636 if ( ! list.isEmpty() ) { 2636 if ( ! list.isEmpty() ) {
2637 x = list[0].toInt(); 2637 x = list[0].toInt();
2638 y = list[1].toInt(); 2638 y = list[1].toInt();
2639 w = list[2].toInt(); 2639 w = list[2].toInt();
2640 h = list[3].toInt(); 2640 h = list[3].toInt();
2641 KApplication::testCoords( &x,&y,&w,&h ); 2641 KApplication::testCoords( &x,&y,&w,&h );
2642 topLevelWidget()->setGeometry(x,y,w,h); 2642 topLevelWidget()->setGeometry(x,y,w,h);
2643 2643
2644 } else { 2644 } else {
2645 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2645 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2646 } 2646 }
2647 list = config->readListEntry("EditEventLayout"); 2647 list = config->readListEntry("EditEventLayout");
2648 if ( ! list.isEmpty() ) { 2648 if ( ! list.isEmpty() ) {
2649 x = list[0].toInt(); 2649 x = list[0].toInt();
2650 y = list[1].toInt(); 2650 y = list[1].toInt();
2651 w = list[2].toInt(); 2651 w = list[2].toInt();
2652 h = list[3].toInt(); 2652 h = list[3].toInt();
2653 KApplication::testCoords( &x,&y,&w,&h ); 2653 KApplication::testCoords( &x,&y,&w,&h );
2654 mEventEditor->setGeometry(x,y,w,h); 2654 mEventEditor->setGeometry(x,y,w,h);
2655 2655
2656 } 2656 }
2657 list = config->readListEntry("EditTodoLayout"); 2657 list = config->readListEntry("EditTodoLayout");
2658 if ( ! list.isEmpty() ) { 2658 if ( ! list.isEmpty() ) {
2659 x = list[0].toInt(); 2659 x = list[0].toInt();
2660 y = list[1].toInt(); 2660 y = list[1].toInt();
2661 w = list[2].toInt(); 2661 w = list[2].toInt();
2662 h = list[3].toInt(); 2662 h = list[3].toInt();
2663 KApplication::testCoords( &x,&y,&w,&h ); 2663 KApplication::testCoords( &x,&y,&w,&h );
2664 mTodoEditor->setGeometry(x,y,w,h); 2664 mTodoEditor->setGeometry(x,y,w,h);
2665 2665
2666 } 2666 }
2667 list = config->readListEntry("ViewerLayout"); 2667 list = config->readListEntry("ViewerLayout");
2668 if ( ! list.isEmpty() ) { 2668 if ( ! list.isEmpty() ) {
2669 x = list[0].toInt(); 2669 x = list[0].toInt();
2670 y = list[1].toInt(); 2670 y = list[1].toInt();
2671 w = list[2].toInt(); 2671 w = list[2].toInt();
2672 h = list[3].toInt(); 2672 h = list[3].toInt();
2673 KApplication::testCoords( &x,&y,&w,&h ); 2673 KApplication::testCoords( &x,&y,&w,&h );
2674 getEventViewerDialog()->setGeometry(x,y,w,h); 2674 getEventViewerDialog()->setGeometry(x,y,w,h);
2675 } 2675 }
2676#endif 2676#endif
2677 config->setGroup( "Views" ); 2677 config->setGroup( "Views" );
2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2679 2679
2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2681 2681
2682 int resetval = 0; 2682 int resetval = 0;
2683 int maxVal = 0; 2683 int maxVal = 0;
2684 if (sizes.count() != 3) { 2684 if (sizes.count() != 3) {
2685 if ( KOPrefs::instance()->mVerticalScreen ) { 2685 if ( KOPrefs::instance()->mVerticalScreen ) {
2686 resetval = mDateNavigator->sizeHint().width()+2; 2686 resetval = mDateNavigator->sizeHint().width()+2;
2687 } else { 2687 } else {
2688 resetval = mDateNavigator->sizeHint().height()+2; 2688 resetval = mDateNavigator->sizeHint().height()+2;
2689 } 2689 }
2690 } 2690 }
2691 if ( resetval ) { 2691 if ( resetval ) {
2692 sizes.clear(); 2692 sizes.clear();
2693 if ( KOPrefs::instance()->mVerticalScreen ) { 2693 if ( KOPrefs::instance()->mVerticalScreen ) {
2694 maxVal = QApplication::desktop()->width() -10; 2694 maxVal = QApplication::desktop()->width() -10;
2695 } else { 2695 } else {
2696 maxVal = QApplication::desktop()->height()-10; 2696 maxVal = QApplication::desktop()->height()-10;
2697 } 2697 }
2698 sizes << resetval; 2698 sizes << resetval;
2699 if ( maxVal < resetval + resetval) 2699 if ( maxVal < resetval + resetval)
2700 resetval = maxVal - resetval; 2700 resetval = maxVal - resetval;
2701 sizes << resetval; 2701 sizes << resetval;
2702 sizes << 100; 2702 sizes << 100;
2703 } 2703 }
2704 mLeftFrame->setSizes(sizes); 2704 mLeftFrame->setSizes(sizes);
2705 sizes = config->readIntListEntry("Main Splitter Frame"); 2705 sizes = config->readIntListEntry("Main Splitter Frame");
2706 resetval = 0; 2706 resetval = 0;
2707 maxVal = 0; 2707 maxVal = 0;
2708 if (sizes.count() != 2) { 2708 if (sizes.count() != 2) {
2709 if ( !KOPrefs::instance()->mVerticalScreen ) { 2709 if ( !KOPrefs::instance()->mVerticalScreen ) {
2710 resetval = mDateNavigator->sizeHint().width()+2; 2710 resetval = mDateNavigator->sizeHint().width()+2;
2711 } else { 2711 } else {
2712 resetval = mDateNavigator->sizeHint().height()+2; 2712 resetval = mDateNavigator->sizeHint().height()+2;
2713 } 2713 }
2714 } 2714 }
2715 if ( resetval ) { 2715 if ( resetval ) {
2716 sizes.clear(); 2716 sizes.clear();
2717 if ( !KOPrefs::instance()->mVerticalScreen ) { 2717 if ( !KOPrefs::instance()->mVerticalScreen ) {
2718 maxVal = QApplication::desktop()->width() -10; 2718 maxVal = QApplication::desktop()->width() -10;
2719 } else { 2719 } else {
2720 maxVal = QApplication::desktop()->height()-10; 2720 maxVal = QApplication::desktop()->height()-10;
2721 } 2721 }
2722 sizes << resetval; 2722 sizes << resetval;
2723 if ( maxVal < resetval + resetval) 2723 if ( maxVal < resetval + resetval)
2724 resetval = maxVal - resetval; 2724 resetval = maxVal - resetval;
2725 sizes << resetval; 2725 sizes << resetval;
2726 } 2726 }
2727 mMainFrame->setSizes(sizes); 2727 mMainFrame->setSizes(sizes);
2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2729 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2729 else if ( dateCount == 7 ) mNavigator->selectWeek();
2730 else mNavigator->selectDates( dateCount ); 2730 else mNavigator->selectDates( dateCount );
2731 // mViewManager->readSettings( config ); 2731 // mViewManager->readSettings( config );
2732 updateConfig(); 2732 updateConfig();
2733 globalFlagBlockAgenda = 2; 2733 globalFlagBlockAgenda = 2;
2734 mViewManager->readSettings( config ); 2734 mViewManager->readSettings( config );
2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2736} 2736}
2737 2737
2738void CalendarView::checkSuspendAlarm() 2738void CalendarView::checkSuspendAlarm()
2739{ 2739{
2740 if ( mSuspendTimer->isActive() ) { 2740 if ( mSuspendTimer->isActive() ) {
2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2742 } 2742 }
2743} 2743}
2744void CalendarView::writeSettings() 2744void CalendarView::writeSettings()
2745{ 2745{
2746 // kdDebug() << "CalendarView::writeSettings" << endl; 2746 // kdDebug() << "CalendarView::writeSettings" << endl;
2747 2747
2748 KConfig *config = KOGlobals::config(); 2748 KConfig *config = KOGlobals::config();
2749 2749
2750 mViewManager->writeSettings( config ); 2750 mViewManager->writeSettings( config );
2751 mTodoList->saveLayout(config,QString("Todo Layout")); 2751 mTodoList->saveLayout(config,QString("Todo Layout"));
2752 mDialogManager->writeSettings( config ); 2752 mDialogManager->writeSettings( config );
2753 //KOPrefs::instance()->usrWriteConfig(); 2753 //KOPrefs::instance()->usrWriteConfig();
2754 KOPrefs::instance()->writeConfig(); 2754 KOPrefs::instance()->writeConfig();
2755 2755
2756 writeFilterSettings(config); 2756 writeFilterSettings(config);
2757 config->setGroup( "AppRun" ); 2757 config->setGroup( "AppRun" );
2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2759 int days = dt.daysTo( QDate::currentDate() ); 2759 int days = dt.daysTo( QDate::currentDate() );
2760 dt = dt.addDays( days ); 2760 dt = dt.addDays( days );
2761 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2761 int secs = dt.secsTo( QDateTime::currentDateTime() );
2762 config->writeEntry( "LatestProgramStopDays", days ); 2762 config->writeEntry( "LatestProgramStopDays", days );
2763 config->writeEntry( "LatestProgramStopSecs", secs ); 2763 config->writeEntry( "LatestProgramStopSecs", secs );
2764 //qDebug("KO: Writing stop time: %d ", secs); 2764 //qDebug("KO: Writing stop time: %d ", secs);
2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2766 //QDateTime latest = dt.addSecs ( secs ); 2766 //QDateTime latest = dt.addSecs ( secs );
2767 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2767 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2768 config->setGroup( "Views" ); 2768 config->setGroup( "Views" );
2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2770 2770
2771#if 0 2771#if 0
2772 qDebug("********************* "); 2772 qDebug("********************* ");
2773 qDebug("Testcode secsto "); 2773 qDebug("Testcode secsto ");
2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2776 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2776 int secsto = dt_nodaylight.secsTo( dt_daylight );
2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 17248dc..07bfdbf 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -123,768 +123,773 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name
123 sde->setDate( mTodo->runStart().date() ); 123 sde->setDate( mTodo->runStart().date() );
124 ste->setTime( mTodo->runStart().time() ); 124 ste->setTime( mTodo->runStart().time() );
125 ede->setDate( QDate::currentDate()); 125 ede->setDate( QDate::currentDate());
126 ete->setTime( QTime::currentTime() ); 126 ete->setTime( QTime::currentTime() );
127 QPushButton * ok = new QPushButton( i18n("Stop and save"), this ); 127 QPushButton * ok = new QPushButton( i18n("Stop and save"), this );
128 lay->addWidget( ok ); 128 lay->addWidget( ok );
129 ok->setDefault( true ); 129 ok->setDefault( true );
130 QPushButton * cancel = new QPushButton( i18n("Continue running"), this ); 130 QPushButton * cancel = new QPushButton( i18n("Continue running"), this );
131 lay->addWidget( cancel ); 131 lay->addWidget( cancel );
132 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 132 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
133 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 133 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
134 ok = new QPushButton( i18n("Stop - do not save"), this ); 134 ok = new QPushButton( i18n("Stop - do not save"), this );
135 connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) ); 135 connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) );
136 lay->addWidget( ok ); 136 lay->addWidget( ok );
137 if (QApplication::desktop()->width() < 320 ) 137 if (QApplication::desktop()->width() < 320 )
138 resize( 240, sizeHint().height() ); 138 resize( 240, sizeHint().height() );
139 else 139 else
140 resize( 320, sizeHint().height() ); 140 resize( 320, sizeHint().height() );
141 141
142} 142}
143 143
144void KOStopTodoPrefs::accept() 144void KOStopTodoPrefs::accept()
145{ 145{
146 QDateTime start = QDateTime( sde->date(), ste->getTime() ); 146 QDateTime start = QDateTime( sde->date(), ste->getTime() );
147 QDateTime stop = QDateTime( ede->date(), ete->getTime() ); 147 QDateTime stop = QDateTime( ede->date(), ete->getTime() );
148 if ( start > stop ) { 148 if ( start > stop ) {
149 KMessageBox::sorry(this, 149 KMessageBox::sorry(this,
150 i18n("The start time is\nafter the end time!"), 150 i18n("The start time is\nafter the end time!"),
151 i18n("Time mismatch!")); 151 i18n("Time mismatch!"));
152 return; 152 return;
153 } 153 }
154 mTodo->saveRunningInfo( mComment->text(), start, stop ); 154 mTodo->saveRunningInfo( mComment->text(), start, stop );
155 QDialog::accept(); 155 QDialog::accept();
156} 156}
157void KOStopTodoPrefs::doNotSave() 157void KOStopTodoPrefs::doNotSave()
158{ 158{
159 int result = KMessageBox::warningContinueCancel(this, 159 int result = KMessageBox::warningContinueCancel(this,
160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") ); 160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") );
161 if (result != KMessageBox::Continue) return; 161 if (result != KMessageBox::Continue) return;
162 mTodo->stopRunning(); 162 mTodo->stopRunning();
163 QDialog::accept(); 163 QDialog::accept();
164} 164}
165 165
166 166
167class KOTodoViewWhatsThis :public QWhatsThis 167class KOTodoViewWhatsThis :public QWhatsThis
168{ 168{
169public: 169public:
170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; 170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
171 171
172protected: 172protected:
173 virtual QString text( const QPoint& p) 173 virtual QString text( const QPoint& p)
174 { 174 {
175 return _view->getWhatsThisText(p) ; 175 return _view->getWhatsThisText(p) ;
176 } 176 }
177private: 177private:
178 QWidget* _wid; 178 QWidget* _wid;
179 KOTodoView * _view; 179 KOTodoView * _view;
180}; 180};
181 181
182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
183 const char *name) : 183 const char *name) :
184 KListView(parent,name) 184 KListView(parent,name)
185{ 185{
186 mName = QString ( name ); 186 mName = QString ( name );
187 mCalendar = calendar; 187 mCalendar = calendar;
188#ifndef DESKTOP_VERSION 188#ifndef DESKTOP_VERSION
189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
190#endif 190#endif
191 mOldCurrent = 0; 191 mOldCurrent = 0;
192 mMousePressed = false; 192 mMousePressed = false;
193 193
194 setAcceptDrops(true); 194 setAcceptDrops(true);
195 viewport()->setAcceptDrops(true); 195 viewport()->setAcceptDrops(true);
196 int size = 16; 196 int size = 16;
197 if (qApp->desktop()->width() < 300 ) 197 if (qApp->desktop()->width() < 300 )
198 size = 12; 198 size = 12;
199 setTreeStepSize( size + 6 ); 199 setTreeStepSize( size + 6 );
200 200
201} 201}
202 202
203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) 203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e)
204{ 204{
205#ifndef KORG_NODND 205#ifndef KORG_NODND
206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; 206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl;
207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
208 !QTextDrag::canDecode( e ) ) { 208 !QTextDrag::canDecode( e ) ) {
209 e->ignore(); 209 e->ignore();
210 return; 210 return;
211 } 211 }
212 212
213 mOldCurrent = currentItem(); 213 mOldCurrent = currentItem();
214#endif 214#endif
215} 215}
216 216
217 217
218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) 218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e)
219{ 219{
220#ifndef KORG_NODND 220#ifndef KORG_NODND
221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; 221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl;
222 222
223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
224 !QTextDrag::canDecode( e ) ) { 224 !QTextDrag::canDecode( e ) ) {
225 e->ignore(); 225 e->ignore();
226 return; 226 return;
227 } 227 }
228 228
229 e->accept(); 229 e->accept();
230#endif 230#endif
231} 231}
232 232
233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) 233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *)
234{ 234{
235#ifndef KORG_NODND 235#ifndef KORG_NODND
236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; 236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl;
237 237
238 setCurrentItem(mOldCurrent); 238 setCurrentItem(mOldCurrent);
239 setSelected(mOldCurrent,true); 239 setSelected(mOldCurrent,true);
240#endif 240#endif
241} 241}
242 242
243void KOTodoListView::contentsDropEvent(QDropEvent *e) 243void KOTodoListView::contentsDropEvent(QDropEvent *e)
244{ 244{
245#ifndef KORG_NODND 245#ifndef KORG_NODND
246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl; 246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl;
247 247
248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
249 !QTextDrag::canDecode( e ) ) { 249 !QTextDrag::canDecode( e ) ) {
250 e->ignore(); 250 e->ignore();
251 return; 251 return;
252 } 252 }
253 253
254 DndFactory factory( mCalendar ); 254 DndFactory factory( mCalendar );
255 Todo *todo = factory.createDropTodo(e); 255 Todo *todo = factory.createDropTodo(e);
256 256
257 if (todo) { 257 if (todo) {
258 e->acceptAction(); 258 e->acceptAction();
259 259
260 KOTodoViewItem *destination = 260 KOTodoViewItem *destination =
261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); 261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
262 Todo *destinationEvent = 0; 262 Todo *destinationEvent = 0;
263 if (destination) destinationEvent = destination->todo(); 263 if (destination) destinationEvent = destination->todo();
264 264
265 Todo *existingTodo = mCalendar->todo(todo->uid()); 265 Todo *existingTodo = mCalendar->todo(todo->uid());
266 266
267 if(existingTodo) { 267 if(existingTodo) {
268 Incidence *to = destinationEvent; 268 Incidence *to = destinationEvent;
269 while(to) { 269 while(to) {
270 if (to->uid() == todo->uid()) { 270 if (to->uid() == todo->uid()) {
271 KMessageBox::sorry(this, 271 KMessageBox::sorry(this,
272 i18n("Cannot move Todo to itself\nor a child of itself"), 272 i18n("Cannot move Todo to itself\nor a child of itself"),
273 i18n("Drop Todo")); 273 i18n("Drop Todo"));
274 delete todo; 274 delete todo;
275 return; 275 return;
276 } 276 }
277 to = to->relatedTo(); 277 to = to->relatedTo();
278 } 278 }
279 internalDrop = true; 279 internalDrop = true;
280 if ( destinationEvent ) 280 if ( destinationEvent )
281 reparentTodoSignal( destinationEvent, existingTodo ); 281 reparentTodoSignal( destinationEvent, existingTodo );
282 else 282 else
283 unparentTodoSignal(existingTodo); 283 unparentTodoSignal(existingTodo);
284 delete todo; 284 delete todo;
285 } else { 285 } else {
286 mCalendar->addTodo(todo); 286 mCalendar->addTodo(todo);
287 emit todoDropped(todo, KOGlobals::EVENTADDED); 287 emit todoDropped(todo, KOGlobals::EVENTADDED);
288 if ( destinationEvent ) 288 if ( destinationEvent )
289 reparentTodoSignal( destinationEvent, todo ); 289 reparentTodoSignal( destinationEvent, todo );
290 } 290 }
291 } 291 }
292 else { 292 else {
293 QString text; 293 QString text;
294 if (QTextDrag::decode(e,text)) { 294 if (QTextDrag::decode(e,text)) {
295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); 295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); 296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
297 qDebug("Dropped : " + text); 297 qDebug("Dropped : " + text);
298 QStringList emails = QStringList::split(",",text); 298 QStringList emails = QStringList::split(",",text);
299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
300 int pos = (*it).find("<"); 300 int pos = (*it).find("<");
301 QString name = (*it).left(pos); 301 QString name = (*it).left(pos);
302 QString email = (*it).mid(pos); 302 QString email = (*it).mid(pos);
303 if (!email.isEmpty() && todoi) { 303 if (!email.isEmpty() && todoi) {
304 todoi->todo()->addAttendee(new Attendee(name,email)); 304 todoi->todo()->addAttendee(new Attendee(name,email));
305 } 305 }
306 } 306 }
307 } 307 }
308 else { 308 else {
309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); 309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable ");
310 e->ignore(); 310 e->ignore();
311 } 311 }
312 } 312 }
313#endif 313#endif
314} 314}
315void KOTodoListView::wheelEvent (QWheelEvent *e) 315void KOTodoListView::wheelEvent (QWheelEvent *e)
316{ 316{
317 QListView::wheelEvent (e); 317 QListView::wheelEvent (e);
318} 318}
319 319
320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) 320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
321{ 321{
322 322
323 QPoint p(contentsToViewport(e->pos())); 323 QPoint p(contentsToViewport(e->pos()));
324 QListViewItem *i = itemAt(p); 324 QListViewItem *i = itemAt(p);
325 bool rootClicked = true; 325 bool rootClicked = true;
326 if (i) { 326 if (i) {
327 // if the user clicked into the root decoration of the item, don't 327 // if the user clicked into the root decoration of the item, don't
328 // try to start a drag! 328 // try to start a drag!
329 int X = p.x(); 329 int X = p.x();
330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
331 if (X > header()->sectionPos(0) + 331 if (X > header()->sectionPos(0) +
332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
333 itemMargin() +i->height()|| 333 itemMargin() +i->height()||
334 X < header()->sectionPos(0)) { 334 X < header()->sectionPos(0)) {
335 rootClicked = false; 335 rootClicked = false;
336 } 336 }
337 } else { 337 } else {
338 rootClicked = false; 338 rootClicked = false;
339 } 339 }
340#ifndef KORG_NODND 340#ifndef KORG_NODND
341 mMousePressed = false; 341 mMousePressed = false;
342 if (! rootClicked && !( e->button() == RightButton) ) { 342 if (! rootClicked && !( e->button() == RightButton) ) {
343 mPressPos = e->pos(); 343 mPressPos = e->pos();
344 mMousePressed = true; 344 mMousePressed = true;
345 } else { 345 } else {
346 mMousePressed = false; 346 mMousePressed = false;
347 } 347 }
348#endif 348#endif
349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); 349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
350#ifndef DESKTOP_VERSION 350#ifndef DESKTOP_VERSION
351 if (!( e->button() == RightButton && rootClicked) ) 351 if (!( e->button() == RightButton && rootClicked) )
352 QListView::contentsMousePressEvent(e); 352 QListView::contentsMousePressEvent(e);
353#else 353#else
354 QListView::contentsMousePressEvent(e); 354 QListView::contentsMousePressEvent(e);
355#endif 355#endif
356} 356}
357void KOTodoListView::paintEvent(QPaintEvent* e) 357void KOTodoListView::paintEvent(QPaintEvent* e)
358{ 358{
359 emit paintNeeded(); 359 emit paintNeeded();
360 QListView::paintEvent( e); 360 QListView::paintEvent( e);
361} 361}
362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
363{ 363{
364 364
365#ifndef KORG_NODND 365#ifndef KORG_NODND
366 //QListView::contentsMouseMoveEvent(e); 366 //QListView::contentsMouseMoveEvent(e);
367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
368 QApplication::startDragDistance()*3) { 368 QApplication::startDragDistance()*3) {
369 mMousePressed = false; 369 mMousePressed = false;
370 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 370 QListViewItem *item = itemAt(contentsToViewport(mPressPos));
371 if (item) { 371 if (item) {
372 DndFactory factory( mCalendar ); 372 DndFactory factory( mCalendar );
373 ICalDrag *vd = factory.createDrag( 373 ICalDrag *vd = factory.createDrag(
374 ((KOTodoViewItem *)item)->todo(),viewport()); 374 ((KOTodoViewItem *)item)->todo(),viewport());
375 internalDrop = false; 375 internalDrop = false;
376 // we cannot do any senseful here, because the DnD is still broken in Qt 376 // we cannot do any senseful here, because the DnD is still broken in Qt
377 if (vd->drag()) { 377 if (vd->drag()) {
378 if ( !internalDrop ) { 378 if ( !internalDrop ) {
379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
380 qDebug("Dnd: External move: Delete drag source "); 380 qDebug("Dnd: External move: Delete drag source ");
381 } else 381 } else
382 qDebug("Dnd: Internal move "); 382 qDebug("Dnd: Internal move ");
383 383
384 } else { 384 } else {
385 if ( !internalDrop ) { 385 if ( !internalDrop ) {
386 qDebug("Dnd: External Copy"); 386 qDebug("Dnd: External Copy");
387 } else 387 } else
388 qDebug("DnD: Internal copy: Copy pending"); 388 qDebug("DnD: Internal copy: Copy pending");
389 } 389 }
390 } 390 }
391 } 391 }
392#endif 392#endif
393} 393}
394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
395{ 395{
396 if ( !e->isAutoRepeat() ) { 396 if ( !e->isAutoRepeat() ) {
397 mFlagKeyPressed = false; 397 mFlagKeyPressed = false;
398 } 398 }
399} 399}
400 400
401 401
402void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 402void KOTodoListView::keyPressEvent ( QKeyEvent * e )
403{ 403{
404 qApp->processEvents(); 404 qApp->processEvents();
405 if ( !isVisible() ) { 405 if ( !isVisible() ) {
406 e->ignore(); 406 e->ignore();
407 return; 407 return;
408 } 408 }
409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
410 e->ignore(); 410 e->ignore();
411 // qDebug(" ignore %d",e->isAutoRepeat() ); 411 // qDebug(" ignore %d",e->isAutoRepeat() );
412 return; 412 return;
413 } 413 }
414 if (! e->isAutoRepeat() ) 414 if (! e->isAutoRepeat() )
415 mFlagKeyPressed = true; 415 mFlagKeyPressed = true;
416 QListViewItem* cn; 416 QListViewItem* cn;
417 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { 417 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") {
418 cn = currentItem(); 418 cn = currentItem();
419 if ( cn ) { 419 if ( cn ) {
420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
421 if ( ci ){ 421 if ( ci ){
422 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
423 ci->setOn( false ); 423 ci->setOn( false );
424 else 424 else
425 ci->setOn( true ); 425 ci->setOn( true );
426 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
427 if ( cn ) { 427 if ( cn ) {
428 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
429 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
430 } 430 }
431 431
432 } 432 }
433 } 433 }
434 434
435 e->accept(); 435 e->accept();
436 return; 436 return;
437 } 437 }
438 438
439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
440 switch ( e->key() ) { 440 switch ( e->key() ) {
441 case Qt::Key_Down: 441 case Qt::Key_Down:
442 case Qt::Key_Up: 442 case Qt::Key_Up:
443 QListView::keyPressEvent ( e ); 443 QListView::keyPressEvent ( e );
444 e->accept(); 444 e->accept();
445 break; 445 break;
446 case Qt::Key_Left: 446 case Qt::Key_Left:
447 case Qt::Key_Right: 447 case Qt::Key_Right:
448 QListView::keyPressEvent ( e ); 448 QListView::keyPressEvent ( e );
449 e->accept(); 449 e->accept();
450 return; 450 return;
451 break; 451 break;
452 default: 452 default:
453 e->ignore(); 453 e->ignore();
454 break; 454 break;
455 } 455 }
456 return; 456 return;
457 } 457 }
458 e->ignore(); 458 e->ignore();
459} 459}
460void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 460void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
461{ 461{
462 QListView::contentsMouseReleaseEvent(e); 462 QListView::contentsMouseReleaseEvent(e);
463 mMousePressed = false; 463 mMousePressed = false;
464} 464}
465 465
466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
467{ 467{
468 if (!e) return; 468 if (!e) return;
469 469
470 QPoint vp = contentsToViewport(e->pos()); 470 QPoint vp = contentsToViewport(e->pos());
471 471
472 QListViewItem *item = itemAt(vp); 472 QListViewItem *item = itemAt(vp);
473 473
474 emit double_Clicked(item); 474 emit double_Clicked(item);
475 if (!item) return; 475 if (!item) return;
476 476
477 emit doubleClicked(item,vp,0); 477 emit doubleClicked(item,vp,0);
478} 478}
479 479
480///////////////////////////////////////////////////////////////////////////// 480/////////////////////////////////////////////////////////////////////////////
481 481
482KOQuickTodo::KOQuickTodo(QWidget *parent) : 482KOQuickTodo::KOQuickTodo(QWidget *parent) :
483 QLineEdit(parent) 483 QLineEdit(parent)
484{ 484{
485 setText(i18n("Click to add new Todo")); 485 setText(i18n("Click to add new Todo"));
486 setFocusPolicy ( QWidget::ClickFocus ); 486 setFocusPolicy ( QWidget::ClickFocus );
487} 487}
488 488
489void KOQuickTodo::focusInEvent(QFocusEvent *ev) 489void KOQuickTodo::focusInEvent(QFocusEvent *ev)
490{ 490{
491 if ( text()==i18n("Click to add new Todo") ) 491 if ( text()==i18n("Click to add new Todo") )
492 setText(""); 492 setText("");
493 QLineEdit::focusInEvent(ev); 493 QLineEdit::focusInEvent(ev);
494} 494}
495 495
496void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 496void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
497{ 497{
498 setText(i18n("Click to add new Todo")); 498 setText(i18n("Click to add new Todo"));
499 QLineEdit::focusOutEvent(ev); 499 QLineEdit::focusOutEvent(ev);
500} 500}
501 501
502///////////////////////////////////////////////////////////////////////////// 502/////////////////////////////////////////////////////////////////////////////
503 503
504KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 504KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
505 KOrg::BaseView(calendar,parent,name) 505 KOrg::BaseView(calendar,parent,name)
506{ 506{
507
508 mCurItem = 0;
509 mCurItemRootParent = 0;
510 mCurItemParent = 0;
511 mCurItemAbove = 0;
507 mActiveItem = 0; 512 mActiveItem = 0;
508 mCategoryPopupMenu = 0; 513 mCategoryPopupMenu = 0;
509 mPendingUpdateBeforeRepaint = false; 514 mPendingUpdateBeforeRepaint = false;
510 isFlatDisplay = false; 515 isFlatDisplay = false;
511 mNavigator = 0; 516 mNavigator = 0;
512 QBoxLayout *topLayout = new QVBoxLayout(this); 517 QBoxLayout *topLayout = new QVBoxLayout(this);
513 mName = QString ( name ); 518 mName = QString ( name );
514 mBlockUpdate = false; 519 mBlockUpdate = false;
515 mQuickBar = new QWidget( this ); 520 mQuickBar = new QWidget( this );
516 topLayout->addWidget(mQuickBar); 521 topLayout->addWidget(mQuickBar);
517 522
518 mQuickAdd = new KOQuickTodo(mQuickBar); 523 mQuickAdd = new KOQuickTodo(mQuickBar);
519 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 524 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
520 quickLayout->addWidget( mQuickAdd ); 525 quickLayout->addWidget( mQuickAdd );
521 mNewSubBut = new QPushButton( "sub",mQuickBar ); 526 mNewSubBut = new QPushButton( "sub",mQuickBar );
522 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 527 QPushButton * s_done = new QPushButton( "D",mQuickBar );
523 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 528 QPushButton * s_run = new QPushButton( "R",mQuickBar );
524 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 529 QPushButton * allopen = new QPushButton( "O",mQuickBar );
525 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 530 QPushButton * allclose = new QPushButton( "C",mQuickBar );
526 QPushButton * flat = new QPushButton( "F",mQuickBar ); 531 QPushButton * flat = new QPushButton( "F",mQuickBar );
527 532
528 int fixwid = mQuickAdd->sizeHint().height(); 533 int fixwid = mQuickAdd->sizeHint().height();
529 int fixhei = fixwid; 534 int fixhei = fixwid;
530 if ( QApplication::desktop()->width() > 800 ) 535 if ( QApplication::desktop()->width() > 800 )
531 fixwid = (fixwid*3)/2; 536 fixwid = (fixwid*3)/2;
532 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 537 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
533 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 538 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
534 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 539 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
535 s_done->setPixmap( SmallIcon("greenhook16")); 540 s_done->setPixmap( SmallIcon("greenhook16"));
536 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 541 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
537 s_run->setPixmap( SmallIcon("ko16old")); 542 s_run->setPixmap( SmallIcon("ko16old"));
538 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 543 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
539 544
540 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 545 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
541 546
542 mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() ); 547 mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
543 mNewSubBut->setEnabled( false ); 548 mNewSubBut->setEnabled( false );
544 flat->setFixedWidth( fixwid ); 549 flat->setFixedWidth( fixwid );
545 s_done->setFixedWidth( fixwid ); 550 s_done->setFixedWidth( fixwid );
546 allopen->setFixedWidth( fixwid ); 551 allopen->setFixedWidth( fixwid );
547 allclose->setFixedWidth( fixwid ); 552 allclose->setFixedWidth( fixwid );
548 s_run->setFixedWidth( fixwid ); 553 s_run->setFixedWidth( fixwid );
549 554
550 flat->setFixedHeight(fixhei ); 555 flat->setFixedHeight(fixhei );
551 s_done->setFixedHeight(fixhei ); 556 s_done->setFixedHeight(fixhei );
552 allopen->setFixedHeight(fixhei ); 557 allopen->setFixedHeight(fixhei );
553 allclose->setFixedHeight(fixhei ); 558 allclose->setFixedHeight(fixhei );
554 s_run->setFixedHeight(fixhei ); 559 s_run->setFixedHeight(fixhei );
555 mNewSubBut->setFixedHeight(fixhei ); 560 mNewSubBut->setFixedHeight(fixhei );
556 561
557 flat->setFocusPolicy( NoFocus ); 562 flat->setFocusPolicy( NoFocus );
558 s_done->setFocusPolicy( NoFocus ); 563 s_done->setFocusPolicy( NoFocus );
559 allopen->setFocusPolicy( NoFocus ); 564 allopen->setFocusPolicy( NoFocus );
560 allclose->setFocusPolicy( NoFocus ); 565 allclose->setFocusPolicy( NoFocus );
561 s_run->setFocusPolicy( NoFocus ); 566 s_run->setFocusPolicy( NoFocus );
562 mNewSubBut->setFocusPolicy( NoFocus ); 567 mNewSubBut->setFocusPolicy( NoFocus );
563 568
564 QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); 569 QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) );
565 QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); 570 QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) );
566 QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); 571 QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) );
567 QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); 572 QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) );
568 QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); 573 QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) );
569 QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); 574 QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) );
570 575
571 quickLayout->addWidget( mNewSubBut ); 576 quickLayout->addWidget( mNewSubBut );
572 quickLayout->addWidget( s_done ); 577 quickLayout->addWidget( s_done );
573 quickLayout->addWidget( s_run ); 578 quickLayout->addWidget( s_run );
574 quickLayout->addWidget( allopen ); 579 quickLayout->addWidget( allopen );
575 quickLayout->addWidget( allclose ); 580 quickLayout->addWidget( allclose );
576 quickLayout->addWidget( flat ); 581 quickLayout->addWidget( flat );
577 582
578 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 583 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
579 584
580 mTodoListView = new KOTodoListView(calendar,this, name ); 585 mTodoListView = new KOTodoListView(calendar,this, name );
581 topLayout->addWidget(mTodoListView); 586 topLayout->addWidget(mTodoListView);
582 //mTodoListView->header()->setMaximumHeight(30); 587 //mTodoListView->header()->setMaximumHeight(30);
583 mTodoListView->setRootIsDecorated(true); 588 mTodoListView->setRootIsDecorated(true);
584 mTodoListView->setAllColumnsShowFocus(true); 589 mTodoListView->setAllColumnsShowFocus(true);
585 590
586 mTodoListView->setShowSortIndicator(true); 591 mTodoListView->setShowSortIndicator(true);
587 592
588 mTodoListView->addColumn(i18n("Todo")); 593 mTodoListView->addColumn(i18n("Todo"));
589 mTodoListView->addColumn(i18n("Prio")); 594 mTodoListView->addColumn(i18n("Prio"));
590 mTodoListView->setColumnAlignment(1,AlignHCenter); 595 mTodoListView->setColumnAlignment(1,AlignHCenter);
591 mTodoListView->addColumn(i18n("Complete")); 596 mTodoListView->addColumn(i18n("Complete"));
592 mTodoListView->setColumnAlignment(2,AlignCenter); 597 mTodoListView->setColumnAlignment(2,AlignCenter);
593 598
594 mTodoListView->addColumn(i18n("Due Date")); 599 mTodoListView->addColumn(i18n("Due Date"));
595 mTodoListView->setColumnAlignment(3,AlignLeft); 600 mTodoListView->setColumnAlignment(3,AlignLeft);
596 mTodoListView->addColumn(i18n("Due Time")); 601 mTodoListView->addColumn(i18n("Due Time"));
597 mTodoListView->setColumnAlignment(4,AlignHCenter); 602 mTodoListView->setColumnAlignment(4,AlignHCenter);
598 603
599 mTodoListView->addColumn(i18n("Start Date")); 604 mTodoListView->addColumn(i18n("Start Date"));
600 mTodoListView->setColumnAlignment(5,AlignLeft); 605 mTodoListView->setColumnAlignment(5,AlignLeft);
601 mTodoListView->addColumn(i18n("Start Time")); 606 mTodoListView->addColumn(i18n("Start Time"));
602 mTodoListView->setColumnAlignment(6,AlignHCenter); 607 mTodoListView->setColumnAlignment(6,AlignHCenter);
603 608
604 //mTodoListView->addColumn(i18n("Cancelled")); 609 //mTodoListView->addColumn(i18n("Cancelled"));
605 mTodoListView->addColumn(i18n("Categories")); 610 mTodoListView->addColumn(i18n("Categories"));
606 mTodoListView->addColumn(i18n("Calendar")); 611 mTodoListView->addColumn(i18n("Calendar"));
607 mTodoListView->addColumn(i18n("Last Modified")); 612 mTodoListView->addColumn(i18n("Last Modified"));
608 mTodoListView->addColumn(i18n("Created")); 613 mTodoListView->addColumn(i18n("Created"));
609 mTodoListView->addColumn(i18n("Last Modified Sub")); 614 mTodoListView->addColumn(i18n("Last Modified Sub"));
610#if 0 615#if 0
611 mTodoListView->addColumn(i18n("Sort Id")); 616 mTodoListView->addColumn(i18n("Sort Id"));
612 mTodoListView->setColumnAlignment(4,AlignHCenter); 617 mTodoListView->setColumnAlignment(4,AlignHCenter);
613#endif 618#endif
614 619
615 mTodoListView->setMinimumHeight( 60 ); 620 mTodoListView->setMinimumHeight( 60 );
616 mTodoListView->setItemsRenameable( true ); 621 mTodoListView->setItemsRenameable( true );
617 mTodoListView->setRenameable( 0 ); 622 mTodoListView->setRenameable( 0 );
618 mTodoListView->setColumnWidth( 0, 120 ); 623 mTodoListView->setColumnWidth( 0, 120 );
619 int iii = 0; 624 int iii = 0;
620 for ( iii = 0; iii< 12 ; ++iii ) 625 for ( iii = 0; iii< 12 ; ++iii )
621 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 626 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
622 627
623 628
624 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 629 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
625 630
626 mPriorityPopupMenu = new QPopupMenu(this); 631 mPriorityPopupMenu = new QPopupMenu(this);
627 for (int i = 1; i <= 5; i++) { 632 for (int i = 1; i <= 5; i++) {
628 QString label = QString ("%1").arg (i); 633 QString label = QString ("%1").arg (i);
629 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 634 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
630 } 635 }
631 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 636 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
632 637
633 mPercentageCompletedPopupMenu = new QPopupMenu(this); 638 mPercentageCompletedPopupMenu = new QPopupMenu(this);
634 for (int i = 0; i <= 100; i+=20) { 639 for (int i = 0; i <= 100; i+=20) {
635 QString label = QString ("%1 %").arg (i); 640 QString label = QString ("%1 %").arg (i);
636 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 641 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
637 } 642 }
638 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 643 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
639 644
640 645
641 mCategoryPopupMenu = new QPopupMenu (this); 646 mCategoryPopupMenu = new QPopupMenu (this);
642 mCategoryPopupMenu->setCheckable (true); 647 mCategoryPopupMenu->setCheckable (true);
643 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 648 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
644 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 649 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
645 650
646 mCalPopupMenu = new QPopupMenu (this); 651 mCalPopupMenu = new QPopupMenu (this);
647 mCalPopupMenu->setCheckable (true); 652 mCalPopupMenu->setCheckable (true);
648 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 653 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
649 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 654 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
650 655
651 656
652 657
653 658
654 mItemPopupMenu = new QPopupMenu(this); 659 mItemPopupMenu = new QPopupMenu(this);
655 mItemPopupMenu->insertItem(i18n("Show"), this, 660 mItemPopupMenu->insertItem(i18n("Show"), this,
656 SLOT (showTodo())); 661 SLOT (showTodo()));
657 mItemPopupMenu->insertItem(i18n("Edit..."), this, 662 mItemPopupMenu->insertItem(i18n("Edit..."), this,
658 SLOT (editTodo())); 663 SLOT (editTodo()));
659 mItemPopupMenu->insertItem( i18n("Delete..."), this, 664 mItemPopupMenu->insertItem( i18n("Delete..."), this,
660 SLOT (deleteTodo())); 665 SLOT (deleteTodo()));
661 mItemPopupMenu->insertItem( i18n("Clone..."), this, 666 mItemPopupMenu->insertItem( i18n("Clone..."), this,
662 SLOT (cloneTodo())); 667 SLOT (cloneTodo()));
663 mItemPopupMenu->insertItem( i18n("Move..."), this, 668 mItemPopupMenu->insertItem( i18n("Move..."), this,
664 SLOT (moveTodo())); 669 SLOT (moveTodo()));
665#ifndef DESKTOP_VERSION 670#ifndef DESKTOP_VERSION
666 mItemPopupMenu->insertItem( i18n("Beam..."), this, 671 mItemPopupMenu->insertItem( i18n("Beam..."), this,
667 SLOT (beamTodo())); 672 SLOT (beamTodo()));
668#endif 673#endif
669 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 674 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
670 SLOT (cancelTodo())); 675 SLOT (cancelTodo()));
671 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); 676 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
672 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); 677 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
673 mItemPopupMenu->insertSeparator(); 678 mItemPopupMenu->insertSeparator();
674 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 679 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
675 SLOT (toggleRunningItem())); 680 SLOT (toggleRunningItem()));
676 mItemPopupMenu->insertSeparator(); 681 mItemPopupMenu->insertSeparator();
677 /* 682 /*
678 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 683 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
679 SLOT (newTodo())); 684 SLOT (newTodo()));
680 */ 685 */
681 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 686 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
682 SLOT (newSubTodo())); 687 SLOT (newSubTodo()));
683 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 688 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
684 SLOT (unparentTodo()),0,21); 689 SLOT (unparentTodo()),0,21);
685 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 690 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
686 SLOT (reparentTodo()),0,22); 691 SLOT (reparentTodo()),0,22);
687 mItemPopupMenu->insertSeparator(); 692 mItemPopupMenu->insertSeparator();
688#if 0 693#if 0
689 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 694 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
690 this, SLOT( purgeCompleted() ) ); 695 this, SLOT( purgeCompleted() ) );
691 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 696 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
692 this, SLOT( toggleCompleted() ),0, 33 ); 697 this, SLOT( toggleCompleted() ),0, 33 );
693 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 698 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
694 this, SLOT( toggleQuickTodo() ),0, 34 ); 699 this, SLOT( toggleQuickTodo() ),0, 34 );
695 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 700 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
696 this, SLOT( toggleRunning() ),0, 35 ); 701 this, SLOT( toggleRunning() ),0, 35 );
697 702
698#endif 703#endif
699 mPopupMenu = new QPopupMenu(this); 704 mPopupMenu = new QPopupMenu(this);
700 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 705 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
701 SLOT (newTodo()),0,1); 706 SLOT (newTodo()),0,1);
702 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), 707 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
703 this, SLOT(purgeCompleted()),0,2); 708 this, SLOT(purgeCompleted()),0,2);
704 mPopupMenu->insertItem(i18n("Show Completed"), 709 mPopupMenu->insertItem(i18n("Show Completed"),
705 this, SLOT( toggleCompleted() ),0,3 ); 710 this, SLOT( toggleCompleted() ),0,3 );
706 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 711 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
707 this, SLOT( toggleRunning() ),0,5 ); 712 this, SLOT( toggleRunning() ),0,5 );
708 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 713 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
709 this, SLOT( setAllOpen() ),0,6 ); 714 this, SLOT( setAllOpen() ),0,6 );
710 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 715 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
711 this, SLOT( setAllClose() ),0,7 ); 716 this, SLOT( setAllClose() ),0,7 );
712 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 717 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
713 this, SLOT( setAllFlat() ),0,8 ); 718 this, SLOT( setAllFlat() ),0,8 );
714 mPopupMenu->insertSeparator(); 719 mPopupMenu->insertSeparator();
715 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 720 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
716 this, SLOT( toggleQuickTodo() ),0,4 ); 721 this, SLOT( toggleQuickTodo() ),0,4 );
717 mDocPrefs = new DocPrefs( name ); 722 mDocPrefs = new DocPrefs( name );
718 723
719 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 724 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
720 mPopupMenu->setCheckable( true ); 725 mPopupMenu->setCheckable( true );
721 mItemPopupMenu->setCheckable( true ); 726 mItemPopupMenu->setCheckable( true );
722 727
723 728
724 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 729 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
725 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 730 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
726 731
727 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 732 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
728 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 733 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
729 734
730 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 735 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
731 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 736 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
732 737
733 738
734 // Double clicking conflicts with opening/closing the subtree 739 // Double clicking conflicts with opening/closing the subtree
735 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 740 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
736 SLOT( editItem( QListViewItem *) ) ); 741 SLOT( editItem( QListViewItem *) ) );
737 /* 742 /*
738 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 743 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
739 const QPoint &,int ) ), 744 const QPoint &,int ) ),
740 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 745 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
741 */ 746 */
742 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 747 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
743 const QPoint &,int ) ), 748 const QPoint &,int ) ),
744 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 749 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
745 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 750 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
746 SLOT( itemClicked( QListViewItem * ) ) ); 751 SLOT( itemClicked( QListViewItem * ) ) );
747 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 752 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
748 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 753 SLOT( itemDoubleClicked( QListViewItem * ) ) );
749 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 754 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
750 SLOT( updateView() ) ); 755 SLOT( updateView() ) );
751 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 756 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
752 SLOT( todoModified(Todo *, int) ) ); 757 SLOT( todoModified(Todo *, int) ) );
753 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 758 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
754 SLOT( itemStateChanged( QListViewItem * ) ) ); 759 SLOT( itemStateChanged( QListViewItem * ) ) );
755 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 760 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
756 SLOT( itemStateChanged( QListViewItem * ) ) ); 761 SLOT( itemStateChanged( QListViewItem * ) ) );
757 connect( mTodoListView, SIGNAL( paintNeeded() ), 762 connect( mTodoListView, SIGNAL( paintNeeded() ),
758 SLOT( paintNeeded()) ); 763 SLOT( paintNeeded()) );
759 764
760#if 0 765#if 0
761 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 766 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
762 SLOT(selectionChanged(QListViewItem *))); 767 SLOT(selectionChanged(QListViewItem *)));
763 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 768 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
764 SLOT(selectionChanged(QListViewItem *))); 769 SLOT(selectionChanged(QListViewItem *)));
765 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 770 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
766 SLOT(selectionChanged(QListViewItem *))); 771 SLOT(selectionChanged(QListViewItem *)));
767#endif 772#endif
768 773
769 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 774 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
770 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 775 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
771 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 776 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
772 777
773 connect( mTodoListView, SIGNAL(selectionChanged() ), 778 connect( mTodoListView, SIGNAL(selectionChanged() ),
774 SLOT( processSelectionChange() ) ); 779 SLOT( processSelectionChange() ) );
775 connect( mQuickAdd, SIGNAL( returnPressed () ), 780 connect( mQuickAdd, SIGNAL( returnPressed () ),
776 SLOT( addQuickTodo() ) ); 781 SLOT( addQuickTodo() ) );
777 782
778} 783}
779 784
780KOTodoView::~KOTodoView() 785KOTodoView::~KOTodoView()
781{ 786{
782 787
783#if QT_VERSION >= 0x030000 788#if QT_VERSION >= 0x030000
784 789
785#else 790#else
786 delete mKOTodoViewWhatsThis; 791 delete mKOTodoViewWhatsThis;
787#endif 792#endif
788 793
789 delete mDocPrefs; 794 delete mDocPrefs;
790} 795}
791QString KOTodoView::getWhatsThisText(QPoint p) 796QString KOTodoView::getWhatsThisText(QPoint p)
792{ 797{
793 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 798 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
794 if ( item ) 799 if ( item )
795 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 800 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
796 KOPrefs::instance()->mWTshowDetails, 801 KOPrefs::instance()->mWTshowDetails,
797 KOPrefs::instance()->mWTshowCreated, 802 KOPrefs::instance()->mWTshowCreated,
798 KOPrefs::instance()->mWTshowChanged); 803 KOPrefs::instance()->mWTshowChanged);
799 return i18n("That is the todo view" ); 804 return i18n("That is the todo view" );
800 805
801} 806}
802 807
803void KOTodoView::jumpToDate () 808void KOTodoView::jumpToDate ()
804{ 809{
805 // if (mActiveItem) { 810 // if (mActiveItem) {
806// mActiveItem->todo()); 811// mActiveItem->todo());
807// if ( mActiveItem->todo()->hasDueDate() ) 812// if ( mActiveItem->todo()->hasDueDate() )
808// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 813// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
809} 814}
810void KOTodoView::paintNeeded() 815void KOTodoView::paintNeeded()
811{ 816{
812 if ( mPendingUpdateBeforeRepaint ) { 817 if ( mPendingUpdateBeforeRepaint ) {
813 updateView(); 818 updateView();
814 mPendingUpdateBeforeRepaint = false; 819 mPendingUpdateBeforeRepaint = false;
815 } 820 }
816} 821}
817void KOTodoView::paintEvent(QPaintEvent * pevent) 822void KOTodoView::paintEvent(QPaintEvent * pevent)
818{ 823{
819 if ( mPendingUpdateBeforeRepaint ) { 824 if ( mPendingUpdateBeforeRepaint ) {
820 updateView(); 825 updateView();
821 mPendingUpdateBeforeRepaint = false; 826 mPendingUpdateBeforeRepaint = false;
822 } 827 }
823 KOrg::BaseView::paintEvent( pevent); 828 KOrg::BaseView::paintEvent( pevent);
824} 829}
825 830
826void KOTodoView::clearList( bool saveCurrentItem ) // default true 831void KOTodoView::clearList( bool saveCurrentItem ) // default true
827{ 832{
828 if ( mTodoListView->childCount() ) { 833 if ( mTodoListView->childCount() ) {
829 if ( saveCurrentItem ) 834 if ( saveCurrentItem )
830 storeCurrentItem(); 835 storeCurrentItem();
831 mTodoListView->clear(); 836 mTodoListView->clear();
832 mTodoMap.clear(); 837 mTodoMap.clear();
833 } 838 }
834} 839}
835void KOTodoView::updateView() 840void KOTodoView::updateView()
836{ 841{
837 mActiveItem = 0; 842 mActiveItem = 0;
838 pendingSubtodo = 0; 843 pendingSubtodo = 0;
839 if ( mBlockUpdate ) { 844 if ( mBlockUpdate ) {
840 return; 845 return;
841 } 846 }
842 if ( !isVisible() ) { 847 if ( !isVisible() ) {
843 clearList (); 848 clearList ();
844 mPendingUpdateBeforeRepaint = true; 849 mPendingUpdateBeforeRepaint = true;
845 return; 850 return;
846 } 851 }
847 //qDebug("KOTodoView::updateView() %x", this); 852 //qDebug("KOTodoView::updateView() %x", this);
848 if ( isFlatDisplay ) { 853 if ( isFlatDisplay ) {
849 displayAllFlat(); 854 displayAllFlat();
850 return; 855 return;
851 } 856 }
852 //qDebug("update "); 857 //qDebug("update ");
853// kdDebug() << "KOTodoView::updateView()" << endl; 858// kdDebug() << "KOTodoView::updateView()" << endl;
854 QFont fo = KOPrefs::instance()->mTodoViewFont; 859 QFont fo = KOPrefs::instance()->mTodoViewFont;
855 860
856 clearList (); 861 clearList ();
857 862
858 if ( mName == "todolistsmall" ) { 863 if ( mName == "todolistsmall" ) {
859 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 864 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
860 int ps = fo.pointSize() -2; 865 int ps = fo.pointSize() -2;
861 if ( ps > 12 ) 866 if ( ps > 12 )
862 ps -= 2; 867 ps -= 2;
863 fo.setPointSize( ps ); 868 fo.setPointSize( ps );
864 } 869 }
865 } 870 }
866 871
867 mTodoListView->setFont( fo ); 872 mTodoListView->setFont( fo );
868 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 873 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
869 //mTodoListView->header()->setMaximumHeight(fm.height()); 874 //mTodoListView->header()->setMaximumHeight(fm.height());
870 QPtrList<Todo> todoList = calendar()->todos(); 875 QPtrList<Todo> todoList = calendar()->todos();
871 876
872/* 877/*
873 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 878 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
874 Event *t; 879 Event *t;
875 for(t = todoList.first(); t; t = todoList.next()) { 880 for(t = todoList.first(); t; t = todoList.next()) {
876 kdDebug() << " " << t->getSummary() << endl; 881 kdDebug() << " " << t->getSummary() << endl;
877 882
878 if (t->getRelatedTo()) { 883 if (t->getRelatedTo()) {
879 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 884 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
880 } 885 }
881 886
882 QPtrList<Event> l = t->getRelations(); 887 QPtrList<Event> l = t->getRelations();
883 Event *c; 888 Event *c;
884 for(c=l.first();c;c=l.next()) { 889 for(c=l.first();c;c=l.next()) {
885 kdDebug() << " - relation: " << c->getSummary() << endl; 890 kdDebug() << " - relation: " << c->getSummary() << endl;
886 } 891 }
887 } 892 }
888*/ 893*/
889 894
890 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 895 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index c9d1345..6339370 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,115 +1,115 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#include <stdlib.h> 14#include <stdlib.h>
15#endif 15#endif
16#include <qtextcodec.h> 16#include <qtextcodec.h>
17 17
18#include <qdir.h> 18#include <qdir.h>
19#include <kstandarddirs.h> 19#include <kstandarddirs.h>
20#include <kglobal.h> 20#include <kglobal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25 25
26 26
27int main( int argc, char **argv ) 27int main( int argc, char **argv )
28{ 28{
29#ifndef DESKTOP_VERSION 29#ifndef DESKTOP_VERSION
30 QPEApplication a( argc, argv ); 30 QPEApplication a( argc, argv );
31 a.setKeepRunning (); 31 a.setKeepRunning ();
32#else 32#else
33 QApplication a( argc, argv ); 33 QApplication a( argc, argv );
34 QApplication::setStyle( new QPlatinumStyle ()); 34 QApplication::setStyle( new QPlatinumStyle ());
35#ifdef _WIN32_ 35#ifdef _WIN32_
36 QString hdir ( getenv( "HOME") ); 36 QString hdir ( getenv( "HOME") );
37 if ( hdir.isEmpty() ) { 37 if ( hdir.isEmpty() ) {
38 QString hd ("C:/" ); 38 QString hd ("C:/" );
39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
40 if ( QDir::homeDirPath().lower() == hd.lower() ) { 40 if ( QDir::homeDirPath().lower() == hd.lower() ) {
41 _putenv( "HOME=C:"); 41 _putenv( "HOME=C:");
42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
43 } 43 }
44 } else { 44 } else {
45 QDir app_dir; 45 QDir app_dir;
46 if ( !app_dir.exists(hdir) ) 46 if ( !app_dir.exists(hdir) )
47 app_dir.mkdir (hdir); 47 app_dir.mkdir (hdir);
48 } 48 }
49#endif 49#endif
50#endif 50#endif
51 bool exitHelp = false; 51 bool exitHelp = false;
52 if ( argc > 1 ) { 52 if ( argc > 1 ) {
53 QString command = argv[1]; 53 QString command = argv[1];
54 if ( command == "-help" ){ 54 if ( command == "-help" ){
55 printf("KO/Pi command line commands:\n"); 55 printf("KO/Pi command line commands:\n");
56 printf(" no command: Start KO/Pi in usual way\n"); 56 printf(" no command: Start KO/Pi in usual way\n");
57 printf(" -help: This output\n"); 57 printf(" -help: This output\n");
58 printf("Next Option: Open or Show after start:\n"); 58 printf("Next Option: Open or Show after start:\n");
59 printf(" -newTodo: New Todo dialog\n"); 59 printf(" -newTodo: New Todo dialog\n");
60 printf(" -newEvent: New Event dialog\n"); 60 printf(" -newEvent: New Event dialog\n");
61 printf(" -showList: List view\n"); 61 printf(" -showList: List view\n");
62 printf(" -showDay: Day view\n"); 62 printf(" -showDay: Day view\n");
63 printf(" -showWWeek: Work Week view\n"); 63 printf(" -showWWeek: Work Week view\n");
64 printf(" -showWeek: Week view\n"); 64 printf(" -showWeek: Week view\n");
65 printf(" -showTodo: Todo view\n"); 65 printf(" -showTodo: Todo view\n");
66 printf(" -showJournal: Journal view\n"); 66 printf(" -showJournal: Journal view\n");
67 printf(" -showKO: Next Days view\n"); 67 printf(" -showKO: Next Days view\n");
68 printf(" -showWNext: What's Next view\n"); 68 printf(" -showWNext: What's Next view\n");
69 printf(" -showNextXView: Next X View\n"); 69 printf(" -showNextXView: Next X View\n");
70 printf(" -new[Y] and -show[X] may be used togehther\n"); 70 printf(" -new[Y] and -show[X] may be used togehther\n");
71 printf(" KO/Pi is exiting now. Bye!\n"); 71 printf(" KO/Pi is exiting now. Bye!\n");
72 exitHelp = true; 72 exitHelp = true;
73 } 73 }
74 } 74 }
75 if ( ! exitHelp ) { 75 if ( ! exitHelp ) {
76 KGlobal::setAppName( "korganizer" ); 76 KGlobal::setAppName( "korganizer" );
77 QString fileName ; 77 QString fileName ;
78#ifndef DESKTOP_VERSION 78#ifndef DESKTOP_VERSION
79 fileName = getenv("QPEDIR"); 79 fileName = getenv("QPEDIR");
80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
81#else 81#else
82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
84#endif 84#endif
85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
86 86
87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
88 KPimGlobalPrefs::instance()->setGlobalConfig(); 88 KPimGlobalPrefs::instance()->setGlobalConfig();
89 MainWindow m; 89 MainWindow m;
90#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
91 91
92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& )));
93 a.showMainWidget(&m ); 93 a.showMainWidget(&m );
94#else 94#else
95 a.setMainWidget(&m ); 95 a.setMainWidget(&m );
96 m.show(); 96 m.show();
97 //m.resize( 800, 600 ); 97 //m.resize( 800, 600 );
98 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 98 //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
99#endif 99#endif
100 if ( argc > 1 ) { 100 if ( argc > 1 ) {
101 QCString command = argv[1]; 101 QCString command = argv[1];
102 if ( argc > 2 ) 102 if ( argc > 2 )
103 command += argv[2]; 103 command += argv[2];
104 qApp->processEvents(); 104 qApp->processEvents();
105 m.recieve(command, QByteArray() ); 105 m.recieve(command, QByteArray() );
106 106
107 } 107 }
108 108
109 a.exec(); 109 a.exec();
110 dumpMissing(); 110 dumpMissing();
111 111
112 KPimGlobalPrefs::instance()->writeConfig(); 112 KPimGlobalPrefs::instance()->writeConfig();
113 } 113 }
114 qDebug("KO: Bye! "); 114 qDebug("KO: Bye! ");
115} 115}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9ae393d..8c72d89 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,927 +1,954 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qtopia/alarmserver.h> 27#include <qtopia/alarmserver.h>
28#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
29#include <unistd.h> // for sleep 29#include <unistd.h> // for sleep
30#else 30#else
31#include <qtoolbar.h> 31#include <qtoolbar.h>
32#include <qapplication.h> 32#include <qapplication.h>
33//#include <resource.h> 33//#include <resource.h>
34 34
35#endif 35#endif
36#include <libkcal/calendarlocal.h> 36#include <libkcal/calendarlocal.h>
37#include <libkcal/todo.h> 37#include <libkcal/todo.h>
38#include <libkcal/phoneformat.h> 38#include <libkcal/phoneformat.h>
39#include <libkdepim/ksyncprofile.h> 39#include <libkdepim/ksyncprofile.h>
40#include <libkdepim/phoneaccess.h> 40#include <libkdepim/phoneaccess.h>
41#include <libkcal/kincidenceformatter.h> 41#include <libkcal/kincidenceformatter.h>
42#include <libkdepim/kpimglobalprefs.h> 42#include <libkdepim/kpimglobalprefs.h>
43 43
44#include "calendarview.h" 44#include "calendarview.h"
45#include "koviewmanager.h" 45#include "koviewmanager.h"
46#include "datenavigator.h" 46#include "datenavigator.h"
47#include "koagendaview.h" 47#include "koagendaview.h"
48#include "kojournalview.h" 48#include "kojournalview.h"
49#include "koagenda.h" 49#include "koagenda.h"
50#include "kodialogmanager.h" 50#include "kodialogmanager.h"
51#include "kdialogbase.h" 51#include "kdialogbase.h"
52#include "kapplication.h" 52#include "kapplication.h"
53#include "kofilterview.h" 53#include "kofilterview.h"
54#include "kstandarddirs.h" 54#include "kstandarddirs.h"
55#include "koprefs.h" 55#include "koprefs.h"
56#include "kfiledialog.h" 56#include "kfiledialog.h"
57#include "koglobals.h" 57#include "koglobals.h"
58#include "kglobal.h" 58#include "kglobal.h"
59#include "ktoolbar.h" 59#include "ktoolbar.h"
60#include "klocale.h" 60#include "klocale.h"
61#include "kconfig.h" 61#include "kconfig.h"
62#include "externalapphandler.h" 62#include "externalapphandler.h"
63#include <kglobalsettings.h> 63#include <kglobalsettings.h>
64 64
65using namespace KCal; 65using namespace KCal;
66#ifndef _WIN32_ 66#ifndef _WIN32_
67#include <unistd.h> 67#include <unistd.h>
68#else 68#else
69#ifdef _OL_IMPORT_ 69#ifdef _OL_IMPORT_
70#include "koimportoldialog.h" 70#include "koimportoldialog.h"
71#endif 71#endif
72#endif 72#endif
73#include "mainwindow.h" 73#include "mainwindow.h"
74 74
75 75
76class KOex2phonePrefs : public QDialog 76class KOex2phonePrefs : public QDialog
77{ 77{
78 public: 78 public:
79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
80 QDialog( parent, name, true ) 80 QDialog( parent, name, true )
81 { 81 {
82 setCaption( i18n("Export to phone options") ); 82 setCaption( i18n("Export to phone options") );
83 QVBoxLayout* lay = new QVBoxLayout( this ); 83 QVBoxLayout* lay = new QVBoxLayout( this );
84 lay->setSpacing( 3 ); 84 lay->setSpacing( 3 );
85 lay->setMargin( 3 ); 85 lay->setMargin( 3 );
86 QLabel *lab; 86 QLabel *lab;
87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
88 lab->setAlignment (AlignHCenter ); 88 lab->setAlignment (AlignHCenter );
89 QHBox* temphb; 89 QHBox* temphb;
90 temphb = new QHBox( this ); 90 temphb = new QHBox( this );
91 new QLabel( i18n("I/O device: "), temphb ); 91 new QLabel( i18n("I/O device: "), temphb );
92 mPhoneDevice = new QLineEdit( temphb); 92 mPhoneDevice = new QLineEdit( temphb);
93 lay->addWidget( temphb ); 93 lay->addWidget( temphb );
94 temphb = new QHBox( this ); 94 temphb = new QHBox( this );
95 new QLabel( i18n("Connection: "), temphb ); 95 new QLabel( i18n("Connection: "), temphb );
96 mPhoneConnection = new QLineEdit( temphb); 96 mPhoneConnection = new QLineEdit( temphb);
97 lay->addWidget( temphb ); 97 lay->addWidget( temphb );
98 temphb = new QHBox( this ); 98 temphb = new QHBox( this );
99 new QLabel( i18n("Model(opt.): "), temphb ); 99 new QLabel( i18n("Model(opt.): "), temphb );
100 mPhoneModel = new QLineEdit( temphb); 100 mPhoneModel = new QLineEdit( temphb);
101 lay->addWidget( temphb ); 101 lay->addWidget( temphb );
102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
103 mWriteBackFuture->setChecked( true ); 103 mWriteBackFuture->setChecked( true );
104 lay->addWidget( mWriteBackFuture ); 104 lay->addWidget( mWriteBackFuture );
105 temphb = new QHBox( this ); 105 temphb = new QHBox( this );
106 new QLabel( i18n("Max. weeks in future: ") , temphb ); 106 new QLabel( i18n("Max. weeks in future: ") , temphb );
107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
108 mWriteBackFutureWeeks->setValue( 8 ); 108 mWriteBackFutureWeeks->setValue( 8 );
109 lay->addWidget( temphb ); 109 lay->addWidget( temphb );
110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
111 lab->setAlignment (AlignHCenter ); 111 lab->setAlignment (AlignHCenter );
112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
113 lay->addWidget( ok ); 113 lay->addWidget( ok );
114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
115 lay->addWidget( cancel ); 115 lay->addWidget( cancel );
116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
118 resize( 220, 240 ); 118 resize( 220, 240 );
119 qApp->processEvents(); 119 qApp->processEvents();
120 int dw = QApplication::desktop()->width(); 120 int dw = QApplication::desktop()->width();
121 int dh = QApplication::desktop()->height(); 121 int dh = QApplication::desktop()->height();
122 move( (dw-width())/2, (dh - height() )/2 ); 122 move( (dw-width())/2, (dh - height() )/2 );
123 } 123 }
124 124
125public: 125public:
126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
127 QCheckBox* mWriteBackFuture; 127 QCheckBox* mWriteBackFuture;
128 QSpinBox* mWriteBackFutureWeeks; 128 QSpinBox* mWriteBackFutureWeeks;
129}; 129};
130 130
131QPixmap* sgListViewCompletedPix[6]; 131QPixmap* sgListViewCompletedPix[6];
132QPixmap* sgListViewJournalPix; 132QPixmap* sgListViewJournalPix;
133 133
134 134
135int globalFlagBlockStartup; 135int globalFlagBlockStartup;
136MainWindow::MainWindow( QWidget *parent, const char *name ) : 136MainWindow::MainWindow( QWidget *parent, const char *name ) :
137 QMainWindow( parent, name ) 137 QMainWindow( parent, name )
138{ 138{
139 sgListViewCompletedPix[5] = &listviewPix; 139 sgListViewCompletedPix[5] = &listviewPix;
140 sgListViewCompletedPix[0] = &listviewPix0; 140 sgListViewCompletedPix[0] = &listviewPix0;
141 sgListViewCompletedPix[1] = &listviewPix20; 141 sgListViewCompletedPix[1] = &listviewPix20;
142 sgListViewCompletedPix[2] = &listviewPix40; 142 sgListViewCompletedPix[2] = &listviewPix40;
143 sgListViewCompletedPix[3] = &listviewPix60; 143 sgListViewCompletedPix[3] = &listviewPix60;
144 sgListViewCompletedPix[4] = &listviewPix80; 144 sgListViewCompletedPix[4] = &listviewPix80;
145 //int size = 12; 145 //int size = 12;
146 { 146 {
147 sgListViewCompletedPix[5]->resize( 11, 11 ); 147 sgListViewCompletedPix[5]->resize( 11, 11 );
148 sgListViewCompletedPix[5]->fill( Qt::white ); 148 sgListViewCompletedPix[5]->fill( Qt::white );
149 QPainter p ( sgListViewCompletedPix[5] ); 149 QPainter p ( sgListViewCompletedPix[5] );
150 p.drawRect( 0,0,11,11); 150 p.drawRect( 0,0,11,11);
151 p.drawLine ( 2, 5, 4 , 7 ) ; 151 p.drawLine ( 2, 5, 4 , 7 ) ;
152 p.drawLine ( 4 , 7 , 8, 3) ; 152 p.drawLine ( 4 , 7 , 8, 3) ;
153 int iii = 0; 153 int iii = 0;
154 for ( iii = 0; iii < 5; ++iii ) { 154 for ( iii = 0; iii < 5; ++iii ) {
155 sgListViewCompletedPix[iii]->resize( 11, 11 ); 155 sgListViewCompletedPix[iii]->resize( 11, 11 );
156 sgListViewCompletedPix[iii]->fill( Qt::white ); 156 sgListViewCompletedPix[iii]->fill( Qt::white );
157 QPainter p ( sgListViewCompletedPix[iii] ); 157 QPainter p ( sgListViewCompletedPix[iii] );
158 p.drawRect( 0,0,11,11); 158 p.drawRect( 0,0,11,11);
159 if ( iii ) 159 if ( iii )
160 p.fillRect( 1,1,iii*2,9,Qt::gray ); 160 p.fillRect( 1,1,iii*2,9,Qt::gray );
161 } 161 }
162 sgListViewJournalPix = &journalPix; 162 sgListViewJournalPix = &journalPix;
163 sgListViewJournalPix->resize( 11, 11 ); 163 sgListViewJournalPix->resize( 11, 11 );
164 sgListViewJournalPix->fill( Qt::white ); 164 sgListViewJournalPix->fill( Qt::white );
165 { 165 {
166 QPainter p ( sgListViewJournalPix ); 166 QPainter p ( sgListViewJournalPix );
167 p.drawRect( 0,0,11,11); 167 p.drawRect( 0,0,11,11);
168 p.drawLine( 2,3,5,3); 168 p.drawLine( 2,3,5,3);
169 p.drawLine( 2,5,8,5); 169 p.drawLine( 2,5,8,5);
170 p.drawLine( 2,7,6,7); 170 p.drawLine( 2,7,6,7);
171 } 171 }
172 } 172 }
173 mClosed = false; 173 mClosed = false;
174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
175 QString confFile = locateLocal("config","korganizerrc"); 175 QString confFile = locateLocal("config","korganizerrc");
176 QFileInfo finf ( confFile ); 176 QFileInfo finf ( confFile );
177 bool showWarning = !finf.exists(); 177 bool showWarning = !finf.exists();
178 setIcon(SmallIcon( "ko24" ) ); 178 setIcon(SmallIcon( "ko24" ) );
179 mBlockAtStartup = true; 179 mBlockAtStartup = true;
180 mFlagKeyPressed = false; 180 mFlagKeyPressed = false;
181 setCaption("KO/Pi"); 181 setCaption("KO/Pi");
182 KOPrefs *p = KOPrefs::instance(); 182 KOPrefs *p = KOPrefs::instance();
183 //KPimGlobalPrefs::instance()->setGlobalConfig(); 183 //KPimGlobalPrefs::instance()->setGlobalConfig();
184 p->mCurrentDisplayedView = 0; 184 p->mCurrentDisplayedView = 0;
185 if ( p->mHourSize > 22 ) 185 if ( p->mHourSize > 22 )
186 p->mHourSize = 22; 186 p->mHourSize = 22;
187 QMainWindow::ToolBarDock tbd; 187 QMainWindow::ToolBarDock tbd;
188 if ( p->mToolBarHor ) { 188 if ( p->mToolBarHor ) {
189 if ( p->mToolBarUp ) 189 if ( p->mToolBarUp )
190 tbd = Bottom; 190 tbd = Bottom;
191 else 191 else
192 tbd = Top; 192 tbd = Top;
193 } 193 }
194 else { 194 else {
195 if ( p->mToolBarUp ) 195 if ( p->mToolBarUp )
196 tbd = Right; 196 tbd = Right;
197 else 197 else
198 tbd = Left; 198 tbd = Left;
199 } 199 }
200 if ( KOPrefs::instance()->mUseAppColors ) 200 if ( KOPrefs::instance()->mUseAppColors )
201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
202 globalFlagBlockStartup = 1; 202 globalFlagBlockStartup = 1;
203 iconToolBar = new QPEToolBar( this ); 203 iconToolBar = new QPEToolBar( this );
204 addToolBar (iconToolBar , tbd ); 204 addToolBar (iconToolBar , tbd );
205 205
206#ifdef DESKTOP_VERSION 206#ifdef DESKTOP_VERSION
207 if ( KOPrefs::instance()->mShowIconFilter ) 207 if ( KOPrefs::instance()->mShowIconFilter )
208#else 208#else
209 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) 209 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
210#endif 210#endif
211 211
212{ 212{
213 if ( p->mToolBarHorF ) { 213 if ( p->mToolBarHorF ) {
214 if ( p->mToolBarUpF ) 214 if ( p->mToolBarUpF )
215 tbd = Bottom; 215 tbd = Bottom;
216 else 216 else
217 tbd = Top; 217 tbd = Top;
218 } 218 }
219 else { 219 else {
220 if ( p->mToolBarUpF ) 220 if ( p->mToolBarUpF )
221 tbd = Right; 221 tbd = Right;
222 else 222 else
223 tbd = Left; 223 tbd = Left;
224 } 224 }
225 filterToolBar = new QPEToolBar ( this ); 225 filterToolBar = new QPEToolBar ( this );
226 filterMenubar = new KMenuBar( 0 ); 226 filterMenubar = new KMenuBar( 0 );
227 QFontMetrics fm ( filterMenubar->font() ); 227 QFontMetrics fm ( filterMenubar->font() );
228#ifndef DESKTOP_VERSION 228#ifndef DESKTOP_VERSION
229 filterToolBar->setFocusPolicy( NoFocus ); 229 filterToolBar->setFocusPolicy( NoFocus );
230 filterMenubar->setFocusPolicy( NoFocus ); 230 filterMenubar->setFocusPolicy( NoFocus );
231#endif 231#endif
232 filterPopupMenu = new QPopupMenu( this ); 232 filterPopupMenu = new QPopupMenu( this );
233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
234 QString addTest = "A"; 234 QString addTest = "A";
235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
236#ifdef DESKTOP_VERSION 236#ifdef DESKTOP_VERSION
237 addTest = "AAAAAABBBCCCx"; 237 addTest = "AAAAAABBBCCCx";
238#else 238#else
239 addTest = "AAAAAx"; 239 addTest = "AAAAAx";
240#endif 240#endif
241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
242 addToolBar (filterToolBar , tbd ); 242 addToolBar (filterToolBar , tbd );
243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
246 filterToolBar->hide(); 246 filterToolBar->hide();
247 } else { 247 } else {
248 filterToolBar = 0; 248 filterToolBar = 0;
249 filterMenubar = 0; 249 filterMenubar = 0;
250 filterPopupMenu = 0; 250 filterPopupMenu = 0;
251 } 251 }
252 if ( p->mShowIconOnetoolbar ) { 252 if ( p->mShowIconOnetoolbar ) {
253 viewToolBar = iconToolBar ; 253 viewToolBar = iconToolBar ;
254 navigatorToolBar = iconToolBar ; 254 navigatorToolBar = iconToolBar ;
255 } else { 255 } else {
256#ifndef DESKTOP_VERSION 256#ifndef DESKTOP_VERSION
257 setToolBarsMovable( false ); 257 setToolBarsMovable( false );
258#endif 258#endif
259 if ( p->mToolBarHorV ) { 259 if ( p->mToolBarHorV ) {
260 if ( p->mToolBarUpV ) 260 if ( p->mToolBarUpV )
261 tbd = Bottom; 261 tbd = Bottom;
262 else 262 else
263 tbd = Top; 263 tbd = Top;
264 } 264 }
265 else { 265 else {
266 if ( p->mToolBarUpV ) 266 if ( p->mToolBarUpV )
267 tbd = Right; 267 tbd = Right;
268 else 268 else
269 tbd = Left; 269 tbd = Left;
270 } 270 }
271 viewToolBar = new QPEToolBar( this ); 271 viewToolBar = new QPEToolBar( this );
272 addToolBar (viewToolBar , tbd ); 272 addToolBar (viewToolBar , tbd );
273 if ( p->mToolBarHorN ) { 273 if ( p->mToolBarHorN ) {
274 if ( p->mToolBarUpN ) 274 if ( p->mToolBarUpN )
275 tbd = Bottom; 275 tbd = Bottom;
276 else 276 else
277 tbd = Top; 277 tbd = Top;
278 } 278 }
279 else { 279 else {
280 if ( p->mToolBarUpN ) 280 if ( p->mToolBarUpN )
281 tbd = Right; 281 tbd = Right;
282 else 282 else
283 tbd = Left; 283 tbd = Left;
284 } 284 }
285 navigatorToolBar = new QPEToolBar( this ); 285 navigatorToolBar = new QPEToolBar( this );
286 addToolBar (navigatorToolBar , tbd ); 286 addToolBar (navigatorToolBar , tbd );
287 } 287 }
288 288
289 289
290 290
291 mCalendarModifiedFlag = false; 291 mCalendarModifiedFlag = false;
292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
293 splash->setAlignment ( AlignCenter ); 293 splash->setAlignment ( AlignCenter );
294 setCentralWidget( splash ); 294 setCentralWidget( splash );
295#ifndef DESKTOP_VERSION 295#ifndef DESKTOP_VERSION
296 showMaximized(); 296 showMaximized();
297#endif 297#endif
298 298
299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
300 setDefaultPreferences(); 300 setDefaultPreferences();
301 mCalendar = new CalendarLocal(); 301 mCalendar = new CalendarLocal();
302 mView = new CalendarView( mCalendar, this,"mCalendar " ); 302 mView = new CalendarView( mCalendar, this,"mCalendar " );
303 mView->hide(); 303 mView->hide();
304 //mView->resize(splash->size() ); 304 //mView->resize(splash->size() );
305 initActions(); 305 initActions();
306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
307 mSyncManager->setBlockSave(false); 307 mSyncManager->setBlockSave(false);
308 mView->setSyncManager(mSyncManager); 308 mView->setSyncManager(mSyncManager);
309#ifndef DESKTOP_VERSION 309#ifndef DESKTOP_VERSION
310 iconToolBar->show(); 310 iconToolBar->show();
311 qApp->processEvents(); 311 qApp->processEvents();
312#endif 312#endif
313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
314 int vh = height() ; 314 int vh = height() ;
315 int vw = width(); 315 int vw = width();
316 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 316 //qDebug("Toolbar hei %d ",iconToolBar->height() );
317 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 317 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
318 vh -= iconToolBar->height(); 318 vh -= iconToolBar->height();
319 } else { 319 } else {
320 vw -= iconToolBar->height(); 320 vw -= iconToolBar->height();
321 } 321 }
322 //mView->setMaximumSize( splash->size() ); 322 //mView->setMaximumSize( splash->size() );
323 //mView->resize( splash->size() ); 323 //mView->resize( splash->size() );
324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
325 mView->readSettings(); 325 mView->readSettings();
326 bool newFile = false; 326 bool newFile = false;
327 if( !QFile::exists( defaultFileName() ) ) { 327 if( !QFile::exists( defaultFileName() ) ) {
328 QFileInfo finfo ( defaultFileName() ); 328 QFileInfo finfo ( defaultFileName() );
329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
331 finfo.setFile( oldFile ); 331 finfo.setFile( oldFile );
332 if (finfo.exists() ) { 332 if (finfo.exists() ) {
333 KMessageBox::information( this, message); 333 KMessageBox::information( this, message);
334 mView->openCalendar( oldFile ); 334 mView->openCalendar( oldFile );
335 qApp->processEvents(); 335 qApp->processEvents();
336 } else { 336 } else {
337 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 337 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
338 finfo.setFile( oldFile ); 338 finfo.setFile( oldFile );
339 if (finfo.exists() ) { 339 if (finfo.exists() ) {
340 KMessageBox::information( this, message); 340 KMessageBox::information( this, message);
341 mView->openCalendar( oldFile ); 341 mView->openCalendar( oldFile );
342 qApp->processEvents(); 342 qApp->processEvents();
343 } 343 }
344 } 344 }
345 mView->saveCalendar( defaultFileName() ); 345 mView->saveCalendar( defaultFileName() );
346 newFile = true; 346 newFile = true;
347 } 347 }
348 348
349 QTime neededSaveTime = QDateTime::currentDateTime().time(); 349 //QTime neededSaveTime = QDateTime::currentDateTime().time();
350 mView->loadCalendars(); 350 //mView->loadCalendars();
351 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 351 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
352 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 352 //qDebug("KO: Calendar loading time: %d ms",msNeeded );
353 353
354 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 354 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
355 KOPrefs::instance()->setAllDefaults(); 355 KOPrefs::instance()->setAllDefaults();
356 } 356 }
357 processIncidenceSelection( 0 );
358 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
359 SLOT( processIncidenceSelection( Incidence * ) ) );
360 connect( mView, SIGNAL( modifiedChanged( bool ) ),
361 SLOT( slotModifiedChanged( bool ) ) );
362 357
363 358
364 connect( mView, SIGNAL( tempDisableBR(bool) ), 359 connect( mView, SIGNAL( tempDisableBR(bool) ),
365 SLOT( disableBR(bool) ) ); 360 SLOT( disableBR(bool) ) );
366 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 361 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
367 mView->setModified( false );
368 mBlockAtStartup = false;
369 mView->setModified( false );
370 setCentralWidget( mView ); 362 setCentralWidget( mView );
371 globalFlagBlockStartup = 0; 363 globalFlagBlockStartup = 0;
372 mView->show(); 364 mView->show();
373 delete splash; 365 delete splash;
374 if ( newFile ) 366 if ( newFile )
375 mView->updateConfig(); 367 mView->updateConfig();
376 // qApp->processEvents(); 368 // qApp->processEvents();
377 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 369 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
378 //fillSyncMenu(); 370 //fillSyncMenu();
379 371
380 372
381 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 373 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
382 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
383 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 374 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
384 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 375 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
385 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 376 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
386 mSyncManager->setDefaultFileName( sentSyncFile()); 377 mSyncManager->setDefaultFileName( sentSyncFile());
387 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 378 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
388 mSyncManager->fillSyncMenu(); 379 mSyncManager->fillSyncMenu();
389 380
390 381
391 382
392 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 383 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
393 if ( showWarning ) { 384 if ( showWarning ) {
394 KMessageBox::information( this, 385 KMessageBox::information( this,
395 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 386 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
396 qApp->processEvents(); 387 qApp->processEvents();
397 mView->dialogManager()->showSyncOptions(); 388 mView->dialogManager()->showSyncOptions();
398 } 389 }
399 390
400 //US listen for result adressed from Ka/Pi 391 //US listen for result adressed from Ka/Pi
401#ifndef DESKTOP_VERSION 392
402 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
403#endif
404#ifndef DESKTOP_VERSION 393#ifndef DESKTOP_VERSION
405 infrared = 0; 394 infrared = 0;
406#endif 395#endif
407 updateFilterToolbar(); 396 updateFilterToolbar();
408 updateWeek( mView->startDate() ); 397 updateWeek( mView->startDate() );
409 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 398 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
410 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 399 SLOT( updateWeekNum( const KCal::DateList & ) ) );
411 mBRdisabled = false; 400 mBRdisabled = false;
412 //toggleBeamReceive(); 401 //toggleBeamReceive();
413 402
414 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 403 setCaption(i18n("Loading calendar files ... please wait" ));
404 QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() ));
415} 405}
416MainWindow::~MainWindow() 406MainWindow::~MainWindow()
417{ 407{
418 //qDebug("MainWindow::~MainWindow() "); 408 //qDebug("MainWindow::~MainWindow() ");
419 //save toolbar location 409 //save toolbar location
420 delete mCalendar; 410 delete mCalendar;
421 delete mSyncManager; 411 delete mSyncManager;
422#ifndef DESKTOP_VERSION 412#ifndef DESKTOP_VERSION
423 if ( infrared ) 413 if ( infrared )
424 delete infrared; 414 delete infrared;
425#endif 415#endif
426 416
427 417
428} 418}
419
420void MainWindow::loadDataAfterStart()
421{
422
423 qDebug("KO: Start loading files..." );
424 QTime neededSaveTime = QDateTime::currentDateTime().time();
425 mView->loadCalendars();
426 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
427 qDebug("KO: Calendar loading time: %d ms",msNeeded );
428 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
429 mView->setModified( false );
430 mBlockAtStartup = false;
431 mView->setModified( false );
432 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
433 processIncidenceSelection( 0 );
434 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
435 SLOT( processIncidenceSelection( Incidence * ) ) );
436 connect( mView, SIGNAL( modifiedChanged( bool ) ),
437 SLOT( slotModifiedChanged( bool ) ) );
438
439#ifndef DESKTOP_VERSION
440 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
441 connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& )));
442 disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& )));
443 if ( !mCStringMess.isEmpty() )
444 recieve( mCStringMess, mByteData );
445#endif
446
447
448 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
449}
450
429void MainWindow::slotResetFocus() 451void MainWindow::slotResetFocus()
430{ 452{
431 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); 453 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
432 mFocusLoop = 3; 454 mFocusLoop = 3;
433 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 455 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
434} 456}
435void MainWindow::slotResetFocusLoop() 457void MainWindow::slotResetFocusLoop()
436{ 458{
437 --mFocusLoop; 459 --mFocusLoop;
438 QWidget* fw = mView->viewManager()->currentView(); 460 QWidget* fw = mView->viewManager()->currentView();
439 if ( fw ) { 461 if ( fw ) {
440 //qDebug("loop "); 462 //qDebug("loop ");
441 fw->setFocus(); 463 fw->setFocus();
442 if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) 464 if ( qApp->focusWidget() != fw && mFocusLoop > 0 )
443 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 465 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
444 } 466 }
445 467
446} 468}
447void MainWindow::disableBR(bool b) 469void MainWindow::disableBR(bool b)
448{ 470{
449#ifndef DESKTOP_VERSION 471#ifndef DESKTOP_VERSION
450 if ( b ) { 472 if ( b ) {
451 if ( infrared ) { 473 if ( infrared ) {
452 toggleBeamReceive(); 474 toggleBeamReceive();
453 mBRdisabled = true; 475 mBRdisabled = true;
454 } 476 }
455 mBRdisabled = true; 477 mBRdisabled = true;
456 } else { 478 } else {
457 if ( mBRdisabled ) { 479 if ( mBRdisabled ) {
458 mBRdisabled = false; 480 mBRdisabled = false;
459 //makes no sense,because other cal ap is probably running 481 //makes no sense,because other cal ap is probably running
460 // toggleBeamReceive(); 482 // toggleBeamReceive();
461 } 483 }
462 } 484 }
463#endif 485#endif
464 486
465} 487}
466bool MainWindow::beamReceiveEnabled() 488bool MainWindow::beamReceiveEnabled()
467{ 489{
468#ifndef DESKTOP_VERSION 490#ifndef DESKTOP_VERSION
469 return ( infrared != 0 ); 491 return ( infrared != 0 );
470#endif 492#endif
471 return false; 493 return false;
472} 494}
473 495
474void MainWindow::toggleBeamReceive() 496void MainWindow::toggleBeamReceive()
475{ 497{
476 if ( mBRdisabled ) 498 if ( mBRdisabled )
477 return; 499 return;
478#ifndef DESKTOP_VERSION 500#ifndef DESKTOP_VERSION
479 if ( infrared ) { 501 if ( infrared ) {
480 qDebug("KO: Disable BeamReceive "); 502 qDebug("KO: Disable BeamReceive ");
481 delete infrared; 503 delete infrared;
482 infrared = 0; 504 infrared = 0;
483 brAction->setOn(false); 505 brAction->setOn(false);
484 return; 506 return;
485 } 507 }
486 qDebug("KO: Enable BeamReceive "); 508 qDebug("KO: Enable BeamReceive ");
487 brAction->setOn(true); 509 brAction->setOn(true);
488 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 510 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
489 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 511 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
490#endif 512#endif
491} 513}
492void MainWindow::showMaximized () 514void MainWindow::showMaximized ()
493{ 515{
494#ifndef DESKTOP_VERSION 516#ifndef DESKTOP_VERSION
495 if ( ! globalFlagBlockStartup ) 517 if ( ! globalFlagBlockStartup )
496 if ( mClosed ) 518 if ( mClosed )
497 mView->goToday(); 519 mView->goToday();
498#endif 520#endif
499 QWidget::showMaximized () ; 521 QWidget::showMaximized () ;
500 mClosed = false; 522 mClosed = false;
501} 523}
502void MainWindow::closeEvent( QCloseEvent* ce ) 524void MainWindow::closeEvent( QCloseEvent* ce )
503{ 525{
504 526
505 527
506 528
507 if ( ! KOPrefs::instance()->mAskForQuit ) { 529 if ( ! KOPrefs::instance()->mAskForQuit ) {
508 saveOnClose(); 530 saveOnClose();
509 if ( mCalendarModifiedFlag ) { 531 if ( mCalendarModifiedFlag ) {
510 ce->ignore(); 532 ce->ignore();
511 return; 533 return;
512 } 534 }
513 mClosed = true; 535 mClosed = true;
514 ce->accept(); 536 ce->accept();
515 return; 537 return;
516 538
517 } 539 }
518 540
519 switch( QMessageBox::information( this, "KO/Pi", 541 switch( QMessageBox::information( this, "KO/Pi",
520 i18n("Do you really want\nto close KO/Pi?"), 542 i18n("Do you really want\nto close KO/Pi?"),
521 i18n("Close"), i18n("No"), 543 i18n("Close"), i18n("No"),
522 0, 0 ) ) { 544 0, 0 ) ) {
523 case 0: 545 case 0:
524 saveOnClose(); 546 saveOnClose();
525 if ( mCalendarModifiedFlag ) { 547 if ( mCalendarModifiedFlag ) {
526 ce->ignore(); 548 ce->ignore();
527 return; 549 return;
528 } 550 }
529 mClosed = true; 551 mClosed = true;
530 ce->accept(); 552 ce->accept();
531 break; 553 break;
532 case 1: 554 case 1:
533 ce->ignore(); 555 ce->ignore();
534 break; 556 break;
535 case 2: 557 case 2:
536 558
537 default: 559 default:
538 break; 560 break;
539 } 561 }
540 562
541 563
542} 564}
543 565void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data )
566{
567 qDebug("KO: QCOP start message received: %s ", cmsg.data() );
568 mCStringMess = cmsg;
569 mByteData = data;
570}
544void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 571void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
545{ 572{
546 QDataStream stream( data, IO_ReadOnly ); 573 QDataStream stream( data, IO_ReadOnly );
547 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 574 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
548 //QString datamess; 575 //QString datamess;
549 //qDebug("message "); 576 //qDebug("message ");
550 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 577 qDebug("KO: QCOP message received: %s ", cmsg.data() );
551 578
552 if ( cmsg == "setDocument(QString)" ) { 579 if ( cmsg == "setDocument(QString)" ) {
553 QDataStream stream( data, IO_ReadOnly ); 580 QDataStream stream( data, IO_ReadOnly );
554 QString fileName; 581 QString fileName;
555 stream >> fileName; 582 stream >> fileName;
556 //qDebug("filename %s ", fileName.latin1()); 583 //qDebug("filename %s ", fileName.latin1());
557 showMaximized(); 584 showMaximized();
558 raise(); 585 raise();
559 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 586 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
560 mSyncManager->slotSyncMenu( 1002 ); 587 mSyncManager->slotSyncMenu( 1002 );
561 return; 588 return;
562 } 589 }
563 590
564 if ( cmsg == "-writeFile" ) { 591 if ( cmsg == "-writeFile" ) {
565 // I made from the "-writeFile" an "-writeAlarm" 592 // I made from the "-writeFile" an "-writeAlarm"
566 mView->viewManager()->showWhatsNextView(); 593 mView->viewManager()->showWhatsNextView();
567 mCalendar->checkAlarmForIncidence( 0, true); 594 mCalendar->checkAlarmForIncidence( 0, true);
568 showMaximized(); 595 showMaximized();
569 raise(); 596 raise();
570 return; 597 return;
571 598
572 } 599 }
573 if ( cmsg == "-writeFileSilent" ) { 600 if ( cmsg == "-writeFileSilent" ) {
574 // I made from the "-writeFile" an "-writeAlarm" 601 // I made from the "-writeFile" an "-writeAlarm"
575 // mView->viewManager()->showWhatsNextView(); 602 // mView->viewManager()->showWhatsNextView();
576 mCalendar->checkAlarmForIncidence( 0, true); 603 mCalendar->checkAlarmForIncidence( 0, true);
577 //showMaximized(); 604 //showMaximized();
578 //raise(); 605 //raise();
579 hide(); 606 hide();
580 return; 607 return;
581 } 608 }
582 if ( cmsg == "-newCountdown" ) { 609 if ( cmsg == "-newCountdown" ) {
583 qDebug("newCountdown "); 610 qDebug("newCountdown ");
584 611
585 } 612 }
586 QString msg ; 613 QString msg ;
587 QString allmsg = cmsg; 614 QString allmsg = cmsg;
588 while ( allmsg.length() > 0 ) { 615 while ( allmsg.length() > 0 ) {
589 int nextC = allmsg.find( "-", 1 ); 616 int nextC = allmsg.find( "-", 1 );
590 if ( nextC == -1 ) { 617 if ( nextC == -1 ) {
591 msg = allmsg; 618 msg = allmsg;
592 allmsg = ""; 619 allmsg = "";
593 } else{ 620 } else{
594 msg = allmsg.left( nextC ); 621 msg = allmsg.left( nextC );
595 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 622 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
596 } 623 }
597 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 624 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
598 if ( msg == "-newEvent" ) { 625 if ( msg == "-newEvent" ) {
599 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 626 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
600 } 627 }
601 if ( msg == "-newTodo" ) { 628 if ( msg == "-newTodo" ) {
602 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 629 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
603 } 630 }
604 if ( msg == "-showWN" ) { 631 if ( msg == "-showWN" ) {
605 mView->viewManager()->showWhatsNextView(); 632 mView->viewManager()->showWhatsNextView();
606 } 633 }
607 if ( msg == "-showTodo" ) { 634 if ( msg == "-showTodo" ) {
608 mView->viewManager()->showTodoView(); 635 mView->viewManager()->showTodoView();
609 } 636 }
610 if ( msg == "-showList" ) { 637 if ( msg == "-showList" ) {
611 mView->viewManager()->showListView(); 638 mView->viewManager()->showListView();
612 } 639 }
613 else if ( msg == "-showDay" ) { 640 else if ( msg == "-showDay" ) {
614 mView->viewManager()->showDayView(); 641 mView->viewManager()->showDayView();
615 } 642 }
616 else if ( msg == "-showWWeek" ) { 643 else if ( msg == "-showWWeek" ) {
617 mView->viewManager()->showWorkWeekView(); 644 mView->viewManager()->showWorkWeekView();
618 } 645 }
619 else if ( msg == "-ringSync" ) { 646 else if ( msg == "-ringSync" ) {
620 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 647 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
621 } 648 }
622 else if ( msg == "-showWeek" ) { 649 else if ( msg == "-showWeek" ) {
623 mView->viewManager()->showWeekView(); 650 mView->viewManager()->showWeekView();
624 } 651 }
625 else if ( msg == "-showTodo" ) { 652 else if ( msg == "-showTodo" ) {
626 mView->viewManager()->showTodoView(); 653 mView->viewManager()->showTodoView();
627 } 654 }
628 else if ( msg == "-showJournal" ) { 655 else if ( msg == "-showJournal" ) {
629 mView->dateNavigator()->selectDates( 1 ); 656 mView->dateNavigator()->selectDates( 1 );
630 mView->dateNavigator()->selectToday(); 657 mView->dateNavigator()->selectToday();
631 mView->viewManager()->showJournalView(); 658 mView->viewManager()->showJournalView();
632 } 659 }
633 else if ( msg == "-showKO" ) { 660 else if ( msg == "-showKO" ) {
634 mView->viewManager()->showNextXView(); 661 mView->viewManager()->showNextXView();
635 } 662 }
636 else if ( msg == "-showWNext" ) { 663 else if ( msg == "-showWNext" ) {
637 mView->viewManager()->showWhatsNextView(); 664 mView->viewManager()->showWhatsNextView();
638 } 665 }
639 else if ( msg == "nextView()" ) { 666 else if ( msg == "nextView()" ) {
640 mView->viewManager()->showNextView(); 667 mView->viewManager()->showNextView();
641 } 668 }
642 else if ( msg == "-showNextXView" ) { 669 else if ( msg == "-showNextXView" ) {
643 mView->viewManager()->showNextXView(); 670 mView->viewManager()->showNextXView();
644 } 671 }
645 672
646 673
647 } 674 }
648 675
649 showMaximized(); 676 showMaximized();
650 raise(); 677 raise();
651} 678}
652void MainWindow::startMultiSync() 679void MainWindow::startMultiSync()
653{ 680{
654 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 681 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
655 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 682 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
656 question, 683 question,
657 i18n("Yes"), i18n("No"), 684 i18n("Yes"), i18n("No"),
658 0, 0 ) != 0 ) { 685 0, 0 ) != 0 ) {
659 setCaption(i18n("Aborted! Nothing synced!")); 686 setCaption(i18n("Aborted! Nothing synced!"));
660 return; 687 return;
661 } 688 }
662 mSyncManager->multiSync( false ); 689 mSyncManager->multiSync( false );
663#ifndef DESKTOP_VERSION 690#ifndef DESKTOP_VERSION
664 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 691 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
665#endif 692#endif
666} 693}
667QPixmap MainWindow::loadPixmap( QString name ) 694QPixmap MainWindow::loadPixmap( QString name )
668{ 695{
669 return SmallIcon( name ); 696 return SmallIcon( name );
670 697
671} 698}
672void MainWindow::setUsesBigPixmaps ( bool b ) 699void MainWindow::setUsesBigPixmaps ( bool b )
673{ 700{
674 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 701 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
675 if ( b ) 702 if ( b )
676 qDebug("KO: BigPixmaps are not supported "); 703 qDebug("KO: BigPixmaps are not supported ");
677} 704}
678void MainWindow::initActions() 705void MainWindow::initActions()
679{ 706{
680 //KOPrefs::instance()->mShowFullMenu 707 //KOPrefs::instance()->mShowFullMenu
681 iconToolBar->clear(); 708 iconToolBar->clear();
682 KOPrefs *p = KOPrefs::instance(); 709 KOPrefs *p = KOPrefs::instance();
683 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 710 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
684 711
685 QPopupMenu *viewMenu = new QPopupMenu( this ); 712 QPopupMenu *viewMenu = new QPopupMenu( this );
686 QPopupMenu *actionMenu = new QPopupMenu( this ); 713 QPopupMenu *actionMenu = new QPopupMenu( this );
687 mCurrentItemMenu = new QPopupMenu ( this ); 714 mCurrentItemMenu = new QPopupMenu ( this );
688 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 715 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
689 QPopupMenu *importMenu = new QPopupMenu( this ); 716 QPopupMenu *importMenu = new QPopupMenu( this );
690 QPopupMenu *importMenu_X = new QPopupMenu( this ); 717 QPopupMenu *importMenu_X = new QPopupMenu( this );
691 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 718 QPopupMenu *exportMenu_X = new QPopupMenu( this );
692 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 719 QPopupMenu *beamMenu_X = new QPopupMenu( this );
693 selectFilterMenu = new QPopupMenu( this ); 720 selectFilterMenu = new QPopupMenu( this );
694 selectFilterMenu->setCheckable( true ); 721 selectFilterMenu->setCheckable( true );
695 syncMenu = new QPopupMenu( this ); 722 syncMenu = new QPopupMenu( this );
696 configureAgendaMenu = new QPopupMenu( this ); 723 configureAgendaMenu = new QPopupMenu( this );
697 configureToolBarMenu = new QPopupMenu( this ); 724 configureToolBarMenu = new QPopupMenu( this );
698 QPopupMenu *helpMenu = new QPopupMenu( this ); 725 QPopupMenu *helpMenu = new QPopupMenu( this );
699 QIconSet icon; 726 QIconSet icon;
700 int pixWid = 22, pixHei = 22; 727 int pixWid = 22, pixHei = 22;
701 QString pathString = ""; 728 QString pathString = "";
702 if ( !p->mToolBarMiniIcons ) { 729 if ( !p->mToolBarMiniIcons ) {
703 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 730 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
704 pathString += "icons16/"; 731 pathString += "icons16/";
705 pixWid = 18; pixHei = 16; 732 pixWid = 18; pixHei = 16;
706 } 733 }
707 } else { 734 } else {
708 pathString += "iconsmini/"; 735 pathString += "iconsmini/";
709 pixWid = 18; pixHei = 16; 736 pixWid = 18; pixHei = 16;
710 } 737 }
711 738
712 if ( KOPrefs::instance()->mShowFullMenu ) { 739 if ( KOPrefs::instance()->mShowFullMenu ) {
713 menuBar1 = new KMenuBar( this );//menuBar(); 740 menuBar1 = new KMenuBar( this );//menuBar();
714 //setMenuBar( menuBar1 ); 741 //setMenuBar( menuBar1 );
715 menuBar1->show(); 742 menuBar1->show();
716 menuBar1->insertItem( i18n("File"), importMenu ); 743 menuBar1->insertItem( i18n("File"), importMenu );
717 menuBar1->insertItem( i18n("View"), viewMenu ); 744 menuBar1->insertItem( i18n("View"), viewMenu );
718 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 745 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
719 menuBar1->insertItem( i18n("Action"), actionMenu ); 746 menuBar1->insertItem( i18n("Action"), actionMenu );
720#ifdef DESKTOP_VERSION 747#ifdef DESKTOP_VERSION
721 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 748 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
722 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 749 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
723#else 750#else
724 menuBar1->insertItem( i18n("Sync"), syncMenu ); 751 menuBar1->insertItem( i18n("Sync"), syncMenu );
725 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 752 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
726#endif 753#endif
727 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 754 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
728 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 755 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
729 menuBar1->insertItem( i18n("Help"), helpMenu ); 756 menuBar1->insertItem( i18n("Help"), helpMenu );
730 } else { 757 } else {
731 menuBar1 = new KMenuBar( iconToolBar ); 758 menuBar1 = new KMenuBar( iconToolBar );
732 QPopupMenu *menuBar = new QPopupMenu( this ); 759 QPopupMenu *menuBar = new QPopupMenu( this );
733 icon = loadPixmap( pathString + "z_menu" ); 760 icon = loadPixmap( pathString + "z_menu" );
734 menuBar1->insertItem( icon.pixmap(), menuBar); 761 menuBar1->insertItem( icon.pixmap(), menuBar);
735 //menuBar1->insertItem( i18n("ME"), menuBar); 762 //menuBar1->insertItem( i18n("ME"), menuBar);
736 menuBar->insertItem( i18n("File"), importMenu ); 763 menuBar->insertItem( i18n("File"), importMenu );
737 menuBar->insertItem( i18n("View"), viewMenu ); 764 menuBar->insertItem( i18n("View"), viewMenu );
738 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 765 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
739 menuBar->insertItem( i18n("Action"), actionMenu ); 766 menuBar->insertItem( i18n("Action"), actionMenu );
740 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 767 menuBar->insertItem( i18n("Synchronize"), syncMenu );
741 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 768 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
742 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 769 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
743 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 770 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
744 menuBar->insertItem( i18n("Help"), helpMenu ); 771 menuBar->insertItem( i18n("Help"), helpMenu );
745 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 772 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
746 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 773 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
747 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); 774 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) );
748 } 775 }
749 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 776 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
750 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 777 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
751 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 778 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
752 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 779 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
753 780
754 781
755 mWeekBgColor = iconToolBar->backgroundColor(); 782 mWeekBgColor = iconToolBar->backgroundColor();
756 mWeekPixmap.resize( pixWid , pixHei ); 783 mWeekPixmap.resize( pixWid , pixHei );
757 mWeekPixmap.fill( mWeekBgColor ); 784 mWeekPixmap.fill( mWeekBgColor );
758 icon = mWeekPixmap; 785 icon = mWeekPixmap;
759 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 786 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
760 if ( p-> mShowIconWeekNum ) 787 if ( p-> mShowIconWeekNum )
761 mWeekAction->addTo( iconToolBar ); 788 mWeekAction->addTo( iconToolBar );
762 mWeekFont = font(); 789 mWeekFont = font();
763 790
764 int fontPoint = mWeekFont.pointSize(); 791 int fontPoint = mWeekFont.pointSize();
765 QFontMetrics f( mWeekFont ); 792 QFontMetrics f( mWeekFont );
766 int fontWid = f.width( "30" ); 793 int fontWid = f.width( "30" );
767 while ( fontWid > pixWid ) { 794 while ( fontWid > pixWid ) {
768 --fontPoint; 795 --fontPoint;
769 mWeekFont.setPointSize( fontPoint ); 796 mWeekFont.setPointSize( fontPoint );
770 QFontMetrics f( mWeekFont ); 797 QFontMetrics f( mWeekFont );
771 fontWid = f.width( "30" ); 798 fontWid = f.width( "30" );
772 //qDebug("dec-- "); 799 //qDebug("dec-- ");
773 } 800 }
774 801
775 connect( mWeekAction, SIGNAL( activated() ), 802 connect( mWeekAction, SIGNAL( activated() ),
776 this, SLOT( weekAction() ) ); 803 this, SLOT( weekAction() ) );
777 804
778 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 805 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
779 if ( p->mShowIconFilterview ) { 806 if ( p->mShowIconFilterview ) {
780 icon = loadPixmap( pathString + "filter" ); 807 icon = loadPixmap( pathString + "filter" );
781 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 808 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
782 connect( actionFilterMenuTB, SIGNAL( activated() ), 809 connect( actionFilterMenuTB, SIGNAL( activated() ),
783 this, SLOT( fillFilterMenuTB() ) ); 810 this, SLOT( fillFilterMenuTB() ) );
784 actionFilterMenuTB->addTo( iconToolBar ); 811 actionFilterMenuTB->addTo( iconToolBar );
785 selectFilterMenuTB = new QPopupMenu( this ); 812 selectFilterMenuTB = new QPopupMenu( this );
786 selectFilterMenuTB->setCheckable( true ); 813 selectFilterMenuTB->setCheckable( true );
787 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 814 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
788 } 815 }
789 816
790 //#endif 817 //#endif
791 // ****************** 818 // ******************
792 QAction *action; 819 QAction *action;
793 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 820 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
794 configureToolBarMenu->setCheckable( true ); 821 configureToolBarMenu->setCheckable( true );
795 822
796 823
797 configureAgendaMenu->setCheckable( true ); 824 configureAgendaMenu->setCheckable( true );
798 int iii ; 825 int iii ;
799 for ( iii = 1;iii<= 10 ;++iii ){ 826 for ( iii = 1;iii<= 10 ;++iii ){
800 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 827 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
801 } 828 }
802 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 829 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
803 830
804 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 831 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
805 this, SLOT( showConfigureAgenda( ) ) ); 832 this, SLOT( showConfigureAgenda( ) ) );
806 icon = loadPixmap( pathString + "today" ); 833 icon = loadPixmap( pathString + "today" );
807 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 834 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
808 today_action->addTo( actionMenu ); 835 today_action->addTo( actionMenu );
809 connect( today_action, SIGNAL( activated() ), 836 connect( today_action, SIGNAL( activated() ),
810 mView, SLOT( goToday() ) ); 837 mView, SLOT( goToday() ) );
811 838
812 icon = loadPixmap( pathString + "picker" ); 839 icon = loadPixmap( pathString + "picker" );
813 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 840 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
814 dPickerAction->addTo( actionMenu ); 841 dPickerAction->addTo( actionMenu );
815 connect( dPickerAction, SIGNAL( activated() ), 842 connect( dPickerAction, SIGNAL( activated() ),
816 mView, SLOT( showDatePicker() ) ); 843 mView, SLOT( showDatePicker() ) );
817 844
818 icon = loadPixmap( pathString + "search" ); 845 icon = loadPixmap( pathString + "search" );
819 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 846 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
820 search_action->addTo( actionMenu ); 847 search_action->addTo( actionMenu );
821 connect( search_action, SIGNAL( activated() ), 848 connect( search_action, SIGNAL( activated() ),
822 mView->dialogManager(), SLOT( showSearchDialog() ) ); 849 mView->dialogManager(), SLOT( showSearchDialog() ) );
823 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 850 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
824 851
825 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 852 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
826 action->addTo( nextConflictMenu ); 853 action->addTo( nextConflictMenu );
827 connect( action, SIGNAL( activated() ), 854 connect( action, SIGNAL( activated() ),
828 mView, SLOT( conflictAll() ) ); 855 mView, SLOT( conflictAll() ) );
829 856
830 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 857 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
831 action->addTo( nextConflictMenu ); 858 action->addTo( nextConflictMenu );
832 connect( action, SIGNAL( activated() ), 859 connect( action, SIGNAL( activated() ),
833 mView, SLOT( conflictAllday() ) ); 860 mView, SLOT( conflictAllday() ) );
834 861
835 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 862 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
836 action->addTo( nextConflictMenu ); 863 action->addTo( nextConflictMenu );
837 connect( action, SIGNAL( activated() ), 864 connect( action, SIGNAL( activated() ),
838 mView, SLOT( conflictNotAll() ) ); 865 mView, SLOT( conflictNotAll() ) );
839 866
840 actionMenu->insertSeparator(); 867 actionMenu->insertSeparator();
841 868
842 icon = loadPixmap( pathString + "newevent" ); 869 icon = loadPixmap( pathString + "newevent" );
843 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 870 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
844 ne_action->addTo( mCurrentItemMenu ); 871 ne_action->addTo( mCurrentItemMenu );
845 connect( ne_action, SIGNAL( activated() ), 872 connect( ne_action, SIGNAL( activated() ),
846 mView, SLOT( newEvent() ) ); 873 mView, SLOT( newEvent() ) );
847 icon = loadPixmap( pathString + "newtodo" ); 874 icon = loadPixmap( pathString + "newtodo" );
848 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 875 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
849 nt_action->addTo( mCurrentItemMenu ); 876 nt_action->addTo( mCurrentItemMenu );
850 connect( nt_action, SIGNAL( activated() ), 877 connect( nt_action, SIGNAL( activated() ),
851 mView, SLOT( newTodo() ) ); 878 mView, SLOT( newTodo() ) );
852 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 879 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
853 this ); 880 this );
854 mNewSubTodoAction->addTo( mCurrentItemMenu ); 881 mNewSubTodoAction->addTo( mCurrentItemMenu );
855 connect( mNewSubTodoAction, SIGNAL( activated() ), 882 connect( mNewSubTodoAction, SIGNAL( activated() ),
856 mView, SLOT( newSubTodo() ) ); 883 mView, SLOT( newSubTodo() ) );
857 884
858 mCurrentItemMenu->insertSeparator(); 885 mCurrentItemMenu->insertSeparator();
859 icon = loadPixmap( pathString + "newevent" ); 886 icon = loadPixmap( pathString + "newevent" );
860 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 887 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
861 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 888 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
862 configureToolBarMenu->insertSeparator(); 889 configureToolBarMenu->insertSeparator();
863 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 890 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
864 configureToolBarMenu->insertSeparator(); 891 configureToolBarMenu->insertSeparator();
865 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 892 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
866 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 893 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
867 icon = loadPixmap( pathString + "newtodo" ); 894 icon = loadPixmap( pathString + "newtodo" );
868 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 895 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
869 896
870 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 897 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
871 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 898 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
872 mShowAction->addTo( mCurrentItemMenu ); 899 mShowAction->addTo( mCurrentItemMenu );
873 connect( mShowAction, SIGNAL( activated() ), 900 connect( mShowAction, SIGNAL( activated() ),
874 mView, SLOT( showIncidence() ) ); 901 mView, SLOT( showIncidence() ) );
875 902
876 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 903 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
877 mEditAction->addTo( mCurrentItemMenu ); 904 mEditAction->addTo( mCurrentItemMenu );
878 connect( mEditAction, SIGNAL( activated() ), 905 connect( mEditAction, SIGNAL( activated() ),
879 mView, SLOT( editIncidence() ) ); 906 mView, SLOT( editIncidence() ) );
880 907
881 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 908 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
882 mDeleteAction->addTo( mCurrentItemMenu ); 909 mDeleteAction->addTo( mCurrentItemMenu );
883 connect( mDeleteAction, SIGNAL( activated() ), 910 connect( mDeleteAction, SIGNAL( activated() ),
884 mView, SLOT( deleteIncidence() ) ); 911 mView, SLOT( deleteIncidence() ) );
885 912
886 913
887 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 914 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
888 mCloneAction->addTo( mCurrentItemMenu ); 915 mCloneAction->addTo( mCurrentItemMenu );
889 connect( mCloneAction, SIGNAL( activated() ), 916 connect( mCloneAction, SIGNAL( activated() ),
890 mView, SLOT( cloneIncidence() ) ); 917 mView, SLOT( cloneIncidence() ) );
891 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 918 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
892 mMoveAction->addTo( mCurrentItemMenu ); 919 mMoveAction->addTo( mCurrentItemMenu );
893 connect( mMoveAction, SIGNAL( activated() ), 920 connect( mMoveAction, SIGNAL( activated() ),
894 mView, SLOT( moveIncidence() ) ); 921 mView, SLOT( moveIncidence() ) );
895#ifndef DESKTOP_VERSION 922#ifndef DESKTOP_VERSION
896 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 923 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
897 mBeamAction->addTo(mCurrentItemMenu ); 924 mBeamAction->addTo(mCurrentItemMenu );
898 connect( mBeamAction, SIGNAL( activated() ), 925 connect( mBeamAction, SIGNAL( activated() ),
899 mView, SLOT( beamIncidence() ) ); 926 mView, SLOT( beamIncidence() ) );
900#endif 927#endif
901 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
902 mCancelAction->addTo( mCurrentItemMenu ); 929 mCancelAction->addTo( mCurrentItemMenu );
903 connect( mCancelAction, SIGNAL( activated() ), 930 connect( mCancelAction, SIGNAL( activated() ),
904 mView, SLOT( toggleCancelIncidence() ) ); 931 mView, SLOT( toggleCancelIncidence() ) );
905 932
906 933
907 mCurrentItemMenu->insertSeparator(); 934 mCurrentItemMenu->insertSeparator();
908 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 935 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
909 action->addTo( mCurrentItemMenu ); 936 action->addTo( mCurrentItemMenu );
910 connect( action, SIGNAL( activated() ), 937 connect( action, SIGNAL( activated() ),
911 mView, SLOT( undo_delete() ) ); 938 mView, SLOT( undo_delete() ) );
912 939
913 // *********************** 940 // ***********************
914 if ( KOPrefs::instance()->mVerticalScreen ) { 941 if ( KOPrefs::instance()->mVerticalScreen ) {
915 icon = SmallIcon( "1updownarrow" ); 942 icon = SmallIcon( "1updownarrow" );
916 } else { 943 } else {
917 icon = SmallIcon("1leftrightarrow" ); 944 icon = SmallIcon("1leftrightarrow" );
918 } 945 }
919 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 946 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
920 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 947 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
921 FSaction->addTo( viewMenu ); 948 FSaction->addTo( viewMenu );
922 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 949 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
923 950
924 951
925 icon = loadPixmap( pathString + "filter" ); 952 icon = loadPixmap( pathString + "filter" );
926 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 953 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
927 icon = loadPixmap( pathString + "configure" ); 954 icon = loadPixmap( pathString + "configure" );
@@ -2135,554 +2162,555 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
2135 mView->viewManager()->showListView(); 2162 mView->viewManager()->showListView();
2136 break; 2163 break;
2137 case Qt::Key_N: 2164 case Qt::Key_N:
2138 mView->viewManager()->showNextView(); 2165 mView->viewManager()->showNextView();
2139 break; 2166 break;
2140 case Qt::Key_V: 2167 case Qt::Key_V:
2141 mView->viewManager()->showTodoView(); 2168 mView->viewManager()->showTodoView();
2142 break; 2169 break;
2143 case Qt::Key_C: 2170 case Qt::Key_C:
2144 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2171 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2145 break; 2172 break;
2146 case Qt::Key_P: 2173 case Qt::Key_P:
2147 mView->showDatePicker( ); 2174 mView->showDatePicker( );
2148 break; 2175 break;
2149 case Qt::Key_F: 2176 case Qt::Key_F:
2150 mView->editFilters(); 2177 mView->editFilters();
2151 break; 2178 break;
2152 case Qt::Key_R: 2179 case Qt::Key_R:
2153 mView->toggleFilter(); 2180 mView->toggleFilter();
2154 break; 2181 break;
2155 case Qt::Key_X: 2182 case Qt::Key_X:
2156 if ( e->state() == Qt::ControlButton ) 2183 if ( e->state() == Qt::ControlButton )
2157 mView->toggleDateNavigatorWidget(); 2184 mView->toggleDateNavigatorWidget();
2158 else { 2185 else {
2159 mView->viewManager()->showNextXView(); 2186 mView->viewManager()->showNextXView();
2160 showSelectedDates = true; 2187 showSelectedDates = true;
2161 } 2188 }
2162 break; 2189 break;
2163 case Qt::Key_Space: 2190 case Qt::Key_Space:
2164 mView->toggleExpand(); 2191 mView->toggleExpand();
2165 break; 2192 break;
2166 case Qt::Key_A: 2193 case Qt::Key_A:
2167 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2194 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2168 mView->showNextAlarms(); 2195 mView->showNextAlarms();
2169 else 2196 else
2170 mView->toggleAllDaySize(); 2197 mView->toggleAllDaySize();
2171 break; 2198 break;
2172 case Qt::Key_T: 2199 case Qt::Key_T:
2173 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2200 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2174 mView->newTodo(); 2201 mView->newTodo();
2175 else { 2202 else {
2176 mView->goToday(); 2203 mView->goToday();
2177 showSelectedDates = true; 2204 showSelectedDates = true;
2178 } 2205 }
2179 break; 2206 break;
2180 case Qt::Key_Q: 2207 case Qt::Key_Q:
2181 if ( e->state() == Qt::ControlButton ) 2208 if ( e->state() == Qt::ControlButton )
2182 mView->conflictNotAll(); 2209 mView->conflictNotAll();
2183 else if ( e->state() == Qt::ShiftButton ) 2210 else if ( e->state() == Qt::ShiftButton )
2184 mView->conflictAllday(); 2211 mView->conflictAllday();
2185 else 2212 else
2186 mView->conflictAll(); 2213 mView->conflictAll();
2187 break; 2214 break;
2188 case Qt::Key_J: 2215 case Qt::Key_J:
2189 mView->viewManager()->showJournalView(); 2216 mView->viewManager()->showJournalView();
2190 break; 2217 break;
2191 case Qt::Key_B: 2218 case Qt::Key_B:
2192 mView->editIncidenceDescription();; 2219 mView->editIncidenceDescription();;
2193 break; 2220 break;
2194 // case Qt::Key_Return: 2221 // case Qt::Key_Return:
2195 case Qt::Key_E: 2222 case Qt::Key_E:
2196 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2223 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2197 mView->newEvent(); 2224 mView->newEvent();
2198 else 2225 else
2199 mView->editIncidence(); 2226 mView->editIncidence();
2200 break; 2227 break;
2201 case Qt::Key_Plus: 2228 case Qt::Key_Plus:
2202 size = p->mHourSize +2; 2229 size = p->mHourSize +2;
2203 if ( size <= 22 ) 2230 if ( size <= 22 )
2204 configureAgenda( size ); 2231 configureAgenda( size );
2205 break; 2232 break;
2206 case Qt::Key_Minus: 2233 case Qt::Key_Minus:
2207 size = p->mHourSize - 2; 2234 size = p->mHourSize - 2;
2208 if ( size >= 4 ) 2235 if ( size >= 4 )
2209 configureAgenda( size ); 2236 configureAgenda( size );
2210 break; 2237 break;
2211 2238
2212 2239
2213 default: 2240 default:
2214 e->ignore(); 2241 e->ignore();
2215 } 2242 }
2216 if ( pro > 0 ) { 2243 if ( pro > 0 ) {
2217 selectFilter( pro+1 ); 2244 selectFilter( pro+1 );
2218 } 2245 }
2219 if ( showSelectedDates ) { 2246 if ( showSelectedDates ) {
2220 ;// setCaptionToDates(); 2247 ;// setCaptionToDates();
2221 } 2248 }
2222 2249
2223} 2250}
2224void MainWindow::fillFilterMenuTB() 2251void MainWindow::fillFilterMenuTB()
2225{ 2252{
2226 selectFilterMenuTB->clear(); 2253 selectFilterMenuTB->clear();
2227 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2254 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2228 selectFilterMenuTB->insertSeparator(); 2255 selectFilterMenuTB->insertSeparator();
2229 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2256 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2230 2257
2231 selectFilterMenuTB->insertSeparator(); 2258 selectFilterMenuTB->insertSeparator();
2232 QPtrList<CalFilter> fili = mView->filters(); 2259 QPtrList<CalFilter> fili = mView->filters();
2233 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2260 CalFilter *curfilter = mView->filterView()->selectedFilter();
2234 CalFilter *filter = fili.first(); 2261 CalFilter *filter = fili.first();
2235 int iii = 2; 2262 int iii = 2;
2236 bool checkitem = mView->filterView()->filtersEnabled(); 2263 bool checkitem = mView->filterView()->filtersEnabled();
2237 while(filter) { 2264 while(filter) {
2238 selectFilterMenuTB->insertItem( filter->name(), iii ); 2265 selectFilterMenuTB->insertItem( filter->name(), iii );
2239 if ( filter == curfilter) 2266 if ( filter == curfilter)
2240 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2267 selectFilterMenuTB->setItemChecked( iii, checkitem );
2241 filter = fili.next(); 2268 filter = fili.next();
2242 ++iii; 2269 ++iii;
2243 } 2270 }
2244 if ( !checkitem ) 2271 if ( !checkitem )
2245 selectFilterMenuTB->setItemChecked( 1, true ); 2272 selectFilterMenuTB->setItemChecked( 1, true );
2246 2273
2247 int x = 0; 2274 int x = 0;
2248 int y = iconToolBar->height(); 2275 int y = iconToolBar->height();
2249 int dX = 0; 2276 int dX = 0;
2250 int dY = 0; 2277 int dY = 0;
2251 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2278 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2252 if ( iconToolBar->y() > height()/2 ) { 2279 if ( iconToolBar->y() > height()/2 ) {
2253 dY = selectFilterMenuTB->sizeHint().height()+8; 2280 dY = selectFilterMenuTB->sizeHint().height()+8;
2254 y = 0; 2281 y = 0;
2255 } 2282 }
2256 } else { 2283 } else {
2257 if ( iconToolBar->x() > width()/2 ) { // right side 2284 if ( iconToolBar->x() > width()/2 ) { // right side
2258 x=0; 2285 x=0;
2259 dX= selectFilterMenuTB->sizeHint().width()+8; 2286 dX= selectFilterMenuTB->sizeHint().width()+8;
2260 y = 0; 2287 y = 0;
2261 } else { 2288 } else {
2262 x= iconToolBar->width(); 2289 x= iconToolBar->width();
2263 y = 0; 2290 y = 0;
2264 } 2291 }
2265 } 2292 }
2266 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2293 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2267 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2294 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2268} 2295}
2269void MainWindow::fillFilterMenu() 2296void MainWindow::fillFilterMenu()
2270{ 2297{
2271 selectFilterMenu->clear(); 2298 selectFilterMenu->clear();
2272 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2299 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2273 selectFilterMenu->insertSeparator(); 2300 selectFilterMenu->insertSeparator();
2274 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2301 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2275 2302
2276 selectFilterMenu->insertSeparator(); 2303 selectFilterMenu->insertSeparator();
2277 QPtrList<CalFilter> fili = mView->filters(); 2304 QPtrList<CalFilter> fili = mView->filters();
2278 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2305 CalFilter *curfilter = mView->filterView()->selectedFilter();
2279 CalFilter *filter = fili.first(); 2306 CalFilter *filter = fili.first();
2280 int iii = 2; 2307 int iii = 2;
2281 bool checkitem = mView->filterView()->filtersEnabled(); 2308 bool checkitem = mView->filterView()->filtersEnabled();
2282 while(filter) { 2309 while(filter) {
2283 selectFilterMenu->insertItem( filter->name(), iii ); 2310 selectFilterMenu->insertItem( filter->name(), iii );
2284 if ( filter == curfilter) 2311 if ( filter == curfilter)
2285 selectFilterMenu->setItemChecked( iii, checkitem ); 2312 selectFilterMenu->setItemChecked( iii, checkitem );
2286 filter = fili.next(); 2313 filter = fili.next();
2287 ++iii; 2314 ++iii;
2288 } 2315 }
2289 if ( !checkitem ) 2316 if ( !checkitem )
2290 selectFilterMenu->setItemChecked( 1, true ); 2317 selectFilterMenu->setItemChecked( 1, true );
2291} 2318}
2292void MainWindow::fillFilterMenuPopup() 2319void MainWindow::fillFilterMenuPopup()
2293{ 2320{
2294 filterPopupMenu->clear(); 2321 filterPopupMenu->clear();
2295 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2322 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2296 2323
2297 filterPopupMenu->insertSeparator(); 2324 filterPopupMenu->insertSeparator();
2298 QPtrList<CalFilter> fili = mView->filters(); 2325 QPtrList<CalFilter> fili = mView->filters();
2299 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2326 CalFilter *curfilter = mView->filterView()->selectedFilter();
2300 CalFilter *filter = fili.first(); 2327 CalFilter *filter = fili.first();
2301 int iii = 1; 2328 int iii = 1;
2302 bool checkitem = mView->filterView()->filtersEnabled(); 2329 bool checkitem = mView->filterView()->filtersEnabled();
2303 while(filter) { 2330 while(filter) {
2304 filterPopupMenu->insertItem( filter->name(), iii ); 2331 filterPopupMenu->insertItem( filter->name(), iii );
2305 if ( filter == curfilter) 2332 if ( filter == curfilter)
2306 filterPopupMenu->setItemChecked( iii, checkitem ); 2333 filterPopupMenu->setItemChecked( iii, checkitem );
2307 filter = fili.next(); 2334 filter = fili.next();
2308 ++iii; 2335 ++iii;
2309 } 2336 }
2310 if ( !checkitem ) 2337 if ( !checkitem )
2311 filterPopupMenu->setItemChecked( 0, true ); 2338 filterPopupMenu->setItemChecked( 0, true );
2312} 2339}
2313void MainWindow::selectFilter( int fil ) 2340void MainWindow::selectFilter( int fil )
2314{ 2341{
2315 2342
2316 if ( fil == 0 ) { 2343 if ( fil == 0 ) {
2317 mView->editFilters( ); 2344 mView->editFilters( );
2318 } else if ( fil == 1 ){ 2345 } else if ( fil == 1 ){
2319 if ( mView->filterView()->filtersEnabled() ) 2346 if ( mView->filterView()->filtersEnabled() )
2320 mView->toggleFilerEnabled( ); 2347 mView->toggleFilerEnabled( );
2321 } else { 2348 } else {
2322 if ( !mView->filterView()->filtersEnabled() ) { 2349 if ( !mView->filterView()->filtersEnabled() ) {
2323 mView->filterView()->blockSignals( true ); 2350 mView->filterView()->blockSignals( true );
2324 mView->toggleFilerEnabled( ); 2351 mView->toggleFilerEnabled( );
2325 mView->filterView()->blockSignals( false ); 2352 mView->filterView()->blockSignals( false );
2326 } 2353 }
2327 mView->selectFilter( fil-2 ); 2354 mView->selectFilter( fil-2 );
2328 } 2355 }
2329} 2356}
2330void MainWindow::updateFilterToolbar() 2357void MainWindow::updateFilterToolbar()
2331{ 2358{
2332 if ( filterMenubar ) { 2359 if ( filterMenubar ) {
2333 if ( !mView->filterView()->filtersEnabled() ) { 2360 if ( !mView->filterView()->filtersEnabled() ) {
2334 filterMenubar->changeItem( 0, i18n("No Filter") ); 2361 filterMenubar->changeItem( 0, i18n("No Filter") );
2335 } else { 2362 } else {
2336 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2363 CalFilter *curfilter = mView->filterView()->selectedFilter();
2337 if ( curfilter ) { 2364 if ( curfilter ) {
2338 QString name = curfilter->name(); 2365 QString name = curfilter->name();
2339 if ( name.length() > 12 ) 2366 if ( name.length() > 12 )
2340 name = name.left(10)+"..."; 2367 name = name.left(10)+"...";
2341 filterMenubar->changeItem( 0, name ); 2368 filterMenubar->changeItem( 0, name );
2342 } 2369 }
2343 } 2370 }
2344 } 2371 }
2345} 2372}
2346void MainWindow::selectFilterPopup( int fil ) 2373void MainWindow::selectFilterPopup( int fil )
2347{ 2374{
2348 selectFilter( fil + 1 ); 2375 selectFilter( fil + 1 );
2349 2376
2350} 2377}
2351void MainWindow::configureToolBar( int item ) 2378void MainWindow::configureToolBar( int item )
2352{ 2379{
2353 2380
2354 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2381 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2355 KOPrefs *p = KOPrefs::instance(); 2382 KOPrefs *p = KOPrefs::instance();
2356 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2383 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2357 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2384 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2358 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2385 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2359 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2386 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2360 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2387 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2361 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2388 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2362 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2389 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2363 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2390 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2364 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2391 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2365 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2392 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2366 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2393 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2367 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2394 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2368 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2395 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2369 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2396 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2370 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2397 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2371 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2398 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2372 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2399 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2373 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2400 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2374 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2401 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2375 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2402 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2376 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2403 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2377 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2404 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2378 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2405 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2379 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2406 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2380 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2407 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2381 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2408 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2382 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2409 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2383 // initActions(); 2410 // initActions();
2384 setCaption ( i18n("Toolbar changes needs a restart!") ); 2411 setCaption ( i18n("Toolbar changes needs a restart!") );
2385} 2412}
2386void MainWindow::setCaption ( const QString & c ) 2413void MainWindow::setCaption ( const QString & c )
2387{ 2414{
2388 QString cap = c; 2415 QString cap = c;
2389 cap.replace( QRegExp("\n"), " " ); 2416 cap.replace( QRegExp("\n"), " " );
2390 cap = cap.stripWhiteSpace(); 2417 cap = cap.stripWhiteSpace();
2391 if ( cap.isEmpty() ) 2418 if ( cap.isEmpty() )
2392 cap = "KO/Pi"; 2419 cap = "KO/Pi";
2393 QWidget::setCaption( cap ); 2420 QWidget::setCaption( cap );
2394} 2421}
2395void MainWindow::setCaptionToDates() 2422void MainWindow::setCaptionToDates()
2396{ 2423{
2397 QString selDates; 2424 QString selDates;
2398 QDate date = mView->startDate(); 2425 QDate date = mView->startDate();
2399 if ( ! date.isValid() ) { 2426 if ( ! date.isValid() ) {
2400 setCaption(""); 2427 setCaption("");
2401 return; 2428 return;
2402 } 2429 }
2403 selDates = KGlobal::locale()->formatDate( date, true); 2430 selDates = KGlobal::locale()->formatDate( date, true);
2404 if (mView->startDate() < mView->endDate() ) 2431 if (mView->startDate() < mView->endDate() )
2405 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2432 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2406 else { 2433 else {
2407 QString addString; 2434 QString addString;
2408 if ( date == QDateTime::currentDateTime().date() ) 2435 if ( date == QDateTime::currentDateTime().date() )
2409 addString = i18n("Today"); 2436 addString = i18n("Today");
2410 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2437 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2411 addString = i18n("Tomorrow"); 2438 addString = i18n("Tomorrow");
2412 if ( !addString.isEmpty() ) 2439 if ( !addString.isEmpty() )
2413 selDates = addString+", "+selDates ; 2440 selDates = addString+", "+selDates ;
2414 } 2441 }
2415 setCaption( i18n("Dates: ") + selDates ); 2442 setCaption( i18n("Dates: ") + selDates );
2416 2443
2417} 2444}
2418void MainWindow::showConfigureAgenda( ) 2445void MainWindow::showConfigureAgenda( )
2419{ 2446{
2420 int iii; 2447 int iii;
2421 for ( iii = 1;iii<= 10 ;++iii ){ 2448 for ( iii = 1;iii<= 10 ;++iii ){
2422 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2449 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2423 } 2450 }
2424 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2451 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2425} 2452}
2426void MainWindow::configureAgenda( int item ) 2453void MainWindow::configureAgenda( int item )
2427{ 2454{
2428 if ( KOPrefs::instance()->mHourSize == item ) 2455 if ( KOPrefs::instance()->mHourSize == item )
2429 return; 2456 return;
2430 KOPrefs::instance()->mHourSize=item; 2457 KOPrefs::instance()->mHourSize=item;
2431 mView->viewManager()->agendaView()->updateConfig(); 2458 mView->viewManager()->agendaView()->updateConfig();
2432} 2459}
2433 2460
2434void MainWindow::saveCalendar() 2461void MainWindow::saveCalendar()
2435{ 2462{
2436 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2463 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2437 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2464 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2438 bupDir = KGlobalSettings::backupDataDir(); 2465 bupDir = KGlobalSettings::backupDataDir();
2439 bupDir = KGlobal::formatMessage ( bupDir, 0 ); 2466 bupDir = KGlobal::formatMessage ( bupDir, 0 );
2440 QString bupHint; 2467 QString bupHint;
2441 if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) 2468 if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
2442 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); 2469 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
2443 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; 2470 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return;
2444 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; 2471 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
2445 KPimGlobalPrefs::instance()->mBackupEnabled = false; 2472 KPimGlobalPrefs::instance()->mBackupEnabled = false;
2446 save(); 2473 save();
2447 KPimGlobalPrefs::instance()->mBackupEnabled = enabled; 2474 KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
2448 backupAllFiles(); 2475 backupAllFiles();
2449} 2476}
2450void MainWindow::loadCalendar() 2477void MainWindow::loadCalendar()
2451{ 2478{
2452 2479
2453 2480
2454#if 0 2481#if 0
2455 QString fn = KOPrefs::instance()->mLastLoadFile; 2482 QString fn = KOPrefs::instance()->mLastLoadFile;
2456 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2483 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2457 2484
2458 if ( fn == "" ) 2485 if ( fn == "" )
2459 return; 2486 return;
2460 QFileInfo info; 2487 QFileInfo info;
2461 info.setFile( fn ); 2488 info.setFile( fn );
2462 QString mess; 2489 QString mess;
2463 bool loadbup = true; 2490 bool loadbup = true;
2464 if ( info. exists() ) { 2491 if ( info. exists() ) {
2465 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2492 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2466 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2493 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2467 mess, 2494 mess,
2468 i18n("Load!"), i18n("Cancel"), 0, 2495 i18n("Load!"), i18n("Cancel"), 0,
2469 0, 1 ); 2496 0, 1 );
2470 if ( result != 0 ) { 2497 if ( result != 0 ) {
2471 loadbup = false; 2498 loadbup = false;
2472 } 2499 }
2473 } else { 2500 } else {
2474 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2501 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2475 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2502 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2476 0, 1 ); 2503 0, 1 );
2477 2504
2478 return; 2505 return;
2479 } 2506 }
2480 if ( loadbup ) { 2507 if ( loadbup ) {
2481 mView->openCalendar( fn ); 2508 mView->openCalendar( fn );
2482 KOPrefs::instance()->mLastLoadFile = fn; 2509 KOPrefs::instance()->mLastLoadFile = fn;
2483 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2510 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2484 setCaption(mess); 2511 setCaption(mess);
2485 } 2512 }
2486#endif 2513#endif
2487 2514
2488} 2515}
2489void MainWindow::quickImportIcal() 2516void MainWindow::quickImportIcal()
2490{ 2517{
2491 importFile( KOPrefs::instance()->mLastImportFile, false ); 2518 importFile( KOPrefs::instance()->mLastImportFile, false );
2492} 2519}
2493void MainWindow::importFile( QString fn, bool quick ) 2520void MainWindow::importFile( QString fn, bool quick )
2494{ 2521{
2495 QFileInfo info; 2522 QFileInfo info;
2496 info.setFile( fn ); 2523 info.setFile( fn );
2497 QString mess; 2524 QString mess;
2498 if ( !info. exists() ) { 2525 if ( !info. exists() ) {
2499 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2526 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2500 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2527 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2501 mess ); 2528 mess );
2502 return; 2529 return;
2503 } 2530 }
2504 int result = 0; 2531 int result = 0;
2505 if ( !quick ) { 2532 if ( !quick ) {
2506 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2533 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2507 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2534 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2508 mess, 2535 mess,
2509 "Import", "Cancel", 0, 2536 "Import", "Cancel", 0,
2510 0, 1 ); 2537 0, 1 );
2511 } 2538 }
2512 if ( result == 0 ) { 2539 if ( result == 0 ) {
2513 if ( mView->openCalendar( fn, true )) { 2540 if ( mView->openCalendar( fn, true )) {
2514 KOPrefs::instance()->mLastImportFile = fn; 2541 KOPrefs::instance()->mLastImportFile = fn;
2515 setCaption(i18n("Imported file successfully")); 2542 setCaption(i18n("Imported file successfully"));
2516 } else { 2543 } else {
2517 setCaption(i18n("Error importing file")); 2544 setCaption(i18n("Error importing file"));
2518 } 2545 }
2546 mView->updateView();
2519 } 2547 }
2520} 2548}
2521 2549
2522void MainWindow::importIcal() 2550void MainWindow::importIcal()
2523{ 2551{
2524 2552
2525 QString fn =KOPrefs::instance()->mLastImportFile; 2553 QString fn =KOPrefs::instance()->mLastImportFile;
2526 2554
2527 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2555 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2528 if ( fn == "" ) 2556 if ( fn == "" )
2529 return; 2557 return;
2530 importFile( fn, true ); 2558 importFile( fn, true );
2531 2559
2532} 2560}
2533 2561
2534void MainWindow::exportVCalendar() 2562void MainWindow::exportVCalendar()
2535{ 2563{
2536 QString fn = KOPrefs::instance()->mLastVcalFile; 2564 QString fn = KOPrefs::instance()->mLastVcalFile;
2537 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2565 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2538 if ( fn == "" ) 2566 if ( fn == "" )
2539 return; 2567 return;
2540 QFileInfo info; 2568 QFileInfo info;
2541 info.setFile( fn ); 2569 info.setFile( fn );
2542 QString mes; 2570 QString mes;
2543 bool createbup = true; 2571 bool createbup = true;
2544 if ( info. exists() ) { 2572 if ( info. exists() ) {
2545 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2573 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2546 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2574 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2547 i18n("Overwrite!"), i18n("Cancel"), 0, 2575 i18n("Overwrite!"), i18n("Cancel"), 0,
2548 0, 1 ); 2576 0, 1 );
2549 if ( result != 0 ) { 2577 if ( result != 0 ) {
2550 createbup = false; 2578 createbup = false;
2551 } 2579 }
2552 } 2580 }
2553 if ( createbup ) { 2581 if ( createbup ) {
2554 if ( mView->exportVCalendar( fn ) ) { 2582 if ( mView->exportVCalendar( fn ) ) {
2555 KOPrefs::instance()->mLastVcalFile = fn; 2583 KOPrefs::instance()->mLastVcalFile = fn;
2556 if ( fn.length() > 20 ) 2584 if ( fn.length() > 20 )
2557 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2585 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2558 else 2586 else
2559 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2587 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2560 setCaption(mes); 2588 setCaption(mes);
2561 } 2589 }
2562 } 2590 }
2563 2591
2564} 2592}
2565QString MainWindow::sentSyncFile() 2593QString MainWindow::sentSyncFile()
2566{ 2594{
2567#ifdef DESKTOP_VERSION 2595#ifdef DESKTOP_VERSION
2568 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); 2596 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) );
2569#else 2597#else
2570 return QString( "/tmp/copysynccal.ics" ); 2598 return QString( "/tmp/copysynccal.ics" );
2571#endif 2599#endif
2572} 2600}
2573 2601
2574void MainWindow::syncFileRequest() 2602void MainWindow::syncFileRequest()
2575{ 2603{
2576 while ( mSyncManager->blockSave() ) { 2604 while ( mSyncManager->blockSave() ) {
2577 qApp->processEvents(); 2605 qApp->processEvents();
2578 } 2606 }
2579 mSyncManager->setBlockSave(true); 2607 mSyncManager->setBlockSave(true);
2580 2608
2581 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2609 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2582 mSyncManager->slotSyncMenu( 999 ); 2610 mSyncManager->slotSyncMenu( 999 );
2583 } 2611 }
2584 2612
2585 setCaption(i18n("Saving Data to temp file ..." )); 2613 setCaption(i18n("Saving Data to temp file ..." ));
2586 mView->saveCalendar( sentSyncFile() ); 2614 mView->saveCalendar( sentSyncFile() );
2587 setCaption(i18n("Data saved to temp file!" )); 2615 setCaption(i18n("Data saved to temp file!" ));
2588 mSyncManager->setBlockSave( false ); 2616 mSyncManager->setBlockSave( false );
2589 2617
2590} 2618}
2591void MainWindow::getFile( bool success ) 2619void MainWindow::getFile( bool success )
2592{ 2620{
2593 if ( ! success ) { 2621 if ( ! success ) {
2594 setCaption( i18n("Error receiving file. Nothing changed!") ); 2622 setCaption( i18n("Error receiving file. Nothing changed!") );
2595 return; 2623 return;
2596 } 2624 }
2597 mView->mergeFile( sentSyncFile() ); 2625 mView->mergeFile( sentSyncFile() );
2598 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2626 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2599 mSyncManager->slotSyncMenu( 999 ); 2627 mSyncManager->slotSyncMenu( 999 );
2600 } 2628 }
2601 setCaption( i18n("Pi-Sync successful!") ); 2629 setCaption( i18n("Pi-Sync successful!") );
2602} 2630}
2603void MainWindow::printListView() 2631void MainWindow::printListView()
2604{ 2632{
2605 2633
2606 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2634 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2607 2635
2608 KMessageBox::information( this, message); 2636 KMessageBox::information( this, message);
2609} 2637}
2610void MainWindow::printSel( ) 2638void MainWindow::printSel( )
2611{ 2639{
2612 mView->viewManager()->agendaView()->agenda()->printSelection(); 2640 mView->viewManager()->agendaView()->agenda()->printSelection();
2613} 2641}
2614 2642
2615void MainWindow::printCal() 2643void MainWindow::printCal()
2616{ 2644{
2617 mView->print();//mCp->showDialog(); 2645 mView->print();//mCp->showDialog();
2618} 2646}
2619 2647
2620 2648
2621#include "libkdepim/kdatepicker.h" 2649#include "libkdepim/kdatepicker.h"
2622#include <kdatetbl.h> 2650#include <kdatetbl.h>
2623 2651
2624void MainWindow::weekAction() 2652void MainWindow::weekAction()
2625{ 2653{
2626 int month; 2654 int month;
2627 KPopupFrame* popup = new KPopupFrame(this); 2655 KPopupFrame* popup = new KPopupFrame(this);
2628 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2656 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2629 // ----- 2657 // -----
2630 picker->resize(picker->sizeHint()); 2658 picker->resize(picker->sizeHint());
2631 popup->setMainWidget(picker); 2659 popup->setMainWidget(picker);
2632 picker->setFocus(); 2660 picker->setFocus();
2633 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2661 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2634 int x = 0; 2662 int x = 0;
2635 int y = iconToolBar->height(); 2663 int y = iconToolBar->height();
2636 int dX = 0; 2664 int dX = 0;
2637 int dY = 0; 2665 int dY = 0;
2638 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2666 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2639 if ( iconToolBar->y() > height()/2 ) { 2667 if ( iconToolBar->y() > height()/2 ) {
2640 dY = picker->sizeHint().height()+8; 2668 dY = picker->sizeHint().height()+8;
2641 y = 0; 2669 y = 0;
2642 } 2670 }
2643 } else { 2671 } else {
2644 if ( iconToolBar->x() > width()/2 ) { // right side 2672 if ( iconToolBar->x() > width()/2 ) { // right side
2645 x=0; 2673 x=0;
2646 dX= picker->sizeHint().width()+8; 2674 dX= picker->sizeHint().width()+8;
2647 y = 0; 2675 y = 0;
2648 } else { 2676 } else {
2649 x= iconToolBar->width(); 2677 x= iconToolBar->width();
2650 y = 0; 2678 y = 0;
2651 } 2679 }
2652 } 2680 }
2653 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2681 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2654 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2682 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2655 { 2683 {
2656 month = picker->getResult(); 2684 month = picker->getResult();
2657 emit selectWeek ( month ); 2685 emit selectWeek ( month );
2658 //qDebug("weekSelected %d ", month); 2686 //qDebug("weekSelected %d ", month);
2659 } 2687 }
2660 delete popup; 2688 delete popup;
2661} 2689}
2662 2690
2663void MainWindow::hideEvent ( QHideEvent * ) 2691void MainWindow::hideEvent ( QHideEvent * )
2664{ 2692{
2665 QString message; 2693 QString message;
2666 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2694 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2667 if ( nextA.isValid() ) { 2695 if ( nextA.isValid() ) {
2668 QString sum = mCalendar->nextSummary(); 2696 QString sum = mCalendar->nextSummary();
2669 2697
2670 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2698 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2671 setCaption( message ); 2699 setCaption( message );
2672 } 2700 }
2673} 2701}
2674 2702
2675void MainWindow::resizeEvent( QResizeEvent* e) 2703void MainWindow::resizeEvent( QResizeEvent* e)
2676{ 2704{
2677#ifndef DESKTOP_VERSION 2705#ifndef DESKTOP_VERSION
2678 if ( filterToolBar ) { 2706 if ( filterToolBar ) {
2679 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2707 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2680 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2708 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2681 filterToolBar->hide(); 2709 filterToolBar->hide();
2682 else 2710 else
2683 filterToolBar->show(); 2711 filterToolBar->show();
2684 } 2712 }
2685 } 2713 }
2686#endif 2714#endif
2687 QMainWindow::resizeEvent( e); 2715 QMainWindow::resizeEvent( e);
2688} 2716}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 7d3d492..fdcf7c4 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,178 +1,184 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14#include <kpopupmenu.h> 14#include <kpopupmenu.h>
15#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
16#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
17#endif 17#endif
18class QAction; 18class QAction;
19class CalendarView; 19class CalendarView;
20class KSyncProfile; 20class KSyncProfile;
21#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
22 22
23#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
24#endif 24#endif
25class QPEToolBar; 25class QPEToolBar;
26 26
27 27
28namespace KCal { 28namespace KCal {
29class CalendarLocal; 29class CalendarLocal;
30} 30}
31 31
32using namespace KCal; 32using namespace KCal;
33 33
34class MainWindow : public QMainWindow 34class MainWindow : public QMainWindow
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 MainWindow( QWidget *parent = 0, const char *name = 0 ); 38 MainWindow( QWidget *parent = 0, const char *name = 0 );
39 ~MainWindow(); 39 ~MainWindow();
40 bool beamReceiveEnabled(); 40 bool beamReceiveEnabled();
41 static QString defaultFileName(); 41 static QString defaultFileName();
42 static QString syncFileName(); 42 static QString syncFileName();
43 static QString resourcePath(); 43 static QString resourcePath();
44 public slots: 44 public slots:
45 void setUsesBigPixmaps ( bool ); 45 void setUsesBigPixmaps ( bool );
46 void setCaption ( const QString & ); 46 void setCaption ( const QString & );
47 void updateWeekNum(const KCal::DateList &); 47 void updateWeekNum(const KCal::DateList &);
48 void updateWeek(QDate); 48 void updateWeek(QDate);
49 void updateFilterToolbar(); 49 void updateFilterToolbar();
50 virtual void showMaximized (); 50 virtual void showMaximized ();
51 void configureAgenda( int ); 51 void configureAgenda( int );
52 void recieve( const QCString& msg, const QByteArray& data ); 52 void recieve( const QCString& msg, const QByteArray& data );
53 void receiveStart( const QCString& msg, const QByteArray& data );
53 protected slots: 54 protected slots:
55 void loadDataAfterStart();
54 void calHint(); 56 void calHint();
55 void startMultiSync(); 57 void startMultiSync();
56 void setCaptionToDates(); 58 void setCaptionToDates();
57 void weekAction(); 59 void weekAction();
58 void about(); 60 void about();
59 void licence(); 61 void licence();
60 void faq(); 62 void faq();
61 void usertrans(); 63 void usertrans();
62 void features(); 64 void features();
63 void synchowto(); 65 void synchowto();
64 void storagehowto(); 66 void storagehowto();
65 void timetrackinghowto(); 67 void timetrackinghowto();
66 void kdesynchowto(); 68 void kdesynchowto();
67 void multisynchowto(); 69 void multisynchowto();
68 void whatsNew(); 70 void whatsNew();
69 void keyBindings(); 71 void keyBindings();
70 void aboutAutoSaving();; 72 void aboutAutoSaving();;
71 void aboutKnownBugs(); 73 void aboutKnownBugs();
72 74
73 void processIncidenceSelection( Incidence * ); 75 void processIncidenceSelection( Incidence * );
74 76
75 void importQtopia(); 77 void importQtopia();
76 void importBday(); 78 void importBday();
77 void importOL(); 79 void importOL();
78 void importIcal(); 80 void importIcal();
79 void importFile( QString, bool ); 81 void importFile( QString, bool );
80 void quickImportIcal(); 82 void quickImportIcal();
81 83
82 void slotModifiedChanged( bool ); 84 void slotModifiedChanged( bool );
83 85
84 void save(); 86 void save();
85 void backupAllFiles(); 87 void backupAllFiles();
86 void saveStopTimer(); 88 void saveStopTimer();
87 void configureToolBar( int ); 89 void configureToolBar( int );
88 void printSel(); 90 void printSel();
89 void printCal(); 91 void printCal();
90 void printListView(); 92 void printListView();
91 void saveCalendar(); 93 void saveCalendar();
92 void loadCalendar(); 94 void loadCalendar();
93 void exportVCalendar(); 95 void exportVCalendar();
94 void fillFilterMenu(); 96 void fillFilterMenu();
95 void fillFilterMenuTB(); 97 void fillFilterMenuTB();
96 void selectFilter( int ); 98 void selectFilter( int );
97 void fillFilterMenuPopup(); 99 void fillFilterMenuPopup();
98 void selectFilterPopup( int ); 100 void selectFilterPopup( int );
99 void exportToPhone( int ); 101 void exportToPhone( int );
100 void toggleBeamReceive(); 102 void toggleBeamReceive();
101 void disableBR(bool); 103 void disableBR(bool);
102 signals: 104 signals:
103 void selectWeek ( int ); 105 void selectWeek ( int );
104 private slots: 106 private slots:
105 void slotResetFocus(); 107 void slotResetFocus();
106 void slotResetFocusLoop(); 108 void slotResetFocusLoop();
107 void showConfigureAgenda(); 109 void showConfigureAgenda();
108 void getFile( bool ); 110 void getFile( bool );
109 void syncFileRequest(); 111 void syncFileRequest();
110 112
111 protected: 113 protected:
112 int mFocusLoop; 114 int mFocusLoop;
113 void hideEvent ( QHideEvent * ); 115 void hideEvent ( QHideEvent * );
114 QString sentSyncFile(); 116 QString sentSyncFile();
115 void displayText( QString, QString); 117 void displayText( QString, QString);
116 void enableIncidenceActions( bool ); 118 void enableIncidenceActions( bool );
117 119
118 private: 120 private:
121
122 QCString mCStringMess;
123 QByteArray mByteData;
124
119 //void setMenuBar( QMenuBar * ); 125 //void setMenuBar( QMenuBar * );
120 bool mBRdisabled; 126 bool mBRdisabled;
121#ifndef DESKTOP_VERSION 127#ifndef DESKTOP_VERSION
122 QCopChannel* infrared; 128 QCopChannel* infrared;
123#endif 129#endif
124 QAction* brAction; 130 QAction* brAction;
125 KSyncManager* mSyncManager; 131 KSyncManager* mSyncManager;
126 bool mClosed; 132 bool mClosed;
127 void saveOnClose(); 133 void saveOnClose();
128 bool mFlagKeyPressed; 134 bool mFlagKeyPressed;
129 bool mBlockAtStartup; 135 bool mBlockAtStartup;
130 KMenuBar *menuBar1; 136 KMenuBar *menuBar1;
131 QPEToolBar *iconToolBar; 137 QPEToolBar *iconToolBar;
132 QPEToolBar *viewToolBar; 138 QPEToolBar *viewToolBar;
133 QPEToolBar *navigatorToolBar; 139 QPEToolBar *navigatorToolBar;
134 QPEToolBar *filterToolBar; 140 QPEToolBar *filterToolBar;
135 KMenuBar *filterMenubar; 141 KMenuBar *filterMenubar;
136 QPopupMenu * filterPopupMenu; 142 QPopupMenu * filterPopupMenu;
137 QPopupMenu * mCurrentItemMenu; 143 QPopupMenu * mCurrentItemMenu;
138 void initActions(); 144 void initActions();
139 void setDefaultPreferences(); 145 void setDefaultPreferences();
140 void resizeEvent( QResizeEvent* e); 146 void resizeEvent( QResizeEvent* e);
141 void keyPressEvent ( QKeyEvent * ) ; 147 void keyPressEvent ( QKeyEvent * ) ;
142 void keyReleaseEvent ( QKeyEvent * ) ; 148 void keyReleaseEvent ( QKeyEvent * ) ;
143 QPopupMenu *configureToolBarMenu; 149 QPopupMenu *configureToolBarMenu;
144 QPopupMenu *selectFilterMenu; 150 QPopupMenu *selectFilterMenu;
145 QPopupMenu *selectFilterMenuTB; 151 QPopupMenu *selectFilterMenuTB;
146 QPopupMenu *configureAgendaMenu, *syncMenu; 152 QPopupMenu *configureAgendaMenu, *syncMenu;
147 CalendarLocal *mCalendar; 153 CalendarLocal *mCalendar;
148 CalendarView *mView; 154 CalendarView *mView;
149 QAction *mNewSubTodoAction; 155 QAction *mNewSubTodoAction;
150 QAction *mWeekAction; 156 QAction *mWeekAction;
151 QFont mWeekFont; 157 QFont mWeekFont;
152 QPixmap mWeekPixmap; 158 QPixmap mWeekPixmap;
153 QColor mWeekBgColor; 159 QColor mWeekBgColor;
154 160
155 QAction *mShowAction; 161 QAction *mShowAction;
156 QAction *mEditAction; 162 QAction *mEditAction;
157 QAction *mDeleteAction; 163 QAction *mDeleteAction;
158 QAction *mCloneAction; 164 QAction *mCloneAction;
159 QAction *mMoveAction; 165 QAction *mMoveAction;
160 QAction *mBeamAction; 166 QAction *mBeamAction;
161 QAction *mCancelAction; 167 QAction *mCancelAction;
162 QAction *mPrintSelAction; 168 QAction *mPrintSelAction;
163 169
164 QAction *mToggleNav; 170 QAction *mToggleNav;
165 QAction *mToggleFilter; 171 QAction *mToggleFilter;
166 QAction *mToggleAllday; 172 QAction *mToggleAllday;
167 QAction *actionFilterMenuTB; 173 QAction *actionFilterMenuTB;
168 174
169 void closeEvent( QCloseEvent* ce ); 175 void closeEvent( QCloseEvent* ce );
170 QTimer mSaveTimer; 176 QTimer mSaveTimer;
171 //bool mBlockSaveFlag; 177 //bool mBlockSaveFlag;
172 bool mCalendarModifiedFlag; 178 bool mCalendarModifiedFlag;
173 QPixmap loadPixmap( QString ); 179 QPixmap loadPixmap( QString );
174 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; 180 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
175}; 181};
176 182
177 183
178#endif 184#endif