summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt6
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/mainwindow.cpp12
3 files changed, 27 insertions, 5 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 78fa13b..1a1fd0e 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1090,463 +1090,467 @@
1090{ "Restore","Wiederherstellen" }, 1090{ "Restore","Wiederherstellen" },
1091{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" }, 1091{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" },
1092{ "% completed","% erledigt" }, 1092{ "% completed","% erledigt" },
1093{ "%d item(s) found.","%d Item(s) gefunden." }, 1093{ "%d item(s) found.","%d Item(s) gefunden." },
1094{ "Set complete","Setze auf erledigt" }, 1094{ "Set complete","Setze auf erledigt" },
1095{ "(cancelled)","(gecancelt)" }, 1095{ "(cancelled)","(gecancelt)" },
1096{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1096{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1097{ " Local time "," Lokale Zeit " }, 1097{ " Local time "," Lokale Zeit " },
1098{ "Form2","Form2" }, 1098{ "Form2","Form2" },
1099{ "Filter enabled","Filter angeschaltet" }, 1099{ "Filter enabled","Filter angeschaltet" },
1100{ "Edit Filters","Ändere Filter" }, 1100{ "Edit Filters","Ändere Filter" },
1101{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1101{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1102{ "Agenda","Agenda" }, 1102{ "Agenda","Agenda" },
1103{ " ("," (" }, 1103{ " ("," (" },
1104{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1104{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1105{ "Print","Print" }, 1105{ "Print","Print" },
1106{ "&Setup Printer...","Drucker &Setup..." }, 1106{ "&Setup Printer...","Drucker &Setup..." },
1107{ "View Type","Zeige Typ" }, 1107{ "View Type","Zeige Typ" },
1108{ "Page &orientation:","Seiten Ausrichtung:" }, 1108{ "Page &orientation:","Seiten Ausrichtung:" },
1109{ "Use Default of Selected Style","Default des selektierten Stils" }, 1109{ "Use Default of Selected Style","Default des selektierten Stils" },
1110{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1110{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1111{ "Portrait","Portrait" }, 1111{ "Portrait","Portrait" },
1112{ "Landscape","Landschaft" }, 1112{ "Landscape","Landschaft" },
1113{ "Print day","Drucke Tag" }, 1113{ "Print day","Drucke Tag" },
1114{ "CalPrintDay_Base","CalPrintDay_Base" }, 1114{ "CalPrintDay_Base","CalPrintDay_Base" },
1115{ "Date && Time Range","Datum && Zeitspanne" }, 1115{ "Date && Time Range","Datum && Zeitspanne" },
1116{ "&End date:","&Enddatum:" }, 1116{ "&End date:","&Enddatum:" },
1117{ "&Start date:","&Startdatum:" }, 1117{ "&Start date:","&Startdatum:" },
1118{ "Start &time:","Startzeit:" }, 1118{ "Start &time:","Startzeit:" },
1119{ "End ti&me:","Endzeit:" }, 1119{ "End ti&me:","Endzeit:" },
1120{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1120{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1121{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1121{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1122{ "Alt+D","Alt+D" }, 1122{ "Alt+D","Alt+D" },
1123{ "&Use colors","Nutze Farben" }, 1123{ "&Use colors","Nutze Farben" },
1124{ "Alt+U","Alt+U" }, 1124{ "Alt+U","Alt+U" },
1125{ "Print week","Drucke Woche" }, 1125{ "Print week","Drucke Woche" },
1126{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1126{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1127{ "Use &colors","Nutze Farben" }, 1127{ "Use &colors","Nutze Farben" },
1128{ "Type of View","Typ der Ansicht" }, 1128{ "Type of View","Typ der Ansicht" },
1129{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1129{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1130{ "Alt+F","Alt+F" }, 1130{ "Alt+F","Alt+F" },
1131{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1131{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1132{ "Alt+T","Alt+T" }, 1132{ "Alt+T","Alt+T" },
1133{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1133{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1134{ "Print month","Drucke Monat" }, 1134{ "Print month","Drucke Monat" },
1135{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1135{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1136{ "&Start month:","&Startmonat:" }, 1136{ "&Start month:","&Startmonat:" },
1137{ "&End month:","&Endmonat:" }, 1137{ "&End month:","&Endmonat:" },
1138{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1138{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1139{ "Print todos","Drucke Todos" }, 1139{ "Print todos","Drucke Todos" },
1140{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1140{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1141{ "Include &description of the item","Inclusive Itembeschreibung" }, 1141{ "Include &description of the item","Inclusive Itembeschreibung" },
1142{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1142{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1143{ "Include &priority of the item","Inclusive Priorität des Items" }, 1143{ "Include &priority of the item","Inclusive Priorität des Items" },
1144{ "Items to Print","Zu druckende Items" }, 1144{ "Items to Print","Zu druckende Items" },
1145{ "&From:","Von:" }, 1145{ "&From:","Von:" },
1146{ "&To:","Bis:" }, 1146{ "&To:","Bis:" },
1147{ "Print &all todo items","Drucke alle Todo Items" }, 1147{ "Print &all todo items","Drucke alle Todo Items" },
1148{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1148{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1149{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1149{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1150{ "Todo List","Todo Liste" }, 1150{ "Todo List","Todo Liste" },
1151{ "&Title:","&Titel:" }, 1151{ "&Title:","&Titel:" },
1152{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, 1152{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" },
1153{ "Todo list","Todo Liste" }, 1153{ "Todo list","Todo Liste" },
1154{ "&Print...","Drucke..." }, 1154{ "&Print...","Drucke..." },
1155{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1155{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1156{ "[Unconfigured]","[Unkonfiguriert]" }, 1156{ "[Unconfigured]","[Unkonfiguriert]" },
1157{ "OK","OK" }, 1157{ "OK","OK" },
1158{ "FilterEditor","FilterEditor" }, 1158{ "FilterEditor","FilterEditor" },
1159{ "Include","Inclusive" }, 1159{ "Include","Inclusive" },
1160{ "Exclude","Exclusive" }, 1160{ "Exclude","Exclusive" },
1161{ "Edit Selection...","Editiere Auswahl" }, 1161{ "Edit Selection...","Editiere Auswahl" },
1162{ "recurring events","wiederholende Termine" }, 1162{ "recurring events","wiederholende Termine" },
1163{ "recurr. events","wiederh.Termine" }, 1163{ "recurr. events","wiederh.Termine" },
1164{ "completed to-dos","erledigte Todos" }, 1164{ "completed to-dos","erledigte Todos" },
1165{ "events","Termine" }, 1165{ "events","Termine" },
1166{ "todos","Todos" }, 1166{ "todos","Todos" },
1167{ "journals","Journale" }, 1167{ "journals","Journale" },
1168{ "public","öffentl." }, 1168{ "public","öffentl." },
1169{ "private","privat" }, 1169{ "private","privat" },
1170{ "confidential","vertraul." }, 1170{ "confidential","vertraul." },
1171{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, 1171{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" },
1172{ "Yesterday","Gestern" }, 1172{ "Yesterday","Gestern" },
1173{ "Day after tomorrow","Übermorgen" }, 1173{ "Day after tomorrow","Übermorgen" },
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{ "Loding 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 delected","KO/Pi Konflikt erkannt" }, 1504{ "KO/Pi Conflict delected","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" },
1548{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" },
1549{ "","" },
1550{ "","" },
1547{ "","" }, 1551{ "","" },
1548{ "","" }, 1552{ "","" },
1549{ "","" }, 1553{ "","" },
1550{ "","" }, 1554{ "","" },
1551{ "","" }, 1555{ "","" },
1552{ "","" }, 1556{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 316826a..ca071b2 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -454,769 +454,769 @@ void CalendarView::init()
454 if ( QApplication::desktop()->width() < 800 ) 454 if ( QApplication::desktop()->width() < 800 )
455 mDateScrollBar->hide(); 455 mDateScrollBar->hide();
456#endif 456#endif
457 //mainBoxLayout->addWidget (mLeftFrame); 457 //mainBoxLayout->addWidget (mLeftFrame);
458 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 458 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
459 "CalendarView::DateNavigator" ); 459 "CalendarView::DateNavigator" );
460#if 0 460#if 0
461 // FIXME 461 // FIXME
462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
463 "CalendarView::DateNavigator", QDate::currentDate()); 463 "CalendarView::DateNavigator", QDate::currentDate());
464#endif 464#endif
465 // mDateNavigator->blockSignals( true ); 465 // mDateNavigator->blockSignals( true );
466 //leftFrameLayout->addWidget( mDateNavigator ); 466 //leftFrameLayout->addWidget( mDateNavigator );
467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
480 480
481 mTodoList->setNavigator( mNavigator ); 481 mTodoList->setNavigator( mNavigator );
482#if 0 482#if 0
483 if ( QApplication::desktop()->width() < 480 ) { 483 if ( QApplication::desktop()->width() < 480 ) {
484 leftFrameLayout->addWidget(mFilterView); 484 leftFrameLayout->addWidget(mFilterView);
485 leftFrameLayout->addWidget(mTodoList, 2 ); 485 leftFrameLayout->addWidget(mTodoList, 2 );
486 486
487 } else { 487 } else {
488 leftFrameLayout->addWidget(mTodoList,2 ); 488 leftFrameLayout->addWidget(mTodoList,2 );
489 leftFrameLayout->addWidget(mFilterView ); 489 leftFrameLayout->addWidget(mFilterView );
490 } 490 }
491#endif 491#endif
492 mFilterView->hide(); 492 mFilterView->hide();
493 mCalEditView->hide(); 493 mCalEditView->hide();
494 QWidget *rightBox = new QWidget( mMainFrame ); 494 QWidget *rightBox = new QWidget( mMainFrame );
495 //mainBoxLayout->addWidget ( rightBox, 10 ); 495 //mainBoxLayout->addWidget ( rightBox, 10 );
496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
497 mRightFrame = new QWidgetStack( rightBox ); 497 mRightFrame = new QWidgetStack( rightBox );
498 rightLayout->addWidget( mRightFrame, 10 ); 498 rightLayout->addWidget( mRightFrame, 10 );
499 499
500 //mLeftFrame = (QWidget *)leftFrame; 500 //mLeftFrame = (QWidget *)leftFrame;
501 if ( KOPrefs::instance()->mVerticalScreen ) { 501 if ( KOPrefs::instance()->mVerticalScreen ) {
502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
506 } else { 506 } else {
507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
510 } 510 }
511 if ( !KOPrefs::instance()->mShowDateNavigator) 511 if ( !KOPrefs::instance()->mShowDateNavigator)
512 mDateNavigator->hide(); 512 mDateNavigator->hide();
513 //qDebug("Calendarview Size %d %d ", width(), height()); 513 //qDebug("Calendarview Size %d %d ", width(), height());
514#endif 514#endif
515 515
516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
517 SLOT( showDates( const KCal::DateList & ) ) ); 517 SLOT( showDates( const KCal::DateList & ) ) );
518 518
519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
521 521
522 522
523 523
524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
525 mViewManager, SLOT( showMonth( const QDate & ) ) ); 525 mViewManager, SLOT( showMonth( const QDate & ) ) );
526 526
527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
528 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 528 mNavigator, SLOT( selectWeek( const QDate & ) ) );
529 529
530 connect( mDateNavigator, SIGNAL( goPrevYear() ), 530 connect( mDateNavigator, SIGNAL( goPrevYear() ),
531 mNavigator, SLOT( selectPreviousYear() ) ); 531 mNavigator, SLOT( selectPreviousYear() ) );
532 connect( mDateNavigator, SIGNAL( goNextYear() ), 532 connect( mDateNavigator, SIGNAL( goNextYear() ),
533 mNavigator, SLOT( selectNextYear() ) ); 533 mNavigator, SLOT( selectNextYear() ) );
534 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 534 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
535 mNavigator, SLOT( selectPreviousMonth() ) ); 535 mNavigator, SLOT( selectPreviousMonth() ) );
536 connect( mDateNavigator, SIGNAL( goNextMonth() ), 536 connect( mDateNavigator, SIGNAL( goNextMonth() ),
537 mNavigator, SLOT( selectNextMonth() ) ); 537 mNavigator, SLOT( selectNextMonth() ) );
538 538
539 connect( mDateNavigator, SIGNAL( goPrevious() ), 539 connect( mDateNavigator, SIGNAL( goPrevious() ),
540 mNavigator, SLOT( selectPrevious() ) ); 540 mNavigator, SLOT( selectPrevious() ) );
541 connect( mDateNavigator, SIGNAL( goNext() ), 541 connect( mDateNavigator, SIGNAL( goNext() ),
542 mNavigator, SLOT( selectNext() ) ); 542 mNavigator, SLOT( selectNext() ) );
543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
544 mNavigator, SLOT( slotMonthSelect( int ) ) ); 544 mNavigator, SLOT( slotMonthSelect( int ) ) );
545 545
546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
548#if 0 548#if 0
549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
550 SLOT( incidenceAdded( Incidence *) ) ); 550 SLOT( incidenceAdded( Incidence *) ) );
551#endif 551#endif
552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
553 553
554 connect( this, SIGNAL( configChanged() ), 554 connect( this, SIGNAL( configChanged() ),
555 mDateNavigator, SLOT( updateConfig() ) ); 555 mDateNavigator, SLOT( updateConfig() ) );
556 556
557 connect( mTodoList, SIGNAL( newTodoSignal() ), 557 connect( mTodoList, SIGNAL( newTodoSignal() ),
558 SLOT( newTodo() ) ); 558 SLOT( newTodo() ) );
559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
560 SLOT( newSubTodo( Todo * ) ) ); 560 SLOT( newSubTodo( Todo * ) ) );
561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
562 SLOT( editTodo( Todo * ) ) ); 562 SLOT( editTodo( Todo * ) ) );
563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
564 SLOT( showTodo( Todo *) ) ); 564 SLOT( showTodo( Todo *) ) );
565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
566 SLOT( deleteTodo( Todo *) ) ); 566 SLOT( deleteTodo( Todo *) ) );
567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
569 SLOT( purgeCompleted() ) ); 569 SLOT( purgeCompleted() ) );
570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
571 SIGNAL( todoModified( Todo *, int ) ) ); 571 SIGNAL( todoModified( Todo *, int ) ) );
572 572
573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
574 this, SLOT ( cloneIncidence( Incidence * ) ) ); 574 this, SLOT ( cloneIncidence( Incidence * ) ) );
575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
576 this, SLOT (cancelIncidence( Incidence * ) ) ); 576 this, SLOT (cancelIncidence( Incidence * ) ) );
577 577
578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
579 this, SLOT ( moveIncidence( Incidence * ) ) ); 579 this, SLOT ( moveIncidence( Incidence * ) ) );
580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
581 this, SLOT ( beamIncidence( Incidence * ) ) ); 581 this, SLOT ( beamIncidence( Incidence * ) ) );
582 582
583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
584 this, SLOT ( todo_unsub( Todo * ) ) ); 584 this, SLOT ( todo_unsub( Todo * ) ) );
585 585
586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
587 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 587 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
589 SLOT( updateTodo( Todo *, int ) ) ); 589 SLOT( updateTodo( Todo *, int ) ) );
590 connect( this, SIGNAL( todoModified( Todo *, int )), this, 590 connect( this, SIGNAL( todoModified( Todo *, int )), this,
591 SLOT( changeTodoDisplay( Todo *, int ) ) ); 591 SLOT( changeTodoDisplay( Todo *, int ) ) );
592 592
593 593
594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
598 598
599 599
600 600
601 601
602 602
603 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 603 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
604 SLOT(checkClipboard())); 604 SLOT(checkClipboard()));
605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
606 SLOT( processTodoListSelection( Incidence * ) ) ); 606 SLOT( processTodoListSelection( Incidence * ) ) );
607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
608 608
609 // kdDebug() << "CalendarView::CalendarView() done" << endl; 609 // kdDebug() << "CalendarView::CalendarView() done" << endl;
610 610
611 mDateFrame = new QVBox(0,0,WType_Popup); 611 mDateFrame = new QVBox(0,0,WType_Popup);
612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
614 mDateFrame->setLineWidth(3); 614 mDateFrame->setLineWidth(3);
615 mDateFrame->hide(); 615 mDateFrame->hide();
616 mDateFrame->setCaption( i18n( "Pick a date to display")); 616 mDateFrame->setCaption( i18n( "Pick a date to display"));
617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
618 618
619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
620 620
621 mEventEditor = mDialogManager->getEventEditor(); 621 mEventEditor = mDialogManager->getEventEditor();
622 mTodoEditor = mDialogManager->getTodoEditor(); 622 mTodoEditor = mDialogManager->getTodoEditor();
623 623
624 mFlagEditDescription = false; 624 mFlagEditDescription = false;
625 625
626 mSuspendTimer = new QTimer( this ); 626 mSuspendTimer = new QTimer( this );
627 mAlarmTimer = new QTimer( this ); 627 mAlarmTimer = new QTimer( this );
628 mRecheckAlarmTimer = new QTimer( this ); 628 mRecheckAlarmTimer = new QTimer( this );
629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
632 mAlarmDialog = new AlarmDialog( this ); 632 mAlarmDialog = new AlarmDialog( this );
633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
634 mAlarmDialog->setServerNotification( false ); 634 mAlarmDialog->setServerNotification( false );
635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
636 636
637 637
638#ifndef DESKTOP_VERSION 638#ifndef DESKTOP_VERSION
639//US listen for arriving address resultsets 639//US listen for arriving address resultsets
640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
642#endif 642#endif
643 mDateNavigator->setCalendar( mCalendar ); 643 mDateNavigator->setCalendar( mCalendar );
644} 644}
645 645
646 646
647CalendarView::~CalendarView() 647CalendarView::~CalendarView()
648{ 648{
649 // kdDebug() << "~CalendarView()" << endl; 649 // kdDebug() << "~CalendarView()" << endl;
650 //qDebug("CalendarView::~CalendarView() "); 650 //qDebug("CalendarView::~CalendarView() ");
651 delete mDialogManager; 651 delete mDialogManager;
652 delete mViewManager; 652 delete mViewManager;
653 delete mStorage; 653 delete mStorage;
654 delete mDateFrame ; 654 delete mDateFrame ;
655 delete mEventViewerDialog; 655 delete mEventViewerDialog;
656 //kdDebug() << "~CalendarView() done" << endl; 656 //kdDebug() << "~CalendarView() done" << endl;
657} 657}
658 658
659 659
660void CalendarView::nextConflict( bool all, bool allday ) 660void CalendarView::nextConflict( bool all, bool allday )
661{ 661{
662 static bool block = false; 662 static bool block = false;
663 if ( block ) return; 663 if ( block ) return;
664 block = true; 664 block = true;
665 QPtrList<Event> testlist = mCalendar->events(); 665 QPtrList<Event> testlist = mCalendar->events();
666 Event * test = testlist.first(); 666 Event * test = testlist.first();
667 while ( test ) { 667 while ( test ) {
668 test->setTagged( false ); 668 test->setTagged( false );
669 test = testlist.next(); 669 test = testlist.next();
670 } 670 }
671 QTime st ( 0,0,0); 671 QTime st ( 0,0,0);
672 if ( mViewManager->currentView() == mViewManager->agendaView() ) 672 if ( mViewManager->currentView() == mViewManager->agendaView() )
673 st = mViewManager->agendaView()->agenda()->getEndTime(); 673 st = mViewManager->agendaView()->agenda()->getEndTime();
674 //qDebug("time %s ", st.toString().latin1()); 674 //qDebug("time %s ", st.toString().latin1());
675 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); 675 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
676 QDateTime conflict; 676 QDateTime conflict;
677 QDateTime retVal; 677 QDateTime retVal;
678 bool found = false; 678 bool found = false;
679 Event * cE = 0; 679 Event * cE = 0;
680 Event * cE2 = 0; 680 Event * cE2 = 0;
681 QPtrList<Event> testlist2 = testlist; 681 QPtrList<Event> testlist2 = testlist;
682 test = testlist.first(); 682 test = testlist.first();
683 bool skip = false; 683 bool skip = false;
684 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 684 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
685 //QTime tm; 685 //QTime tm;
686 //tm.start(); 686 //tm.start();
687 while ( test ) { 687 while ( test ) {
688 qApp->processEvents(); 688 qApp->processEvents();
689 skip = false; 689 skip = false;
690 if ( !all ) skip = ( allday != test->doesFloat() ); 690 if ( !all ) skip = ( allday != test->doesFloat() );
691 if ( !skip ) { 691 if ( !skip ) {
692 if ( found ) 692 if ( found )
693 skip = !test->matchTime( &startDT, &conflict ); 693 skip = !test->matchTime( &startDT, &conflict );
694 else 694 else
695 skip = !test->matchTime( &startDT, 0 ); 695 skip = !test->matchTime( &startDT, 0 );
696 } 696 }
697 if ( !skip ) { 697 if ( !skip ) {
698 Event * test2 = testlist2.first(); 698 Event * test2 = testlist2.first();
699 while ( test2 ) { 699 while ( test2 ) {
700 skip = test2->isTagged(); 700 skip = test2->isTagged();
701 if ( !skip && !all ) skip = ( allday != test2->doesFloat() ); 701 if ( !skip && !all ) skip = ( allday != test2->doesFloat() );
702 if ( !skip ) { 702 if ( !skip ) {
703 if ( found ) 703 if ( found )
704 skip = !test2->matchTime( &startDT, &conflict ); 704 skip = !test2->matchTime( &startDT, &conflict );
705 else 705 else
706 skip = !test2->matchTime( &startDT, 0 ); 706 skip = !test2->matchTime( &startDT, 0 );
707 } 707 }
708 if ( !skip ) { 708 if ( !skip ) {
709 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { 709 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) {
710 //qDebug("overlap "); 710 //qDebug("overlap ");
711 if ( ! found ) { 711 if ( ! found ) {
712 if ( retVal >= startDT ) { 712 if ( retVal >= startDT ) {
713 conflict = retVal; 713 conflict = retVal;
714 cE = test; 714 cE = test;
715 cE2 = test2; 715 cE2 = test2;
716 found = true; 716 found = true;
717 } 717 }
718 } else { 718 } else {
719 if ( retVal >= startDT && retVal < conflict ) { 719 if ( retVal >= startDT && retVal < conflict ) {
720 conflict = retVal; 720 conflict = retVal;
721 cE = test; 721 cE = test;
722 cE2 = test2; 722 cE2 = test2;
723 } 723 }
724 } 724 }
725 } 725 }
726 } 726 }
727 test2 = testlist2.next(); 727 test2 = testlist2.next();
728 } 728 }
729 } 729 }
730 test->setTagged( true ); 730 test->setTagged( true );
731 test = testlist.next(); 731 test = testlist.next();
732 } 732 }
733 //qDebug("Search time : %d", tm.elapsed()); 733 //qDebug("Search time : %d", tm.elapsed());
734 if ( found ) { 734 if ( found ) {
735 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 735 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
736 mViewManager->showDayView(); 736 mViewManager->showDayView();
737 mNavigator->slotDaySelect( conflict.date() ); 737 mNavigator->slotDaySelect( conflict.date() );
738 int hour = conflict.time().hour(); 738 int hour = conflict.time().hour();
739 mViewManager->agendaView()->setStartHour( hour ); 739 mViewManager->agendaView()->setStartHour( hour );
740 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); 740 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
741 block = false; 741 block = false;
742 return; 742 return;
743 } 743 }
744 744
745 topLevelWidget()->setCaption( i18n("No conflict found") ); 745 topLevelWidget()->setCaption( i18n("No conflict found") );
746 //qDebug("No conflict found "); 746 //qDebug("No conflict found ");
747 block = false; 747 block = false;
748 return; 748 return;
749} 749}
750 750
751void CalendarView::conflictAll() 751void CalendarView::conflictAll()
752{ 752{
753 nextConflict ( true, true ); 753 nextConflict ( true, true );
754} 754}
755void CalendarView::conflictAllday() 755void CalendarView::conflictAllday()
756{ 756{
757 nextConflict ( false, true ); 757 nextConflict ( false, true );
758} 758}
759void CalendarView::conflictNotAll() 759void CalendarView::conflictNotAll()
760{ 760{
761 nextConflict ( false, false ); 761 nextConflict ( false, false );
762} 762}
763 763
764void CalendarView::setCalReadOnly( int id, bool readO ) 764void CalendarView::setCalReadOnly( int id, bool readO )
765{ 765{
766 if ( readO ) { 766 if ( readO ) {
767 emit save(); 767 emit save();
768 } 768 }
769 mCalendar->setReadOnly( id, readO ); 769 mCalendar->setReadOnly( id, readO );
770} 770}
771void CalendarView::setScrollBarStep(int val ) 771void CalendarView::setScrollBarStep(int val )
772{ 772{
773#ifdef DESKTOP_VERSION 773#ifdef DESKTOP_VERSION
774 mDateScrollBar->setLineStep ( val ); 774 mDateScrollBar->setLineStep ( val );
775#endif 775#endif
776} 776}
777void CalendarView::scrollBarValue(int val ) 777void CalendarView::scrollBarValue(int val )
778{ 778{
779#ifdef DESKTOP_VERSION 779#ifdef DESKTOP_VERSION
780 if ( QApplication::desktop()->width() < 800 ) return; 780 if ( QApplication::desktop()->width() < 800 ) return;
781 static bool block = false; 781 static bool block = false;
782 if ( block ) return; 782 if ( block ) return;
783 block = true; 783 block = true;
784 int count = mNavigator->selectedDates().count(); 784 int count = mNavigator->selectedDates().count();
785 int day = mNavigator->selectedDates().first().dayOfYear(); 785 int day = mNavigator->selectedDates().first().dayOfYear();
786 int stepdays = val; 786 int stepdays = val;
787 if ( mDateScrollBar->lineStep () <= count ) { 787 if ( mDateScrollBar->lineStep () <= count ) {
788 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 788 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
789 //qDebug("VAL %d ",val ); 789 //qDebug("VAL %d ",val );
790 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 790 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
791 stepdays = day+stepdays; 791 stepdays = day+stepdays;
792 if ( stepdays < 0 ) stepdays = 0; 792 if ( stepdays < 0 ) stepdays = 0;
793 } 793 }
794 if ( stepdays == day ) { 794 if ( stepdays == day ) {
795 block = false; 795 block = false;
796 return; 796 return;
797 } 797 }
798 int year = mNavigator->selectedDates().first().year(); 798 int year = mNavigator->selectedDates().first().year();
799 QDate d ( year,1,1 ); 799 QDate d ( year,1,1 );
800 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 800 mNavigator->selectDates( d.addDays( stepdays-1) , count );
801 block = false; 801 block = false;
802#endif 802#endif
803 803
804} 804}
805void CalendarView::updateView(const QDate &start, const QDate &end) 805void CalendarView::updateView(const QDate &start, const QDate &end)
806{ 806{
807#ifdef DESKTOP_VERSION 807#ifdef DESKTOP_VERSION
808 if ( ! mDateScrollBar->draggingSlider () ) { 808 if ( ! mDateScrollBar->draggingSlider () ) {
809 int dof = start.dayOfYear(); 809 int dof = start.dayOfYear();
810 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); 810 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
811 if ( dof != mDateScrollBar->value() ) { 811 if ( dof != mDateScrollBar->value() ) {
812 mDateScrollBar->blockSignals( true ); 812 mDateScrollBar->blockSignals( true );
813 mDateScrollBar->setValue( start.dayOfYear()); 813 mDateScrollBar->setValue( start.dayOfYear());
814 mDateScrollBar->blockSignals( false ); 814 mDateScrollBar->blockSignals( false );
815 } 815 }
816 } 816 }
817#endif 817#endif
818 mTodoList->updateView(); 818 mTodoList->updateView();
819 mViewManager->updateView(start, end); 819 mViewManager->updateView(start, end);
820 //mDateNavigator->updateView(); 820 //mDateNavigator->updateView();
821} 821}
822 822
823 823
824 824
825void CalendarView::checkFiles() 825void CalendarView::checkFiles()
826{ 826{
827 QString message; 827 QString message;
828 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 828 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
829 KopiCalendarFile * cal = calendars.first(); 829 KopiCalendarFile * cal = calendars.first();
830 while ( cal ) { 830 while ( cal ) {
831 if ( cal->mErrorOnLoad ) { 831 if ( cal->mErrorOnLoad ) {
832 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 832 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
833 } 833 }
834 cal = calendars.next(); 834 cal = calendars.next();
835 } 835 }
836 if ( !message.isEmpty() ) { 836 if ( !message.isEmpty() ) {
837 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 837 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
838 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 838 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed"));
839 } 839 }
840 static bool firstTime = true; 840 static bool firstTime = true;
841 if ( firstTime ) { 841 if ( firstTime ) {
842 firstTime = false; 842 firstTime = false;
843 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 843 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
844 } 844 }
845} 845}
846void CalendarView::checkAlarms() 846void CalendarView::checkAlarms()
847{ 847{
848 KConfig *config = KOGlobals::config(); 848 KConfig *config = KOGlobals::config();
849 config->setGroup( "AppRun" ); 849 config->setGroup( "AppRun" );
850 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 850 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
851 int daysto = dt.daysTo( QDate::currentDate() ); 851 int daysto = dt.daysTo( QDate::currentDate() );
852 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 852 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
853 dt = dt.addDays( days ); 853 dt = dt.addDays( days );
854 int secto = dt.secsTo( QDateTime::currentDateTime() ); 854 int secto = dt.secsTo( QDateTime::currentDateTime() );
855 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 855 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
856 //qDebug("KO: Reading program stop %d ", secs); 856 //qDebug("KO: Reading program stop %d ", secs);
857 //secs -= ( 3600 * 24*3 ); // debug only 857 //secs -= ( 3600 * 24*3 ); // debug only
858 QDateTime latest = dt.addSecs ( secs ); 858 QDateTime latest = dt.addSecs ( secs );
859 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 859 qDebug("KO: Last termination on %s ", latest.toString().latin1());
860 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 860 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
861 QPtrList<Incidence> el = mCalendar->rawIncidences(); 861 QPtrList<Incidence> el = mCalendar->rawIncidences();
862 QPtrList<Incidence> al; 862 QPtrList<Incidence> al;
863 Incidence* inL = el.first(); 863 Incidence* inL = el.first();
864 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 864 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
865 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 865 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
866 while ( inL ) { 866 while ( inL ) {
867 bool ok = false; 867 bool ok = false;
868 int offset = 0; 868 int offset = 0;
869 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 869 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
870 if ( ok ) { 870 if ( ok ) {
871 //qDebug("OK %s",next.toString().latin1()); 871 //qDebug("OK %s",next.toString().latin1());
872 if ( next < cur ) { 872 if ( next < cur ) {
873 al.append( inL ); 873 al.append( inL );
874 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 874 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
875 } 875 }
876 } 876 }
877 inL = el.next(); 877 inL = el.next();
878 } 878 }
879 if ( al.count() ) { 879 if ( al.count() ) {
880 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 880 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
881 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 881 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
882 QVBoxLayout* lay = new QVBoxLayout( dia ); 882 QVBoxLayout* lay = new QVBoxLayout( dia );
883 lay->setSpacing( 0 ); 883 lay->setSpacing( 0 );
884 lay->setMargin( 0 ); 884 lay->setMargin( 0 );
885 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 885 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
886 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 886 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
887 lay->addWidget( matb ); 887 lay->addWidget( matb );
888 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 888 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
889 int wid = 210; 889 int wid = 210;
890 int x = QApplication::desktop()->width() - wid - 7; 890 int x = QApplication::desktop()->width() - wid - 7;
891 int y = QApplication::desktop()->height() - wid - 70; 891 int y = QApplication::desktop()->height() - wid - 70;
892 dia->setGeometry ( x,y,wid,wid); 892 dia->setGeometry ( x,y,wid,wid);
893 } else { 893 } else {
894 int si = 220; 894 int si = 220;
895 if ( QApplication::desktop()->width() > 470 ) 895 if ( QApplication::desktop()->width() > 470 )
896 si = 400; 896 si = 400;
897 dia->resize(si,si/2); 897 dia->resize(si,si/2);
898 } 898 }
899 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 899 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
900 dia->show(); 900 dia->show();
901 901
902 } 902 }
903#if 0 903#if 0
904 // for creating timetracker test data 904 // for creating timetracker test data
905 qDebug("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc "); 905 qDebug("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc ");
906 Todo * nt; 906 Todo * nt;
907 mCalendar->close(); 907 mCalendar->close();
908 { 908 {
909 Todo * root1 = new Todo; 909 Todo * root1 = new Todo;
910 mCalendar->addTodo( root1 ); 910 mCalendar->addTodo( root1 );
911 root1->setSummary( "Project1"); 911 root1->setSummary( "Project1");
912 root1->setPriority( 1 ); 912 root1->setPriority( 1 );
913 root1->setCategories( QString( "Cat_Pro1") ); 913 root1->setCategories( QString( "Cat_Pro1") );
914 root1->setDescription( "This is a test description of a root Project" ); 914 root1->setDescription( "This is a test description of a root Project" );
915 root1->setPercentComplete( 20 ); 915 root1->setPercentComplete( 20 );
916 updateView(); 916 updateView();
917 QDateTime start = QDateTime ( QDate( 2004,11,1), QTime ( 7,30,0) ); 917 QDateTime start = QDateTime ( QDate( 2004,11,1), QTime ( 7,30,0) );
918 QDateTime end = QDateTime ( QDate( 2005,8,5), QTime ( 0,0,0) ); 918 QDateTime end = QDateTime ( QDate( 2005,8,5), QTime ( 0,0,0) );
919 919
920 nt = new Todo; 920 nt = new Todo;
921 mCalendar->addTodo( nt ); 921 mCalendar->addTodo( nt );
922 nt->setSummary( "Planning Project1"); 922 nt->setSummary( "Planning Project1");
923 nt->setPriority( 1 ); 923 nt->setPriority( 1 );
924 nt->setDescription( "This is a test description of Planning Project1" ); 924 nt->setDescription( "This is a test description of Planning Project1" );
925 nt->setPercentComplete( 20 ); 925 nt->setPercentComplete( 20 );
926 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1") ); 926 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1") );
927 927
928 928
929 Todo * sub1 = nt; 929 Todo * sub1 = nt;
930 sub1->setRelatedTo( root1 ); 930 sub1->setRelatedTo( root1 );
931 931
932 nt = new Todo; 932 nt = new Todo;
933 mCalendar->addTodo( nt ); 933 mCalendar->addTodo( nt );
934 nt->setSummary( "Planning Project1: Lutz"); 934 nt->setSummary( "Planning Project1: Lutz");
935 nt->setPriority( 1 ); 935 nt->setPriority( 1 );
936 nt->setDescription( "This todo counts the actual work of a person on a project" ); 936 nt->setDescription( "This todo counts the actual work of a person on a project" );
937 nt->setPercentComplete( 20 ); 937 nt->setPercentComplete( 20 );
938 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1,Cat_Work_Lutz") ); 938 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1,Cat_Work_Lutz") );
939 Todo * workLutz11 = nt; 939 Todo * workLutz11 = nt;
940 workLutz11->setRelatedTo( sub1 ); 940 workLutz11->setRelatedTo( sub1 );
941 941
942 nt = new Todo; 942 nt = new Todo;
943 mCalendar->addTodo( nt ); 943 mCalendar->addTodo( nt );
944 nt->setSummary( "Planning Project1: Norbert"); 944 nt->setSummary( "Planning Project1: Norbert");
945 nt->setPriority( 1 ); 945 nt->setPriority( 1 );
946 nt->setDescription( "This todo counts the actual work of a person on a project" ); 946 nt->setDescription( "This todo counts the actual work of a person on a project" );
947 nt->setPercentComplete( 20 ); 947 nt->setPercentComplete( 20 );
948 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1,Cat_Work_Norbert") ); 948 nt->setCategories( QString( "Cat_Pro1,Cat_Plan_Pro1,Cat_Work_Norbert") );
949 Todo * workNorbert11 = nt; 949 Todo * workNorbert11 = nt;
950 workNorbert11->setRelatedTo( sub1 ); 950 workNorbert11->setRelatedTo( sub1 );
951 951
952 nt = new Todo; 952 nt = new Todo;
953 mCalendar->addTodo( nt ); 953 mCalendar->addTodo( nt );
954 nt->setSummary( "Work on 1"); 954 nt->setSummary( "Work on 1");
955 nt->setPriority( 1 ); 955 nt->setPriority( 1 );
956 nt->setDescription( "This is a test description of Work Project_1" ); 956 nt->setDescription( "This is a test description of Work Project_1" );
957 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1") ); 957 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1") );
958 nt->setPercentComplete( 20 ); 958 nt->setPercentComplete( 20 );
959 959
960 Todo * sub2 = nt; 960 Todo * sub2 = nt;
961 sub2->setRelatedTo( root1 ); 961 sub2->setRelatedTo( root1 );
962 962
963 963
964 nt = new Todo; 964 nt = new Todo;
965 mCalendar->addTodo( nt ); 965 mCalendar->addTodo( nt );
966 nt->setSummary( "Work on 1: Lutz"); 966 nt->setSummary( "Work on 1: Lutz");
967 nt->setPriority( 1 ); 967 nt->setPriority( 1 );
968 nt->setDescription( "This todo counts the actual work of a person on a project" ); 968 nt->setDescription( "This todo counts the actual work of a person on a project" );
969 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1,Cat_Work_Lutz") ); 969 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1,Cat_Work_Lutz") );
970 nt->setPercentComplete( 20 ); 970 nt->setPercentComplete( 20 );
971 Todo * workLutz12 = nt; 971 Todo * workLutz12 = nt;
972 workLutz12->setRelatedTo( sub2 ); 972 workLutz12->setRelatedTo( sub2 );
973 973
974 nt = new Todo; 974 nt = new Todo;
975 mCalendar->addTodo( nt ); 975 mCalendar->addTodo( nt );
976 nt->setSummary( "Work on 1: Norbert"); 976 nt->setSummary( "Work on 1: Norbert");
977 nt->setPriority( 1 ); 977 nt->setPriority( 1 );
978 nt->setDescription( "This todo counts the actual work of a person on a project" ); 978 nt->setDescription( "This todo counts the actual work of a person on a project" );
979 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1,Cat_Work_Norbert") ); 979 nt->setCategories( QString( "Cat_Pro1,Cat_Work_Pro1,Cat_Work_Norbert") );
980 nt->setPercentComplete( 20 ); 980 nt->setPercentComplete( 20 );
981 Todo * workNorbert12 = nt; 981 Todo * workNorbert12 = nt;
982 workNorbert12->setRelatedTo( sub2 ); 982 workNorbert12->setRelatedTo( sub2 );
983 983
984 int secLenRunning = 7200; 984 int secLenRunning = 7200;
985 int secLenPausing = 3600 * 3; 985 int secLenPausing = 3600 * 3;
986 int dayInterval = 1; 986 int dayInterval = 1;
987 //createRunningDate4Todo( root1, start, end, secLenRunning, secLenPausing, dayInterval ); 987 //createRunningDate4Todo( root1, start, end, secLenRunning, secLenPausing, dayInterval );
988 createRunningDate4Todo( root1, start, end, secLenRunning*24, secLenPausing, 14 ); 988 createRunningDate4Todo( root1, start, end, secLenRunning*24, secLenPausing, 14 );
989 createRunningDate4Todo( sub1, start.addSecs( secLenRunning ), start.addDays( 10 ), secLenRunning*4, secLenPausing, 1); 989 createRunningDate4Todo( sub1, start.addSecs( secLenRunning ), start.addDays( 10 ), secLenRunning*4, secLenPausing, 1);
990 createRunningDate4Todo( sub2, start.addDays( 8 ), end, secLenRunning*4, secLenPausing, 3); 990 createRunningDate4Todo( sub2, start.addDays( 8 ), end, secLenRunning*4, secLenPausing, 3);
991 createRunningDate4Todo( workLutz11, start, start.addDays( 8 ), secLenRunning, secLenPausing, 0); 991 createRunningDate4Todo( workLutz11, start, start.addDays( 8 ), secLenRunning, secLenPausing, 0);
992 createRunningDate4Todo( workNorbert11, start, start.addDays( 8 ), secLenRunning*2, secLenPausing, 1); 992 createRunningDate4Todo( workNorbert11, start, start.addDays( 8 ), secLenRunning*2, secLenPausing, 1);
993 createRunningDate4Todo( workLutz12, start.addDays( 8 ),end, secLenRunning*5, secLenPausing, 3); 993 createRunningDate4Todo( workLutz12, start.addDays( 8 ),end, secLenRunning*5, secLenPausing, 3);
994 createRunningDate4Todo( workNorbert12, start.addDays( 8 ), end, secLenRunning, secLenPausing*3, 0); 994 createRunningDate4Todo( workNorbert12, start.addDays( 8 ), end, secLenRunning, secLenPausing*3, 0);
995 995
996 } 996 }
997 997
998 { 998 {
999 Todo * root1 = new Todo; 999 Todo * root1 = new Todo;
1000 mCalendar->addTodo( root1 ); 1000 mCalendar->addTodo( root1 );
1001 root1->setSummary( "Project2"); 1001 root1->setSummary( "Project2");
1002 root1->setPriority( 1 ); 1002 root1->setPriority( 1 );
1003 root1->setDescription( "This is a test description of a root Project 2" ); 1003 root1->setDescription( "This is a test description of a root Project 2" );
1004 root1->setPercentComplete( 20 ); 1004 root1->setPercentComplete( 20 );
1005 root1->setCategories( QString( "Cat_Pro2") ); 1005 root1->setCategories( QString( "Cat_Pro2") );
1006 updateView(); 1006 updateView();
1007 QDateTime start = QDateTime ( QDate( 2004,11,1), QTime ( 7,30,0) ); 1007 QDateTime start = QDateTime ( QDate( 2004,11,1), QTime ( 7,30,0) );
1008 QDateTime end = QDateTime ( QDate( 2005,8,5), QTime ( 0,0,0) ); 1008 QDateTime end = QDateTime ( QDate( 2005,8,5), QTime ( 0,0,0) );
1009 int secLenRunning = 7200; 1009 int secLenRunning = 7200;
1010 int secLenPausing = 3600 * 3; 1010 int secLenPausing = 3600 * 3;
1011 int dayInterval = 1; 1011 int dayInterval = 1;
1012 1012
1013 nt = new Todo; 1013 nt = new Todo;
1014 mCalendar->addTodo( nt ); 1014 mCalendar->addTodo( nt );
1015 nt->setSummary( "Planning Project2"); 1015 nt->setSummary( "Planning Project2");
1016 nt->setPriority( 1 ); 1016 nt->setPriority( 1 );
1017 nt->setDescription( "This is a test description of Planning_Project_2" ); 1017 nt->setDescription( "This is a test description of Planning_Project_2" );
1018 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2") ); 1018 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2") );
1019 nt->setPercentComplete( 20 ); 1019 nt->setPercentComplete( 20 );
1020 1020
1021 1021
1022 Todo * sub1 = nt; 1022 Todo * sub1 = nt;
1023 sub1->setRelatedTo( root1 ); 1023 sub1->setRelatedTo( root1 );
1024 1024
1025 nt = new Todo; 1025 nt = new Todo;
1026 mCalendar->addTodo( nt ); 1026 mCalendar->addTodo( nt );
1027 nt->setSummary( "Planning Project2: Lutz"); 1027 nt->setSummary( "Planning Project2: Lutz");
1028 nt->setPriority( 1 ); 1028 nt->setPriority( 1 );
1029 nt->setDescription( "This todo counts the actual work of a person on a project" ); 1029 nt->setDescription( "This todo counts the actual work of a person on a project" );
1030 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2,Cat_Work_Lutz") ); 1030 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2,Cat_Work_Lutz") );
1031 nt->setPercentComplete( 20 ); 1031 nt->setPercentComplete( 20 );
1032 Todo * workLutz11 = nt; 1032 Todo * workLutz11 = nt;
1033 workLutz11->setRelatedTo( sub1 ); 1033 workLutz11->setRelatedTo( sub1 );
1034 1034
1035 nt = new Todo; 1035 nt = new Todo;
1036 mCalendar->addTodo( nt ); 1036 mCalendar->addTodo( nt );
1037 nt->setSummary( "Planning Project2: Norbert"); 1037 nt->setSummary( "Planning Project2: Norbert");
1038 nt->setPriority( 1 ); 1038 nt->setPriority( 1 );
1039 nt->setDescription( "This todo counts the actual work of a person on a project" ); 1039 nt->setDescription( "This todo counts the actual work of a person on a project" );
1040 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2,Cat_Work_Norbert") ); 1040 nt->setCategories( QString( "Cat_Pro2,Cat_Plan_Pro2,Cat_Work_Norbert") );
1041 nt->setPercentComplete( 20 ); 1041 nt->setPercentComplete( 20 );
1042 Todo * workNorbert11 = nt; 1042 Todo * workNorbert11 = nt;
1043 workNorbert11->setRelatedTo( sub1 ); 1043 workNorbert11->setRelatedTo( sub1 );
1044 1044
1045 nt = new Todo; 1045 nt = new Todo;
1046 mCalendar->addTodo( nt ); 1046 mCalendar->addTodo( nt );
1047 nt->setSummary( "Work on 2"); 1047 nt->setSummary( "Work on 2");
1048 nt->setPriority( 1 ); 1048 nt->setPriority( 1 );
1049 nt->setDescription( "This is a test description of Work Project_2" ); 1049 nt->setDescription( "This is a test description of Work Project_2" );
1050 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2") ); 1050 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2") );
1051 nt->setPercentComplete( 20 ); 1051 nt->setPercentComplete( 20 );
1052 1052
1053 Todo * sub2 = nt; 1053 Todo * sub2 = nt;
1054 sub2->setRelatedTo( root1 ); 1054 sub2->setRelatedTo( root1 );
1055 1055
1056 1056
1057 nt = new Todo; 1057 nt = new Todo;
1058 mCalendar->addTodo( nt ); 1058 mCalendar->addTodo( nt );
1059 nt->setSummary( "Work on 2: Lutz"); 1059 nt->setSummary( "Work on 2: Lutz");
1060 nt->setPriority( 1 ); 1060 nt->setPriority( 1 );
1061 nt->setDescription( "This todo counts the actual work of a person on a project" ); 1061 nt->setDescription( "This todo counts the actual work of a person on a project" );
1062 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2,Cat_Work_Lutz") ); 1062 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2,Cat_Work_Lutz") );
1063 nt->setPercentComplete( 20 ); 1063 nt->setPercentComplete( 20 );
1064 Todo * workLutz12 = nt; 1064 Todo * workLutz12 = nt;
1065 workLutz12->setRelatedTo( sub2 ); 1065 workLutz12->setRelatedTo( sub2 );
1066 1066
1067 nt = new Todo; 1067 nt = new Todo;
1068 mCalendar->addTodo( nt ); 1068 mCalendar->addTodo( nt );
1069 nt->setSummary( "Work on 2: Norbert"); 1069 nt->setSummary( "Work on 2: Norbert");
1070 nt->setPriority( 1 ); 1070 nt->setPriority( 1 );
1071 nt->setDescription( "This todo counts the actual work of a person on a project" ); 1071 nt->setDescription( "This todo counts the actual work of a person on a project" );
1072 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2,Cat_Work_Norbert") ); 1072 nt->setCategories( QString( "Cat_Pro2,Cat_Work_Pro2,Cat_Work_Norbert") );
1073 nt->setPercentComplete( 20 ); 1073 nt->setPercentComplete( 20 );
1074 Todo * workNorbert12 = nt; 1074 Todo * workNorbert12 = nt;
1075 workNorbert12->setRelatedTo( sub2 ); 1075 workNorbert12->setRelatedTo( sub2 );
1076 createRunningDate4Todo( root1, start, end, secLenRunning, secLenPausing, 10 ); 1076 createRunningDate4Todo( root1, start, end, secLenRunning, secLenPausing, 10 );
1077 createRunningDate4Todo( sub1, start.addSecs( secLenRunning*3 ), start.addDays( 20 ), secLenRunning*2, secLenPausing, 2); 1077 createRunningDate4Todo( sub1, start.addSecs( secLenRunning*3 ), start.addDays( 20 ), secLenRunning*2, secLenPausing, 2);
1078 createRunningDate4Todo( sub2, start.addDays( 8 ), end, secLenRunning*3, secLenPausing, 7); 1078 createRunningDate4Todo( sub2, start.addDays( 8 ), end, secLenRunning*3, secLenPausing, 7);
1079 createRunningDate4Todo( workLutz11, start, start.addDays( 18 ), secLenRunning/2, secLenPausing*5, 0); 1079 createRunningDate4Todo( workLutz11, start, start.addDays( 18 ), secLenRunning/2, secLenPausing*5, 0);
1080 createRunningDate4Todo( workNorbert11, start.addDays( 8 ), start.addDays( 18 ), secLenRunning*5, secLenPausing*5, 1); 1080 createRunningDate4Todo( workNorbert11, start.addDays( 8 ), start.addDays( 18 ), secLenRunning*5, secLenPausing*5, 1);
1081 createRunningDate4Todo( workLutz12, start.addDays( 8 ),end, secLenRunning, secLenPausing*8, 0); 1081 createRunningDate4Todo( workLutz12, start.addDays( 8 ),end, secLenRunning, secLenPausing*8, 0);
1082 createRunningDate4Todo( workNorbert12, start.addDays( 28 ), end, secLenRunning/8, secLenPausing*6, 0); 1082 createRunningDate4Todo( workNorbert12, start.addDays( 28 ), end, secLenRunning/8, secLenPausing*6, 0);
1083 } 1083 }
1084 updateView(); 1084 updateView();
1085#endif 1085#endif
1086 1086
1087} 1087}
1088void CalendarView::createRunningDate4Todo( Todo * runT, QDateTime start , QDateTime end, int secLenRunning, int secLenPausing,int dayInterval ) 1088void CalendarView::createRunningDate4Todo( Todo * runT, QDateTime start , QDateTime end, int secLenRunning, int secLenPausing,int dayInterval )
1089{ 1089{
1090 static int ccc = 0; 1090 static int ccc = 0;
1091 ++ccc; 1091 ++ccc;
1092 QDateTime t_start = start; 1092 QDateTime t_start = start;
1093 runT->setPriority( 5 ); 1093 runT->setPriority( 5 );
1094 runT->setPercentComplete( 0 ); 1094 runT->setPercentComplete( 0 );
1095 int count = 0; 1095 int count = 0;
1096 int prio = 5; 1096 int prio = 5;
1097 int complete = 0; 1097 int complete = 0;
1098 while ( t_start < end ) { 1098 while ( t_start < end ) {
1099 ++count; 1099 ++count;
1100 if ( count > ccc ) { 1100 if ( count > ccc ) {
1101 count = 0; 1101 count = 0;
1102 --prio; 1102 --prio;
1103 if ( prio == 0 ) prio = 5; 1103 if ( prio == 0 ) prio = 5;
1104 complete += 20; 1104 complete += 20;
1105 if ( complete > 100 ) complete = 0; 1105 if ( complete > 100 ) complete = 0;
1106 runT->setPriority( prio ); 1106 runT->setPriority( prio );
1107 runT->setPercentComplete( complete ); 1107 runT->setPercentComplete( complete );
1108 } 1108 }
1109 runT->setRunning( true ); 1109 runT->setRunning( true );
1110 runT->saveRunningInfo( "Additional tt comment: running on "+ t_start.toString(), t_start, t_start.addSecs( secLenRunning ) ); 1110 runT->saveRunningInfo( "Additional tt comment: running on "+ t_start.toString(), t_start, t_start.addSecs( secLenRunning ) );
1111 if ( dayInterval ) 1111 if ( dayInterval )
1112 t_start = t_start.addDays( dayInterval ); 1112 t_start = t_start.addDays( dayInterval );
1113 else { 1113 else {
1114 t_start = t_start.addSecs( secLenRunning + secLenPausing ); 1114 t_start = t_start.addSecs( secLenRunning + secLenPausing );
1115 } 1115 }
1116 } 1116 }
1117} 1117}
1118 1118
1119void CalendarView::showDay( QDate d ) 1119void CalendarView::showDay( QDate d )
1120{ 1120{
1121 dateNavigator()->blockSignals( true ); 1121 dateNavigator()->blockSignals( true );
1122 dateNavigator()->selectDate( d ); 1122 dateNavigator()->selectDate( d );
1123 dateNavigator()->blockSignals( false ); 1123 dateNavigator()->blockSignals( false );
1124 mViewManager->showDayView(); 1124 mViewManager->showDayView();
1125 //dateNavigator()->selectDate( d ); 1125 //dateNavigator()->selectDate( d );
1126} 1126}
1127void CalendarView::timerAlarm() 1127void CalendarView::timerAlarm()
1128{ 1128{
1129 //qDebug("CalendarView::timerAlarm() "); 1129 //qDebug("CalendarView::timerAlarm() ");
1130 computeAlarm(mAlarmNotification ); 1130 computeAlarm(mAlarmNotification );
1131} 1131}
1132 1132
1133void CalendarView::suspendAlarm() 1133void CalendarView::suspendAlarm()
1134{ 1134{
1135 //qDebug(" CalendarView::suspendAlarm() "); 1135 //qDebug(" CalendarView::suspendAlarm() ");
1136 computeAlarm(mSuspendAlarmNotification ); 1136 computeAlarm(mSuspendAlarmNotification );
1137 1137
1138} 1138}
1139 1139
1140void CalendarView::startAlarm( QString mess , QString filename) 1140void CalendarView::startAlarm( QString mess , QString filename)
1141{ 1141{
1142 1142
1143 topLevelWidget()->showNormal(); 1143 topLevelWidget()->showNormal();
1144 topLevelWidget()->setActiveWindow(); 1144 topLevelWidget()->setActiveWindow();
1145 topLevelWidget()->raise(); 1145 topLevelWidget()->raise();
1146 1146
1147 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 1147 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
1148 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); 1148 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
1149 1149
1150} 1150}
1151 1151
1152void CalendarView::checkNextTimerAlarm() 1152void CalendarView::checkNextTimerAlarm()
1153{ 1153{
1154 mCalendar->checkAlarmForIncidence( 0, true ); 1154 mCalendar->checkAlarmForIncidence( 0, true );
1155} 1155}
1156 1156
1157void CalendarView::computeAlarm( QString msg ) 1157void CalendarView::computeAlarm( QString msg )
1158{ 1158{
1159 1159
1160 QString mess = msg; 1160 QString mess = msg;
1161 QString mAlarmMessage = mess.mid( 9 ); 1161 QString mAlarmMessage = mess.mid( 9 );
1162 QString filename = MainWindow::resourcePath(); 1162 QString filename = MainWindow::resourcePath();
1163 filename += "koalarm.wav"; 1163 filename += "koalarm.wav";
1164 QString tempfilename; 1164 QString tempfilename;
1165 if ( mess.left( 13 ) == "suspend_alarm") { 1165 if ( mess.left( 13 ) == "suspend_alarm") {
1166 bool error = false; 1166 bool error = false;
1167 int len = mess.mid( 13 ).find("+++"); 1167 int len = mess.mid( 13 ).find("+++");
1168 if ( len < 2 ) 1168 if ( len < 2 )
1169 error = true; 1169 error = true;
1170 else { 1170 else {
1171 tempfilename = mess.mid( 13, len ); 1171 tempfilename = mess.mid( 13, len );
1172 if ( !QFile::exists( tempfilename ) ) 1172 if ( !QFile::exists( tempfilename ) )
1173 error = true; 1173 error = true;
1174 } 1174 }
1175 if ( ! error ) { 1175 if ( ! error ) {
1176 filename = tempfilename; 1176 filename = tempfilename;
1177 } 1177 }
1178 mAlarmMessage = mess.mid( 13+len+3 ); 1178 mAlarmMessage = mess.mid( 13+len+3 );
1179 //qDebug("suspend file %s ",tempfilename.latin1() ); 1179 //qDebug("suspend file %s ",tempfilename.latin1() );
1180 startAlarm( mAlarmMessage, filename); 1180 startAlarm( mAlarmMessage, filename);
1181 return; 1181 return;
1182 } 1182 }
1183 if ( mess.left( 11 ) == "timer_alarm") { 1183 if ( mess.left( 11 ) == "timer_alarm") {
1184 //mTimerTime = 0; 1184 //mTimerTime = 0;
1185 startAlarm( mess.mid( 11 ), filename ); 1185 startAlarm( mess.mid( 11 ), filename );
1186 return; 1186 return;
1187 } 1187 }
1188 if ( mess.left( 10 ) == "proc_alarm") { 1188 if ( mess.left( 10 ) == "proc_alarm") {
1189 bool error = false; 1189 bool error = false;
1190 int len = mess.mid( 10 ).find("+++"); 1190 int len = mess.mid( 10 ).find("+++");
1191 if ( len < 2 ) 1191 if ( len < 2 )
1192 error = true; 1192 error = true;
1193 else { 1193 else {
1194 tempfilename = mess.mid( 10, len ); 1194 tempfilename = mess.mid( 10, len );
1195 if ( !QFile::exists( tempfilename ) ) 1195 if ( !QFile::exists( tempfilename ) )
1196 error = true; 1196 error = true;
1197 } 1197 }
1198 if ( error ) { 1198 if ( error ) {
1199 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 1199 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
1200 mAlarmMessage += mess.mid( 10+len+3+9 ); 1200 mAlarmMessage += mess.mid( 10+len+3+9 );
1201 } else { 1201 } else {
1202 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 1202 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
1203 //qDebug("-----system command %s ",tempfilename.latin1() ); 1203 //qDebug("-----system command %s ",tempfilename.latin1() );
1204#ifndef _WIN32_ 1204#ifndef _WIN32_
1205 if ( vfork () == 0 ) { 1205 if ( vfork () == 0 ) {
1206 execl ( tempfilename.latin1(), 0 ); 1206 execl ( tempfilename.latin1(), 0 );
1207 return; 1207 return;
1208 } 1208 }
1209#else 1209#else
1210 QProcess* p = new QProcess(); 1210 QProcess* p = new QProcess();
1211 p->addArgument( tempfilename.latin1() ); 1211 p->addArgument( tempfilename.latin1() );
1212 p->start(); 1212 p->start();
1213 return; 1213 return;
1214#endif 1214#endif
1215 1215
1216 return; 1216 return;
1217 } 1217 }
1218 1218
1219 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 1219 //qDebug("+++++++system command %s ",tempfilename.latin1() );
1220 } 1220 }
1221 if ( mess.left( 11 ) == "audio_alarm") { 1221 if ( mess.left( 11 ) == "audio_alarm") {
1222 bool error = false; 1222 bool error = false;
@@ -2150,780 +2150,790 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
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 saveCalendar( MainWindow::defaultFileName() ); 2534 QString saveError;
2535 if ( !saveCalendar( MainWindow::defaultFileName() ) )
2536 saveError = cal->mName +"\n";
2535 cal = calendars.next(); 2537 cal = calendars.next();
2536 while ( cal ) { 2538 while ( cal ) {
2537 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2539 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2538 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2540 mCalendar->setDefaultCalendar( cal->mCalNumber );
2539 mCalendar->setDefaultCalendarEnabledOnly(); 2541 mCalendar->setDefaultCalendarEnabledOnly();
2540 if ( saveCalendar( cal->mFileName ) ) 2542 if ( saveCalendar( cal->mFileName ) )
2541 cal->mLoadDt = QDateTime::currentDateTime(); 2543 cal->mLoadDt = QDateTime::currentDateTime();
2544 else
2545 saveError += cal->mName + "\n";
2542 } 2546 }
2543 cal = calendars.next(); 2547 cal = calendars.next();
2544 } 2548 }
2545 restoreCalendarSettings(); 2549 restoreCalendarSettings();
2550
2551 if ( !saveError.isEmpty() ) {
2552 saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError;
2553 KMessageBox::error(this, saveError, i18n("Error saving data"));
2554 return false;
2555 }
2546 return true; 2556 return true;
2547} 2557}
2548bool CalendarView::saveCalendar( QString filename ) 2558bool CalendarView::saveCalendar( QString filename )
2549{ 2559{
2550 2560
2551 // Store back all unsaved data into calendar object 2561 // Store back all unsaved data into calendar object
2552 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2562 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2553 if ( mViewManager->currentView() ) 2563 if ( mViewManager->currentView() )
2554 mViewManager->currentView()->flushView(); 2564 mViewManager->currentView()->flushView();
2555 2565
2556 2566
2557 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2567 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2558 mStorage->setSaveFormat( new ICalFormat() ); 2568 mStorage->setSaveFormat( new ICalFormat() );
2559 mStorage->setFileName( filename ); 2569 mStorage->setFileName( filename );
2560 bool success; 2570 bool success;
2561 success = mStorage->save(); 2571 success = mStorage->save();
2562 if ( !success ) { 2572 if ( !success ) {
2563 return false; 2573 return false;
2564 } 2574 }
2565 if ( filename == MainWindow::defaultFileName() ) { 2575 if ( filename == MainWindow::defaultFileName() ) {
2566 setLoadedFileVersion( lfv ); 2576 setLoadedFileVersion( lfv );
2567 watchSavedFile(); 2577 watchSavedFile();
2568 } 2578 }
2569 return true; 2579 return true;
2570} 2580}
2571 2581
2572void CalendarView::closeCalendar() 2582void CalendarView::closeCalendar()
2573{ 2583{
2574 2584
2575 // child windows no longer valid 2585 // child windows no longer valid
2576 clearAllViews(); 2586 clearAllViews();
2577 emit closingDown(); 2587 emit closingDown();
2578 2588
2579 mCalendar->close(); 2589 mCalendar->close();
2580 setModified(false); 2590 setModified(false);
2581 updateView(); 2591 updateView();
2582} 2592}
2583 2593
2584void CalendarView::archiveCalendar() 2594void CalendarView::archiveCalendar()
2585{ 2595{
2586 mDialogManager->showArchiveDialog(); 2596 mDialogManager->showArchiveDialog();
2587} 2597}
2588 2598
2589 2599
2590void CalendarView::readSettings() 2600void CalendarView::readSettings()
2591{ 2601{
2592 2602
2593 2603
2594 // mViewManager->showAgendaView(); 2604 // mViewManager->showAgendaView();
2595 QString str; 2605 QString str;
2596 //qDebug("CalendarView::readSettings() "); 2606 //qDebug("CalendarView::readSettings() ");
2597 // read settings from the KConfig, supplying reasonable 2607 // read settings from the KConfig, supplying reasonable
2598 // defaults where none are to be found 2608 // defaults where none are to be found
2599 KConfig *config = KOGlobals::config(); 2609 KConfig *config = KOGlobals::config();
2600#ifndef KORG_NOSPLITTER 2610#ifndef KORG_NOSPLITTER
2601 config->setGroup("KOrganizer Geometry"); 2611 config->setGroup("KOrganizer Geometry");
2602 2612
2603 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2613 QValueList<int> sizes = config->readIntListEntry("Separator1");
2604 if (sizes.count() != 2) { 2614 if (sizes.count() != 2) {
2605 sizes << mDateNavigator->minimumSizeHint().width(); 2615 sizes << mDateNavigator->minimumSizeHint().width();
2606 sizes << 300; 2616 sizes << 300;
2607 } 2617 }
2608 mPanner->setSizes(sizes); 2618 mPanner->setSizes(sizes);
2609 2619
2610 sizes = config->readIntListEntry("Separator2"); 2620 sizes = config->readIntListEntry("Separator2");
2611 if ( ( mResourceView && sizes.count() == 4 ) || 2621 if ( ( mResourceView && sizes.count() == 4 ) ||
2612 ( !mResourceView && sizes.count() == 3 ) ) { 2622 ( !mResourceView && sizes.count() == 3 ) ) {
2613 mLeftSplitter->setSizes(sizes); 2623 mLeftSplitter->setSizes(sizes);
2614 } 2624 }
2615#endif 2625#endif
2616 globalFlagBlockAgenda = 1; 2626 globalFlagBlockAgenda = 1;
2617 mViewManager->showAgendaView(); 2627 mViewManager->showAgendaView();
2618 //mViewManager->readSettings( config ); 2628 //mViewManager->readSettings( config );
2619 mTodoList->restoreLayout(config,QString("Todo Layout")); 2629 mTodoList->restoreLayout(config,QString("Todo Layout"));
2620 readFilterSettings(config); 2630 readFilterSettings(config);
2621 2631
2622#ifdef DESKTOP_VERSION 2632#ifdef DESKTOP_VERSION
2623 config->setGroup("WidgetLayout"); 2633 config->setGroup("WidgetLayout");
2624 QStringList list; 2634 QStringList list;
2625 list = config->readListEntry("MainLayout"); 2635 list = config->readListEntry("MainLayout");
2626 int x,y,w,h; 2636 int x,y,w,h;
2627 if ( ! list.isEmpty() ) { 2637 if ( ! list.isEmpty() ) {
2628 x = list[0].toInt(); 2638 x = list[0].toInt();
2629 y = list[1].toInt(); 2639 y = list[1].toInt();
2630 w = list[2].toInt(); 2640 w = list[2].toInt();
2631 h = list[3].toInt(); 2641 h = list[3].toInt();
2632 KApplication::testCoords( &x,&y,&w,&h ); 2642 KApplication::testCoords( &x,&y,&w,&h );
2633 topLevelWidget()->setGeometry(x,y,w,h); 2643 topLevelWidget()->setGeometry(x,y,w,h);
2634 2644
2635 } else { 2645 } else {
2636 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2646 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2637 } 2647 }
2638 list = config->readListEntry("EditEventLayout"); 2648 list = config->readListEntry("EditEventLayout");
2639 if ( ! list.isEmpty() ) { 2649 if ( ! list.isEmpty() ) {
2640 x = list[0].toInt(); 2650 x = list[0].toInt();
2641 y = list[1].toInt(); 2651 y = list[1].toInt();
2642 w = list[2].toInt(); 2652 w = list[2].toInt();
2643 h = list[3].toInt(); 2653 h = list[3].toInt();
2644 KApplication::testCoords( &x,&y,&w,&h ); 2654 KApplication::testCoords( &x,&y,&w,&h );
2645 mEventEditor->setGeometry(x,y,w,h); 2655 mEventEditor->setGeometry(x,y,w,h);
2646 2656
2647 } 2657 }
2648 list = config->readListEntry("EditTodoLayout"); 2658 list = config->readListEntry("EditTodoLayout");
2649 if ( ! list.isEmpty() ) { 2659 if ( ! list.isEmpty() ) {
2650 x = list[0].toInt(); 2660 x = list[0].toInt();
2651 y = list[1].toInt(); 2661 y = list[1].toInt();
2652 w = list[2].toInt(); 2662 w = list[2].toInt();
2653 h = list[3].toInt(); 2663 h = list[3].toInt();
2654 KApplication::testCoords( &x,&y,&w,&h ); 2664 KApplication::testCoords( &x,&y,&w,&h );
2655 mTodoEditor->setGeometry(x,y,w,h); 2665 mTodoEditor->setGeometry(x,y,w,h);
2656 2666
2657 } 2667 }
2658 list = config->readListEntry("ViewerLayout"); 2668 list = config->readListEntry("ViewerLayout");
2659 if ( ! list.isEmpty() ) { 2669 if ( ! list.isEmpty() ) {
2660 x = list[0].toInt(); 2670 x = list[0].toInt();
2661 y = list[1].toInt(); 2671 y = list[1].toInt();
2662 w = list[2].toInt(); 2672 w = list[2].toInt();
2663 h = list[3].toInt(); 2673 h = list[3].toInt();
2664 KApplication::testCoords( &x,&y,&w,&h ); 2674 KApplication::testCoords( &x,&y,&w,&h );
2665 getEventViewerDialog()->setGeometry(x,y,w,h); 2675 getEventViewerDialog()->setGeometry(x,y,w,h);
2666 } 2676 }
2667#endif 2677#endif
2668 config->setGroup( "Views" ); 2678 config->setGroup( "Views" );
2669 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2679 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2670 2680
2671 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2681 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2672 2682
2673 int resetval = 0; 2683 int resetval = 0;
2674 int maxVal = 0; 2684 int maxVal = 0;
2675 if (sizes.count() != 3) { 2685 if (sizes.count() != 3) {
2676 if ( KOPrefs::instance()->mVerticalScreen ) { 2686 if ( KOPrefs::instance()->mVerticalScreen ) {
2677 resetval = mDateNavigator->sizeHint().width()+2; 2687 resetval = mDateNavigator->sizeHint().width()+2;
2678 } else { 2688 } else {
2679 resetval = mDateNavigator->sizeHint().height()+2; 2689 resetval = mDateNavigator->sizeHint().height()+2;
2680 } 2690 }
2681 } 2691 }
2682 if ( resetval ) { 2692 if ( resetval ) {
2683 sizes.clear(); 2693 sizes.clear();
2684 if ( KOPrefs::instance()->mVerticalScreen ) { 2694 if ( KOPrefs::instance()->mVerticalScreen ) {
2685 maxVal = QApplication::desktop()->width() -10; 2695 maxVal = QApplication::desktop()->width() -10;
2686 } else { 2696 } else {
2687 maxVal = QApplication::desktop()->height()-10; 2697 maxVal = QApplication::desktop()->height()-10;
2688 } 2698 }
2689 sizes << resetval; 2699 sizes << resetval;
2690 if ( maxVal < resetval + resetval) 2700 if ( maxVal < resetval + resetval)
2691 resetval = maxVal - resetval; 2701 resetval = maxVal - resetval;
2692 sizes << resetval; 2702 sizes << resetval;
2693 sizes << 100; 2703 sizes << 100;
2694 } 2704 }
2695 mLeftFrame->setSizes(sizes); 2705 mLeftFrame->setSizes(sizes);
2696 sizes = config->readIntListEntry("Main Splitter Frame"); 2706 sizes = config->readIntListEntry("Main Splitter Frame");
2697 resetval = 0; 2707 resetval = 0;
2698 maxVal = 0; 2708 maxVal = 0;
2699 if (sizes.count() != 2) { 2709 if (sizes.count() != 2) {
2700 if ( !KOPrefs::instance()->mVerticalScreen ) { 2710 if ( !KOPrefs::instance()->mVerticalScreen ) {
2701 resetval = mDateNavigator->sizeHint().width()+2; 2711 resetval = mDateNavigator->sizeHint().width()+2;
2702 } else { 2712 } else {
2703 resetval = mDateNavigator->sizeHint().height()+2; 2713 resetval = mDateNavigator->sizeHint().height()+2;
2704 } 2714 }
2705 } 2715 }
2706 if ( resetval ) { 2716 if ( resetval ) {
2707 sizes.clear(); 2717 sizes.clear();
2708 if ( !KOPrefs::instance()->mVerticalScreen ) { 2718 if ( !KOPrefs::instance()->mVerticalScreen ) {
2709 maxVal = QApplication::desktop()->width() -10; 2719 maxVal = QApplication::desktop()->width() -10;
2710 } else { 2720 } else {
2711 maxVal = QApplication::desktop()->height()-10; 2721 maxVal = QApplication::desktop()->height()-10;
2712 } 2722 }
2713 sizes << resetval; 2723 sizes << resetval;
2714 if ( maxVal < resetval + resetval) 2724 if ( maxVal < resetval + resetval)
2715 resetval = maxVal - resetval; 2725 resetval = maxVal - resetval;
2716 sizes << resetval; 2726 sizes << resetval;
2717 } 2727 }
2718 mMainFrame->setSizes(sizes); 2728 mMainFrame->setSizes(sizes);
2719 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2729 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2720 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2730 else if ( dateCount == 7 ) mNavigator->selectWeek();
2721 else mNavigator->selectDates( dateCount ); 2731 else mNavigator->selectDates( dateCount );
2722 // mViewManager->readSettings( config ); 2732 // mViewManager->readSettings( config );
2723 updateConfig(); 2733 updateConfig();
2724 globalFlagBlockAgenda = 2; 2734 globalFlagBlockAgenda = 2;
2725 mViewManager->readSettings( config ); 2735 mViewManager->readSettings( config );
2726 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2736 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2727} 2737}
2728 2738
2729void CalendarView::checkSuspendAlarm() 2739void CalendarView::checkSuspendAlarm()
2730{ 2740{
2731 if ( mSuspendTimer->isActive() ) { 2741 if ( mSuspendTimer->isActive() ) {
2732 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2742 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2733 } 2743 }
2734} 2744}
2735void CalendarView::writeSettings() 2745void CalendarView::writeSettings()
2736{ 2746{
2737 // kdDebug() << "CalendarView::writeSettings" << endl; 2747 // kdDebug() << "CalendarView::writeSettings" << endl;
2738 2748
2739 KConfig *config = KOGlobals::config(); 2749 KConfig *config = KOGlobals::config();
2740 2750
2741 mViewManager->writeSettings( config ); 2751 mViewManager->writeSettings( config );
2742 mTodoList->saveLayout(config,QString("Todo Layout")); 2752 mTodoList->saveLayout(config,QString("Todo Layout"));
2743 mDialogManager->writeSettings( config ); 2753 mDialogManager->writeSettings( config );
2744 //KOPrefs::instance()->usrWriteConfig(); 2754 //KOPrefs::instance()->usrWriteConfig();
2745 KOPrefs::instance()->writeConfig(); 2755 KOPrefs::instance()->writeConfig();
2746 2756
2747 writeFilterSettings(config); 2757 writeFilterSettings(config);
2748 config->setGroup( "AppRun" ); 2758 config->setGroup( "AppRun" );
2749 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2759 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2750 int days = dt.daysTo( QDate::currentDate() ); 2760 int days = dt.daysTo( QDate::currentDate() );
2751 dt = dt.addDays( days ); 2761 dt = dt.addDays( days );
2752 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2762 int secs = dt.secsTo( QDateTime::currentDateTime() );
2753 config->writeEntry( "LatestProgramStopDays", days ); 2763 config->writeEntry( "LatestProgramStopDays", days );
2754 config->writeEntry( "LatestProgramStopSecs", secs ); 2764 config->writeEntry( "LatestProgramStopSecs", secs );
2755 //qDebug("KO: Writing stop time: %d ", secs); 2765 //qDebug("KO: Writing stop time: %d ", secs);
2756 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2766 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2757 //QDateTime latest = dt.addSecs ( secs ); 2767 //QDateTime latest = dt.addSecs ( secs );
2758 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2768 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2759 config->setGroup( "Views" ); 2769 config->setGroup( "Views" );
2760 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2770 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2761 2771
2762#if 0 2772#if 0
2763 qDebug("********************* "); 2773 qDebug("********************* ");
2764 qDebug("Testcode secsto "); 2774 qDebug("Testcode secsto ");
2765 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2775 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2766 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2776 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2767 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2777 int secsto = dt_nodaylight.secsTo( dt_daylight );
2768 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2778 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2769 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2779 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2770 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2780 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2771 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2781 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2772 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2782 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2773 qDebug("********************* testcode end"); 2783 qDebug("********************* testcode end");
2774 2784
2775#endif 2785#endif
2776 2786
2777 QValueList<int> listINT = mLeftFrame->sizes(); 2787 QValueList<int> listINT = mLeftFrame->sizes();
2778 config->writeEntry("Left Splitter Frame",listINT); 2788 config->writeEntry("Left Splitter Frame",listINT);
2779 QValueList<int> listINT2 = mMainFrame->sizes(); 2789 QValueList<int> listINT2 = mMainFrame->sizes();
2780 config->writeEntry("Main Splitter Frame",listINT2); 2790 config->writeEntry("Main Splitter Frame",listINT2);
2781#ifdef DESKTOP_VERSION 2791#ifdef DESKTOP_VERSION
2782 config->setGroup("WidgetLayout"); 2792 config->setGroup("WidgetLayout");
2783 QStringList list ;//= config->readListEntry("MainLayout"); 2793 QStringList list ;//= config->readListEntry("MainLayout");
2784 int x,y,w,h; 2794 int x,y,w,h;
2785 QWidget* wid; 2795 QWidget* wid;
2786 wid = topLevelWidget(); 2796 wid = topLevelWidget();
2787 x = wid->geometry().x(); 2797 x = wid->geometry().x();
2788 y = wid->geometry().y(); 2798 y = wid->geometry().y();
2789 w = wid->width(); 2799 w = wid->width();
2790 h = wid->height(); 2800 h = wid->height();
2791 list.clear(); 2801 list.clear();
2792 list << QString::number( x ); 2802 list << QString::number( x );
2793 list << QString::number( y ); 2803 list << QString::number( y );
2794 list << QString::number( w ); 2804 list << QString::number( w );
2795 list << QString::number( h ); 2805 list << QString::number( h );
2796 config->writeEntry("MainLayout",list ); 2806 config->writeEntry("MainLayout",list );
2797 2807
2798 wid = mEventEditor; 2808 wid = mEventEditor;
2799 x = wid->geometry().x(); 2809 x = wid->geometry().x();
2800 y = wid->geometry().y(); 2810 y = wid->geometry().y();
2801 w = wid->width(); 2811 w = wid->width();
2802 h = wid->height(); 2812 h = wid->height();
2803 list.clear(); 2813 list.clear();
2804 list << QString::number( x ); 2814 list << QString::number( x );
2805 list << QString::number( y ); 2815 list << QString::number( y );
2806 list << QString::number( w ); 2816 list << QString::number( w );
2807 list << QString::number( h ); 2817 list << QString::number( h );
2808 config->writeEntry("EditEventLayout",list ); 2818 config->writeEntry("EditEventLayout",list );
2809 2819
2810 wid = mTodoEditor; 2820 wid = mTodoEditor;
2811 x = wid->geometry().x(); 2821 x = wid->geometry().x();
2812 y = wid->geometry().y(); 2822 y = wid->geometry().y();
2813 w = wid->width(); 2823 w = wid->width();
2814 h = wid->height(); 2824 h = wid->height();
2815 list.clear(); 2825 list.clear();
2816 list << QString::number( x ); 2826 list << QString::number( x );
2817 list << QString::number( y ); 2827 list << QString::number( y );
2818 list << QString::number( w ); 2828 list << QString::number( w );
2819 list << QString::number( h ); 2829 list << QString::number( h );
2820 config->writeEntry("EditTodoLayout",list ); 2830 config->writeEntry("EditTodoLayout",list );
2821 wid = getEventViewerDialog(); 2831 wid = getEventViewerDialog();
2822 x = wid->geometry().x(); 2832 x = wid->geometry().x();
2823 y = wid->geometry().y(); 2833 y = wid->geometry().y();
2824 w = wid->width(); 2834 w = wid->width();
2825 h = wid->height(); 2835 h = wid->height();
2826 list.clear(); 2836 list.clear();
2827 list << QString::number( x ); 2837 list << QString::number( x );
2828 list << QString::number( y ); 2838 list << QString::number( y );
2829 list << QString::number( w ); 2839 list << QString::number( w );
2830 list << QString::number( h ); 2840 list << QString::number( h );
2831 config->writeEntry("ViewerLayout",list ); 2841 config->writeEntry("ViewerLayout",list );
2832 wid = mDialogManager->getSearchDialog(); 2842 wid = mDialogManager->getSearchDialog();
2833 if ( wid ) { 2843 if ( wid ) {
2834 x = wid->geometry().x(); 2844 x = wid->geometry().x();
2835 y = wid->geometry().y(); 2845 y = wid->geometry().y();
2836 w = wid->width(); 2846 w = wid->width();
2837 h = wid->height(); 2847 h = wid->height();
2838 list.clear(); 2848 list.clear();
2839 list << QString::number( x ); 2849 list << QString::number( x );
2840 list << QString::number( y ); 2850 list << QString::number( y );
2841 list << QString::number( w ); 2851 list << QString::number( w );
2842 list << QString::number( h ); 2852 list << QString::number( h );
2843 config->writeEntry("SearchLayout",list ); 2853 config->writeEntry("SearchLayout",list );
2844 } 2854 }
2845#endif 2855#endif
2846 2856
2847 2857
2848 config->sync(); 2858 config->sync();
2849} 2859}
2850 2860
2851void CalendarView::readFilterSettings(KConfig *config) 2861void CalendarView::readFilterSettings(KConfig *config)
2852{ 2862{
2853 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2863 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2854 2864
2855 mFilters.clear(); 2865 mFilters.clear();
2856 2866
2857 config->setGroup("General"); 2867 config->setGroup("General");
2858 QStringList filterList = config->readListEntry("CalendarFilters"); 2868 QStringList filterList = config->readListEntry("CalendarFilters");
2859 2869
2860 QStringList::ConstIterator it = filterList.begin(); 2870 QStringList::ConstIterator it = filterList.begin();
2861 QStringList::ConstIterator end = filterList.end(); 2871 QStringList::ConstIterator end = filterList.end();
2862 while(it != end) { 2872 while(it != end) {
2863 // kdDebug() << " filter: " << (*it) << endl; 2873 // kdDebug() << " filter: " << (*it) << endl;
2864 2874
2865 CalFilter *filter; 2875 CalFilter *filter;
2866 filter = new CalFilter(*it); 2876 filter = new CalFilter(*it);
2867 config->setGroup("Filter_" + (*it).utf8()); 2877 config->setGroup("Filter_" + (*it).utf8());
2868 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2878 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2869 filter->setCriteria(config->readNumEntry("Criteria",0)); 2879 filter->setCriteria(config->readNumEntry("Criteria",0));
2870 filter->setCategoryList(config->readListEntry("CategoryList")); 2880 filter->setCategoryList(config->readListEntry("CategoryList"));
2871 mFilters.append(filter); 2881 mFilters.append(filter);
2872 2882
2873 ++it; 2883 ++it;
2874 } 2884 }
2875 2885
2876 if (mFilters.count() == 0) { 2886 if (mFilters.count() == 0) {
2877 CalFilter *filter = new CalFilter(i18n("Default")); 2887 CalFilter *filter = new CalFilter(i18n("Default"));
2878 mFilters.append(filter); 2888 mFilters.append(filter);
2879 } 2889 }
2880 mFilterView->updateFilters(); 2890 mFilterView->updateFilters();
2881 config->setGroup("FilterView"); 2891 config->setGroup("FilterView");
2882 2892
2883 mFilterView->blockSignals(true); 2893 mFilterView->blockSignals(true);
2884 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2894 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2885 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2895 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2886 mFilterView->blockSignals(false); 2896 mFilterView->blockSignals(false);
2887 // We do it manually to avoid it being done twice by the above calls 2897 // We do it manually to avoid it being done twice by the above calls
2888 updateFilter(); 2898 updateFilter();
2889} 2899}
2890 2900
2891void CalendarView::writeFilterSettings(KConfig *config) 2901void CalendarView::writeFilterSettings(KConfig *config)
2892{ 2902{
2893 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2903 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2894 2904
2895 QStringList filterList; 2905 QStringList filterList;
2896 2906
2897 CalFilter *filter = mFilters.first(); 2907 CalFilter *filter = mFilters.first();
2898 while(filter) { 2908 while(filter) {
2899 // kdDebug() << " fn: " << filter->name() << endl; 2909 // kdDebug() << " fn: " << filter->name() << endl;
2900 filterList << filter->name(); 2910 filterList << filter->name();
2901 config->setGroup("Filter_" + filter->name().utf8()); 2911 config->setGroup("Filter_" + filter->name().utf8());
2902 config->writeEntry("Criteria",filter->criteria()); 2912 config->writeEntry("Criteria",filter->criteria());
2903 config->writeEntry("CategoryList",filter->categoryList()); 2913 config->writeEntry("CategoryList",filter->categoryList());
2904 filter = mFilters.next(); 2914 filter = mFilters.next();
2905 } 2915 }
2906 config->setGroup("General"); 2916 config->setGroup("General");
2907 config->writeEntry("CalendarFilters",filterList); 2917 config->writeEntry("CalendarFilters",filterList);
2908 2918
2909 config->setGroup("FilterView"); 2919 config->setGroup("FilterView");
2910 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2920 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2911 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2921 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2912} 2922}
2913 2923
2914 2924
2915void CalendarView::goToday() 2925void CalendarView::goToday()
2916{ 2926{
2917 if ( mViewManager->currentView()->isMonthView() ) 2927 if ( mViewManager->currentView()->isMonthView() )
2918 mNavigator->selectTodayMonth(); 2928 mNavigator->selectTodayMonth();
2919 else 2929 else
2920 mNavigator->selectToday(); 2930 mNavigator->selectToday();
2921} 2931}
2922 2932
2923void CalendarView::goNext() 2933void CalendarView::goNext()
2924{ 2934{
2925 mNavigator->selectNext(); 2935 mNavigator->selectNext();
2926} 2936}
2927 2937
2928void CalendarView::goPrevious() 2938void CalendarView::goPrevious()
2929{ 2939{
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 94bc4c1..9c55e9f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -125,780 +125,788 @@ class KOex2phonePrefs : public QDialog
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 ); 357 processIncidenceSelection( 0 );
358 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 358 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
359 SLOT( processIncidenceSelection( Incidence * ) ) ); 359 SLOT( processIncidenceSelection( Incidence * ) ) );
360 connect( mView, SIGNAL( modifiedChanged( bool ) ), 360 connect( mView, SIGNAL( modifiedChanged( bool ) ),
361 SLOT( slotModifiedChanged( bool ) ) ); 361 SLOT( slotModifiedChanged( bool ) ) );
362 362
363 363
364 connect( mView, SIGNAL( tempDisableBR(bool) ), 364 connect( mView, SIGNAL( tempDisableBR(bool) ),
365 SLOT( disableBR(bool) ) ); 365 SLOT( disableBR(bool) ) );
366 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 366 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
367 mView->setModified( false ); 367 mView->setModified( false );
368 mBlockAtStartup = false; 368 mBlockAtStartup = false;
369 mView->setModified( false ); 369 mView->setModified( false );
370 setCentralWidget( mView ); 370 setCentralWidget( mView );
371 globalFlagBlockStartup = 0; 371 globalFlagBlockStartup = 0;
372 mView->show(); 372 mView->show();
373 delete splash; 373 delete splash;
374 if ( newFile ) 374 if ( newFile )
375 mView->updateConfig(); 375 mView->updateConfig();
376 // qApp->processEvents(); 376 // qApp->processEvents();
377 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 377 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
378 //fillSyncMenu(); 378 //fillSyncMenu();
379 379
380 380
381 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 381 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
382 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 382 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
383 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 383 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
384 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 384 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
385 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 385 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
386 mSyncManager->setDefaultFileName( sentSyncFile()); 386 mSyncManager->setDefaultFileName( sentSyncFile());
387 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 387 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
388 mSyncManager->fillSyncMenu(); 388 mSyncManager->fillSyncMenu();
389 389
390 390
391 391
392 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 392 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
393 if ( showWarning ) { 393 if ( showWarning ) {
394 KMessageBox::information( this, 394 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"); 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");
396 qApp->processEvents(); 396 qApp->processEvents();
397 mView->dialogManager()->showSyncOptions(); 397 mView->dialogManager()->showSyncOptions();
398 } 398 }
399 399
400 //US listen for result adressed from Ka/Pi 400 //US listen for result adressed from Ka/Pi
401#ifndef DESKTOP_VERSION 401#ifndef DESKTOP_VERSION
402 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 402 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
403#endif 403#endif
404#ifndef DESKTOP_VERSION 404#ifndef DESKTOP_VERSION
405 infrared = 0; 405 infrared = 0;
406#endif 406#endif
407 updateFilterToolbar(); 407 updateFilterToolbar();
408 updateWeek( mView->startDate() ); 408 updateWeek( mView->startDate() );
409 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 409 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
410 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 410 SLOT( updateWeekNum( const KCal::DateList & ) ) );
411 mBRdisabled = false; 411 mBRdisabled = false;
412 //toggleBeamReceive(); 412 //toggleBeamReceive();
413 413
414 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 414 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
415} 415}
416MainWindow::~MainWindow() 416MainWindow::~MainWindow()
417{ 417{
418 //qDebug("MainWindow::~MainWindow() "); 418 //qDebug("MainWindow::~MainWindow() ");
419 //save toolbar location 419 //save toolbar location
420 delete mCalendar; 420 delete mCalendar;
421 delete mSyncManager; 421 delete mSyncManager;
422#ifndef DESKTOP_VERSION 422#ifndef DESKTOP_VERSION
423 if ( infrared ) 423 if ( infrared )
424 delete infrared; 424 delete infrared;
425#endif 425#endif
426 426
427 427
428} 428}
429void MainWindow::slotResetFocus() 429void MainWindow::slotResetFocus()
430{ 430{
431 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); 431 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
432 mFocusLoop = 3; 432 mFocusLoop = 3;
433 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 433 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
434} 434}
435void MainWindow::slotResetFocusLoop() 435void MainWindow::slotResetFocusLoop()
436{ 436{
437 --mFocusLoop; 437 --mFocusLoop;
438 QWidget* fw = mView->viewManager()->currentView(); 438 QWidget* fw = mView->viewManager()->currentView();
439 if ( fw ) { 439 if ( fw ) {
440 //qDebug("loop "); 440 //qDebug("loop ");
441 fw->setFocus(); 441 fw->setFocus();
442 if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) 442 if ( qApp->focusWidget() != fw && mFocusLoop > 0 )
443 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 443 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
444 } 444 }
445 445
446} 446}
447void MainWindow::disableBR(bool b) 447void MainWindow::disableBR(bool b)
448{ 448{
449#ifndef DESKTOP_VERSION 449#ifndef DESKTOP_VERSION
450 if ( b ) { 450 if ( b ) {
451 if ( infrared ) { 451 if ( infrared ) {
452 toggleBeamReceive(); 452 toggleBeamReceive();
453 mBRdisabled = true; 453 mBRdisabled = true;
454 } 454 }
455 mBRdisabled = true; 455 mBRdisabled = true;
456 } else { 456 } else {
457 if ( mBRdisabled ) { 457 if ( mBRdisabled ) {
458 mBRdisabled = false; 458 mBRdisabled = false;
459 //makes no sense,because other cal ap is probably running 459 //makes no sense,because other cal ap is probably running
460 // toggleBeamReceive(); 460 // toggleBeamReceive();
461 } 461 }
462 } 462 }
463#endif 463#endif
464 464
465} 465}
466bool MainWindow::beamReceiveEnabled() 466bool MainWindow::beamReceiveEnabled()
467{ 467{
468#ifndef DESKTOP_VERSION 468#ifndef DESKTOP_VERSION
469 return ( infrared != 0 ); 469 return ( infrared != 0 );
470#endif 470#endif
471 return false; 471 return false;
472} 472}
473 473
474void MainWindow::toggleBeamReceive() 474void MainWindow::toggleBeamReceive()
475{ 475{
476 if ( mBRdisabled ) 476 if ( mBRdisabled )
477 return; 477 return;
478#ifndef DESKTOP_VERSION 478#ifndef DESKTOP_VERSION
479 if ( infrared ) { 479 if ( infrared ) {
480 qDebug("KO: Disable BeamReceive "); 480 qDebug("KO: Disable BeamReceive ");
481 delete infrared; 481 delete infrared;
482 infrared = 0; 482 infrared = 0;
483 brAction->setOn(false); 483 brAction->setOn(false);
484 return; 484 return;
485 } 485 }
486 qDebug("KO: Enable BeamReceive "); 486 qDebug("KO: Enable BeamReceive ");
487 brAction->setOn(true); 487 brAction->setOn(true);
488 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 488 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& ))); 489 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
490#endif 490#endif
491} 491}
492void MainWindow::showMaximized () 492void MainWindow::showMaximized ()
493{ 493{
494#ifndef DESKTOP_VERSION 494#ifndef DESKTOP_VERSION
495 if ( ! globalFlagBlockStartup ) 495 if ( ! globalFlagBlockStartup )
496 if ( mClosed ) 496 if ( mClosed )
497 mView->goToday(); 497 mView->goToday();
498#endif 498#endif
499 QWidget::showMaximized () ; 499 QWidget::showMaximized () ;
500 mClosed = false; 500 mClosed = false;
501} 501}
502void MainWindow::closeEvent( QCloseEvent* ce ) 502void MainWindow::closeEvent( QCloseEvent* ce )
503{ 503{
504 504
505 505
506 506
507 if ( ! KOPrefs::instance()->mAskForQuit ) { 507 if ( ! KOPrefs::instance()->mAskForQuit ) {
508 saveOnClose(); 508 saveOnClose();
509 if ( mCalendarModifiedFlag ) {
510 ce->ignore();
511 return;
512 }
509 mClosed = true; 513 mClosed = true;
510 ce->accept(); 514 ce->accept();
511 return; 515 return;
512 516
513 } 517 }
514 518
515 switch( QMessageBox::information( this, "KO/Pi", 519 switch( QMessageBox::information( this, "KO/Pi",
516 i18n("Do you really want\nto close KO/Pi?"), 520 i18n("Do you really want\nto close KO/Pi?"),
517 i18n("Close"), i18n("No"), 521 i18n("Close"), i18n("No"),
518 0, 0 ) ) { 522 0, 0 ) ) {
519 case 0: 523 case 0:
520 saveOnClose(); 524 saveOnClose();
525 if ( mCalendarModifiedFlag ) {
526 ce->ignore();
527 return;
528 }
521 mClosed = true; 529 mClosed = true;
522 ce->accept(); 530 ce->accept();
523 break; 531 break;
524 case 1: 532 case 1:
525 ce->ignore(); 533 ce->ignore();
526 break; 534 break;
527 case 2: 535 case 2:
528 536
529 default: 537 default:
530 break; 538 break;
531 } 539 }
532 540
533 541
534} 542}
535 543
536void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 544void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
537{ 545{
538 QDataStream stream( data, IO_ReadOnly ); 546 QDataStream stream( data, IO_ReadOnly );
539 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 547 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
540 //QString datamess; 548 //QString datamess;
541 //qDebug("message "); 549 //qDebug("message ");
542 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 550 qDebug("KO: QCOP message received: %s ", cmsg.data() );
543 551
544 if ( cmsg == "setDocument(QString)" ) { 552 if ( cmsg == "setDocument(QString)" ) {
545 QDataStream stream( data, IO_ReadOnly ); 553 QDataStream stream( data, IO_ReadOnly );
546 QString fileName; 554 QString fileName;
547 stream >> fileName; 555 stream >> fileName;
548 //qDebug("filename %s ", fileName.latin1()); 556 //qDebug("filename %s ", fileName.latin1());
549 showMaximized(); 557 showMaximized();
550 raise(); 558 raise();
551 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 559 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
552 mSyncManager->slotSyncMenu( 1002 ); 560 mSyncManager->slotSyncMenu( 1002 );
553 return; 561 return;
554 } 562 }
555 563
556 if ( cmsg == "-writeFile" ) { 564 if ( cmsg == "-writeFile" ) {
557 // I made from the "-writeFile" an "-writeAlarm" 565 // I made from the "-writeFile" an "-writeAlarm"
558 mView->viewManager()->showWhatsNextView(); 566 mView->viewManager()->showWhatsNextView();
559 mCalendar->checkAlarmForIncidence( 0, true); 567 mCalendar->checkAlarmForIncidence( 0, true);
560 showMaximized(); 568 showMaximized();
561 raise(); 569 raise();
562 return; 570 return;
563 571
564 } 572 }
565 if ( cmsg == "-writeFileSilent" ) { 573 if ( cmsg == "-writeFileSilent" ) {
566 // I made from the "-writeFile" an "-writeAlarm" 574 // I made from the "-writeFile" an "-writeAlarm"
567 // mView->viewManager()->showWhatsNextView(); 575 // mView->viewManager()->showWhatsNextView();
568 mCalendar->checkAlarmForIncidence( 0, true); 576 mCalendar->checkAlarmForIncidence( 0, true);
569 //showMaximized(); 577 //showMaximized();
570 //raise(); 578 //raise();
571 hide(); 579 hide();
572 return; 580 return;
573 } 581 }
574 if ( cmsg == "-newCountdown" ) { 582 if ( cmsg == "-newCountdown" ) {
575 qDebug("newCountdown "); 583 qDebug("newCountdown ");
576 584
577 } 585 }
578 QString msg ; 586 QString msg ;
579 QString allmsg = cmsg; 587 QString allmsg = cmsg;
580 while ( allmsg.length() > 0 ) { 588 while ( allmsg.length() > 0 ) {
581 int nextC = allmsg.find( "-", 1 ); 589 int nextC = allmsg.find( "-", 1 );
582 if ( nextC == -1 ) { 590 if ( nextC == -1 ) {
583 msg = allmsg; 591 msg = allmsg;
584 allmsg = ""; 592 allmsg = "";
585 } else{ 593 } else{
586 msg = allmsg.left( nextC ); 594 msg = allmsg.left( nextC );
587 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 595 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
588 } 596 }
589 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 597 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
590 if ( msg == "-newEvent" ) { 598 if ( msg == "-newEvent" ) {
591 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 599 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
592 } 600 }
593 if ( msg == "-newTodo" ) { 601 if ( msg == "-newTodo" ) {
594 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 602 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
595 } 603 }
596 if ( msg == "-showWN" ) { 604 if ( msg == "-showWN" ) {
597 mView->viewManager()->showWhatsNextView(); 605 mView->viewManager()->showWhatsNextView();
598 } 606 }
599 if ( msg == "-showTodo" ) { 607 if ( msg == "-showTodo" ) {
600 mView->viewManager()->showTodoView(); 608 mView->viewManager()->showTodoView();
601 } 609 }
602 if ( msg == "-showList" ) { 610 if ( msg == "-showList" ) {
603 mView->viewManager()->showListView(); 611 mView->viewManager()->showListView();
604 } 612 }
605 else if ( msg == "-showDay" ) { 613 else if ( msg == "-showDay" ) {
606 mView->viewManager()->showDayView(); 614 mView->viewManager()->showDayView();
607 } 615 }
608 else if ( msg == "-showWWeek" ) { 616 else if ( msg == "-showWWeek" ) {
609 mView->viewManager()->showWorkWeekView(); 617 mView->viewManager()->showWorkWeekView();
610 } 618 }
611 else if ( msg == "-ringSync" ) { 619 else if ( msg == "-ringSync" ) {
612 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 620 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
613 } 621 }
614 else if ( msg == "-showWeek" ) { 622 else if ( msg == "-showWeek" ) {
615 mView->viewManager()->showWeekView(); 623 mView->viewManager()->showWeekView();
616 } 624 }
617 else if ( msg == "-showTodo" ) { 625 else if ( msg == "-showTodo" ) {
618 mView->viewManager()->showTodoView(); 626 mView->viewManager()->showTodoView();
619 } 627 }
620 else if ( msg == "-showJournal" ) { 628 else if ( msg == "-showJournal" ) {
621 mView->dateNavigator()->selectDates( 1 ); 629 mView->dateNavigator()->selectDates( 1 );
622 mView->dateNavigator()->selectToday(); 630 mView->dateNavigator()->selectToday();
623 mView->viewManager()->showJournalView(); 631 mView->viewManager()->showJournalView();
624 } 632 }
625 else if ( msg == "-showKO" ) { 633 else if ( msg == "-showKO" ) {
626 mView->viewManager()->showNextXView(); 634 mView->viewManager()->showNextXView();
627 } 635 }
628 else if ( msg == "-showWNext" ) { 636 else if ( msg == "-showWNext" ) {
629 mView->viewManager()->showWhatsNextView(); 637 mView->viewManager()->showWhatsNextView();
630 } 638 }
631 else if ( msg == "nextView()" ) { 639 else if ( msg == "nextView()" ) {
632 mView->viewManager()->showNextView(); 640 mView->viewManager()->showNextView();
633 } 641 }
634 else if ( msg == "-showNextXView" ) { 642 else if ( msg == "-showNextXView" ) {
635 mView->viewManager()->showNextXView(); 643 mView->viewManager()->showNextXView();
636 } 644 }
637 645
638 646
639 } 647 }
640 648
641 showMaximized(); 649 showMaximized();
642 raise(); 650 raise();
643} 651}
644void MainWindow::startMultiSync() 652void MainWindow::startMultiSync()
645{ 653{
646 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 654 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
647 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 655 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
648 question, 656 question,
649 i18n("Yes"), i18n("No"), 657 i18n("Yes"), i18n("No"),
650 0, 0 ) != 0 ) { 658 0, 0 ) != 0 ) {
651 setCaption(i18n("Aborted! Nothing synced!")); 659 setCaption(i18n("Aborted! Nothing synced!"));
652 return; 660 return;
653 } 661 }
654 mSyncManager->multiSync( false ); 662 mSyncManager->multiSync( false );
655#ifndef DESKTOP_VERSION 663#ifndef DESKTOP_VERSION
656 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 664 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
657#endif 665#endif
658} 666}
659QPixmap MainWindow::loadPixmap( QString name ) 667QPixmap MainWindow::loadPixmap( QString name )
660{ 668{
661 return SmallIcon( name ); 669 return SmallIcon( name );
662 670
663} 671}
664void MainWindow::setUsesBigPixmaps ( bool b ) 672void MainWindow::setUsesBigPixmaps ( bool b )
665{ 673{
666 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 674 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
667 if ( b ) 675 if ( b )
668 qDebug("KO: BigPixmaps are not supported "); 676 qDebug("KO: BigPixmaps are not supported ");
669} 677}
670void MainWindow::initActions() 678void MainWindow::initActions()
671{ 679{
672 //KOPrefs::instance()->mShowFullMenu 680 //KOPrefs::instance()->mShowFullMenu
673 iconToolBar->clear(); 681 iconToolBar->clear();
674 KOPrefs *p = KOPrefs::instance(); 682 KOPrefs *p = KOPrefs::instance();
675 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 683 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
676 684
677 QPopupMenu *viewMenu = new QPopupMenu( this ); 685 QPopupMenu *viewMenu = new QPopupMenu( this );
678 QPopupMenu *actionMenu = new QPopupMenu( this ); 686 QPopupMenu *actionMenu = new QPopupMenu( this );
679 mCurrentItemMenu = new QPopupMenu ( this ); 687 mCurrentItemMenu = new QPopupMenu ( this );
680 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 688 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
681 QPopupMenu *importMenu = new QPopupMenu( this ); 689 QPopupMenu *importMenu = new QPopupMenu( this );
682 QPopupMenu *importMenu_X = new QPopupMenu( this ); 690 QPopupMenu *importMenu_X = new QPopupMenu( this );
683 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 691 QPopupMenu *exportMenu_X = new QPopupMenu( this );
684 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 692 QPopupMenu *beamMenu_X = new QPopupMenu( this );
685 selectFilterMenu = new QPopupMenu( this ); 693 selectFilterMenu = new QPopupMenu( this );
686 selectFilterMenu->setCheckable( true ); 694 selectFilterMenu->setCheckable( true );
687 syncMenu = new QPopupMenu( this ); 695 syncMenu = new QPopupMenu( this );
688 configureAgendaMenu = new QPopupMenu( this ); 696 configureAgendaMenu = new QPopupMenu( this );
689 configureToolBarMenu = new QPopupMenu( this ); 697 configureToolBarMenu = new QPopupMenu( this );
690 QPopupMenu *helpMenu = new QPopupMenu( this ); 698 QPopupMenu *helpMenu = new QPopupMenu( this );
691 QIconSet icon; 699 QIconSet icon;
692 int pixWid = 22, pixHei = 22; 700 int pixWid = 22, pixHei = 22;
693 QString pathString = ""; 701 QString pathString = "";
694 if ( !p->mToolBarMiniIcons ) { 702 if ( !p->mToolBarMiniIcons ) {
695 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 703 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
696 pathString += "icons16/"; 704 pathString += "icons16/";
697 pixWid = 18; pixHei = 16; 705 pixWid = 18; pixHei = 16;
698 } 706 }
699 } else { 707 } else {
700 pathString += "iconsmini/"; 708 pathString += "iconsmini/";
701 pixWid = 18; pixHei = 16; 709 pixWid = 18; pixHei = 16;
702 } 710 }
703 711
704 if ( KOPrefs::instance()->mShowFullMenu ) { 712 if ( KOPrefs::instance()->mShowFullMenu ) {
705 menuBar1 = new KMenuBar( this );//menuBar(); 713 menuBar1 = new KMenuBar( this );//menuBar();
706 //setMenuBar( menuBar1 ); 714 //setMenuBar( menuBar1 );
707 menuBar1->show(); 715 menuBar1->show();
708 menuBar1->insertItem( i18n("File"), importMenu ); 716 menuBar1->insertItem( i18n("File"), importMenu );
709 menuBar1->insertItem( i18n("View"), viewMenu ); 717 menuBar1->insertItem( i18n("View"), viewMenu );
710 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 718 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
711 menuBar1->insertItem( i18n("Action"), actionMenu ); 719 menuBar1->insertItem( i18n("Action"), actionMenu );
712#ifdef DESKTOP_VERSION 720#ifdef DESKTOP_VERSION
713 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 721 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
714 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 722 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
715#else 723#else
716 menuBar1->insertItem( i18n("Sync"), syncMenu ); 724 menuBar1->insertItem( i18n("Sync"), syncMenu );
717 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 725 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
718#endif 726#endif
719 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 727 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
720 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 728 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
721 menuBar1->insertItem( i18n("Help"), helpMenu ); 729 menuBar1->insertItem( i18n("Help"), helpMenu );
722 } else { 730 } else {
723 menuBar1 = new KMenuBar( iconToolBar ); 731 menuBar1 = new KMenuBar( iconToolBar );
724 QPopupMenu *menuBar = new QPopupMenu( this ); 732 QPopupMenu *menuBar = new QPopupMenu( this );
725 icon = loadPixmap( pathString + "z_menu" ); 733 icon = loadPixmap( pathString + "z_menu" );
726 menuBar1->insertItem( icon.pixmap(), menuBar); 734 menuBar1->insertItem( icon.pixmap(), menuBar);
727 //menuBar1->insertItem( i18n("ME"), menuBar); 735 //menuBar1->insertItem( i18n("ME"), menuBar);
728 menuBar->insertItem( i18n("File"), importMenu ); 736 menuBar->insertItem( i18n("File"), importMenu );
729 menuBar->insertItem( i18n("View"), viewMenu ); 737 menuBar->insertItem( i18n("View"), viewMenu );
730 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 738 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
731 menuBar->insertItem( i18n("Action"), actionMenu ); 739 menuBar->insertItem( i18n("Action"), actionMenu );
732 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 740 menuBar->insertItem( i18n("Synchronize"), syncMenu );
733 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 741 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
734 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 742 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
735 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 743 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
736 menuBar->insertItem( i18n("Help"), helpMenu ); 744 menuBar->insertItem( i18n("Help"), helpMenu );
737 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 745 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
738 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 746 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
739 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); 747 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) );
740 } 748 }
741 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 749 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
742 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 750 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
743 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 751 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
744 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 752 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
745 753
746 754
747 mWeekBgColor = iconToolBar->backgroundColor(); 755 mWeekBgColor = iconToolBar->backgroundColor();
748 mWeekPixmap.resize( pixWid , pixHei ); 756 mWeekPixmap.resize( pixWid , pixHei );
749 mWeekPixmap.fill( mWeekBgColor ); 757 mWeekPixmap.fill( mWeekBgColor );
750 icon = mWeekPixmap; 758 icon = mWeekPixmap;
751 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 759 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
752 if ( p-> mShowIconWeekNum ) 760 if ( p-> mShowIconWeekNum )
753 mWeekAction->addTo( iconToolBar ); 761 mWeekAction->addTo( iconToolBar );
754 mWeekFont = font(); 762 mWeekFont = font();
755 763
756 int fontPoint = mWeekFont.pointSize(); 764 int fontPoint = mWeekFont.pointSize();
757 QFontMetrics f( mWeekFont ); 765 QFontMetrics f( mWeekFont );
758 int fontWid = f.width( "30" ); 766 int fontWid = f.width( "30" );
759 while ( fontWid > pixWid ) { 767 while ( fontWid > pixWid ) {
760 --fontPoint; 768 --fontPoint;
761 mWeekFont.setPointSize( fontPoint ); 769 mWeekFont.setPointSize( fontPoint );
762 QFontMetrics f( mWeekFont ); 770 QFontMetrics f( mWeekFont );
763 fontWid = f.width( "30" ); 771 fontWid = f.width( "30" );
764 //qDebug("dec-- "); 772 //qDebug("dec-- ");
765 } 773 }
766 774
767 connect( mWeekAction, SIGNAL( activated() ), 775 connect( mWeekAction, SIGNAL( activated() ),
768 this, SLOT( weekAction() ) ); 776 this, SLOT( weekAction() ) );
769 777
770 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 778 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
771 if ( p->mShowIconFilterview ) { 779 if ( p->mShowIconFilterview ) {
772 icon = loadPixmap( pathString + "filter" ); 780 icon = loadPixmap( pathString + "filter" );
773 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 781 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
774 connect( actionFilterMenuTB, SIGNAL( activated() ), 782 connect( actionFilterMenuTB, SIGNAL( activated() ),
775 this, SLOT( fillFilterMenuTB() ) ); 783 this, SLOT( fillFilterMenuTB() ) );
776 actionFilterMenuTB->addTo( iconToolBar ); 784 actionFilterMenuTB->addTo( iconToolBar );
777 selectFilterMenuTB = new QPopupMenu( this ); 785 selectFilterMenuTB = new QPopupMenu( this );
778 selectFilterMenuTB->setCheckable( true ); 786 selectFilterMenuTB->setCheckable( true );
779 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 787 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
780 } 788 }
781 789
782 //#endif 790 //#endif
783 // ****************** 791 // ******************
784 QAction *action; 792 QAction *action;
785 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 793 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
786 configureToolBarMenu->setCheckable( true ); 794 configureToolBarMenu->setCheckable( true );
787 795
788 796
789 configureAgendaMenu->setCheckable( true ); 797 configureAgendaMenu->setCheckable( true );
790 int iii ; 798 int iii ;
791 for ( iii = 1;iii<= 10 ;++iii ){ 799 for ( iii = 1;iii<= 10 ;++iii ){
792 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 800 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
793 } 801 }
794 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 802 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
795 803
796 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 804 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
797 this, SLOT( showConfigureAgenda( ) ) ); 805 this, SLOT( showConfigureAgenda( ) ) );
798 icon = loadPixmap( pathString + "today" ); 806 icon = loadPixmap( pathString + "today" );
799 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 807 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
800 today_action->addTo( actionMenu ); 808 today_action->addTo( actionMenu );
801 connect( today_action, SIGNAL( activated() ), 809 connect( today_action, SIGNAL( activated() ),
802 mView, SLOT( goToday() ) ); 810 mView, SLOT( goToday() ) );
803 811
804 icon = loadPixmap( pathString + "picker" ); 812 icon = loadPixmap( pathString + "picker" );
805 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 813 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
806 dPickerAction->addTo( actionMenu ); 814 dPickerAction->addTo( actionMenu );
807 connect( dPickerAction, SIGNAL( activated() ), 815 connect( dPickerAction, SIGNAL( activated() ),
808 mView, SLOT( showDatePicker() ) ); 816 mView, SLOT( showDatePicker() ) );
809 817
810 icon = loadPixmap( pathString + "search" ); 818 icon = loadPixmap( pathString + "search" );
811 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 819 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
812 search_action->addTo( actionMenu ); 820 search_action->addTo( actionMenu );
813 connect( search_action, SIGNAL( activated() ), 821 connect( search_action, SIGNAL( activated() ),
814 mView->dialogManager(), SLOT( showSearchDialog() ) ); 822 mView->dialogManager(), SLOT( showSearchDialog() ) );
815 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 823 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
816 824
817 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 825 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
818 action->addTo( nextConflictMenu ); 826 action->addTo( nextConflictMenu );
819 connect( action, SIGNAL( activated() ), 827 connect( action, SIGNAL( activated() ),
820 mView, SLOT( conflictAll() ) ); 828 mView, SLOT( conflictAll() ) );
821 829
822 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 830 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
823 action->addTo( nextConflictMenu ); 831 action->addTo( nextConflictMenu );
824 connect( action, SIGNAL( activated() ), 832 connect( action, SIGNAL( activated() ),
825 mView, SLOT( conflictAllday() ) ); 833 mView, SLOT( conflictAllday() ) );
826 834
827 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 835 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
828 action->addTo( nextConflictMenu ); 836 action->addTo( nextConflictMenu );
829 connect( action, SIGNAL( activated() ), 837 connect( action, SIGNAL( activated() ),
830 mView, SLOT( conflictNotAll() ) ); 838 mView, SLOT( conflictNotAll() ) );
831 839
832 actionMenu->insertSeparator(); 840 actionMenu->insertSeparator();
833 841
834 icon = loadPixmap( pathString + "newevent" ); 842 icon = loadPixmap( pathString + "newevent" );
835 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 843 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
836 ne_action->addTo( mCurrentItemMenu ); 844 ne_action->addTo( mCurrentItemMenu );
837 connect( ne_action, SIGNAL( activated() ), 845 connect( ne_action, SIGNAL( activated() ),
838 mView, SLOT( newEvent() ) ); 846 mView, SLOT( newEvent() ) );
839 icon = loadPixmap( pathString + "newtodo" ); 847 icon = loadPixmap( pathString + "newtodo" );
840 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 848 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
841 nt_action->addTo( mCurrentItemMenu ); 849 nt_action->addTo( mCurrentItemMenu );
842 connect( nt_action, SIGNAL( activated() ), 850 connect( nt_action, SIGNAL( activated() ),
843 mView, SLOT( newTodo() ) ); 851 mView, SLOT( newTodo() ) );
844 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 852 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
845 this ); 853 this );
846 mNewSubTodoAction->addTo( mCurrentItemMenu ); 854 mNewSubTodoAction->addTo( mCurrentItemMenu );
847 connect( mNewSubTodoAction, SIGNAL( activated() ), 855 connect( mNewSubTodoAction, SIGNAL( activated() ),
848 mView, SLOT( newSubTodo() ) ); 856 mView, SLOT( newSubTodo() ) );
849 857
850 mCurrentItemMenu->insertSeparator(); 858 mCurrentItemMenu->insertSeparator();
851 icon = loadPixmap( pathString + "newevent" ); 859 icon = loadPixmap( pathString + "newevent" );
852 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 860 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
853 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 861 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
854 configureToolBarMenu->insertSeparator(); 862 configureToolBarMenu->insertSeparator();
855 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 863 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
856 configureToolBarMenu->insertSeparator(); 864 configureToolBarMenu->insertSeparator();
857 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 865 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
858 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 866 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
859 icon = loadPixmap( pathString + "newtodo" ); 867 icon = loadPixmap( pathString + "newtodo" );
860 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 868 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
861 869
862 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 870 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
863 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 871 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
864 mShowAction->addTo( mCurrentItemMenu ); 872 mShowAction->addTo( mCurrentItemMenu );
865 connect( mShowAction, SIGNAL( activated() ), 873 connect( mShowAction, SIGNAL( activated() ),
866 mView, SLOT( showIncidence() ) ); 874 mView, SLOT( showIncidence() ) );
867 875
868 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 876 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
869 mEditAction->addTo( mCurrentItemMenu ); 877 mEditAction->addTo( mCurrentItemMenu );
870 connect( mEditAction, SIGNAL( activated() ), 878 connect( mEditAction, SIGNAL( activated() ),
871 mView, SLOT( editIncidence() ) ); 879 mView, SLOT( editIncidence() ) );
872 880
873 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 881 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
874 mDeleteAction->addTo( mCurrentItemMenu ); 882 mDeleteAction->addTo( mCurrentItemMenu );
875 connect( mDeleteAction, SIGNAL( activated() ), 883 connect( mDeleteAction, SIGNAL( activated() ),
876 mView, SLOT( deleteIncidence() ) ); 884 mView, SLOT( deleteIncidence() ) );
877 885
878 886
879 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 887 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
880 mCloneAction->addTo( mCurrentItemMenu ); 888 mCloneAction->addTo( mCurrentItemMenu );
881 connect( mCloneAction, SIGNAL( activated() ), 889 connect( mCloneAction, SIGNAL( activated() ),
882 mView, SLOT( cloneIncidence() ) ); 890 mView, SLOT( cloneIncidence() ) );
883 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 891 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
884 mMoveAction->addTo( mCurrentItemMenu ); 892 mMoveAction->addTo( mCurrentItemMenu );
885 connect( mMoveAction, SIGNAL( activated() ), 893 connect( mMoveAction, SIGNAL( activated() ),
886 mView, SLOT( moveIncidence() ) ); 894 mView, SLOT( moveIncidence() ) );
887#ifndef DESKTOP_VERSION 895#ifndef DESKTOP_VERSION
888 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 896 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
889 mBeamAction->addTo(mCurrentItemMenu ); 897 mBeamAction->addTo(mCurrentItemMenu );
890 connect( mBeamAction, SIGNAL( activated() ), 898 connect( mBeamAction, SIGNAL( activated() ),
891 mView, SLOT( beamIncidence() ) ); 899 mView, SLOT( beamIncidence() ) );
892#endif 900#endif
893 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 901 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
894 mCancelAction->addTo( mCurrentItemMenu ); 902 mCancelAction->addTo( mCurrentItemMenu );
895 connect( mCancelAction, SIGNAL( activated() ), 903 connect( mCancelAction, SIGNAL( activated() ),
896 mView, SLOT( toggleCancelIncidence() ) ); 904 mView, SLOT( toggleCancelIncidence() ) );
897 905
898 906
899 mCurrentItemMenu->insertSeparator(); 907 mCurrentItemMenu->insertSeparator();
900 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 908 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
901 action->addTo( mCurrentItemMenu ); 909 action->addTo( mCurrentItemMenu );
902 connect( action, SIGNAL( activated() ), 910 connect( action, SIGNAL( activated() ),
903 mView, SLOT( undo_delete() ) ); 911 mView, SLOT( undo_delete() ) );
904 912
@@ -1621,770 +1629,770 @@ void MainWindow::keyBindings()
1621 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1629 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1622 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1630 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1623 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1631 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1624 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1632 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1625 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1633 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1626 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1634 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1627 i18n("<p><h3>In agenda view:</h3></p>\n") + 1635 i18n("<p><h3>In agenda view:</h3></p>\n") +
1628 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1636 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1629 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1637 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1630 i18n("<p><h3>In todo view:</h3></p>\n") + 1638 i18n("<p><h3>In todo view:</h3></p>\n") +
1631 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1639 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1632 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1640 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1633 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1641 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1634 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1642 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1635 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1643 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1636 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1644 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1637 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1645 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1638 i18n("<p><h3>In list view:</h3></p>\n") + 1646 i18n("<p><h3>In list view:</h3></p>\n") +
1639 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1647 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1640 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1648 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1641 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1649 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1642 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1650 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1643 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1651 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1644 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1652 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1645 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1653 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1646 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1654 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1647 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1655 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1648 i18n("<p><b>E</b>: Edit item</p>\n") + 1656 i18n("<p><b>E</b>: Edit item</p>\n") +
1649 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1657 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1650 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1658 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1651 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1659 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1652 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1660 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1653 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1661 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1654 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1662 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1655 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1663 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1656 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1664 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1657 i18n("<p><b>White</b>: Item readonly</p>\n"); 1665 i18n("<p><b>White</b>: Item readonly</p>\n");
1658 displayText( text, cap); 1666 displayText( text, cap);
1659} 1667}
1660void MainWindow::aboutAutoSaving() 1668void MainWindow::aboutAutoSaving()
1661{ 1669{
1662 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1670 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1663 1671
1664 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1672 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1665 1673
1666} 1674}
1667void MainWindow::aboutKnownBugs() 1675void MainWindow::aboutKnownBugs()
1668{ 1676{
1669 QMessageBox* msg; 1677 QMessageBox* msg;
1670 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1678 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1671 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1679 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1672 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1680 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1673 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1681 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1674 i18n("\nor report them in the bugtracker on\n") + 1682 i18n("\nor report them in the bugtracker on\n") +
1675 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1683 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1676 QMessageBox::NoIcon, 1684 QMessageBox::NoIcon,
1677 QMessageBox::Ok, 1685 QMessageBox::Ok,
1678 QMessageBox::NoButton, 1686 QMessageBox::NoButton,
1679 QMessageBox::NoButton); 1687 QMessageBox::NoButton);
1680 msg->exec(); 1688 msg->exec();
1681 delete msg; 1689 delete msg;
1682 1690
1683} 1691}
1684 1692
1685QString MainWindow::defaultFileName() 1693QString MainWindow::defaultFileName()
1686{ 1694{
1687 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1695 return locateLocal( "data", "korganizer/mycalendar.ics" );
1688} 1696}
1689QString MainWindow::syncFileName() 1697QString MainWindow::syncFileName()
1690{ 1698{
1691#ifdef DESKTOP_VERSION 1699#ifdef DESKTOP_VERSION
1692 return locateLocal( "tmp", "synccalendar.ics" ); 1700 return locateLocal( "tmp", "synccalendar.ics" );
1693#else 1701#else
1694 return QString( "/tmp/synccalendar.ics" ); 1702 return QString( "/tmp/synccalendar.ics" );
1695#endif 1703#endif
1696} 1704}
1697#include "koglobals.h" 1705#include "koglobals.h"
1698#include <kcalendarsystem.h> 1706#include <kcalendarsystem.h>
1699void MainWindow::updateWeek(QDate seda) 1707void MainWindow::updateWeek(QDate seda)
1700{ 1708{
1701 int weekNum = KGlobal::locale()->weekNum ( seda ); 1709 int weekNum = KGlobal::locale()->weekNum ( seda );
1702 mWeekPixmap.fill( mWeekBgColor ); 1710 mWeekPixmap.fill( mWeekBgColor );
1703 QPainter p ( &mWeekPixmap ); 1711 QPainter p ( &mWeekPixmap );
1704 p.setFont( mWeekFont ); 1712 p.setFont( mWeekFont );
1705 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1713 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1706 p.end(); 1714 p.end();
1707 QIconSet icon3 ( mWeekPixmap ); 1715 QIconSet icon3 ( mWeekPixmap );
1708 mWeekAction->setIconSet ( icon3 ); 1716 mWeekAction->setIconSet ( icon3 );
1709 1717
1710} 1718}
1711void MainWindow::updateWeekNum(const DateList &selectedDates) 1719void MainWindow::updateWeekNum(const DateList &selectedDates)
1712{ 1720{
1713 updateWeek( selectedDates.first() ); 1721 updateWeek( selectedDates.first() );
1714} 1722}
1715void MainWindow::processIncidenceSelection( Incidence *incidence ) 1723void MainWindow::processIncidenceSelection( Incidence *incidence )
1716{ 1724{
1717 if ( !incidence ) { 1725 if ( !incidence ) {
1718 mShowAction->setMenuText( i18n("Show") ); 1726 mShowAction->setMenuText( i18n("Show") );
1719 enableIncidenceActions( false ); 1727 enableIncidenceActions( false );
1720 mNewSubTodoAction->setEnabled( false ); 1728 mNewSubTodoAction->setEnabled( false );
1721 setCaptionToDates(); 1729 setCaptionToDates();
1722 return; 1730 return;
1723 } 1731 }
1724 QString startString = ""; 1732 QString startString = "";
1725 if ( incidence->typeID() != todoID ) { 1733 if ( incidence->typeID() != todoID ) {
1726 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1734 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1727 if ( incidence->doesFloat() ) { 1735 if ( incidence->doesFloat() ) {
1728 startString += ": "+incidence->dtStartDateStr( true ); 1736 startString += ": "+incidence->dtStartDateStr( true );
1729 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1737 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1730 } else { 1738 } else {
1731 startString = ": "+incidence->dtStartStr(true); 1739 startString = ": "+incidence->dtStartStr(true);
1732 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1740 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1733 } 1741 }
1734 } else { 1742 } else {
1735 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1743 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1736 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1744 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1737 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1745 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1738 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1746 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1739 bool ok; 1747 bool ok;
1740 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1748 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1741 if ( ok ) { 1749 if ( ok ) {
1742 int years = noc.date().year() - incidence->dtStart().date().year(); 1750 int years = noc.date().year() - incidence->dtStart().date().year();
1743 startString += i18n(" (%1 y.)"). arg( years ); 1751 startString += i18n(" (%1 y.)"). arg( years );
1744 } 1752 }
1745 } 1753 }
1746 else 1754 else
1747 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1755 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1748 } 1756 }
1749 } 1757 }
1750 else { 1758 else {
1751 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) 1759 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1752 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); 1760 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
1753 else 1761 else
1754 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1762 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1755 } 1763 }
1756 if ( !incidence->location().isEmpty() ) 1764 if ( !incidence->location().isEmpty() )
1757 startString += " (" +incidence->location()+")"; 1765 startString += " (" +incidence->location()+")";
1758 setCaption( incidence->summary()+startString); 1766 setCaption( incidence->summary()+startString);
1759 enableIncidenceActions( true ); 1767 enableIncidenceActions( true );
1760 if ( incidence->typeID() == eventID ) { 1768 if ( incidence->typeID() == eventID ) {
1761 mShowAction->setMenuText( i18n("Show Event") ); 1769 mShowAction->setMenuText( i18n("Show Event") );
1762 mNewSubTodoAction->setEnabled( false ); 1770 mNewSubTodoAction->setEnabled( false );
1763 } else if ( incidence->typeID() == todoID ) { 1771 } else if ( incidence->typeID() == todoID ) {
1764 mShowAction->setMenuText( i18n("Show Todo") ); 1772 mShowAction->setMenuText( i18n("Show Todo") );
1765 mNewSubTodoAction->setEnabled( true ); 1773 mNewSubTodoAction->setEnabled( true );
1766 } else { 1774 } else {
1767 mShowAction->setMenuText( i18n("Show") ); 1775 mShowAction->setMenuText( i18n("Show") );
1768 mNewSubTodoAction->setEnabled( false ); 1776 mNewSubTodoAction->setEnabled( false );
1769 } 1777 }
1770#ifdef DESKTOP_VERSION 1778#ifdef DESKTOP_VERSION
1771 static QPixmap jP = SmallIcon( "journal" ); 1779 static QPixmap jP = SmallIcon( "journal" );
1772 static QPixmap eP = SmallIcon( "newevent" ); 1780 static QPixmap eP = SmallIcon( "newevent" );
1773 static QPixmap tP = SmallIcon( "newtodo" ); 1781 static QPixmap tP = SmallIcon( "newtodo" );
1774 QIconSet icon; 1782 QIconSet icon;
1775 if ( incidence->typeID() == todoID ) 1783 if ( incidence->typeID() == todoID )
1776 icon = QIconSet ( tP ); 1784 icon = QIconSet ( tP );
1777 else if ( incidence->typeID() == eventID ) 1785 else if ( incidence->typeID() == eventID )
1778 icon = QIconSet ( eP ); 1786 icon = QIconSet ( eP );
1779 else if ( incidence->typeID() == journalID ) 1787 else if ( incidence->typeID() == journalID )
1780 icon = QIconSet ( jP ); 1788 icon = QIconSet ( jP );
1781 mPrintSelAction->setIconSet ( icon ); 1789 mPrintSelAction->setIconSet ( icon );
1782#endif 1790#endif
1783} 1791}
1784 1792
1785void MainWindow::enableIncidenceActions( bool enabled ) 1793void MainWindow::enableIncidenceActions( bool enabled )
1786{ 1794{
1787 mShowAction->setEnabled( enabled ); 1795 mShowAction->setEnabled( enabled );
1788 mEditAction->setEnabled( enabled ); 1796 mEditAction->setEnabled( enabled );
1789 mDeleteAction->setEnabled( enabled ); 1797 mDeleteAction->setEnabled( enabled );
1790 1798
1791 mCloneAction->setEnabled( enabled ); 1799 mCloneAction->setEnabled( enabled );
1792 mMoveAction->setEnabled( enabled ); 1800 mMoveAction->setEnabled( enabled );
1793#ifndef DESKTOP_VERSION 1801#ifndef DESKTOP_VERSION
1794 mBeamAction->setEnabled( enabled ); 1802 mBeamAction->setEnabled( enabled );
1795#else 1803#else
1796 mPrintSelAction->setEnabled( enabled ); 1804 mPrintSelAction->setEnabled( enabled );
1797#endif 1805#endif
1798 mCancelAction->setEnabled( enabled ); 1806 mCancelAction->setEnabled( enabled );
1799} 1807}
1800 1808
1801void MainWindow::importOL() 1809void MainWindow::importOL()
1802{ 1810{
1803#ifdef _OL_IMPORT_ 1811#ifdef _OL_IMPORT_
1804 mView->clearAllViews(); 1812 mView->clearAllViews();
1805 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1813 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1806 id->exec(); 1814 id->exec();
1807 delete id; 1815 delete id;
1808 mView->calendar()->checkAlarmForIncidence( 0, true ); 1816 mView->calendar()->checkAlarmForIncidence( 0, true );
1809 mView->updateView(); 1817 mView->updateView();
1810#endif 1818#endif
1811} 1819}
1812void MainWindow::importBday() 1820void MainWindow::importBday()
1813{ 1821{
1814 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1822 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1815 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1823 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1816 i18n("Import!"), i18n("Cancel"), 0, 1824 i18n("Import!"), i18n("Cancel"), 0,
1817 0, 1 ); 1825 0, 1 );
1818 if ( result == 0 ) { 1826 if ( result == 0 ) {
1819 mView->importBday(); 1827 mView->importBday();
1820 1828
1821 } 1829 }
1822 1830
1823 1831
1824} 1832}
1825void MainWindow::importQtopia() 1833void MainWindow::importQtopia()
1826{ 1834{
1827 //#ifndef DESKTOP_VERSION 1835 //#ifndef DESKTOP_VERSION
1828 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1836 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1829#ifdef DESKTOP_VERSION 1837#ifdef DESKTOP_VERSION
1830 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1838 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1831#endif 1839#endif
1832 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1840 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1833 i18n("Import!"), i18n("Cancel"), 0, 1841 i18n("Import!"), i18n("Cancel"), 0,
1834 0, 1 ); 1842 0, 1 );
1835 if ( result == 0 ) { 1843 if ( result == 0 ) {
1836#ifndef DESKTOP_VERSION 1844#ifndef DESKTOP_VERSION
1837 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1845 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1838 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1846 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1839 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1847 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1840#else 1848#else
1841 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1849 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1842 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1850 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1843 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1851 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1844#endif 1852#endif
1845 mView->importQtopia( categories, datebook, todolist ); 1853 mView->importQtopia( categories, datebook, todolist );
1846 } 1854 }
1847 mView->calendar()->reInitAlarmSettings(); 1855 mView->calendar()->reInitAlarmSettings();
1848#if 0 1856#if 0
1849 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1857 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1850 i18n("Not supported \non desktop!\n"), 1858 i18n("Not supported \non desktop!\n"),
1851 i18n("Ok"), i18n("Cancel"), 0, 1859 i18n("Ok"), i18n("Cancel"), 0,
1852 0, 1 ); 1860 0, 1 );
1853 1861
1854#endif 1862#endif
1855} 1863}
1856 1864
1857void MainWindow::saveOnClose() 1865void MainWindow::saveOnClose()
1858{ 1866{
1859 KOPrefs *p = KOPrefs::instance(); 1867 KOPrefs *p = KOPrefs::instance();
1860 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1868 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1861 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1869 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1862 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1870 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1863 if ( filterToolBar ) { 1871 if ( filterToolBar ) {
1864 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1872 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1865 } 1873 }
1866#ifdef DESKTOP_VERSION 1874#ifdef DESKTOP_VERSION
1867 1875
1868 QPoint myP; 1876 QPoint myP;
1869 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1877 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1870 if ( p->mToolBarHor ) 1878 if ( p->mToolBarHor )
1871 p->mToolBarUp = myP.y() > height()/2; 1879 p->mToolBarUp = myP.y() > height()/2;
1872 else 1880 else
1873 p->mToolBarUp = myP.x() > width()/2; 1881 p->mToolBarUp = myP.x() > width()/2;
1874 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1882 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1875 if ( p->mToolBarHorV ) 1883 if ( p->mToolBarHorV )
1876 p->mToolBarUpV = myP.y() > height()/2; 1884 p->mToolBarUpV = myP.y() > height()/2;
1877 else 1885 else
1878 p->mToolBarUpV = myP.x() > width()/2 ; 1886 p->mToolBarUpV = myP.x() > width()/2 ;
1879 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1887 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1880 if ( p->mToolBarHorN ) 1888 if ( p->mToolBarHorN )
1881 p->mToolBarUpN = myP.y() > height()/2; 1889 p->mToolBarUpN = myP.y() > height()/2;
1882 else 1890 else
1883 p->mToolBarUpN = myP.x() > width()/2 ; 1891 p->mToolBarUpN = myP.x() > width()/2 ;
1884 if ( filterToolBar ) { 1892 if ( filterToolBar ) {
1885 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1893 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1886 if ( p->mToolBarHorF ) 1894 if ( p->mToolBarHorF )
1887 p->mToolBarUpF = myP.y() > height()/2; 1895 p->mToolBarUpF = myP.y() > height()/2;
1888 else 1896 else
1889 p->mToolBarUpF = myP.x() > width()/2 ; 1897 p->mToolBarUpF = myP.x() > width()/2 ;
1890 } 1898 }
1891#else 1899#else
1892 if ( p->mToolBarHor ) 1900 if ( p->mToolBarHor )
1893 p->mToolBarUp = iconToolBar->y() > height()/2; 1901 p->mToolBarUp = iconToolBar->y() > height()/2;
1894 else 1902 else
1895 p->mToolBarUp = iconToolBar->x() > width()/2; 1903 p->mToolBarUp = iconToolBar->x() > width()/2;
1896 if ( p->mToolBarHorV ) 1904 if ( p->mToolBarHorV )
1897 p->mToolBarUpV = viewToolBar->y() > height()/2; 1905 p->mToolBarUpV = viewToolBar->y() > height()/2;
1898 else 1906 else
1899 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1907 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1900 1908
1901 if ( p->mToolBarHorN ) 1909 if ( p->mToolBarHorN )
1902 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1910 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1903 else 1911 else
1904 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1912 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1905 if ( filterToolBar ) { 1913 if ( filterToolBar ) {
1906 if ( p->mToolBarHorF ) 1914 if ( p->mToolBarHorF )
1907 p->mToolBarUpF = filterToolBar->y() > height()/2; 1915 p->mToolBarUpF = filterToolBar->y() > height()/2;
1908 else 1916 else
1909 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1917 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1910 } 1918 }
1911#endif 1919#endif
1912 save(); 1920 save();
1913 mView->writeSettings(); 1921 mView->writeSettings();
1914 mView->checkSuspendAlarm(); 1922 mView->checkSuspendAlarm();
1915} 1923}
1916void MainWindow::slotModifiedChanged( bool ) 1924void MainWindow::slotModifiedChanged( bool )
1917{ 1925{
1918 if ( mBlockAtStartup ) 1926 if ( mBlockAtStartup )
1919 return; 1927 return;
1920 1928
1921 int msec; 1929 int msec;
1922 if ( mCalendarModifiedFlag ) { 1930 if ( mCalendarModifiedFlag ) {
1923 //qDebug(" MainWindow timer is running "); 1931 //qDebug(" MainWindow timer is running ");
1924 return; 1932 return;
1925 } 1933 }
1926 // we store the changes after 1 minute, 1934 // we store the changes after 1 minute,
1927 // and for safety reasons after 10 minutes again 1935 // and for safety reasons after 10 minutes again
1928 if ( !mSyncManager->blockSave() ) 1936 if ( !mSyncManager->blockSave() )
1929 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1937 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1930 else 1938 else
1931 msec = 1000 * 600; 1939 msec = 1000 * 600;
1932 mSaveTimer.start( msec, true ); // 1 minute 1940 mSaveTimer.start( msec, true ); // 1 minute
1933 qDebug("KO: Saving File in %d secs!", msec/1000); 1941 qDebug("KO: Saving File in %d secs!", msec/1000);
1934 mCalendarModifiedFlag = true; 1942 mCalendarModifiedFlag = true;
1935} 1943}
1936void MainWindow::saveStopTimer() 1944void MainWindow::saveStopTimer()
1937{ 1945{
1938 mSaveTimer.stop(); 1946 mSaveTimer.stop();
1939} 1947}
1940void MainWindow::backupAllFiles() 1948void MainWindow::backupAllFiles()
1941{ 1949{
1942 QDate reference ( 2000,1,1); 1950 QDate reference ( 2000,1,1);
1943 int daysTo = reference.daysTo ( QDate::currentDate() ); 1951 int daysTo = reference.daysTo ( QDate::currentDate() );
1944 setCaption(i18n("Creating backup ... please wait ..." )); 1952 setCaption(i18n("Creating backup ... please wait ..." ));
1945 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1953 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1946 // we need the file path, the backup dir and the number of bups as param 1954 // we need the file path, the backup dir and the number of bups as param
1947 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1955 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1948 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1956 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1949 bupDir = KGlobalSettings::backupDataDir(); 1957 bupDir = KGlobalSettings::backupDataDir();
1950 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1958 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1951 if ( retval == 0 ) { 1959 if ( retval == 0 ) {
1952 setCaption(i18n("Backup cancelled" )); 1960 setCaption(i18n("Backup cancelled" ));
1953 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1961 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1954 // retval == 0 : backup skipped for today, try again tomorrow 1962 // retval == 0 : backup skipped for today, try again tomorrow
1955 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1963 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1956 } else if ( retval == 1 ){ 1964 } else if ( retval == 1 ){
1957 qDebug("KO: Backup created."); 1965 qDebug("KO: Backup created.");
1958 // backup ok 1966 // backup ok
1959 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1967 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1960 KopiCalendarFile * cal = calendars.first(); 1968 KopiCalendarFile * cal = calendars.first();
1961 cal = calendars.next(); 1969 cal = calendars.next();
1962 while ( cal ) { 1970 while ( cal ) {
1963 if ( !cal->mErrorOnLoad ) { 1971 if ( !cal->mErrorOnLoad ) {
1964 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1972 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1965 } 1973 }
1966 cal = calendars.next(); 1974 cal = calendars.next();
1967 } 1975 }
1968 KOPrefs::instance()->mLastBackupDate = daysTo; 1976 KOPrefs::instance()->mLastBackupDate = daysTo;
1969 setCaption(i18n("Backup succesfully finished" )); 1977 setCaption(i18n("Backup succesfully finished" ));
1970 } else if ( retval == 2 ){ 1978 } else if ( retval == 2 ){
1971 setCaption(i18n("Backup globally disabled" )); 1979 setCaption(i18n("Backup globally disabled" ));
1972 qDebug("KO: Backup globally cancelled."); 1980 qDebug("KO: Backup globally cancelled.");
1973 // backup globally cancelled 1981 // backup globally cancelled
1974 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1982 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1975 } 1983 }
1976 // retval == 3: do nothing, try again later 1984 // retval == 3: do nothing, try again later
1977} 1985}
1978void MainWindow::save() 1986void MainWindow::save()
1979{ 1987{
1980 1988
1981 if ( mView->viewManager()->journalView() ) 1989 if ( mView->viewManager()->journalView() )
1982 mView->viewManager()->journalView()->checkModified(); 1990 mView->viewManager()->journalView()->checkModified();
1983 if ( !mCalendarModifiedFlag ) { 1991 if ( !mCalendarModifiedFlag ) {
1984 qDebug("KO: Calendar not modified. Nothing saved."); 1992 qDebug("KO: Calendar not modified. Nothing saved.");
1985 return; 1993 return;
1986 } 1994 }
1987 if ( mSyncManager->blockSave() ) { 1995 if ( mSyncManager->blockSave() ) {
1988 slotModifiedChanged( true ); 1996 slotModifiedChanged( true );
1989 return; 1997 return;
1990 } 1998 }
1991 mSyncManager->setBlockSave(true); 1999 mSyncManager->setBlockSave(true);
1992 if ( mView->checkAllFileVersions() ) { 2000 if ( mView->checkAllFileVersions() ) {
1993 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 2001 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1994 QDate reference ( 2000,1,1); 2002 QDate reference ( 2000,1,1);
1995 int daysTo = reference.daysTo ( QDate::currentDate() ); 2003 int daysTo = reference.daysTo ( QDate::currentDate() );
1996 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 2004 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
1997 backupAllFiles(); 2005 backupAllFiles();
1998 } 2006 }
1999 ; // KPimGlobalPrefs::instance()->mLastBackupDate 2007 ; // KPimGlobalPrefs::instance()->mLastBackupDate
2000 } 2008 }
2001 QTime neededSaveTime = QDateTime::currentDateTime().time(); 2009 QTime neededSaveTime = QDateTime::currentDateTime().time();
2002 if ( !isMinimized () ) 2010 if ( !isMinimized () )
2003 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 2011 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
2004 qDebug("KO: Start saving data to file!"); 2012 qDebug("KO: Start saving data to file!");
2005 mView->saveCalendars(); 2013 if ( mView->saveCalendars() )
2006 mCalendarModifiedFlag = false; 2014 mCalendarModifiedFlag = false;
2007 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 2015 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
2008 qDebug("KO: Needed %d ms for saving.",msNeeded ); 2016 qDebug("KO: Needed %d ms for saving.",msNeeded );
2009 QString savemes; 2017 QString savemes;
2010 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 2018 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
2011 if ( !isMinimized () ) 2019 if ( !isMinimized () )
2012 setCaption(savemes); 2020 setCaption(savemes);
2013 else 2021 else
2014 qDebug(savemes); 2022 qDebug(savemes);
2015 } else { 2023 } else {
2016 setCaption(i18n("Saving cancelled!")); 2024 setCaption(i18n("Saving cancelled!"));
2017 mCalendarModifiedFlag = false; 2025 mCalendarModifiedFlag = false;
2018 slotModifiedChanged( true ); 2026 slotModifiedChanged( true );
2019 } 2027 }
2020 mSyncManager->setBlockSave( false ); 2028 mSyncManager->setBlockSave( false );
2021} 2029}
2022 2030
2023void MainWindow::keyReleaseEvent ( QKeyEvent * e) 2031void MainWindow::keyReleaseEvent ( QKeyEvent * e)
2024{ 2032{
2025 if ( !e->isAutoRepeat() ) { 2033 if ( !e->isAutoRepeat() ) {
2026 mFlagKeyPressed = false; 2034 mFlagKeyPressed = false;
2027 } 2035 }
2028} 2036}
2029void MainWindow::keyPressEvent ( QKeyEvent * e ) 2037void MainWindow::keyPressEvent ( QKeyEvent * e )
2030{ 2038{
2031 qApp->processEvents(); 2039 qApp->processEvents();
2032 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 2040 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
2033 e->ignore(); 2041 e->ignore();
2034 // qDebug(" ignore %d",e->isAutoRepeat() ); 2042 // qDebug(" ignore %d",e->isAutoRepeat() );
2035 return; 2043 return;
2036 } 2044 }
2037 if (! e->isAutoRepeat() ) 2045 if (! e->isAutoRepeat() )
2038 mFlagKeyPressed = true; 2046 mFlagKeyPressed = true;
2039 KOPrefs *p = KOPrefs::instance(); 2047 KOPrefs *p = KOPrefs::instance();
2040 bool showSelectedDates = false; 2048 bool showSelectedDates = false;
2041 int size; 2049 int size;
2042 int pro = 0; 2050 int pro = 0;
2043 //qDebug("MainWindow::keyPressEvent "); 2051 //qDebug("MainWindow::keyPressEvent ");
2044 switch ( e->key() ) { 2052 switch ( e->key() ) {
2045 case Qt::Key_Right: 2053 case Qt::Key_Right:
2046 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2054 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2047 mView->goNextMonth(); 2055 mView->goNextMonth();
2048 else 2056 else
2049 mView->goNext(); 2057 mView->goNext();
2050 showSelectedDates = true; 2058 showSelectedDates = true;
2051 break; 2059 break;
2052 case Qt::Key_Left: 2060 case Qt::Key_Left:
2053 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2061 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2054 mView->goPreviousMonth(); 2062 mView->goPreviousMonth();
2055 else 2063 else
2056 mView->goPrevious(); 2064 mView->goPrevious();
2057 showSelectedDates = true; 2065 showSelectedDates = true;
2058 break; 2066 break;
2059 case Qt::Key_Down: 2067 case Qt::Key_Down:
2060 mView->viewManager()->agendaView()->scrollOneHourDown(); 2068 mView->viewManager()->agendaView()->scrollOneHourDown();
2061 break; 2069 break;
2062 case Qt::Key_Up: 2070 case Qt::Key_Up:
2063 mView->viewManager()->agendaView()->scrollOneHourUp(); 2071 mView->viewManager()->agendaView()->scrollOneHourUp();
2064 break; 2072 break;
2065 case Qt::Key_K: 2073 case Qt::Key_K:
2066 mView->viewManager()->showMonthViewWeek(); 2074 mView->viewManager()->showMonthViewWeek();
2067 break; 2075 break;
2068 case Qt::Key_I: 2076 case Qt::Key_I:
2069 mView->showIncidence(); 2077 mView->showIncidence();
2070 break; 2078 break;
2071 case Qt::Key_Delete: 2079 case Qt::Key_Delete:
2072 case Qt::Key_Backspace: 2080 case Qt::Key_Backspace:
2073 mView->deleteIncidence(); 2081 mView->deleteIncidence();
2074 break; 2082 break;
2075 case Qt::Key_D: 2083 case Qt::Key_D:
2076 mView->viewManager()->showDayView(); 2084 mView->viewManager()->showDayView();
2077 showSelectedDates = true; 2085 showSelectedDates = true;
2078 break; 2086 break;
2079 case Qt::Key_O: 2087 case Qt::Key_O:
2080 mView->toggleFilerEnabled( ); 2088 mView->toggleFilerEnabled( );
2081 break; 2089 break;
2082 case Qt::Key_0: 2090 case Qt::Key_0:
2083 case Qt::Key_1: 2091 case Qt::Key_1:
2084 case Qt::Key_2: 2092 case Qt::Key_2:
2085 case Qt::Key_3: 2093 case Qt::Key_3:
2086 case Qt::Key_4: 2094 case Qt::Key_4:
2087 case Qt::Key_5: 2095 case Qt::Key_5:
2088 case Qt::Key_6: 2096 case Qt::Key_6:
2089 case Qt::Key_7: 2097 case Qt::Key_7:
2090 case Qt::Key_8: 2098 case Qt::Key_8:
2091 case Qt::Key_9: 2099 case Qt::Key_9:
2092 pro = e->key()-48; 2100 pro = e->key()-48;
2093 if ( pro == 0 ) 2101 if ( pro == 0 )
2094 pro = 10; 2102 pro = 10;
2095 if ( e->state() == Qt::ControlButton) 2103 if ( e->state() == Qt::ControlButton)
2096 pro += 10; 2104 pro += 10;
2097 break; 2105 break;
2098 case Qt::Key_M: 2106 case Qt::Key_M:
2099 mView->viewManager()->showMonthView(); 2107 mView->viewManager()->showMonthView();
2100 showSelectedDates = true; 2108 showSelectedDates = true;
2101 break; 2109 break;
2102 case Qt::Key_Insert: 2110 case Qt::Key_Insert:
2103 mView->newEvent(); 2111 mView->newEvent();
2104 break; 2112 break;
2105 case Qt::Key_S : 2113 case Qt::Key_S :
2106 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2114 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2107 mView->newSubTodo(); 2115 mView->newSubTodo();
2108 else 2116 else
2109 mView->dialogManager()->showSearchDialog(); 2117 mView->dialogManager()->showSearchDialog();
2110 break; 2118 break;
2111 case Qt::Key_Y : 2119 case Qt::Key_Y :
2112 case Qt::Key_Z : 2120 case Qt::Key_Z :
2113 mView->viewManager()->showWorkWeekView(); 2121 mView->viewManager()->showWorkWeekView();
2114 showSelectedDates = true; 2122 showSelectedDates = true;
2115 break; 2123 break;
2116 case Qt::Key_U : 2124 case Qt::Key_U :
2117 mView->viewManager()->showWeekView(); 2125 mView->viewManager()->showWeekView();
2118 showSelectedDates = true; 2126 showSelectedDates = true;
2119 break; 2127 break;
2120 case Qt::Key_H : 2128 case Qt::Key_H :
2121 keyBindings(); 2129 keyBindings();
2122 break; 2130 break;
2123 case Qt::Key_W: 2131 case Qt::Key_W:
2124 mView->viewManager()->showWhatsNextView(); 2132 mView->viewManager()->showWhatsNextView();
2125 break; 2133 break;
2126 case Qt::Key_L: 2134 case Qt::Key_L:
2127 mView->viewManager()->showListView(); 2135 mView->viewManager()->showListView();
2128 break; 2136 break;
2129 case Qt::Key_N: 2137 case Qt::Key_N:
2130 mView->viewManager()->showNextView(); 2138 mView->viewManager()->showNextView();
2131 break; 2139 break;
2132 case Qt::Key_V: 2140 case Qt::Key_V:
2133 mView->viewManager()->showTodoView(); 2141 mView->viewManager()->showTodoView();
2134 break; 2142 break;
2135 case Qt::Key_C: 2143 case Qt::Key_C:
2136 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2144 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2137 break; 2145 break;
2138 case Qt::Key_P: 2146 case Qt::Key_P:
2139 mView->showDatePicker( ); 2147 mView->showDatePicker( );
2140 break; 2148 break;
2141 case Qt::Key_F: 2149 case Qt::Key_F:
2142 mView->editFilters(); 2150 mView->editFilters();
2143 break; 2151 break;
2144 case Qt::Key_R: 2152 case Qt::Key_R:
2145 mView->toggleFilter(); 2153 mView->toggleFilter();
2146 break; 2154 break;
2147 case Qt::Key_X: 2155 case Qt::Key_X:
2148 if ( e->state() == Qt::ControlButton ) 2156 if ( e->state() == Qt::ControlButton )
2149 mView->toggleDateNavigatorWidget(); 2157 mView->toggleDateNavigatorWidget();
2150 else { 2158 else {
2151 mView->viewManager()->showNextXView(); 2159 mView->viewManager()->showNextXView();
2152 showSelectedDates = true; 2160 showSelectedDates = true;
2153 } 2161 }
2154 break; 2162 break;
2155 case Qt::Key_Space: 2163 case Qt::Key_Space:
2156 mView->toggleExpand(); 2164 mView->toggleExpand();
2157 break; 2165 break;
2158 case Qt::Key_A: 2166 case Qt::Key_A:
2159 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2167 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2160 mView->showNextAlarms(); 2168 mView->showNextAlarms();
2161 else 2169 else
2162 mView->toggleAllDaySize(); 2170 mView->toggleAllDaySize();
2163 break; 2171 break;
2164 case Qt::Key_T: 2172 case Qt::Key_T:
2165 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2173 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2166 mView->newTodo(); 2174 mView->newTodo();
2167 else { 2175 else {
2168 mView->goToday(); 2176 mView->goToday();
2169 showSelectedDates = true; 2177 showSelectedDates = true;
2170 } 2178 }
2171 break; 2179 break;
2172 case Qt::Key_Q: 2180 case Qt::Key_Q:
2173 if ( e->state() == Qt::ControlButton ) 2181 if ( e->state() == Qt::ControlButton )
2174 mView->conflictNotAll(); 2182 mView->conflictNotAll();
2175 else if ( e->state() == Qt::ShiftButton ) 2183 else if ( e->state() == Qt::ShiftButton )
2176 mView->conflictAllday(); 2184 mView->conflictAllday();
2177 else 2185 else
2178 mView->conflictAll(); 2186 mView->conflictAll();
2179 break; 2187 break;
2180 case Qt::Key_J: 2188 case Qt::Key_J:
2181 mView->viewManager()->showJournalView(); 2189 mView->viewManager()->showJournalView();
2182 break; 2190 break;
2183 case Qt::Key_B: 2191 case Qt::Key_B:
2184 mView->editIncidenceDescription();; 2192 mView->editIncidenceDescription();;
2185 break; 2193 break;
2186 // case Qt::Key_Return: 2194 // case Qt::Key_Return:
2187 case Qt::Key_E: 2195 case Qt::Key_E:
2188 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2196 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2189 mView->newEvent(); 2197 mView->newEvent();
2190 else 2198 else
2191 mView->editIncidence(); 2199 mView->editIncidence();
2192 break; 2200 break;
2193 case Qt::Key_Plus: 2201 case Qt::Key_Plus:
2194 size = p->mHourSize +2; 2202 size = p->mHourSize +2;
2195 if ( size <= 22 ) 2203 if ( size <= 22 )
2196 configureAgenda( size ); 2204 configureAgenda( size );
2197 break; 2205 break;
2198 case Qt::Key_Minus: 2206 case Qt::Key_Minus:
2199 size = p->mHourSize - 2; 2207 size = p->mHourSize - 2;
2200 if ( size >= 4 ) 2208 if ( size >= 4 )
2201 configureAgenda( size ); 2209 configureAgenda( size );
2202 break; 2210 break;
2203 2211
2204 2212
2205 default: 2213 default:
2206 e->ignore(); 2214 e->ignore();
2207 } 2215 }
2208 if ( pro > 0 ) { 2216 if ( pro > 0 ) {
2209 selectFilter( pro+1 ); 2217 selectFilter( pro+1 );
2210 } 2218 }
2211 if ( showSelectedDates ) { 2219 if ( showSelectedDates ) {
2212 ;// setCaptionToDates(); 2220 ;// setCaptionToDates();
2213 } 2221 }
2214 2222
2215} 2223}
2216void MainWindow::fillFilterMenuTB() 2224void MainWindow::fillFilterMenuTB()
2217{ 2225{
2218 selectFilterMenuTB->clear(); 2226 selectFilterMenuTB->clear();
2219 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2227 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2220 selectFilterMenuTB->insertSeparator(); 2228 selectFilterMenuTB->insertSeparator();
2221 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2229 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2222 2230
2223 selectFilterMenuTB->insertSeparator(); 2231 selectFilterMenuTB->insertSeparator();
2224 QPtrList<CalFilter> fili = mView->filters(); 2232 QPtrList<CalFilter> fili = mView->filters();
2225 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2233 CalFilter *curfilter = mView->filterView()->selectedFilter();
2226 CalFilter *filter = fili.first(); 2234 CalFilter *filter = fili.first();
2227 int iii = 2; 2235 int iii = 2;
2228 bool checkitem = mView->filterView()->filtersEnabled(); 2236 bool checkitem = mView->filterView()->filtersEnabled();
2229 while(filter) { 2237 while(filter) {
2230 selectFilterMenuTB->insertItem( filter->name(), iii ); 2238 selectFilterMenuTB->insertItem( filter->name(), iii );
2231 if ( filter == curfilter) 2239 if ( filter == curfilter)
2232 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2240 selectFilterMenuTB->setItemChecked( iii, checkitem );
2233 filter = fili.next(); 2241 filter = fili.next();
2234 ++iii; 2242 ++iii;
2235 } 2243 }
2236 if ( !checkitem ) 2244 if ( !checkitem )
2237 selectFilterMenuTB->setItemChecked( 1, true ); 2245 selectFilterMenuTB->setItemChecked( 1, true );
2238 2246
2239 int x = 0; 2247 int x = 0;
2240 int y = iconToolBar->height(); 2248 int y = iconToolBar->height();
2241 int dX = 0; 2249 int dX = 0;
2242 int dY = 0; 2250 int dY = 0;
2243 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2251 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2244 if ( iconToolBar->y() > height()/2 ) { 2252 if ( iconToolBar->y() > height()/2 ) {
2245 dY = selectFilterMenuTB->sizeHint().height()+8; 2253 dY = selectFilterMenuTB->sizeHint().height()+8;
2246 y = 0; 2254 y = 0;
2247 } 2255 }
2248 } else { 2256 } else {
2249 if ( iconToolBar->x() > width()/2 ) { // right side 2257 if ( iconToolBar->x() > width()/2 ) { // right side
2250 x=0; 2258 x=0;
2251 dX= selectFilterMenuTB->sizeHint().width()+8; 2259 dX= selectFilterMenuTB->sizeHint().width()+8;
2252 y = 0; 2260 y = 0;
2253 } else { 2261 } else {
2254 x= iconToolBar->width(); 2262 x= iconToolBar->width();
2255 y = 0; 2263 y = 0;
2256 } 2264 }
2257 } 2265 }
2258 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2266 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2259 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2267 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2260} 2268}
2261void MainWindow::fillFilterMenu() 2269void MainWindow::fillFilterMenu()
2262{ 2270{
2263 selectFilterMenu->clear(); 2271 selectFilterMenu->clear();
2264 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2272 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2265 selectFilterMenu->insertSeparator(); 2273 selectFilterMenu->insertSeparator();
2266 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2274 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2267 2275
2268 selectFilterMenu->insertSeparator(); 2276 selectFilterMenu->insertSeparator();
2269 QPtrList<CalFilter> fili = mView->filters(); 2277 QPtrList<CalFilter> fili = mView->filters();
2270 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2278 CalFilter *curfilter = mView->filterView()->selectedFilter();
2271 CalFilter *filter = fili.first(); 2279 CalFilter *filter = fili.first();
2272 int iii = 2; 2280 int iii = 2;
2273 bool checkitem = mView->filterView()->filtersEnabled(); 2281 bool checkitem = mView->filterView()->filtersEnabled();
2274 while(filter) { 2282 while(filter) {
2275 selectFilterMenu->insertItem( filter->name(), iii ); 2283 selectFilterMenu->insertItem( filter->name(), iii );
2276 if ( filter == curfilter) 2284 if ( filter == curfilter)
2277 selectFilterMenu->setItemChecked( iii, checkitem ); 2285 selectFilterMenu->setItemChecked( iii, checkitem );
2278 filter = fili.next(); 2286 filter = fili.next();
2279 ++iii; 2287 ++iii;
2280 } 2288 }
2281 if ( !checkitem ) 2289 if ( !checkitem )
2282 selectFilterMenu->setItemChecked( 1, true ); 2290 selectFilterMenu->setItemChecked( 1, true );
2283} 2291}
2284void MainWindow::fillFilterMenuPopup() 2292void MainWindow::fillFilterMenuPopup()
2285{ 2293{
2286 filterPopupMenu->clear(); 2294 filterPopupMenu->clear();
2287 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2295 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2288 2296
2289 filterPopupMenu->insertSeparator(); 2297 filterPopupMenu->insertSeparator();
2290 QPtrList<CalFilter> fili = mView->filters(); 2298 QPtrList<CalFilter> fili = mView->filters();
2291 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2299 CalFilter *curfilter = mView->filterView()->selectedFilter();
2292 CalFilter *filter = fili.first(); 2300 CalFilter *filter = fili.first();
2293 int iii = 1; 2301 int iii = 1;
2294 bool checkitem = mView->filterView()->filtersEnabled(); 2302 bool checkitem = mView->filterView()->filtersEnabled();
2295 while(filter) { 2303 while(filter) {
2296 filterPopupMenu->insertItem( filter->name(), iii ); 2304 filterPopupMenu->insertItem( filter->name(), iii );
2297 if ( filter == curfilter) 2305 if ( filter == curfilter)
2298 filterPopupMenu->setItemChecked( iii, checkitem ); 2306 filterPopupMenu->setItemChecked( iii, checkitem );
2299 filter = fili.next(); 2307 filter = fili.next();
2300 ++iii; 2308 ++iii;
2301 } 2309 }
2302 if ( !checkitem ) 2310 if ( !checkitem )
2303 filterPopupMenu->setItemChecked( 0, true ); 2311 filterPopupMenu->setItemChecked( 0, true );
2304} 2312}
2305void MainWindow::selectFilter( int fil ) 2313void MainWindow::selectFilter( int fil )
2306{ 2314{
2307 2315
2308 if ( fil == 0 ) { 2316 if ( fil == 0 ) {
2309 mView->editFilters( ); 2317 mView->editFilters( );
2310 } else if ( fil == 1 ){ 2318 } else if ( fil == 1 ){
2311 if ( mView->filterView()->filtersEnabled() ) 2319 if ( mView->filterView()->filtersEnabled() )
2312 mView->toggleFilerEnabled( ); 2320 mView->toggleFilerEnabled( );
2313 } else { 2321 } else {
2314 if ( !mView->filterView()->filtersEnabled() ) { 2322 if ( !mView->filterView()->filtersEnabled() ) {
2315 mView->filterView()->blockSignals( true ); 2323 mView->filterView()->blockSignals( true );
2316 mView->toggleFilerEnabled( ); 2324 mView->toggleFilerEnabled( );
2317 mView->filterView()->blockSignals( false ); 2325 mView->filterView()->blockSignals( false );
2318 } 2326 }
2319 mView->selectFilter( fil-2 ); 2327 mView->selectFilter( fil-2 );
2320 } 2328 }
2321} 2329}
2322void MainWindow::updateFilterToolbar() 2330void MainWindow::updateFilterToolbar()
2323{ 2331{
2324 if ( filterMenubar ) { 2332 if ( filterMenubar ) {
2325 if ( !mView->filterView()->filtersEnabled() ) { 2333 if ( !mView->filterView()->filtersEnabled() ) {
2326 filterMenubar->changeItem( 0, i18n("No Filter") ); 2334 filterMenubar->changeItem( 0, i18n("No Filter") );
2327 } else { 2335 } else {
2328 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2336 CalFilter *curfilter = mView->filterView()->selectedFilter();
2329 if ( curfilter ) { 2337 if ( curfilter ) {
2330 QString name = curfilter->name(); 2338 QString name = curfilter->name();
2331 if ( name.length() > 12 ) 2339 if ( name.length() > 12 )
2332 name = name.left(10)+"..."; 2340 name = name.left(10)+"...";
2333 filterMenubar->changeItem( 0, name ); 2341 filterMenubar->changeItem( 0, name );
2334 } 2342 }
2335 } 2343 }
2336 } 2344 }
2337} 2345}
2338void MainWindow::selectFilterPopup( int fil ) 2346void MainWindow::selectFilterPopup( int fil )
2339{ 2347{
2340 selectFilter( fil + 1 ); 2348 selectFilter( fil + 1 );
2341 2349
2342} 2350}
2343void MainWindow::configureToolBar( int item ) 2351void MainWindow::configureToolBar( int item )
2344{ 2352{
2345 2353
2346 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2354 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2347 KOPrefs *p = KOPrefs::instance(); 2355 KOPrefs *p = KOPrefs::instance();
2348 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2356 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2349 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2357 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2350 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2358 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2351 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2359 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2352 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2360 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2353 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2361 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2354 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2362 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2355 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2363 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2356 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2364 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2357 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2365 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2358 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2366 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2359 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2367 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2360 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2368 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2361 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2369 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2362 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2370 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2363 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2371 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2364 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2372 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2365 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2373 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2366 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2374 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2367 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2375 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2368 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2376 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2369 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2377 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2370 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2378 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2371 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2379 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2372 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2380 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2373 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2381 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2374 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2382 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2375 // initActions(); 2383 // initActions();
2376 setCaption ( i18n("Toolbar changes needs a restart!") ); 2384 setCaption ( i18n("Toolbar changes needs a restart!") );
2377} 2385}
2378void MainWindow::setCaption ( const QString & c ) 2386void MainWindow::setCaption ( const QString & c )
2379{ 2387{
2380 QString cap = c; 2388 QString cap = c;
2381 cap.replace( QRegExp("\n"), " " ); 2389 cap.replace( QRegExp("\n"), " " );
2382 cap = cap.stripWhiteSpace(); 2390 cap = cap.stripWhiteSpace();
2383 if ( cap.isEmpty() ) 2391 if ( cap.isEmpty() )
2384 cap = "KO/Pi"; 2392 cap = "KO/Pi";
2385 QWidget::setCaption( cap ); 2393 QWidget::setCaption( cap );
2386} 2394}
2387void MainWindow::setCaptionToDates() 2395void MainWindow::setCaptionToDates()
2388{ 2396{
2389 QString selDates; 2397 QString selDates;
2390 QDate date = mView->startDate(); 2398 QDate date = mView->startDate();