summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/calendarview.cpp17
-rw-r--r--korganizer/kofilterview.cpp32
-rw-r--r--korganizer/kofilterview.h3
-rw-r--r--korganizer/koprefs.cpp4
-rw-r--r--korganizer/main.cpp1
-rw-r--r--korganizer/mainwindow.cpp9
8 files changed, 60 insertions, 13 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index dfc9553..2e120df 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,160 +1,163 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.10 ************ 3********** VERSION 2.1.10 ************
4 4
5KO/Pi:
6Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file.
7
5********** VERSION 2.1.9 ************ 8********** VERSION 2.1.9 ************
6 9
7KO/Pi: 10KO/Pi:
8Fixed some problems of the new search options in the search dialog. 11Fixed some problems of the new search options in the search dialog.
9Fixed some problems in the new resource config options. 12Fixed some problems in the new resource config options.
10Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. 13Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page.
11Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: 14Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown:
12Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. 15Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup.
13 16
14Fixed a problem in recurrence range in syncing with DTM. 17Fixed a problem in recurrence range in syncing with DTM.
15 18
16KA/Pi: 19KA/Pi:
17Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) 20Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...)
18 21
19PwM/Pi: 22PwM/Pi:
20Added "sec" to the timeout config settings to make it clear the timeout values are seconds. 23Added "sec" to the timeout config settings to make it clear the timeout values are seconds.
21 24
22********** VERSION 2.1.8 ************ 25********** VERSION 2.1.8 ************
23 26
24KO/Pi: 27KO/Pi:
25Added info about the completion state of a todo in the ListView/Searchdialog. 28Added info about the completion state of a todo in the ListView/Searchdialog.
26If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 29If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
27Fixed some updating problems when changing the filter. 30Fixed some updating problems when changing the filter.
28 31
29KA/Pi: 32KA/Pi:
30In the addressee selection dialog now the formatted name is shown, if not empty. 33In the addressee selection dialog now the formatted name is shown, if not empty.
31Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. 34Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
32Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. 35Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
33 36
34Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 37Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
35Fixed the sorting for size in the file selector on the Z. 38Fixed the sorting for size in the file selector on the Z.
36 39
37Changed the color selection dialog on the Zaurus to a more user friendly version. 40Changed the color selection dialog on the Zaurus to a more user friendly version.
38 41
39********** VERSION 2.1.7 ************ 42********** VERSION 2.1.7 ************
40 43
41KO/Pi: 44KO/Pi:
42Fixed several problems in the new Resource handling. 45Fixed several problems in the new Resource handling.
43Added more options to the search dialog. 46Added more options to the search dialog.
44Fixed a problem in the Month view. 47Fixed a problem in the Month view.
45Added more options to the dialog when setting a todo to stopped. 48Added more options to the dialog when setting a todo to stopped.
46 49
47Fixed two small problems in KO/Pi Alarm applet. 50Fixed two small problems in KO/Pi Alarm applet.
48 51
49********** VERSION 2.1.6 ************ 52********** VERSION 2.1.6 ************
50 53
51This release is for testing only. 54This release is for testing only.
52 55
53KO/Pi: 56KO/Pi:
54Added to the list view (the list view is used in search dialog as well) the possibility to print it. 57Added to the list view (the list view is used in search dialog as well) the possibility to print it.
55Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 58Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
56Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 59Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
57Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 60Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
58Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 61Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
59Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 62Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
60 63
61Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 64Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
62In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 65In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
63Now on every sync the set of calendars is synced which are enabled in the resource view. 66Now on every sync the set of calendars is synced which are enabled in the resource view.
64 67
65A calendar is enabled in the resource view if the "eye" column is checked. 68A calendar is enabled in the resource view if the "eye" column is checked.
66You can set a calendar to be the default for new items( "+" column ). 69You can set a calendar to be the default for new items( "+" column ).
67You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 70You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
68To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 71To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
69 72
70 73
71********** VERSION 2.1.5 ************ 74********** VERSION 2.1.5 ************
72 75
73This is the new stable version. 76This is the new stable version.
74Bugfix: 77Bugfix:
75Fixed a problem with agenda popup on the desktop in KO/Pi. 78Fixed a problem with agenda popup on the desktop in KO/Pi.
76Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 79Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
77Added config option to not display completed todos in agenda view. 80Added config option to not display completed todos in agenda view.
78Addressee view is now using the formatted name, if defined. 81Addressee view is now using the formatted name, if defined.
79That makes it possible to display "lastname, firstname" in that view now. 82That makes it possible to display "lastname, firstname" in that view now.
80To set the formatted name for all contacts, please use menu: 83To set the formatted name for all contacts, please use menu:
81Edit->Change->Set formatted name. 84Edit->Change->Set formatted name.
82Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 85Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
83 86
84********** VERSION 2.1.4 ************ 87********** VERSION 2.1.4 ************
85 88
86Fixed two more bugs in the KA/Pi CSV import dialog: 89Fixed two more bugs in the KA/Pi CSV import dialog:
87Made it possible to read multi-line fields and import it to the "Note" field. 90Made it possible to read multi-line fields and import it to the "Note" field.
88Fixed a problem in mapping custom fields, whatever a custem field is... 91Fixed a problem in mapping custom fields, whatever a custem field is...
89 92
90********** VERSION 2.1.3 ************ 93********** VERSION 2.1.3 ************
91 94
92Changed the menu structure of the alarm applet: 95Changed the menu structure of the alarm applet:
93Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 96Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
94 97
95Fixed several problems in the KA/Pi CSV import dialog: 98Fixed several problems in the KA/Pi CSV import dialog:
96Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 99Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
97 100
98 101
99********** VERSION 2.1.2 ************ 102********** VERSION 2.1.2 ************
100 103
101Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 104Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
102 105
103Fixed a problem when importing data from Outlook with mutiple categories set. 106Fixed a problem when importing data from Outlook with mutiple categories set.
104 107
105Changed display of days in datenavigator: 108Changed display of days in datenavigator:
106Birthdays are now blue, not dark green. 109Birthdays are now blue, not dark green.
107When todo view is shown, no birtdays are shown and days with due todos are shown blue. 110When todo view is shown, no birtdays are shown and days with due todos are shown blue.
108When journal view is shown, only holidays are shown and days with journals are blue. 111When journal view is shown, only holidays are shown and days with journals are blue.
109 112
110Added Backup options to global config: 113Added Backup options to global config:
111You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 114You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
112It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 115It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
113The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 116The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
114 117
115********** VERSION 2.1.1 ************ 118********** VERSION 2.1.1 ************
116 119
117Stable release 2.1.1! 120Stable release 2.1.1!
118 121
119KO/Pi: 122KO/Pi:
120Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 123Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
121 124
122********** VERSION 2.1.0 ************ 125********** VERSION 2.1.0 ************
123 126
124Stable release 2.1.0! 127Stable release 2.1.0!
125 128
126Summary of changes/fixes compared to version 2.0.6: 129Summary of changes/fixes compared to version 2.0.6:
127 130
128Many bugs of version 2.0.6 fixed. 131Many bugs of version 2.0.6 fixed.
129Most of them were small bugs, but some of them were important. 132Most of them were small bugs, but some of them were important.
130It is recommended to use version 2.1.0 and not version 2.0.6. 133It is recommended to use version 2.1.0 and not version 2.0.6.
131 134
132Important changes: 135Important changes:
133 136
134Added recurring todos to KO/Pi. 137Added recurring todos to KO/Pi.
135 138
136Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 139Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
137 140
138Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 141Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
139 142
140Datenavigator can now display many months. Very useful on the desktop. 143Datenavigator can now display many months. Very useful on the desktop.
141 144
142KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 145KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
143 146
144Made alarm sound working on Linux desktop. 147Made alarm sound working on Linux desktop.
145 148
146Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 149Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
147 150
148Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 151Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
149 152
150Many other usebility enhancements. 153Many other usebility enhancements.
151Special thanks to Ben for his suggestions! 154Special thanks to Ben for his suggestions!
152 155
153You can find the complete changelog 156You can find the complete changelog
154from version 1.7.7 to 2.1.0 157from version 1.7.7 to 2.1.0
155in the source package or on 158in the source package or on
156 159
157http://www.pi-sync.net/html/changelog.html 160http://www.pi-sync.net/html/changelog.html
158 161
159 162
160 163
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 2ade5bd..01c707e 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1202,263 +1202,263 @@
1202{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1202{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1203{ " and "," und " }, 1203{ " and "," und " },
1204{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1204{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1205{ "Mail to selected","Mail an Ausgewählte" }, 1205{ "Mail to selected","Mail an Ausgewählte" },
1206{ "Mail to all","Mail an Alle" }, 1206{ "Mail to all","Mail an Alle" },
1207{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1207{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1208{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1208{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1209{ " on"," am" }, 1209{ " on"," am" },
1210{ " completed on "," erledigt am " }, 1210{ " completed on "," erledigt am " },
1211{ "Save as Event template","Speichere als Vorlage" }, 1211{ "Save as Event template","Speichere als Vorlage" },
1212{ "Load Event template","Lade Termin Vorlage" }, 1212{ "Load Event template","Lade Termin Vorlage" },
1213{ "Save as Journal template","Speichere als Journal Vorlage" }, 1213{ "Save as Journal template","Speichere als Journal Vorlage" },
1214{ "Insert Journal template","Füge Journal Vorlage ein" }, 1214{ "Insert Journal template","Füge Journal Vorlage ein" },
1215{ "Sub todos:<br>","Unter Todos:<br>" }, 1215{ "Sub todos:<br>","Unter Todos:<br>" },
1216{ "Parent todo:<br>","Über Todo:<br>" }, 1216{ "Parent todo:<br>","Über Todo:<br>" },
1217{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1217{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1218{ " completed"," erledigt" }, 1218{ " completed"," erledigt" },
1219{ "(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!" }, 1219{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" },
1220{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1220{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1221{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1221{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1222{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1222{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1223{ "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?" }, 1223{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" },
1224{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1224{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1225{ "Error","Fehler" }, 1225{ "Error","Fehler" },
1226{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1226{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1227{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1227{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1228{ "Warning","Warnung" }, 1228{ "Warning","Warnung" },
1229{ "Select week number","Wähle Wochen Nummer" }, 1229{ "Select week number","Wähle Wochen Nummer" },
1230{ "Februar","Februar" }, 1230{ "Februar","Februar" },
1231{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1231{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1232{ "W","W" }, 1232{ "W","W" },
1233{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1233{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1234{ "T: %1","T: %1" }, 1234{ "T: %1","T: %1" },
1235{ "Start: ","Start: " }, 1235{ "Start: ","Start: " },
1236{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1236{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1237{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1237{ "Password for remote access:","Passwort für fernen Zugriff:" },
1238{ "Remote IP address:","Ferne IP Adresse:" }, 1238{ "Remote IP address:","Ferne IP Adresse:" },
1239{ "Remote port number:","Ferne Port Nummer:" }, 1239{ "Remote port number:","Ferne Port Nummer:" },
1240{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1240{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1241{ "Remote from: ","Fern von: " }, 1241{ "Remote from: ","Fern von: " },
1242{ "Local from: ","Lokal von: " }, 1242{ "Local from: ","Lokal von: " },
1243{ "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" }, 1243{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
1244{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1244{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1245{ "Write back","Schreibe zurück" }, 1245{ "Write back","Schreibe zurück" },
1246{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1246{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1247{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1247{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1248{ "Received sync request","Sync Anfrage erhalten" }, 1248{ "Received sync request","Sync Anfrage erhalten" },
1249{ "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." }, 1249{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
1250{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1250{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1251{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1251{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1252{ "Sending file...","Sende Datei..." }, 1252{ "Sending file...","Sende Datei..." },
1253{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1253{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1254{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1254{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1255{ "Received %1 bytes","%1 Bytes erhalten" }, 1255{ "Received %1 bytes","%1 Bytes erhalten" },
1256{ "Writing file to disk...","Speichere Datei..." }, 1256{ "Writing file to disk...","Speichere Datei..." },
1257{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1257{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1258{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1258{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1259{ "Synchronize!","Synchronisiere!" }, 1259{ "Synchronize!","Synchronisiere!" },
1260{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1260{ "High clock skew!","Großer Uhrzeitunterschied!" },
1261{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1261{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1262{ "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!" }, 1262{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1263{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1263{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1264{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1264{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1265{ "List week view","Listenwochenansicht" }, 1265{ "List week view","Listenwochenansicht" },
1266{ "List week","Listenwochenansicht" }, 1266{ "List week","Listenwochenansicht" },
1267{ "Next Week","Nächste Woche" }, 1267{ "Next Week","Nächste Woche" },
1268{ "Previous Week","Vorherige Woche" }, 1268{ "Previous Week","Vorherige Woche" },
1269{ "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." }, 1269{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." },
1270{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1270{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1271{ "Details","Details" }, 1271{ "Details","Details" },
1272{ "Created time","Erstellt Zeit" }, 1272{ "Created time","Erstellt Zeit" },
1273{ "Last modified time","Geändert Zeit" }, 1273{ "Last modified time","Geändert Zeit" },
1274{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1274{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1275{ "View Options","Anzeige Optionen" }, 1275{ "View Options","Anzeige Optionen" },
1276{ "<b>Created: ","<b>Erstellt am: " }, 1276{ "<b>Created: ","<b>Erstellt am: " },
1277{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1277{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1278{ "Journal: ","Journal: " }, 1278{ "Journal: ","Journal: " },
1279{ "yearly","jährlich" }, 1279{ "yearly","jährlich" },
1280{ "(%1) ","%1-" }, 1280{ "(%1) ","%1-" },
1281{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1281{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1282{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1282{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1283{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1283{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1284{ "Summary/Loc.","Titel/Ort" }, 1284{ "Summary/Loc.","Titel/Ort" },
1285{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1285{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1286{ "Week Number","Wochennummer" }, 1286{ "Week Number","Wochennummer" },
1287{ "Import","Importiere" }, 1287{ "Import","Importiere" },
1288{ "Export","Exportiere" }, 1288{ "Export","Exportiere" },
1289{ "Beam","Beame" }, 1289{ "Beam","Beame" },
1290{ "Export selected","Exportiere Selektierte" }, 1290{ "Export selected","Exportiere Selektierte" },
1291{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1291{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1292{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1292{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1293{ "Journal/Details...","Journale/Details..." }, 1293{ "Journal/Details...","Journale/Details..." },
1294{ "Agenda View","Agenda Ansicht" }, 1294{ "Agenda View","Agenda Ansicht" },
1295{ "Show current time","Zeige aktuelle Zeit" }, 1295{ "Show current time","Zeige aktuelle Zeit" },
1296{ "Edit new item","Bearbeite neuen Eintrag" }, 1296{ "Edit new item","Bearbeite neuen Eintrag" },
1297{ "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" }, 1297{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" },
1298{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1298{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1299{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1299{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1300{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1300{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1301{ "%1 days\n","%1 Tagen\n" }, 1301{ "%1 days\n","%1 Tagen\n" },
1302{ "1 day\n","1 Tag\n" }, 1302{ "1 day\n","1 Tag\n" },
1303{ "%1 hours\n","%1 Stunden\n" }, 1303{ "%1 hours\n","%1 Stunden\n" },
1304{ "1 hour\n","1 Stunde\n" }, 1304{ "1 hour\n","1 Stunde\n" },
1305{ "%1 minutes\n","%1 Minuten\n" }, 1305{ "%1 minutes\n","%1 Minuten\n" },
1306{ "1 minute\n","1 Minute\n" }, 1306{ "1 minute\n","1 Minute\n" },
1307{ "Only one toolbar","Nur eine Toolbar" }, 1307{ "Only one toolbar","Nur eine Toolbar" },
1308{ "Print","Drucke" }, 1308{ "Print","Drucke" },
1309{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1309{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1310{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1310{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1311{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1311{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1312{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1312{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1313{ "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" }, 1313{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" },
1314{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1314{ "KO/Pi Printout","KO/Pi Ausdruck" },
1315{ "Print unscaled","Drucke unskaliert" }, 1315{ "Print unscaled","Drucke unskaliert" },
1316{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1316{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1317{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1317{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1318{ "Printout Mode","Druck Modus" }, 1318{ "Printout Mode","Druck Modus" },
1319{ "Filter menu icon","Filtermenu Icon" }, 1319{ "Filter menu icon","Filtermenu Icon" },
1320{ "<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" }, 1320{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" },
1321{ "<p><b>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" }, 1321{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" },
1322{ "%1d","%1t" }, 1322{ "%1d","%1t" },
1323{ "%1h","%1std" }, 1323{ "%1h","%1std" },
1324{ "%1min","%1min" }, 1324{ "%1min","%1min" },
1325{ "( %1 before )","( %1 vorher )" }, 1325{ "( %1 before )","( %1 vorher )" },
1326{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1326{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1327{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1327{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1328{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1328{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1329{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1329{ "Show Sync Events","Zeige Sync-Ereignisse" },
1330{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1330{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1331{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1331{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1332{ " on "," am " }, 1332{ " on "," am " },
1333{ "On: ","Am: " }, 1333{ "On: ","Am: " },
1334{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1334{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1335{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1335{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1336{ "Color for running todos:","Farbe für laufende Todos:" }, 1336{ "Color for running todos:","Farbe für laufende Todos:" },
1337{ "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?" }, 1337{ "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" },
1338{ "Todo is started","Todo ist gestartet" }, 1338{ "Todo is started","Todo ist gestartet" },
1339{ "Stop todo","Stoppe Todo" }, 1339{ "Stop todo","Stoppe Todo" },
1340{ "Todo is stopped","Todo ist gestoppt" }, 1340{ "Todo is stopped","Todo ist gestoppt" },
1341{ "Start todo","Starte Todo" }, 1341{ "Start todo","Starte Todo" },
1342{ "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?" }, 1342{ "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" },
1343{ "The todo\n%1\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?" }, 1343{ "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" },
1344{ "Todo has subtodos","Todo hat Untertodos" }, 1344{ "Todo has subtodos","Todo hat Untertodos" },
1345{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1345{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1346{ "Colors","Farben" }, 1346{ "Colors","Farben" },
1347{ "Click on new parent item","Klicke auf neues Übertodo" }, 1347{ "Click on new parent item","Klicke auf neues Übertodo" },
1348{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1348{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1349{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1349{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1350{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1350{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1351{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1351{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1352{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1352{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1353{ "times","Zeiten" }, 1353{ "times","Zeiten" },
1354{ "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?" }, 1354{ "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" },
1355{ "Backup enabled","Backup angeschaltet" }, 1355{ "Backup enabled","Backup angeschaltet" },
1356{ "Use standard backup dir","Standard Backupverzeichnis" }, 1356{ "Use standard backup dir","Standard Backupverzeichnis" },
1357{ "Number of Backups:","Anzahl der Backups" }, 1357{ "Number of Backups:","Anzahl der Backups" },
1358{ "Make backup every ","Mache ein Backup alle " }, 1358{ "Make backup every ","Mache ein Backup alle " },
1359{ " days"," Tage" }, 1359{ " days"," Tage" },
1360{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1360{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1361{ "Backup Failed!","Backup Problem!" }, 1361{ "Backup Failed!","Backup Problem!" },
1362{ "Try again now","Versuche jetzt nochmal" }, 1362{ "Try again now","Versuche jetzt nochmal" },
1363{ "Try again later","Versuche später nochmal" }, 1363{ "Try again later","Versuche später nochmal" },
1364{ "Try again tomorrow","Versuche morgen nochmal" }, 1364{ "Try again tomorrow","Versuche morgen nochmal" },
1365{ "Disable backup","Schalte Backup ab" }, 1365{ "Disable backup","Schalte Backup ab" },
1366{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1366{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1367{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1367{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1368{ "Choose action","Wähle Aktion" }, 1368{ "Choose action","Wähle Aktion" },
1369{ "Comment for todo:","Kommentar zum Todo:" }, 1369{ "Comment for todo:","Kommentar zum Todo:" },
1370{ "Stop+note","Stop+Notiz" }, 1370{ "Stop+note","Stop+Notiz" },
1371{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1371{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1372{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1372{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1373{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1373{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1374{ "Print complete list","Drucke komplette Liste" }, 1374{ "Print complete list","Drucke komplette Liste" },
1375{ "Hide all selected","Verstecke Selektierte" }, 1375{ "Hide all selected","Verstecke Selektierte" },
1376{ "Add items","hinzufügen" }, 1376{ "Add items","hinzufügen" },
1377{ "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?" }, 1377{ "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?" },
1378{ "Print List View...","Drucke Listenansicht..." }, 1378{ "Print List View...","Drucke Listenansicht..." },
1379{ "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." }, 1379{ "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." },
1380{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1380{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1381{ "Global Settings...","Globale Einstellungen..." }, 1381{ "Global Settings...","Globale Einstellungen..." },
1382{ "<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" }, 1382{ "<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" },
1383{ "(disabled)","(abgeschaltet)" }, 1383{ "(disabled)","(abgeschaltet)" },
1384{ "New Calendar","Neuer Kalender" }, 1384{ "New Calendar","Neuer Kalender" },
1385{ "Calendar","Kalender" }, 1385{ "Calendar","Kalender" },
1386{ "Filter selector","Filterauswahl" }, 1386{ "Filter selector","Filterauswahl" },
1387{ "Filtermenu","Filtermenu" }, 1387{ "Filtermenu","Filtermenu" },
1388{ "Toggle Fullscreen","Vollbild umschalten" }, 1388{ "Toggle Fullscreen","Vollbild umschalten" },
1389{ "Toggle Resource View","Resourcenansicht umschalten" }, 1389{ "Toggle Resource View","Resourcenansicht umschalten" },
1390{ "Storage HowTo...","Speicherort HowTo..." }, 1390{ "Storage HowTo...","Speicherort HowTo..." },
1391{ "Timetracking HowTo...","Timetracking HowTo..." }, 1391{ "Timetracking HowTo...","Timetracking HowTo..." },
1392{ "Juni","Juni" }, 1392{ "Juni","Juni" },
1393{ "Juli","Juli" }, 1393{ "Juli","Juli" },
1394{ "ToDo:","ToDo:" }, 1394{ "ToDo:","ToDo:" },
1395{ "Set Calendar","Setze Kalender" }, 1395{ "Set Calendar","Setze Kalender" },
1396{ "Todo: %1","Todo: %1" }, 1396{ "Todo: %1","Todo: %1" },
1397{ ": (Prio ",": (Prio " }, 1397{ ": (Prio ",": (Prio " },
1398{ "Todos","Todos" }, 1398{ "Todos","Todos" },
1399{ "Todo Viewer","Todo Viewer" }, 1399{ "Todo Viewer","Todo Viewer" },
1400{ "Todo ","Todo " }, 1400{ "Todo ","Todo " },
1401{ " Calendar \n Resource "," Kalender \n Resource " }, 1401{ " Calendar \n Resource "," Kalender \n Resource " },
1402{ " Color "," Farbe " }, 1402{ " Color "," Farbe " },
1403{ "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!)" }, 1403{ "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!)" },
1404{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1404{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1405{ "Add new Calendar","Füge Kalender hinzu" }, 1405{ "Add new Calendar","Füge Kalender hinzu" },
1406{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1406{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1407{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, 1407{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" },
1408{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1408{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1409{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1409{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1410{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1410{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1411{ "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>" }, 1411{ "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>" },
1412{ "Global application font for all apps:","Globale Schriftart:" }, 1412{ "Global application font for all apps:","Globale Schriftart:" },
1413{ "Application Font","Applikationsschriftart" }, 1413{ "Application Font","Applikationsschriftart" },
1414{ "Kx/Pi","Kx/Pi" }, 1414{ "Kx/Pi","Kx/Pi" },
1415{ "Backup","Backup" }, 1415{ "Backup","Backup" },
1416{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1416{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1417{ "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!" }, 1417{ "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!" },
1418{ "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!" }, 1418{ "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!" },
1419{ "Choose Color","Wähle Farbe" }, 1419{ "Choose Color","Wähle Farbe" },
1420{ " OK "," OK " }, 1420{ " OK "," OK " },
1421{ " Cancel "," Abbrechen " }, 1421{ " Cancel "," Abbrechen " },
1422{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1422{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1423{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1423{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1424{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1424{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1425{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1425{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1426{ "<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>" }, 1426{ "<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>" },
1427{ "%1\nis running!","%1\nist am Laufen!" }, 1427{ "%1\nis running!","%1\nist am Laufen!" },
1428{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1428{ "Additional Comment:","Zusätzlicher Kommentar:" },
1429{ "Stop and save","Stopp und Speichern" }, 1429{ "Stop and save","Stopp und Speichern" },
1430{ "Continue running","Weiter laufen lassen" }, 1430{ "Continue running","Weiter laufen lassen" },
1431{ "Stop - do not save","Stopp - nicht Speichern" }, 1431{ "Stop - do not save","Stopp - nicht Speichern" },
1432{ "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?" }, 1432{ "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?" },
1433{ "Time mismatch!","Zeiten stimmen nicht!" }, 1433{ "Time mismatch!","Zeiten stimmen nicht!" },
1434{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1434{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1435{ "Yes, stop todo","Ja, stoppe Todo" }, 1435{ "Yes, stop todo","Ja, stoppe Todo" },
1436{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1436{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1437{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1437{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1438{ "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." }, 1438{ "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." },
1439{ "Spouse","Ehegatte" }, 1439{ "Spouse","Ehegatte" },
1440{ "Notes","Notizen" }, 1440{ "Notes","Notizen" },
1441{ "Messanger","Messanger" }, 1441{ "Messanger","Messanger" },
1442{ "Assistant","Assistent" }, 1442{ "Assistant","Assistent" },
1443{ "Manager","Manager" }, 1443{ "Manager","Manager" },
1444{ "Secrecy","Sichtbar" }, 1444{ "Secrecy","Sichtbar" },
1445{ "male","männlich" }, 1445{ "male","männlich" },
1446{ "female","weiblich" }, 1446{ "female","weiblich" },
1447{ "Hide!","Verbergen!" }, 1447{ "Hide!","Verbergen!" },
1448{ "Show!","Anzeigen!" }, 1448{ "Show!","Anzeigen!" },
1449{ "Details","Details" }, 1449{ "Details","Details" },
1450{ "Profession","Beruf" }, 1450{ "Profession","Beruf" },
1451{ "Children","Kinder" }, 1451{ "Children","Kinder" },
1452{ "Department","Abteilung" }, 1452{ "Department","Abteilung" },
1453{ "Backup cancelled","Backup abgebrochen" }, 1453{ "Backup cancelled","Backup abgebrochen" },
1454{ "Backup globally disabled","Backup global abgeschaltet" }, 1454{ "Backup globally disabled","Backup global abgeschaltet" },
1455{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1455{ "Backup succesfully finished","Backup erfolgreich beendet" },
1456{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1456{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1457{ "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" }, 1457{ "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" },
1458{ "","" }, 1458{ "Birthdays","Geburtstage" },
1459{ "","" }, 1459{ "KO/Pi import information!","KO/Pi Import Information!" },
1460{ "","" }, 1460{ "","" },
1461{ "","" }, 1461{ "","" },
1462{ "","" }, 1462{ "","" },
1463{ "","" }, 1463{ "","" },
1464{ "","" }, \ No newline at end of file 1464{ "","" }, \ No newline at end of file
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 08909ed..f179c58 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1354,636 +1354,651 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1354 if ( ! bar.isVisible() ) 1354 if ( ! bar.isVisible() )
1355 return false; 1355 return false;
1356 if ( incCounter % modulo == 0 ) 1356 if ( incCounter % modulo == 0 )
1357 bar.setProgress( incCounter ); 1357 bar.setProgress( incCounter );
1358 ++incCounter; 1358 ++incCounter;
1359 uid = inL->uid(); 1359 uid = inL->uid();
1360 bool skipIncidence = false; 1360 bool skipIncidence = false;
1361 if ( uid.left(15) == QString("last-syncEvent-") ) 1361 if ( uid.left(15) == QString("last-syncEvent-") )
1362 skipIncidence = true; 1362 skipIncidence = true;
1363 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1363 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1364 skipIncidence = true; 1364 skipIncidence = true;
1365 if ( !skipIncidence ) { 1365 if ( !skipIncidence ) {
1366 inR = remote->incidence( uid ); 1366 inR = remote->incidence( uid );
1367 if ( ! inR ) { 1367 if ( ! inR ) {
1368 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1368 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1369 // no conflict ********** add or delete local 1369 // no conflict ********** add or delete local
1370 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1370 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1371 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1371 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1372 checkExternSyncEvent(eventLSyncSharp, inL); 1372 checkExternSyncEvent(eventLSyncSharp, inL);
1373 local->deleteIncidence( inL ); 1373 local->deleteIncidence( inL );
1374 ++deletedEventL; 1374 ++deletedEventL;
1375 } else { 1375 } else {
1376 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1376 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1377 inL->removeID(mCurrentSyncDevice ); 1377 inL->removeID(mCurrentSyncDevice );
1378 ++addedEventR; 1378 ++addedEventR;
1379 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1379 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1380 inL->setLastModified( modifiedCalendar ); 1380 inL->setLastModified( modifiedCalendar );
1381 inR = inL->clone(); 1381 inR = inL->clone();
1382 inR->setIDStr( ":" ); 1382 inR->setIDStr( ":" );
1383 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1383 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1384 remote->addIncidence( inR ); 1384 remote->addIncidence( inR );
1385 } 1385 }
1386 } 1386 }
1387 } else { 1387 } else {
1388 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1388 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1389 checkExternSyncEvent(eventLSyncSharp, inL); 1389 checkExternSyncEvent(eventLSyncSharp, inL);
1390 local->deleteIncidence( inL ); 1390 local->deleteIncidence( inL );
1391 ++deletedEventL; 1391 ++deletedEventL;
1392 } else { 1392 } else {
1393 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1393 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1394 ++addedEventR; 1394 ++addedEventR;
1395 inL->setLastModified( modifiedCalendar ); 1395 inL->setLastModified( modifiedCalendar );
1396 inR = inL->clone(); 1396 inR = inL->clone();
1397 inR->setIDStr( ":" ); 1397 inR->setIDStr( ":" );
1398 remote->addIncidence( inR ); 1398 remote->addIncidence( inR );
1399 } 1399 }
1400 } 1400 }
1401 } 1401 }
1402 } else { 1402 } else {
1403 ++filteredOUT; 1403 ++filteredOUT;
1404 } 1404 }
1405 } 1405 }
1406 } 1406 }
1407 inL = el.next(); 1407 inL = el.next();
1408 } 1408 }
1409 int delFut = 0; 1409 int delFut = 0;
1410 int remRem = 0; 1410 int remRem = 0;
1411 if ( mSyncManager->mWriteBackInFuture ) { 1411 if ( mSyncManager->mWriteBackInFuture ) {
1412 er = remote->rawIncidences(); 1412 er = remote->rawIncidences();
1413 remRem = er.count(); 1413 remRem = er.count();
1414 inR = er.first(); 1414 inR = er.first();
1415 QDateTime dt; 1415 QDateTime dt;
1416 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1416 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1417 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1417 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1418 while ( inR ) { 1418 while ( inR ) {
1419 if ( inR->typeID() == todoID ) { 1419 if ( inR->typeID() == todoID ) {
1420 Todo * t = (Todo*)inR; 1420 Todo * t = (Todo*)inR;
1421 if ( t->hasDueDate() ) 1421 if ( t->hasDueDate() )
1422 dt = t->dtDue(); 1422 dt = t->dtDue();
1423 else 1423 else
1424 dt = cur.addSecs( 62 ); 1424 dt = cur.addSecs( 62 );
1425 } 1425 }
1426 else if (inR->typeID() == eventID ) { 1426 else if (inR->typeID() == eventID ) {
1427 bool ok; 1427 bool ok;
1428 dt = inR->getNextOccurence( cur, &ok ); 1428 dt = inR->getNextOccurence( cur, &ok );
1429 if ( !ok ) 1429 if ( !ok )
1430 dt = cur.addSecs( -62 ); 1430 dt = cur.addSecs( -62 );
1431 } 1431 }
1432 else 1432 else
1433 dt = inR->dtStart(); 1433 dt = inR->dtStart();
1434 if ( dt < cur || dt > end ) { 1434 if ( dt < cur || dt > end ) {
1435 remote->deleteIncidence( inR ); 1435 remote->deleteIncidence( inR );
1436 ++delFut; 1436 ++delFut;
1437 } 1437 }
1438 inR = er.next(); 1438 inR = er.next();
1439 } 1439 }
1440 } 1440 }
1441 bar.hide(); 1441 bar.hide();
1442 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1442 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1443 eventLSync->setReadOnly( false ); 1443 eventLSync->setReadOnly( false );
1444 eventLSync->setDtStart( mLastCalendarSync ); 1444 eventLSync->setDtStart( mLastCalendarSync );
1445 eventRSync->setDtStart( mLastCalendarSync ); 1445 eventRSync->setDtStart( mLastCalendarSync );
1446 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1446 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1447 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1447 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1448 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1448 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1449 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1449 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1450 eventLSync->setReadOnly( true ); 1450 eventLSync->setReadOnly( true );
1451 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1451 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1452 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1452 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1453 remote->addEvent( eventRSync ); 1453 remote->addEvent( eventRSync );
1454 else 1454 else
1455 delete eventRSync; 1455 delete eventRSync;
1456 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1456 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1457 QString mes; 1457 QString mes;
1458 mes .sprintf( i18n("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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR, filteredIN, filteredOUT ); 1458 mes .sprintf( i18n("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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR, filteredIN, filteredOUT );
1459 QString delmess; 1459 QString delmess;
1460 if ( delFut ) { 1460 if ( delFut ) {
1461 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are more\nthan %d weeks in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInPast,mSyncManager->mWriteBackInFuture, remRem-delFut); 1461 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are more\nthan %d weeks in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInPast,mSyncManager->mWriteBackInFuture, remRem-delFut);
1462 mes += delmess; 1462 mes += delmess;
1463 } 1463 }
1464 mes = i18n("Local calendar changed!\n") +mes; 1464 mes = i18n("Local calendar changed!\n") +mes;
1465 mCalendar->checkAlarmForIncidence( 0, true ); 1465 mCalendar->checkAlarmForIncidence( 0, true );
1466 qDebug( mes ); 1466 qDebug( mes );
1467 if ( mSyncManager->mShowSyncSummary ) { 1467 if ( mSyncManager->mShowSyncSummary ) {
1468 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1468 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1469 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1469 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1470 qDebug("KO: WB cancelled "); 1470 qDebug("KO: WB cancelled ");
1471 mSyncManager->mWriteBackFile = false; 1471 mSyncManager->mWriteBackFile = false;
1472 return syncOK; 1472 return syncOK;
1473 } 1473 }
1474 } 1474 }
1475 return syncOK; 1475 return syncOK;
1476} 1476}
1477 1477
1478void CalendarView::setSyncDevice( QString s ) 1478void CalendarView::setSyncDevice( QString s )
1479{ 1479{
1480 mCurrentSyncDevice= s; 1480 mCurrentSyncDevice= s;
1481} 1481}
1482void CalendarView::setSyncName( QString s ) 1482void CalendarView::setSyncName( QString s )
1483{ 1483{
1484 mCurrentSyncName= s; 1484 mCurrentSyncName= s;
1485} 1485}
1486bool CalendarView::syncCalendar(QString filename, int mode) 1486bool CalendarView::syncCalendar(QString filename, int mode)
1487{ 1487{
1488 //qDebug("syncCalendar %s ", filename.latin1()); 1488 //qDebug("syncCalendar %s ", filename.latin1());
1489 mGlobalSyncMode = SYNC_MODE_NORMAL; 1489 mGlobalSyncMode = SYNC_MODE_NORMAL;
1490 CalendarLocal* calendar = new CalendarLocal(); 1490 CalendarLocal* calendar = new CalendarLocal();
1491 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1491 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1492 FileStorage* storage = new FileStorage( calendar ); 1492 FileStorage* storage = new FileStorage( calendar );
1493 bool syncOK = false; 1493 bool syncOK = false;
1494 storage->setFileName( filename ); 1494 storage->setFileName( filename );
1495 // qDebug("loading ... "); 1495 // qDebug("loading ... ");
1496 if ( storage->load() ) { 1496 if ( storage->load() ) {
1497 getEventViewerDialog()->setSyncMode( true ); 1497 getEventViewerDialog()->setSyncMode( true );
1498 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1498 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1499 getEventViewerDialog()->setSyncMode( false ); 1499 getEventViewerDialog()->setSyncMode( false );
1500 if ( syncOK ) { 1500 if ( syncOK ) {
1501 if ( mSyncManager->mWriteBackFile ) 1501 if ( mSyncManager->mWriteBackFile )
1502 { 1502 {
1503 storage->setSaveFormat( new ICalFormat() ); 1503 storage->setSaveFormat( new ICalFormat() );
1504 storage->save(); 1504 storage->save();
1505 } 1505 }
1506 } 1506 }
1507 setModified( true ); 1507 setModified( true );
1508 } 1508 }
1509 delete storage; 1509 delete storage;
1510 delete calendar; 1510 delete calendar;
1511 if ( syncOK ) 1511 if ( syncOK )
1512 updateView(); 1512 updateView();
1513 return syncOK; 1513 return syncOK;
1514} 1514}
1515 1515
1516void CalendarView::syncExternal( int mode ) 1516void CalendarView::syncExternal( int mode )
1517{ 1517{
1518 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1518 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1519 1519
1520 qApp->processEvents(); 1520 qApp->processEvents();
1521 CalendarLocal* calendar = new CalendarLocal(); 1521 CalendarLocal* calendar = new CalendarLocal();
1522 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1522 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1523 bool syncOK = false; 1523 bool syncOK = false;
1524 bool loadSuccess = false; 1524 bool loadSuccess = false;
1525 PhoneFormat* phoneFormat = 0; 1525 PhoneFormat* phoneFormat = 0;
1526 emit tempDisableBR(true); 1526 emit tempDisableBR(true);
1527#ifndef DESKTOP_VERSION 1527#ifndef DESKTOP_VERSION
1528 SharpFormat* sharpFormat = 0; 1528 SharpFormat* sharpFormat = 0;
1529 if ( mode == 0 ) { // sharp 1529 if ( mode == 0 ) { // sharp
1530 sharpFormat = new SharpFormat () ; 1530 sharpFormat = new SharpFormat () ;
1531 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1531 loadSuccess = sharpFormat->load( calendar, mCalendar );
1532 1532
1533 } else 1533 } else
1534#endif 1534#endif
1535 if ( mode == 1 ) { // phone 1535 if ( mode == 1 ) { // phone
1536 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1536 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1537 mSyncManager->mPhoneDevice, 1537 mSyncManager->mPhoneDevice,
1538 mSyncManager->mPhoneConnection, 1538 mSyncManager->mPhoneConnection,
1539 mSyncManager->mPhoneModel); 1539 mSyncManager->mPhoneModel);
1540 loadSuccess = phoneFormat->load( calendar,mCalendar); 1540 loadSuccess = phoneFormat->load( calendar,mCalendar);
1541 1541
1542 } else { 1542 } else {
1543 emit tempDisableBR(false); 1543 emit tempDisableBR(false);
1544 return; 1544 return;
1545 } 1545 }
1546 if ( loadSuccess ) { 1546 if ( loadSuccess ) {
1547 getEventViewerDialog()->setSyncMode( true ); 1547 getEventViewerDialog()->setSyncMode( true );
1548 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1548 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1549 getEventViewerDialog()->setSyncMode( false ); 1549 getEventViewerDialog()->setSyncMode( false );
1550 qApp->processEvents(); 1550 qApp->processEvents();
1551 if ( syncOK ) { 1551 if ( syncOK ) {
1552 if ( mSyncManager->mWriteBackFile ) 1552 if ( mSyncManager->mWriteBackFile )
1553 { 1553 {
1554 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1554 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1555 Incidence* inc = iL.first(); 1555 Incidence* inc = iL.first();
1556 if ( phoneFormat ) { 1556 if ( phoneFormat ) {
1557 while ( inc ) { 1557 while ( inc ) {
1558 inc->removeID(mCurrentSyncDevice); 1558 inc->removeID(mCurrentSyncDevice);
1559 inc = iL.next(); 1559 inc = iL.next();
1560 } 1560 }
1561 } 1561 }
1562#ifndef DESKTOP_VERSION 1562#ifndef DESKTOP_VERSION
1563 if ( sharpFormat ) 1563 if ( sharpFormat )
1564 sharpFormat->save(calendar); 1564 sharpFormat->save(calendar);
1565#endif 1565#endif
1566 if ( phoneFormat ) 1566 if ( phoneFormat )
1567 phoneFormat->save(calendar); 1567 phoneFormat->save(calendar);
1568 iL = calendar->rawIncidences(); 1568 iL = calendar->rawIncidences();
1569 inc = iL.first(); 1569 inc = iL.first();
1570 Incidence* loc; 1570 Incidence* loc;
1571 while ( inc ) { 1571 while ( inc ) {
1572 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1572 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1573 loc = mCalendar->incidence(inc->uid() ); 1573 loc = mCalendar->incidence(inc->uid() );
1574 if ( loc ) { 1574 if ( loc ) {
1575 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1575 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1576 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1576 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1577 } 1577 }
1578 } 1578 }
1579 inc = iL.next(); 1579 inc = iL.next();
1580 } 1580 }
1581 Incidence* lse = getLastSyncEvent(); 1581 Incidence* lse = getLastSyncEvent();
1582 if ( lse ) { 1582 if ( lse ) {
1583 lse->setReadOnly( false ); 1583 lse->setReadOnly( false );
1584 lse->setDescription( "" ); 1584 lse->setDescription( "" );
1585 lse->setReadOnly( true ); 1585 lse->setReadOnly( true );
1586 } 1586 }
1587 } 1587 }
1588 } else { 1588 } else {
1589 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1589 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1590 } 1590 }
1591 setModified( true ); 1591 setModified( true );
1592 } else { 1592 } else {
1593 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1593 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1594 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1594 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1595 question, i18n("Ok")) ; 1595 question, i18n("Ok")) ;
1596 1596
1597 } 1597 }
1598 delete calendar; 1598 delete calendar;
1599 updateView(); 1599 updateView();
1600 emit tempDisableBR(false); 1600 emit tempDisableBR(false);
1601 return ;//syncOK; 1601 return ;//syncOK;
1602 1602
1603} 1603}
1604 1604
1605bool CalendarView::importBday() 1605bool CalendarView::importBday()
1606{ 1606{
1607#ifndef KORG_NOKABC 1607#ifndef KORG_NOKABC
1608 1608
1609#ifdef DESKTOP_VERSION 1609#ifdef DESKTOP_VERSION
1610 int curCal = mCalendar->defaultCalendar();
1611 int bd = mCalEditView->getBirtdayID();
1612 if ( bd == 0 )
1613 return;
1614 mCalendar->setDefaultCalendar( bd );
1610 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1615 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1611 KABC::AddressBook::Iterator it; 1616 KABC::AddressBook::Iterator it;
1612 int count = 0; 1617 int count = 0;
1613 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1618 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1614 ++count; 1619 ++count;
1615 } 1620 }
1616 QProgressBar bar(count,0 ); 1621 QProgressBar bar(count,0 );
1617 int w = 300; 1622 int w = 300;
1618 if ( QApplication::desktop()->width() < 320 ) 1623 if ( QApplication::desktop()->width() < 320 )
1619 w = 220; 1624 w = 220;
1620 int h = bar.sizeHint().height() ; 1625 int h = bar.sizeHint().height() ;
1621 int dw = QApplication::desktop()->width(); 1626 int dw = QApplication::desktop()->width();
1622 int dh = QApplication::desktop()->height(); 1627 int dh = QApplication::desktop()->height();
1623 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1628 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1624 bar.show(); 1629 bar.show();
1625 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1630 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1626 qApp->processEvents(); 1631 qApp->processEvents();
1627 count = 0; 1632 count = 0;
1628 int addCount = 0; 1633 int addCount = 0;
1629 KCal::Attendee* a = 0; 1634 KCal::Attendee* a = 0;
1630 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1635 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1631 if ( ! bar.isVisible() ) 1636 if ( ! bar.isVisible() )
1632 return false; 1637 return false;
1633 bar.setProgress( count++ ); 1638 bar.setProgress( count++ );
1634 qApp->processEvents(); 1639 qApp->processEvents();
1635 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1640 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1636 if ( (*it).birthday().date().isValid() ){ 1641 if ( (*it).birthday().date().isValid() ){
1637 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1642 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1638 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1643 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1639 ++addCount; 1644 ++addCount;
1640 } 1645 }
1641 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1646 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1642 if ( anni.isValid() ){ 1647 if ( anni.isValid() ){
1643 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1648 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1644 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1649 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1645 ++addCount; 1650 ++addCount;
1646 } 1651 }
1647 } 1652 }
1653 mCalendar->setDefaultCalendar( curCal );
1648 updateView(); 1654 updateView();
1649 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1655 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1650#else //DESKTOP_VERSION 1656#else //DESKTOP_VERSION
1651 1657
1652 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1658 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1653 // the result should now arrive through method insertBirthdays 1659 // the result should now arrive through method insertBirthdays
1654 1660
1655#endif //DESKTOP_VERSION 1661#endif //DESKTOP_VERSION
1656 1662
1657#endif //KORG_NOKABC 1663#endif //KORG_NOKABC
1658 1664
1659 1665
1660 return true; 1666 return true;
1661} 1667}
1662 1668
1663// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1669// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1664void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1670void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1665 const QStringList& anniversaryList, const QStringList& realNameList, 1671 const QStringList& anniversaryList, const QStringList& realNameList,
1666 const QStringList& emailList, const QStringList& assembledNameList, 1672 const QStringList& emailList, const QStringList& assembledNameList,
1667 const QStringList& uidList) 1673 const QStringList& uidList)
1668{ 1674{
1675
1669 //qDebug("KO::CalendarView::insertBirthdays"); 1676 //qDebug("KO::CalendarView::insertBirthdays");
1670 if (uid == this->name()) 1677 if (uid == this->name())
1671 { 1678 {
1679 int curCal = mCalendar->defaultCalendar();
1680 int bd = mCalEditView->getBirtdayID();
1681 if ( bd == 0 )
1682 return;
1683 mCalendar->setDefaultCalendar( bd );
1684
1685
1672 int count = birthdayList.count(); 1686 int count = birthdayList.count();
1673 int addCount = 0; 1687 int addCount = 0;
1674 KCal::Attendee* a = 0; 1688 KCal::Attendee* a = 0;
1675 1689
1676 //qDebug("CalView 1 %i", count); 1690 //qDebug("CalView 1 %i", count);
1677 1691
1678 QProgressBar bar(count,0 ); 1692 QProgressBar bar(count,0 );
1679 int w = 300; 1693 int w = 300;
1680 if ( QApplication::desktop()->width() < 320 ) 1694 if ( QApplication::desktop()->width() < 320 )
1681 w = 220; 1695 w = 220;
1682 int h = bar.sizeHint().height() ; 1696 int h = bar.sizeHint().height() ;
1683 int dw = QApplication::desktop()->width(); 1697 int dw = QApplication::desktop()->width();
1684 int dh = QApplication::desktop()->height(); 1698 int dh = QApplication::desktop()->height();
1685 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1699 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1686 bar.show(); 1700 bar.show();
1687 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1701 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1688 qApp->processEvents(); 1702 qApp->processEvents();
1689 1703
1690 QDate birthday; 1704 QDate birthday;
1691 QDate anniversary; 1705 QDate anniversary;
1692 QString realName; 1706 QString realName;
1693 QString email; 1707 QString email;
1694 QString assembledName; 1708 QString assembledName;
1695 QString uid; 1709 QString uid;
1696 bool ok = true; 1710 bool ok = true;
1697 for ( int i = 0; i < count; i++) 1711 for ( int i = 0; i < count; i++)
1698 { 1712 {
1699 if ( ! bar.isVisible() ) 1713 if ( ! bar.isVisible() )
1700 return; 1714 return;
1701 bar.setProgress( i ); 1715 bar.setProgress( i );
1702 qApp->processEvents(); 1716 qApp->processEvents();
1703 1717
1704 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1718 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1705 if (!ok) { 1719 if (!ok) {
1706 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1720 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1707 } 1721 }
1708 1722
1709 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1723 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1710 if (!ok) { 1724 if (!ok) {
1711 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1725 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1712 } 1726 }
1713 realName = realNameList[i]; 1727 realName = realNameList[i];
1714 email = emailList[i]; 1728 email = emailList[i];
1715 assembledName = assembledNameList[i]; 1729 assembledName = assembledNameList[i];
1716 uid = uidList[i]; 1730 uid = uidList[i];
1717 //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() ); 1731 //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() );
1718 1732
1719 if ( birthday.isValid() ){ 1733 if ( birthday.isValid() ){
1720 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1734 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1721 KCal::Attendee::ReqParticipant,uid) ; 1735 KCal::Attendee::ReqParticipant,uid) ;
1722 if ( addAnniversary( birthday, assembledName, a, true ) ) 1736 if ( addAnniversary( birthday, assembledName, a, true ) )
1723 ++addCount; 1737 ++addCount;
1724 } 1738 }
1725 1739
1726 if ( anniversary.isValid() ){ 1740 if ( anniversary.isValid() ){
1727 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1741 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1728 KCal::Attendee::ReqParticipant,uid) ; 1742 KCal::Attendee::ReqParticipant,uid) ;
1729 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1743 if ( addAnniversary( anniversary, assembledName, a, false ) )
1730 ++addCount; 1744 ++addCount;
1731 } 1745 }
1732 } 1746 }
1733 1747
1748 mCalendar->setDefaultCalendar( curCal );
1734 updateView(); 1749 updateView();
1735 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1750 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1736 1751
1737 } 1752 }
1738 1753
1739} 1754}
1740 1755
1741 1756
1742 1757
1743bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1758bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1744{ 1759{
1745 //qDebug("addAnni "); 1760 //qDebug("addAnni ");
1746 Event * ev = new Event(); 1761 Event * ev = new Event();
1747 ev->setOrganizer(KOPrefs::instance()->email()); 1762 ev->setOrganizer(KOPrefs::instance()->email());
1748 if ( a ) { 1763 if ( a ) {
1749 ev->addAttendee( a ); 1764 ev->addAttendee( a );
1750 } 1765 }
1751 QString kind; 1766 QString kind;
1752 if ( birthday ) { 1767 if ( birthday ) {
1753 kind = i18n( "Birthday" ); 1768 kind = i18n( "Birthday" );
1754 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 1769 ev->setSummary( name + " (" + QString::number(date.year()) +")");
1755 } 1770 }
1756 else { 1771 else {
1757 kind = i18n( "Anniversary" ); 1772 kind = i18n( "Anniversary" );
1758 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 1773 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
1759 } 1774 }
1760 ev->setCategories( kind ); 1775 ev->setCategories( kind );
1761 ev->setDtStart( QDateTime(date) ); 1776 ev->setDtStart( QDateTime(date) );
1762 ev->setDtEnd( QDateTime(date) ); 1777 ev->setDtEnd( QDateTime(date) );
1763 ev->setFloats( true ); 1778 ev->setFloats( true );
1764 Recurrence * rec = ev->recurrence(); 1779 Recurrence * rec = ev->recurrence();
1765 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1780 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1766 rec->addYearlyNum( date.month() ); 1781 rec->addYearlyNum( date.month() );
1767 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1782 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1768 delete ev; 1783 delete ev;
1769 return false; 1784 return false;
1770 } 1785 }
1771 return true; 1786 return true;
1772 1787
1773} 1788}
1774bool CalendarView::importQtopia( const QString &categories, 1789bool CalendarView::importQtopia( const QString &categories,
1775 const QString &datebook, 1790 const QString &datebook,
1776 const QString &todolist ) 1791 const QString &todolist )
1777{ 1792{
1778 1793
1779 QtopiaFormat qtopiaFormat; 1794 QtopiaFormat qtopiaFormat;
1780 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1795 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1781 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1796 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1782 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1797 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1783 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1798 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1784 1799
1785 updateView(); 1800 updateView();
1786 return true; 1801 return true;
1787 1802
1788#if 0 1803#if 0
1789 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1804 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1790 mCurrentSyncDevice = "qtopia-XML"; 1805 mCurrentSyncDevice = "qtopia-XML";
1791 if ( mSyncManager->mAskForPreferences ) 1806 if ( mSyncManager->mAskForPreferences )
1792 edit_sync_options(); 1807 edit_sync_options();
1793 qApp->processEvents(); 1808 qApp->processEvents();
1794 CalendarLocal* calendar = new CalendarLocal(); 1809 CalendarLocal* calendar = new CalendarLocal();
1795 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1810 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1796 bool syncOK = false; 1811 bool syncOK = false;
1797 QtopiaFormat qtopiaFormat; 1812 QtopiaFormat qtopiaFormat;
1798 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1813 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1799 bool loadOk = true; 1814 bool loadOk = true;
1800 if ( !categories.isEmpty() ) 1815 if ( !categories.isEmpty() )
1801 loadOk = qtopiaFormat.load( calendar, categories ); 1816 loadOk = qtopiaFormat.load( calendar, categories );
1802 if ( loadOk && !datebook.isEmpty() ) 1817 if ( loadOk && !datebook.isEmpty() )
1803 loadOk = qtopiaFormat.load( calendar, datebook ); 1818 loadOk = qtopiaFormat.load( calendar, datebook );
1804 if ( loadOk && !todolist.isEmpty() ) 1819 if ( loadOk && !todolist.isEmpty() )
1805 loadOk = qtopiaFormat.load( calendar, todolist ); 1820 loadOk = qtopiaFormat.load( calendar, todolist );
1806 1821
1807 if ( loadOk ) { 1822 if ( loadOk ) {
1808 getEventViewerDialog()->setSyncMode( true ); 1823 getEventViewerDialog()->setSyncMode( true );
1809 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1824 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1810 getEventViewerDialog()->setSyncMode( false ); 1825 getEventViewerDialog()->setSyncMode( false );
1811 qApp->processEvents(); 1826 qApp->processEvents();
1812 if ( syncOK ) { 1827 if ( syncOK ) {
1813 if ( mSyncManager->mWriteBackFile ) 1828 if ( mSyncManager->mWriteBackFile )
1814 { 1829 {
1815 // write back XML file 1830 // write back XML file
1816 1831
1817 } 1832 }
1818 setModified( true ); 1833 setModified( true );
1819 } 1834 }
1820 } else { 1835 } else {
1821 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1836 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1822 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1837 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1823 question, i18n("Ok")) ; 1838 question, i18n("Ok")) ;
1824 } 1839 }
1825 delete calendar; 1840 delete calendar;
1826 updateView(); 1841 updateView();
1827 return syncOK; 1842 return syncOK;
1828 1843
1829 1844
1830#endif 1845#endif
1831 1846
1832} 1847}
1833 1848
1834void CalendarView::setSyncEventsReadOnly() 1849void CalendarView::setSyncEventsReadOnly()
1835{ 1850{
1836 mCalendar->setSyncEventsReadOnly(); 1851 mCalendar->setSyncEventsReadOnly();
1837} 1852}
1838 1853
1839bool CalendarView::loadCalendars() 1854bool CalendarView::loadCalendars()
1840{ 1855{
1841 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1856 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1842 KopiCalendarFile * cal = calendars.first(); 1857 KopiCalendarFile * cal = calendars.first();
1843 mCalendar->setDefaultCalendar( 1 ); 1858 mCalendar->setDefaultCalendar( 1 );
1844 openCalendar( MainWindow::defaultFileName(), false ); 1859 openCalendar( MainWindow::defaultFileName(), false );
1845 cal = calendars.next(); 1860 cal = calendars.next();
1846 while ( cal ) { 1861 while ( cal ) {
1847 addCalendar( cal ); 1862 addCalendar( cal );
1848 cal = calendars.next(); 1863 cal = calendars.next();
1849 } 1864 }
1850 restoreCalendarSettings(); 1865 restoreCalendarSettings();
1851 return true; 1866 return true;
1852} 1867}
1853bool CalendarView::restoreCalendarSettings() 1868bool CalendarView::restoreCalendarSettings()
1854{ 1869{
1855 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1870 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1856 KopiCalendarFile * cal = calendars.first(); 1871 KopiCalendarFile * cal = calendars.first();
1857 while ( cal ) { 1872 while ( cal ) {
1858 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 1873 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
1859 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 1874 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
1860 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 1875 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
1861 if ( cal->isStandard ) 1876 if ( cal->isStandard )
1862 mCalendar->setDefaultCalendar( cal->mCalNumber ); 1877 mCalendar->setDefaultCalendar( cal->mCalNumber );
1863 cal = calendars.next(); 1878 cal = calendars.next();
1864 } 1879 }
1865 setSyncEventsReadOnly(); 1880 setSyncEventsReadOnly();
1866 mCalendar->reInitAlarmSettings(); 1881 mCalendar->reInitAlarmSettings();
1867 updateUnmanagedViews(); 1882 updateUnmanagedViews();
1868 updateView(); 1883 updateView();
1869 return true; 1884 return true;
1870} 1885}
1871void CalendarView::addCalendarId( int id ) 1886void CalendarView::addCalendarId( int id )
1872{ 1887{
1873 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 1888 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
1874 addCalendar( cal ); 1889 addCalendar( cal );
1875} 1890}
1876bool CalendarView::addCalendar( KopiCalendarFile * cal ) 1891bool CalendarView::addCalendar( KopiCalendarFile * cal )
1877{ 1892{
1878 cal->mErrorOnLoad = false; 1893 cal->mErrorOnLoad = false;
1879 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 1894 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
1880 cal->mLoadDt = QDateTime::currentDateTime(); 1895 cal->mLoadDt = QDateTime::currentDateTime();
1881 return true; 1896 return true;
1882 } 1897 }
1883 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() ); 1898 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() );
1884 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName)); 1899 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName));
1885 cal->mErrorOnLoad = true; 1900 cal->mErrorOnLoad = true;
1886 return false; 1901 return false;
1887} 1902}
1888bool CalendarView::openCalendar(QString filename, bool merge) 1903bool CalendarView::openCalendar(QString filename, bool merge)
1889{ 1904{
1890 1905
1891 if (filename.isEmpty()) { 1906 if (filename.isEmpty()) {
1892 return false; 1907 return false;
1893 } 1908 }
1894 1909
1895 if (!QFile::exists(filename)) { 1910 if (!QFile::exists(filename)) {
1896 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1911 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1897 return false; 1912 return false;
1898 } 1913 }
1899 1914
1900 globalFlagBlockAgenda = 1; 1915 globalFlagBlockAgenda = 1;
1901 clearAllViews(); 1916 clearAllViews();
1902 if (!merge) { 1917 if (!merge) {
1903 mViewManager->setDocumentId( filename ); 1918 mViewManager->setDocumentId( filename );
1904 mCalendar->close(); 1919 mCalendar->close();
1905 } 1920 }
1906 mStorage->setFileName( filename ); 1921 mStorage->setFileName( filename );
1907 1922
1908 if ( mStorage->load() ) { 1923 if ( mStorage->load() ) {
1909 if ( merge ) ;//setModified( true ); 1924 if ( merge ) ;//setModified( true );
1910 else { 1925 else {
1911 //setModified( true ); 1926 //setModified( true );
1912 mViewManager->setDocumentId( filename ); 1927 mViewManager->setDocumentId( filename );
1913 mDialogManager->setDocumentId( filename ); 1928 mDialogManager->setDocumentId( filename );
1914 mTodoList->setDocumentId( filename ); 1929 mTodoList->setDocumentId( filename );
1915 } 1930 }
1916 globalFlagBlockAgenda = 2; 1931 globalFlagBlockAgenda = 2;
1917 // if ( getLastSyncEvent() ) 1932 // if ( getLastSyncEvent() )
1918 // getLastSyncEvent()->setReadOnly( true ); 1933 // getLastSyncEvent()->setReadOnly( true );
1919 mCalendar->reInitAlarmSettings(); 1934 mCalendar->reInitAlarmSettings();
1920 setSyncEventsReadOnly(); 1935 setSyncEventsReadOnly();
1921 updateUnmanagedViews(); 1936 updateUnmanagedViews();
1922 updateView(); 1937 updateView();
1923 if ( filename != MainWindow::defaultFileName() ) { 1938 if ( filename != MainWindow::defaultFileName() ) {
1924 saveCalendar( MainWindow::defaultFileName() ); 1939 saveCalendar( MainWindow::defaultFileName() );
1925 } else { 1940 } else {
1926 QFileInfo finf ( MainWindow::defaultFileName()); 1941 QFileInfo finf ( MainWindow::defaultFileName());
1927 if ( finf.exists() ) { 1942 if ( finf.exists() ) {
1928 setLoadedFileVersion( finf.lastModified () ); 1943 setLoadedFileVersion( finf.lastModified () );
1929 } 1944 }
1930 } 1945 }
1931 return true; 1946 return true;
1932 } else { 1947 } else {
1933 // while failing to load, the calendar object could 1948 // while failing to load, the calendar object could
1934 // have become partially populated. Clear it out. 1949 // have become partially populated. Clear it out.
1935 if ( !merge ) { 1950 if ( !merge ) {
1936 mCalendar->close(); 1951 mCalendar->close();
1937 mViewManager->setDocumentId( filename ); 1952 mViewManager->setDocumentId( filename );
1938 mDialogManager->setDocumentId( filename ); 1953 mDialogManager->setDocumentId( filename );
1939 mTodoList->setDocumentId( filename ); 1954 mTodoList->setDocumentId( filename );
1940 } 1955 }
1941 1956
1942 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 1957 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1943 1958
1944 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 1959 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
1945 globalFlagBlockAgenda = 2; 1960 globalFlagBlockAgenda = 2;
1946 mCalendar->reInitAlarmSettings(); 1961 mCalendar->reInitAlarmSettings();
1947 setSyncEventsReadOnly(); 1962 setSyncEventsReadOnly();
1948 updateUnmanagedViews(); 1963 updateUnmanagedViews();
1949 updateView(); 1964 updateView();
1950 } 1965 }
1951 return false; 1966 return false;
1952} 1967}
1953void CalendarView::showOpenError() 1968void CalendarView::showOpenError()
1954{ 1969{
1955 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 1970 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
1956} 1971}
1957void CalendarView::setLoadedFileVersion(QDateTime dt) 1972void CalendarView::setLoadedFileVersion(QDateTime dt)
1958{ 1973{
1959 loadedFileVersion = dt; 1974 loadedFileVersion = dt;
1960} 1975}
1961bool CalendarView::checkFileChanged(QString fn) 1976bool CalendarView::checkFileChanged(QString fn)
1962{ 1977{
1963 QFileInfo finf ( fn ); 1978 QFileInfo finf ( fn );
1964 if ( !finf.exists() ) 1979 if ( !finf.exists() )
1965 return true; 1980 return true;
1966 QDateTime dt = finf.lastModified (); 1981 QDateTime dt = finf.lastModified ();
1967 if ( dt <= loadedFileVersion ) 1982 if ( dt <= loadedFileVersion )
1968 return false; 1983 return false;
1969 return true; 1984 return true;
1970 1985
1971} 1986}
1972void CalendarView::watchSavedFile() 1987void CalendarView::watchSavedFile()
1973{ 1988{
1974 QFileInfo finf ( MainWindow::defaultFileName()); 1989 QFileInfo finf ( MainWindow::defaultFileName());
1975 if ( !finf.exists() ) 1990 if ( !finf.exists() )
1976 return; 1991 return;
1977 QDateTime dt = finf.lastModified (); 1992 QDateTime dt = finf.lastModified ();
1978 if ( dt < loadedFileVersion ) { 1993 if ( dt < loadedFileVersion ) {
1979 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 1994 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
1980 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 1995 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
1981 return; 1996 return;
1982 } 1997 }
1983 loadedFileVersion = dt; 1998 loadedFileVersion = dt;
1984} 1999}
1985bool CalendarView::checkAllFileVersions() 2000bool CalendarView::checkAllFileVersions()
1986{ 2001{
1987 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2002 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1988 KopiCalendarFile * cal = calendars.first(); 2003 KopiCalendarFile * cal = calendars.first();
1989 mCalendar->setDefaultCalendar( 1 ); 2004 mCalendar->setDefaultCalendar( 1 );
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index a8a3052..3cde103 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -101,334 +101,354 @@ void KOFilterView::setSelectedFilter(QString filterName)
101} 101}
102void KOFilterView::setSelectedFilter( int fil ) 102void KOFilterView::setSelectedFilter( int fil )
103{ 103{
104 if ( fil >= mSelectionCombo->count() ) 104 if ( fil >= mSelectionCombo->count() )
105 return; 105 return;
106 mSelectionCombo->setCurrentItem( fil ); 106 mSelectionCombo->setCurrentItem( fil );
107 emit filterChanged(); 107 emit filterChanged();
108} 108}
109 109
110 110
111 111
112KOCalEditView::KOCalEditView(QWidget* parent, 112KOCalEditView::KOCalEditView(QWidget* parent,
113 const char* name ) 113 const char* name )
114 : QScrollView(parent,name) 114 : QScrollView(parent,name)
115{ 115{
116 mw = 0; 116 mw = 0;
117 setResizePolicy( AutoOneFit ); 117 setResizePolicy( AutoOneFit );
118 setFrameStyle ( QFrame::Panel | QFrame::Plain ); 118 setFrameStyle ( QFrame::Panel | QFrame::Plain );
119 setLineWidth ( 1 ); 119 setLineWidth ( 1 );
120 setMidLineWidth ( 1 ); 120 setMidLineWidth ( 1 );
121 setFocusPolicy(NoFocus); 121 setFocusPolicy(NoFocus);
122} 122}
123 123
124KOCalEditView::~KOCalEditView() 124KOCalEditView::~KOCalEditView()
125{ 125{
126 // no need to delete child widgets, Qt does it all for us 126 // no need to delete child widgets, Qt does it all for us
127} 127}
128void KOCalEditView::selectCal(int id ,bool b) 128void KOCalEditView::selectCal(int id ,bool b)
129{ 129{
130 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 130 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
131 emit calendarEnabled ( id, b ); 131 emit calendarEnabled ( id, b );
132 emit needsUpdate(); 132 emit needsUpdate();
133 133
134} 134}
135void KOCalEditView::selectStdCal( int id, bool b ) 135void KOCalEditView::selectStdCal( int id, bool b )
136{ 136{
137 137
138 if ( !b ) { 138 if ( !b ) {
139 KOCalCheckButton* it = (KOCalCheckButton*) sender(); 139 KOCalCheckButton* it = (KOCalCheckButton*) sender();
140 if ( it ) { 140 if ( it ) {
141 it->blockSignals( true ); 141 it->blockSignals( true );
142 it->setChecked( true ); 142 it->setChecked( true );
143 it->blockSignals( false ); 143 it->blockSignals( false );
144 return; 144 return;
145 } 145 }
146 return; 146 return;
147 } 147 }
148 KOCalRadioButton* sen = (KOCalRadioButton*) sender(); 148 KOCalRadioButton* sen = (KOCalRadioButton*) sender();
149 KOCalRadioButton* it = mStdandardB.first(); 149 KOCalRadioButton* it = mStdandardB.first();
150 while ( it ) { 150 while ( it ) {
151 if ( it->isChecked() ) { 151 if ( it->isChecked() ) {
152 if ( it != sen ) { 152 if ( it != sen ) {
153 it->blockSignals( true ); 153 it->blockSignals( true );
154 it->setChecked( false ); 154 it->setChecked( false );
155 it->blockSignals( false ); 155 it->blockSignals( false );
156 break; 156 break;
157 } 157 }
158 } 158 }
159 it = mStdandardB.next(); 159 it = mStdandardB.next();
160 } 160 }
161 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 161 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
162 while ( kkf ) { 162 while ( kkf ) {
163 kkf->isStandard = false; 163 kkf->isStandard = false;
164 kkf = KOPrefs::instance()->mCalendars.next(); 164 kkf = KOPrefs::instance()->mCalendars.next();
165 } 165 }
166 KOPrefs::instance()->getCalendar( id )->isStandard = true; 166 KOPrefs::instance()->getCalendar( id )->isStandard = true;
167 emit setCalendarDefault ( id ); 167 emit setCalendarDefault ( id );
168} 168}
169 169
170void KOCalEditView::selectCalAlarm(int id ,bool b ) 170void KOCalEditView::selectCalAlarm(int id ,bool b )
171{ 171{
172 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 172 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
173 emit alarmEnabled ( id , b ); 173 emit alarmEnabled ( id , b );
174 emit needsUpdate(); 174 emit needsUpdate();
175} 175}
176void KOCalEditView::selectReadOnly(int id ,bool b ) 176void KOCalEditView::selectReadOnly(int id ,bool b )
177{ 177{
178 KOPrefs::instance()->getCalendar( id )->isReadOnly = b; 178 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
179 emit calendarReadonly ( id , b ); 179 emit calendarReadonly ( id , b );
180 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) { 180 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) {
181 KOPrefs::instance()->getCalendar( id )->isStandard = false; 181 KOPrefs::instance()->getCalendar( id )->isStandard = false;
182 KOPrefs::instance()->getCalendar( 1 )->isStandard = true; 182 KOPrefs::instance()->getCalendar( 1 )->isStandard = true;
183 mStdandardB.at(0)->setChecked( true ); 183 mStdandardB.at(0)->setChecked( true );
184 mStdandardB.at(id-1)->setChecked( false ); 184 mStdandardB.at(id-1)->setChecked( false );
185 emit setCalendarDefault ( 1 ); 185 emit setCalendarDefault ( 1 );
186 } 186 }
187 mStdandardB.at(id-1)->setEnabled( !b ); 187 mStdandardB.at(id-1)->setEnabled( !b );
188 emit needsUpdate(); 188 emit needsUpdate();
189 189
190} 190}
191void KOCalEditView::setColor( const QColor& c, int id ) 191void KOCalEditView::setColor( const QColor& c, int id )
192{ 192{
193 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 193 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
194 emit needsUpdate(); 194 emit needsUpdate();
195} 195}
196void KOCalEditView::deleteCal( int id ) 196void KOCalEditView::deleteCal( int id )
197{ 197{
198 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 198 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
199 QString name = kkf->mName; 199 QString name = kkf->mName;
200 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 200 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
201 if ( KMessageBox::warningContinueCancel( this, i18n("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!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 201 if ( KMessageBox::warningContinueCancel( this, i18n("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!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
202 if ( kkf->isStandard ) 202 if ( kkf->isStandard )
203 selectStdCal( 1, true ); 203 selectStdCal( 1, true );
204 emit removeCalendar ( id ); 204 emit removeCalendar ( id );
205 KOPrefs::instance()->mCalendars.remove ( kkf ); 205 KOPrefs::instance()->mCalendars.remove ( kkf );
206 emit needsUpdate(); 206 emit needsUpdate();
207 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 207 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
208} 208}
209void KOCalEditView::infoCal( int id ) 209void KOCalEditView::infoCal( int id )
210{ 210{
211 QString name = KOPrefs::instance()->getCalendar( id )->mName; 211 QString name = KOPrefs::instance()->getCalendar( id )->mName;
212 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 212 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
213 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { 213 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) {
214 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { 214 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
215 emit calendarAdded( id ); 215 emit calendarAdded( id );
216 emit needsUpdate(); 216 emit needsUpdate();
217 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 217 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
218 } 218 }
219 } 219 }
220 else 220 else
221 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); 221 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) );
222} 222}
223void KOCalEditView::readConfig() 223void KOCalEditView::readConfig()
224{ 224{
225 225
226 mStdandardB.clear(); 226 mStdandardB.clear();
227 mEnabledB.clear(); 227 mEnabledB.clear();
228 mAlarmB.clear(); 228 mAlarmB.clear();
229 mROB.clear(); 229 mROB.clear();
230 230
231 if ( mw ) delete mw; 231 if ( mw ) delete mw;
232 mw = new QWidget ( viewport() ); 232 mw = new QWidget ( viewport() );
233 addChild(mw); 233 addChild(mw);
234 int ii = 0; 234 int ii = 0;
235 mainLayout = new QGridLayout ( mw , 2, 8 ); 235 mainLayout = new QGridLayout ( mw , 2, 8 );
236 mainLayout->setMargin( 2 ); 236 mainLayout->setMargin( 2 );
237 mainLayout->setSpacing( 2 ); 237 mainLayout->setSpacing( 2 );
238 QPushButton * addBut = new QPushButton ( mw ); 238 QPushButton * addBut = new QPushButton ( mw );
239 addBut->setFocusPolicy(NoFocus); 239 addBut->setFocusPolicy(NoFocus);
240 mainLayout->addWidget( addBut,0,0 ); 240 mainLayout->addWidget( addBut,0,0 );
241 addBut->setText( "D"); 241 addBut->setText( "D");
242 connect(addBut,SIGNAL(clicked()),SLOT(defaultInfo())); 242 connect(addBut,SIGNAL(clicked()),SLOT(defaultInfo()));
243 //addBut->setPixmap ( SmallIcon("greenhook16")); 243 //addBut->setPixmap ( SmallIcon("greenhook16"));
244 addBut->setMaximumWidth( addBut->sizeHint().height() ); 244 addBut->setMaximumWidth( addBut->sizeHint().height() );
245 int max = addBut->sizeHint().height(); 245 int max = addBut->sizeHint().height();
246 addBut = new QPushButton ( mw ); 246 addBut = new QPushButton ( mw );
247 addBut->setFocusPolicy(NoFocus); 247 addBut->setFocusPolicy(NoFocus);
248 mainLayout->addWidget( addBut,0,++ii ); 248 mainLayout->addWidget( addBut,0,++ii );
249 addBut->setPixmap ( SmallIcon("eye")); 249 addBut->setPixmap ( SmallIcon("eye"));
250 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 250 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
251 addBut->setMaximumWidth( addBut->sizeHint().height() ); 251 addBut->setMaximumWidth( addBut->sizeHint().height() );
252 252
253 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); 253 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
254 mainLayout->addWidget( lab,0,++ii ); 254 mainLayout->addWidget( lab,0,++ii );
255 //lab = new QLabel ( i18n(" "), mw ); 255 //lab = new QLabel ( i18n(" "), mw );
256 //mainLayout->addWidget( lab,0,++ii ); 256 //mainLayout->addWidget( lab,0,++ii );
257 //lab->setFixedWidth( 1 ); 257 //lab->setFixedWidth( 1 );
258 addBut = new QPushButton ( mw ); 258 addBut = new QPushButton ( mw );
259 addBut->setFocusPolicy(NoFocus); 259 addBut->setFocusPolicy(NoFocus);
260 mainLayout->addWidget( addBut,0,++ii ); 260 mainLayout->addWidget( addBut,0,++ii );
261 addBut->setPixmap ( SmallIcon("bell")); 261 addBut->setPixmap ( SmallIcon("bell"));
262 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 262 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
263 addBut->setMaximumWidth( addBut->sizeHint().height() ); 263 addBut->setMaximumWidth( addBut->sizeHint().height() );
264 264
265 addBut = new QPushButton ( mw ); 265 addBut = new QPushButton ( mw );
266 addBut->setFocusPolicy(NoFocus); 266 addBut->setFocusPolicy(NoFocus);
267 mainLayout->addWidget( addBut,0,++ii ); 267 mainLayout->addWidget( addBut,0,++ii );
268 addBut->setPixmap ( SmallIcon("pencil")); 268 addBut->setPixmap ( SmallIcon("pencil"));
269 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 269 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
270 addBut->setMaximumWidth( addBut->sizeHint().height() ); 270 addBut->setMaximumWidth( addBut->sizeHint().height() );
271 lab = new QLabel ( "", mw ); 271 lab = new QLabel ( "", mw );
272 mainLayout->addWidget( lab,0,++ii ); 272 mainLayout->addWidget( lab,0,++ii );
273 273
274 addBut = new QPushButton ( mw ); 274 addBut = new QPushButton ( mw );
275 addBut->setFocusPolicy(NoFocus); 275 addBut->setFocusPolicy(NoFocus);
276 mainLayout->addWidget( addBut,0,++ii ); 276 mainLayout->addWidget( addBut,0,++ii );
277 addBut->setPixmap ( SmallIcon("plus")); 277 addBut->setPixmap ( SmallIcon("plus"));
278 connect(addBut,SIGNAL(clicked()),SLOT(addCal())); 278 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
279 279
280 lab = new QLabel ( " ", mw ); 280 lab = new QLabel ( " ", mw );
281 mainLayout->addWidget( lab,0,++ii ); 281 mainLayout->addWidget( lab,0,++ii );
282 282
283 283
284 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 284 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
285 int row = 1; 285 int row = 1;
286 while ( kkf ) { 286 while ( kkf ) {
287 int iii = 0; 287 int iii = 0;
288 KOCalRadioButton* rb = new KOCalRadioButton( mw ); 288 KOCalRadioButton* rb = new KOCalRadioButton( mw );
289 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); 289 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb );
290 rb->setChecked( kkf->isStandard ); 290 rb->setChecked( kkf->isStandard );
291 rb->setNum( kkf->mCalNumber ); 291 rb->setNum( kkf->mCalNumber );
292 connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); 292 connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) );
293 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 293 if ( kkf->mErrorOnLoad || kkf->isReadOnly )
294 rb->setEnabled( false ); 294 rb->setEnabled( false );
295 KOCalCheckButton* cb = new KOCalCheckButton( mw ); 295 KOCalCheckButton* cb = new KOCalCheckButton( mw );
296 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); 296 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb );
297 cb->setChecked( kkf->isEnabled ); 297 cb->setChecked( kkf->isEnabled );
298 cb->setNum( kkf->mCalNumber ); 298 cb->setNum( kkf->mCalNumber );
299 if ( kkf->mErrorOnLoad ) 299 if ( kkf->mErrorOnLoad )
300 cb->setEnabled( false ); 300 cb->setEnabled( false );
301 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); 301 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) );
302 KOCalButton* name = new KOCalButton( mw ); 302 KOCalButton* name = new KOCalButton( mw );
303 name->setNum( kkf->mCalNumber ); 303 name->setNum( kkf->mCalNumber );
304 name->setText( kkf->mName ); 304 name->setText( kkf->mName );
305 mainLayout->addWidget( name,row,++iii ); 305 mainLayout->addWidget( name,row,++iii );
306 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); 306 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) );
307 //lab = new QLabel (" ", mw ); 307 //lab = new QLabel (" ", mw );
308 //mainLayout->addWidget( lab,row,++iii ); 308 //mainLayout->addWidget( lab,row,++iii );
309 cb = new KOCalCheckButton( mw ); 309 cb = new KOCalCheckButton( mw );
310 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); 310 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb );
311 cb->setChecked( kkf->isAlarmEnabled ); 311 cb->setChecked( kkf->isAlarmEnabled );
312 cb->setNum( kkf->mCalNumber ); 312 cb->setNum( kkf->mCalNumber );
313 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); 313 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) );
314 if ( kkf->mErrorOnLoad ) 314 if ( kkf->mErrorOnLoad )
315 cb->setEnabled( false ); 315 cb->setEnabled( false );
316 cb = new KOCalCheckButton( mw ); 316 cb = new KOCalCheckButton( mw );
317 mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); 317 mainLayout->addWidget( cb,row,++iii );mROB.append( cb );
318 cb->setChecked( kkf->isReadOnly ); 318 cb->setChecked( kkf->isReadOnly );
319 cb->setNum( kkf->mCalNumber ); 319 cb->setNum( kkf->mCalNumber );
320 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); 320 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) );
321 if ( kkf->mErrorOnLoad ) 321 if ( kkf->mErrorOnLoad )
322 cb->setEnabled( false ); 322 cb->setEnabled( false );
323 if ( row > 1) { 323 if ( row > 1) {
324 KColorButton *colb = new KColorButton( mw ); 324 KColorButton *colb = new KColorButton( mw );
325 mainLayout->addWidget( colb,row,++iii ); 325 mainLayout->addWidget( colb,row,++iii );
326 colb->setID( kkf->mCalNumber ); 326 colb->setID( kkf->mCalNumber );
327 colb->setColor( kkf->mDefaultColor ); 327 colb->setColor( kkf->mDefaultColor );
328 connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); 328 connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) );
329 KOCalButton* calb = new KOCalButton( mw ); 329 KOCalButton* calb = new KOCalButton( mw );
330 mainLayout->addWidget( calb,row,++iii ); 330 mainLayout->addWidget( calb,row,++iii );
331 calb->setNum( kkf->mCalNumber ); 331 calb->setNum( kkf->mCalNumber );
332 calb->setPixmap ( SmallIcon("minus")); 332 calb->setPixmap ( SmallIcon("minus"));
333 connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); 333 connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) );
334 int hei = calb->sizeHint().height(); 334 int hei = calb->sizeHint().height();
335 //calb->setMaximumSize( hei*9/10, hei*9/10 ); 335 //calb->setMaximumSize( hei*9/10, hei*9/10 );
336 } 336 }
337 ++row; 337 ++row;
338 kkf = KOPrefs::instance()->mCalendars.next(); 338 kkf = KOPrefs::instance()->mCalendars.next();
339 } 339 }
340 lab = new QLabel ( "", mw ); 340 lab = new QLabel ( "", mw );
341 mainLayout->addWidget( lab,row,0 ); 341 mainLayout->addWidget( lab,row,0 );
342 mw->show(); 342 mw->show();
343 343
344} 344}
345 345
346 346
347void KOCalEditView::defaultInfo() 347void KOCalEditView::defaultInfo()
348{ 348{
349 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); 349 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
350} 350}
351void KOCalEditView::addCal() 351void KOCalEditView::addCal()
352{ 352{
353 bool tryagain = true; 353 bool tryagain = true;
354 QString name, file; 354 QString name, file;
355 while ( tryagain ) { 355 while ( tryagain ) {
356 KONewCalPrefs prefs ( this ); 356 KONewCalPrefs prefs ( this );
357 prefs.nameE->setText( name ); 357 prefs.nameE->setText( name );
358 prefs.url->setURL( file ); 358 prefs.url->setURL( file );
359 if ( ! prefs.exec() ) 359 if ( ! prefs.exec() )
360 return; 360 return;
361 name = prefs.calName(); 361 name = prefs.calName();
362 file = prefs.calFileName(); 362 file = prefs.calFileName();
363 tryagain = false; 363 tryagain = false;
364 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 364 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
365 while ( kkf ) { 365 while ( kkf ) {
366 if ( kkf->mName == name ) { 366 if ( kkf->mName == name ) {
367 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); 367 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) );
368 name = ""; 368 name = "";
369 tryagain = true; 369 tryagain = true;
370 break; 370 break;
371 } 371 }
372 if ( kkf->mFileName == file ) { 372 if ( kkf->mFileName == file ) {
373 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); 373 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) );
374 tryagain = true; 374 tryagain = true;
375 file = ""; 375 file = "";
376 break; 376 break;
377 } 377 }
378 kkf = KOPrefs::instance()->mCalendars.next(); 378 kkf = KOPrefs::instance()->mCalendars.next();
379 } 379 }
380 } 380 }
381 addCalendar ( name, file );
382}
383int KOCalEditView::addCalendar( QString name, QString file, bool ask )
384{
385
381 QFileInfo fi ( file ); 386 QFileInfo fi ( file );
382 if (!fi.exists() ) { 387 if (!fi.exists() ) {
383 if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) 388 if ( ask )
384 return; 389 if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No )
390 return 0;
385 QFile fileIn( file ); 391 QFile fileIn( file );
386 if (!fileIn.open( IO_WriteOnly ) ) { 392 if (!fileIn.open( IO_WriteOnly ) ) {
387 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); 393 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
388 return; 394 return 0;
389 } 395 }
390 QTextStream tsIn( &fileIn ); 396 QTextStream tsIn( &fileIn );
391 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 397 tsIn.setCodec( QTextCodec::codecForName("utf8") );
392 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; 398 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n";
393 fileIn.close(); 399 fileIn.close();
394 } 400 }
395 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); 401 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar();
396 kkf->mName = name; 402 kkf->mName = name;
397 kkf->mFileName = file; 403 kkf->mFileName = file;
398 emit calendarAdded( kkf->mCalNumber ); 404 emit calendarAdded( kkf->mCalNumber );
399 emit needsUpdate(); 405 if ( ask )
400 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 406 emit needsUpdate();
407 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
408 return kkf->mCalNumber;
401} 409}
410int KOCalEditView::getBirtdayID()
411{
412 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
413 while ( kkf ) {
414 if ( kkf->mName == i18n("Birthdays") )
415 return kkf->mCalNumber;
416 kkf = KOPrefs::instance()->mCalendars.next();
417 }
418 QString file = locateLocal( "data", "korganizer/birthdays.ics" );
419 return addCalendar( i18n("Birthdays"), file, false );
420}
421
402void KOCalEditView::enableAll() 422void KOCalEditView::enableAll()
403{ 423{
404 toggleList( mEnabledB ); 424 toggleList( mEnabledB );
405} 425}
406void KOCalEditView::enableAlarm() 426void KOCalEditView::enableAlarm()
407{ 427{
408 toggleList( mAlarmB ); 428 toggleList( mAlarmB );
409} 429}
410void KOCalEditView::disableRO() 430void KOCalEditView::disableRO()
411{ 431{
412 toggleList( mROB ); 432 toggleList( mROB );
413} 433}
414void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) 434void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list )
415{ 435{
416 bool dis = false; 436 bool dis = false;
417 KOCalCheckButton* it = list.first(); 437 KOCalCheckButton* it = list.first();
418 while ( it ) { 438 while ( it ) {
419 if ( !it->isChecked() ) { 439 if ( !it->isChecked() ) {
420 dis = true; 440 dis = true;
421 break; 441 break;
422 } 442 }
423 it = list.next(); 443 it = list.next();
424 } 444 }
425 it = list.first(); 445 it = list.first();
426 while ( it ) { 446 while ( it ) {
427 it->setChecked(dis); 447 it->setChecked(dis);
428 it = list.next(); 448 it = list.next();
429 } 449 }
430} 450}
431void KOCalEditView::deleteAll() 451void KOCalEditView::deleteAll()
432{ 452{
433 qDebug("delteAll"); 453 qDebug("delteAll");
434} 454}
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index b57a6e9..54fe2c5 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -1,248 +1,249 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOFILTERVIEW_H 23#ifndef KOFILTERVIEW_H
24#define KOFILTERVIEW_H 24#define KOFILTERVIEW_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <qcheckbox.h> 27#include <qcheckbox.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qdialog.h> 31#include <qdialog.h>
32#include <qscrollview.h> 32#include <qscrollview.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <kconfig.h> 34#include <kconfig.h>
35#include "kofilterview_base.h" 35#include "kofilterview_base.h"
36 36
37#include <libkcal/calfilter.h> 37#include <libkcal/calfilter.h>
38 38
39#include <kurlrequester.h> 39#include <kurlrequester.h>
40#include <klineedit.h> 40#include <klineedit.h>
41#include <kglobal.h> 41#include <kglobal.h>
42#include <kmessagebox.h> 42#include <kmessagebox.h>
43 43
44class QGridLayout; 44class QGridLayout;
45 45
46using namespace KCal; 46using namespace KCal;
47 47
48class KONewCalPrefs : public QDialog 48class KONewCalPrefs : public QDialog
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 public: 51 public:
52 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : 52 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) :
53 QDialog( parent, name, true ) 53 QDialog( parent, name, true )
54 { 54 {
55 setCaption( i18n("Add new Calendar") ); 55 setCaption( i18n("Add new Calendar") );
56 QVBoxLayout* lay = new QVBoxLayout( this ); 56 QVBoxLayout* lay = new QVBoxLayout( this );
57 lay->setSpacing( 3 ); 57 lay->setSpacing( 3 );
58 lay->setMargin( 3 ); 58 lay->setMargin( 3 );
59 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); 59 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this );
60 lay->addWidget( lab ); 60 lay->addWidget( lab );
61 nameE = new KLineEdit( this ); 61 nameE = new KLineEdit( this );
62 lay->addWidget( nameE ); 62 lay->addWidget( nameE );
63 lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this ); 63 lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this );
64 lay->addWidget( lab ); 64 lay->addWidget( lab );
65 url = new KURLRequester ( this ); 65 url = new KURLRequester ( this );
66 lay->addWidget( url ); 66 lay->addWidget( url );
67 QPushButton * ok = new QPushButton( i18n("OK"), this ); 67 QPushButton * ok = new QPushButton( i18n("OK"), this );
68 lay->addWidget( ok ); 68 lay->addWidget( ok );
69 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 69 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
70 lay->addWidget( cancel ); 70 lay->addWidget( cancel );
71 connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); 71 connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) );
72 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 72 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
73 setMinimumWidth( 220 ); 73 setMinimumWidth( 220 );
74 resize(sizeHint() ); 74 resize(sizeHint() );
75 } 75 }
76 76
77 QString calName() { return nameE->text(); } 77 QString calName() { return nameE->text(); }
78 QString calFileName() { return url->url(); } 78 QString calFileName() { return url->url(); }
79 79
80public slots: 80public slots:
81void checkValid() { 81void checkValid() {
82 if ( nameE->text().isEmpty() ) { 82 if ( nameE->text().isEmpty() ) {
83 KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") ); 83 KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") );
84 nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () )); 84 nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () ));
85 return; 85 return;
86 } 86 }
87 if ( url->url().isEmpty() ) { 87 if ( url->url().isEmpty() ) {
88 KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); 88 KMessageBox::information( this, i18n("Sorry, the file name is empty!") );
89 return; 89 return;
90 } 90 }
91 accept(); 91 accept();
92} 92}
93 93
94public: 94public:
95 KLineEdit* nameE; 95 KLineEdit* nameE;
96 KURLRequester *url; 96 KURLRequester *url;
97}; 97};
98 98
99class KOCalButton : public QPushButton 99class KOCalButton : public QPushButton
100{ 100{
101 Q_OBJECT 101 Q_OBJECT
102 public: 102 public:
103 KOCalButton( QWidget *parent=0, const char *name=0 ) : 103 KOCalButton( QWidget *parent=0, const char *name=0 ) :
104 QPushButton( parent, name) 104 QPushButton( parent, name)
105 { 105 {
106 connect( this, SIGNAL( clicked() ), 106 connect( this, SIGNAL( clicked() ),
107 SLOT( bottonClicked() )); 107 SLOT( bottonClicked() ));
108 mNumber = -1; 108 mNumber = -1;
109 setFocusPolicy(NoFocus); 109 setFocusPolicy(NoFocus);
110 } 110 }
111 void setNum ( int num ) {mNumber = num; } 111 void setNum ( int num ) {mNumber = num; }
112 signals: 112 signals:
113 void selectNum ( int ); 113 void selectNum ( int );
114private: 114private:
115 int mNumber; 115 int mNumber;
116 void keyPressEvent ( QKeyEvent * e ) 116 void keyPressEvent ( QKeyEvent * e )
117 { 117 {
118 e->ignore(); 118 e->ignore();
119 } 119 }
120 120
121private slots : 121private slots :
122 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } 122 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
123}; 123};
124class KOCalCheckButton : public QCheckBox 124class KOCalCheckButton : public QCheckBox
125{ 125{
126 Q_OBJECT 126 Q_OBJECT
127 public: 127 public:
128 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : 128 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
129 QCheckBox( parent, name) 129 QCheckBox( parent, name)
130 { 130 {
131 connect( this, SIGNAL( toggled ( bool ) ), 131 connect( this, SIGNAL( toggled ( bool ) ),
132 SLOT( bottonClicked( bool ) )); 132 SLOT( bottonClicked( bool ) ));
133 mNumber = -1; 133 mNumber = -1;
134 setFocusPolicy(NoFocus); 134 setFocusPolicy(NoFocus);
135 //setMaximumWidth( 10 ); 135 //setMaximumWidth( 10 );
136 136
137 } 137 }
138 void setNum ( int num ) {mNumber = num; } 138 void setNum ( int num ) {mNumber = num; }
139 signals: 139 signals:
140 void selectNum ( int, bool ); 140 void selectNum ( int, bool );
141private: 141private:
142 int mNumber; 142 int mNumber;
143 void keyPressEvent ( QKeyEvent * e ) 143 void keyPressEvent ( QKeyEvent * e )
144 { 144 {
145 e->ignore(); 145 e->ignore();
146 } 146 }
147 147
148private slots : 148private slots :
149 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } 149 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
150}; 150};
151 151
152class KOCalRadioButton : public QRadioButton 152class KOCalRadioButton : public QRadioButton
153{ 153{
154 Q_OBJECT 154 Q_OBJECT
155 public: 155 public:
156 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : 156 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) :
157 QRadioButton( parent, name) 157 QRadioButton( parent, name)
158 { 158 {
159 connect( this, SIGNAL( toggled ( bool ) ), 159 connect( this, SIGNAL( toggled ( bool ) ),
160 SLOT( bottonClicked( bool ) )); 160 SLOT( bottonClicked( bool ) ));
161 mNumber = -1; 161 mNumber = -1;
162 setFocusPolicy(NoFocus); 162 setFocusPolicy(NoFocus);
163 //setMaximumWidth( 10 ); 163 //setMaximumWidth( 10 );
164 164
165 } 165 }
166 void setNum ( int num ) {mNumber = num; } 166 void setNum ( int num ) {mNumber = num; }
167 signals: 167 signals:
168 void selectNum ( int, bool ); 168 void selectNum ( int, bool );
169private: 169private:
170 int mNumber; 170 int mNumber;
171 void keyPressEvent ( QKeyEvent * e ) 171 void keyPressEvent ( QKeyEvent * e )
172 { 172 {
173 e->ignore(); 173 e->ignore();
174 } 174 }
175 175
176private slots : 176private slots :
177 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } 177 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
178}; 178};
179 179
180 180
181 181
182class KOFilterView : public KOFilterView_base 182class KOFilterView : public KOFilterView_base
183{ 183{
184 Q_OBJECT 184 Q_OBJECT
185 public: 185 public:
186 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 186 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
187 ~KOFilterView(); 187 ~KOFilterView();
188 188
189 void updateFilters(); 189 void updateFilters();
190 190
191 bool filtersEnabled(); 191 bool filtersEnabled();
192 void setFiltersEnabled(bool); 192 void setFiltersEnabled(bool);
193 CalFilter *selectedFilter(); 193 CalFilter *selectedFilter();
194 void setSelectedFilter(QString); 194 void setSelectedFilter(QString);
195 void setSelectedFilter( int ); 195 void setSelectedFilter( int );
196 196
197 signals: 197 signals:
198 void filterChanged(); 198 void filterChanged();
199 void editFilters(); 199 void editFilters();
200 200
201 private: 201 private:
202 QPtrList<CalFilter> *mFilters; 202 QPtrList<CalFilter> *mFilters;
203}; 203};
204 204
205class KOCalEditView : public QScrollView 205class KOCalEditView : public QScrollView
206{ 206{
207 Q_OBJECT 207 Q_OBJECT
208 public: 208 public:
209 KOCalEditView( QWidget* parent=0,const char* name=0); 209 KOCalEditView( QWidget* parent=0,const char* name=0);
210 ~KOCalEditView(); 210 ~KOCalEditView();
211 211 int addCalendar( QString calName, QString fileName, bool ask = true );
212 int getBirtdayID();
212 public slots: 213 public slots:
213 void addCal(); 214 void addCal();
214 void enableAll(); 215 void enableAll();
215 void enableAlarm(); 216 void enableAlarm();
216 void disableRO(); 217 void disableRO();
217 void deleteAll(); 218 void deleteAll();
218 void selectStdCal(int,bool ); 219 void selectStdCal(int,bool );
219 void selectCal(int,bool ); 220 void selectCal(int,bool );
220 void selectCalAlarm(int,bool ); 221 void selectCalAlarm(int,bool );
221 void selectReadOnly(int,bool ); 222 void selectReadOnly(int,bool );
222 void setColor(const QColor &,int) ; 223 void setColor(const QColor &,int) ;
223 void deleteCal(int) ; 224 void deleteCal(int) ;
224 void infoCal(int) ; 225 void infoCal(int) ;
225 void readConfig(); 226 void readConfig();
226 void defaultInfo(); 227 void defaultInfo();
227 signals: 228 signals:
228 void alarmEnabled ( int cal, bool enable ); 229 void alarmEnabled ( int cal, bool enable );
229 void calendarEnabled ( int cal, bool enable ); 230 void calendarEnabled ( int cal, bool enable );
230 void calendarReadonly ( int cal, bool readonly ); 231 void calendarReadonly ( int cal, bool readonly );
231 void setCalendarDefault ( int cal ); 232 void setCalendarDefault ( int cal );
232 void removeCalendar ( int cal ); 233 void removeCalendar ( int cal );
233 void calendarAdded( int ); 234 void calendarAdded( int );
234 void needsUpdate(); 235 void needsUpdate();
235 236
236 private: 237 private:
237 QWidget *mw; 238 QWidget *mw;
238 void toggleList ( QPtrList<KOCalCheckButton> ); 239 void toggleList ( QPtrList<KOCalCheckButton> );
239 QPtrList<KOCalRadioButton> mStdandardB; 240 QPtrList<KOCalRadioButton> mStdandardB;
240 QPtrList<KOCalCheckButton> mEnabledB; 241 QPtrList<KOCalCheckButton> mEnabledB;
241 QPtrList<KOCalCheckButton> mAlarmB; 242 QPtrList<KOCalCheckButton> mAlarmB;
242 QPtrList<KOCalCheckButton> mROB; 243 QPtrList<KOCalCheckButton> mROB;
243 QGridLayout* mainLayout; 244 QGridLayout* mainLayout;
244}; 245};
245 246
246 247
247 248
248#endif // KOFILTERVIEW_H 249#endif // KOFILTERVIEW_H
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index a4ea3d3..7ba7269 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -207,393 +207,397 @@ KOPrefs::KOPrefs() :
207 207
208 KPrefs::setCurrentGroup("Colors"); 208 KPrefs::setCurrentGroup("Colors");
209 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 209 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
210 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 210 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
211 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 211 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
212 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 212 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
213 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 213 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
214 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 214 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
215 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 215 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
216 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 216 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
217 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 217 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
218 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 218 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
219 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 219 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
220 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 220 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
221 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 221 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
222 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 222 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
223 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 223 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
224 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 224 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
225 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 225 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
226 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 226 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
227 addItemBool("UseAppColors",&mUseAppColors,false); 227 addItemBool("UseAppColors",&mUseAppColors,false);
228 228
229 229
230 230
231 KPrefs::setCurrentGroup("Views"); 231 KPrefs::setCurrentGroup("Views");
232 addItemBool("Block Popup Menu",&mBlockPopupMenu,true); 232 addItemBool("Block Popup Menu",&mBlockPopupMenu,true);
233 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 233 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
234 addItemInt("Hour Size",&mHourSize,8); 234 addItemInt("Hour Size",&mHourSize,8);
235 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 235 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
236 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 236 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
237 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 237 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
238 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 238 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
239 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 239 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
240 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 240 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
241 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 241 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
242#ifdef DESKTOP_VERION 242#ifdef DESKTOP_VERION
243 addItemBool("Enable ToolTips",&mEnableToolTips,true); 243 addItemBool("Enable ToolTips",&mEnableToolTips,true);
244#else 244#else
245 addItemBool("Enable ToolTips",&mEnableToolTips,false); 245 addItemBool("Enable ToolTips",&mEnableToolTips,false);
246#endif 246#endif
247 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 247 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
248 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 248 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
249 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 249 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
250 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 250 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
251 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 251 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
252 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 252 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
253 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 253 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
254 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 254 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
255 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 255 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
256 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 256 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
267#ifdef DESKTOP_VERSION 267#ifdef DESKTOP_VERSION
268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
269#else 269#else
270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
271#endif 271#endif
272 addItemInt("Day Begins",&mDayBegins,7); 272 addItemInt("Day Begins",&mDayBegins,7);
273 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 273 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
274 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 274 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
275 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 275 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
277 277
278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
279 addItemBool("Full View Month",&mFullViewMonth,true); 279 addItemBool("Full View Month",&mFullViewMonth,true);
280 addItemBool("Full View Todo",&mFullViewTodo,true); 280 addItemBool("Full View Todo",&mFullViewTodo,true);
281 addItemBool("Quick Todo",&mEnableQuickTodo,false); 281 addItemBool("Quick Todo",&mEnableQuickTodo,false);
282 282
283 addItemInt("Next X Days",&mNextXDays,3); 283 addItemInt("Next X Days",&mNextXDays,3);
284 284
285 KPrefs::setCurrentGroup("Printer"); 285 KPrefs::setCurrentGroup("Printer");
286 286
287 KPrefs::setCurrentGroup("Layout"); 287 KPrefs::setCurrentGroup("Layout");
288 288
289 addItemBool("CompactDialogs",&mCompactDialogs,false); 289 addItemBool("CompactDialogs",&mCompactDialogs,false);
290 addItemBool("VerticalScreen",&mVerticalScreen,true); 290 addItemBool("VerticalScreen",&mVerticalScreen,true);
291 291
292 KPrefs::setCurrentGroup("KOrganizer Plugins"); 292 KPrefs::setCurrentGroup("KOrganizer Plugins");
293 293
294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
295 295
296 KPrefs::setCurrentGroup("Group Scheduling"); 296 KPrefs::setCurrentGroup("Group Scheduling");
297 297
298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
300 addItemStringList("AdditionalMails",&mAdditionalMails,""); 300 addItemStringList("AdditionalMails",&mAdditionalMails,"");
301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
306 306
307 KPrefs::setCurrentGroup( "Editors" ); 307 KPrefs::setCurrentGroup( "Editors" );
308 308
309 addItemStringList( "EventTemplates", &mEventTemplates ); 309 addItemStringList( "EventTemplates", &mEventTemplates );
310 addItemStringList( "TodoTemplates", &mTodoTemplates ); 310 addItemStringList( "TodoTemplates", &mTodoTemplates );
311 311
312 addItemInt("DestinationPolicy",&mDestination,standardDestination); 312 addItemInt("DestinationPolicy",&mDestination,standardDestination);
313 313
314 KPrefs::setCurrentGroup( "ViewOptions" ); 314 KPrefs::setCurrentGroup( "ViewOptions" );
315 addItemBool("EVshowDetails",&mEVshowDetails,true); 315 addItemBool("EVshowDetails",&mEVshowDetails,true);
316 addItemBool("EVshowCreated",&mEVshowCreated,true); 316 addItemBool("EVshowCreated",&mEVshowCreated,true);
317 addItemBool("EVshowChanged",&mEVshowChanged,true); 317 addItemBool("EVshowChanged",&mEVshowChanged,true);
318 addItemBool("WTshowDetails",&mWTshowDetails,false); 318 addItemBool("WTshowDetails",&mWTshowDetails,false);
319 addItemBool("WTshowCreated",&mWTshowCreated,false); 319 addItemBool("WTshowCreated",&mWTshowCreated,false);
320 addItemBool("WTshowChanged",&mWTshowChanged,false); 320 addItemBool("WTshowChanged",&mWTshowChanged,false);
321 mCalendars.setAutoDelete( true ); 321 mCalendars.setAutoDelete( true );
322} 322}
323 323
324 324
325KOPrefs::~KOPrefs() 325KOPrefs::~KOPrefs()
326{ 326{
327 if (mInstance == this) 327 if (mInstance == this)
328 mInstance = insd.setObject(0); 328 mInstance = insd.setObject(0);
329 mCalendars.setAutoDelete( true ); 329 mCalendars.setAutoDelete( true );
330 mCalendars.clear(); 330 mCalendars.clear();
331 //qDebug("KOPrefs::~KOPrefs() "); 331 //qDebug("KOPrefs::~KOPrefs() ");
332} 332}
333 333
334 334
335KOPrefs *KOPrefs::instance() 335KOPrefs *KOPrefs::instance()
336{ 336{
337 if (!mInstance) { 337 if (!mInstance) {
338 mInstance = insd.setObject(new KOPrefs()); 338 mInstance = insd.setObject(new KOPrefs());
339 mInstance->readConfig(); 339 mInstance->readConfig();
340 } 340 }
341 341
342 return mInstance; 342 return mInstance;
343} 343}
344 344
345void KOPrefs::usrSetDefaults() 345void KOPrefs::usrSetDefaults()
346{ 346{
347 347
348} 348}
349 349
350void KOPrefs::fillMailDefaults() 350void KOPrefs::fillMailDefaults()
351{ 351{
352 if (mName.isEmpty()) mName = i18n("Anonymous"); 352 if (mName.isEmpty()) mName = i18n("Anonymous");
353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
354} 354}
355 355
356void KOPrefs::setTimeZoneIdDefault() 356void KOPrefs::setTimeZoneIdDefault()
357{ 357{
358 ; 358 ;
359} 359}
360 360
361void KOPrefs::setAllDefaults() 361void KOPrefs::setAllDefaults()
362{ 362{
363 setCategoryDefaults(); 363 setCategoryDefaults();
364 mEventSummaryUser = getDefaultList() ; 364 mEventSummaryUser = getDefaultList() ;
365 mTodoSummaryUser = getDefaultList() ; 365 mTodoSummaryUser = getDefaultList() ;
366 mLocationDefaults = getLocationDefaultList(); 366 mLocationDefaults = getLocationDefaultList();
367} 367}
368 368
369void KOPrefs::setCategoryDefaults() 369void KOPrefs::setCategoryDefaults()
370{ 370{
371 mCustomCategories.clear(); 371 mCustomCategories.clear();
372 mCustomCategories = getDefaultList(); 372 mCustomCategories = getDefaultList();
373 373
374 QStringList::Iterator it; 374 QStringList::Iterator it;
375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
376 setCategoryColor(*it,mDefaultCategoryColor); 376 setCategoryColor(*it,mDefaultCategoryColor);
377 } 377 }
378} 378}
379QStringList KOPrefs::getLocationDefaultList() 379QStringList KOPrefs::getLocationDefaultList()
380{ 380{
381 QStringList retval ; 381 QStringList retval ;
382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
387 387
388 retval.sort(); 388 retval.sort();
389 return retval; 389 return retval;
390} 390}
391QStringList KOPrefs::getDefaultList() 391QStringList KOPrefs::getDefaultList()
392{ 392{
393 QStringList retval ; 393 QStringList retval ;
394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
395 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 395 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
396 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 396 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
398 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 398 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
399 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 399 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
400 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 400 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
402 retval.sort(); 402 retval.sort();
403 //qDebug("cat %s ", retval.join("-").latin1()); 403 //qDebug("cat %s ", retval.join("-").latin1());
404 return retval; 404 return retval;
405} 405}
406 406
407void KOPrefs::usrReadConfig() 407void KOPrefs::usrReadConfig()
408{ 408{
409 config()->setGroup("General"); 409 config()->setGroup("General");
410 410
411 //qDebug("KOPrefs::usrReadConfig() "); 411 //qDebug("KOPrefs::usrReadConfig() ");
412 mCustomCategories = config()->readListEntry("Custom Categories"); 412 mCustomCategories = config()->readListEntry("Custom Categories");
413 mOldLoadedLanguage = mOldLanguage ; 413 mOldLoadedLanguage = mOldLanguage ;
414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
415 if (mLocationDefaults.isEmpty()) { 415 if (mLocationDefaults.isEmpty()) {
416 mLocationDefaults = getLocationDefaultList(); 416 mLocationDefaults = getLocationDefaultList();
417 } 417 }
418 418
419 if (mEventSummaryUser.isEmpty()) { 419 if (mEventSummaryUser.isEmpty()) {
420 mEventSummaryUser = getDefaultList() ; 420 mEventSummaryUser = getDefaultList() ;
421 } 421 }
422 if (mTodoSummaryUser.isEmpty()) { 422 if (mTodoSummaryUser.isEmpty()) {
423 mTodoSummaryUser = getDefaultList() ; 423 mTodoSummaryUser = getDefaultList() ;
424 } 424 }
425 425
426 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 426 if (mCustomCategories.isEmpty()) setCategoryDefaults();
427 427
428 config()->setGroup("Personal Settings"); 428 config()->setGroup("Personal Settings");
429 mName = config()->readEntry("user_name",""); 429 mName = config()->readEntry("user_name","");
430 mEmail = config()->readEntry("user_email",""); 430 mEmail = config()->readEntry("user_email","");
431 fillMailDefaults(); 431 fillMailDefaults();
432 432
433 config()->setGroup("Category Colors"); 433 config()->setGroup("Category Colors");
434 QStringList::Iterator it; 434 QStringList::Iterator it;
435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
437 437
438 } 438 }
439 KConfig fc (locateLocal("config","kopicalendarrc")); 439 KConfig fc (locateLocal("config","kopicalendarrc"));
440 fc.setGroup("CC"); 440 fc.setGroup("CC");
441 int numCals = fc.readNumEntry("NumberCalendars",0 ); 441 int numCals = fc.readNumEntry("NumberCalendars",0 );
442 mNextAvailableCalendar = 1; 442 mNextAvailableCalendar = 1;
443 if ( numCals == 0 ) { 443 if ( numCals == 0 ) {
444 KopiCalendarFile *kkf = getNewCalendar(); 444 KopiCalendarFile *kkf = getNewCalendar();
445 kkf->isStandard = true; 445 kkf->isStandard = true;
446 kkf->mName = i18n("Standard"); 446 kkf->mName = i18n("Standard");
447 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 447 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
448 } 448 }
449 while ( mNextAvailableCalendar <= numCals ) { 449 while ( mNextAvailableCalendar <= numCals ) {
450 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 450 //qDebug("Read cal #%d ", mNextAvailableCalendar );
451 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 451 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
452 KopiCalendarFile *kkf = getNewCalendar(); 452 KopiCalendarFile *kkf = getNewCalendar();
453 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 453 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
454 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 454 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
455 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 455 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
456 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 456 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
457 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 457 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
458 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); 458 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName);
459 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 459 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
460 if ( kkf->mCalNumber == 1 ) { 460 if ( kkf->mCalNumber == 1 ) {
461 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 461 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
462 } 462 }
463 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
464 if ( kkf->mName == i18n("Birthdays") ) {
465 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
466 }
463 } 467 }
464 468
465 KPimPrefs::usrReadConfig(); 469 KPimPrefs::usrReadConfig();
466} 470}
467 471
468KopiCalendarFile * KOPrefs::getCalendar( int num ) 472KopiCalendarFile * KOPrefs::getCalendar( int num )
469{ 473{
470 return mDefCalColors[num-1]; 474 return mDefCalColors[num-1];
471} 475}
472 476
473KopiCalendarFile * KOPrefs::getNewCalendar() 477KopiCalendarFile * KOPrefs::getNewCalendar()
474{ 478{
475 KopiCalendarFile * kkf = new KopiCalendarFile(); 479 KopiCalendarFile * kkf = new KopiCalendarFile();
476 kkf->mCalNumber = mNextAvailableCalendar; 480 kkf->mCalNumber = mNextAvailableCalendar;
477 mDefCalColors.resize( mNextAvailableCalendar ); 481 mDefCalColors.resize( mNextAvailableCalendar );
478 mDefCalColors[mNextAvailableCalendar-1] = kkf; 482 mDefCalColors[mNextAvailableCalendar-1] = kkf;
479 ++mNextAvailableCalendar; 483 ++mNextAvailableCalendar;
480 kkf->mDefaultColor = mEventColor; 484 kkf->mDefaultColor = mEventColor;
481 kkf->mName = i18n("New Calendar"); 485 kkf->mName = i18n("New Calendar");
482 mCalendars.append( kkf ); 486 mCalendars.append( kkf );
483 return kkf; 487 return kkf;
484} 488}
485void KOPrefs::deleteCalendar( int num ) 489void KOPrefs::deleteCalendar( int num )
486{ 490{
487 KopiCalendarFile * kkf = mCalendars.first(); 491 KopiCalendarFile * kkf = mCalendars.first();
488 while ( kkf ) { 492 while ( kkf ) {
489 if ( kkf->mCalNumber == num ) { 493 if ( kkf->mCalNumber == num ) {
490 qDebug("KOPrefs::deleteCalendar %d ", num ); 494 qDebug("KOPrefs::deleteCalendar %d ", num );
491 mCalendars.remove( kkf ); 495 mCalendars.remove( kkf );
492 delete kkf; 496 delete kkf;
493 return; 497 return;
494 } 498 }
495 kkf = mCalendars.next(); 499 kkf = mCalendars.next();
496 } 500 }
497} 501}
498QString KOPrefs::calName( int calNum) const 502QString KOPrefs::calName( int calNum) const
499{ 503{
500 return (mDefCalColors[calNum-1])->mName; 504 return (mDefCalColors[calNum-1])->mName;
501} 505}
502QColor KOPrefs::defaultColor( int calNum ) const 506QColor KOPrefs::defaultColor( int calNum ) const
503{ 507{
504 if ( calNum == 1 ) return mEventColor; 508 if ( calNum == 1 ) return mEventColor;
505 return (mDefCalColors[calNum-1])->mDefaultColor; 509 return (mDefCalColors[calNum-1])->mDefaultColor;
506} 510}
507void KOPrefs::usrWriteConfig() 511void KOPrefs::usrWriteConfig()
508{ 512{
509 config()->setGroup("General"); 513 config()->setGroup("General");
510 config()->writeEntry("Custom Categories",mCustomCategories); 514 config()->writeEntry("Custom Categories",mCustomCategories);
511 515
512 config()->setGroup("Personal Settings"); 516 config()->setGroup("Personal Settings");
513 config()->writeEntry("user_name",mName); 517 config()->writeEntry("user_name",mName);
514 config()->writeEntry("user_email",mEmail); 518 config()->writeEntry("user_email",mEmail);
515 519
516 config()->setGroup("Category Colors"); 520 config()->setGroup("Category Colors");
517 QDictIterator<QColor> it(mCategoryColors); 521 QDictIterator<QColor> it(mCategoryColors);
518 while (it.current()) { 522 while (it.current()) {
519 config()->writeEntry(it.currentKey(),*(it.current())); 523 config()->writeEntry(it.currentKey(),*(it.current()));
520 ++it; 524 ++it;
521 } 525 }
522 KConfig fc (locateLocal("config","kopicalendarrc")); 526 KConfig fc (locateLocal("config","kopicalendarrc"));
523 fc.setGroup("CC"); 527 fc.setGroup("CC");
524 fc.writeEntry("NumberCalendars",mCalendars.count()); 528 fc.writeEntry("NumberCalendars",mCalendars.count());
525 int numCal = 1; 529 int numCal = 1;
526 int writeCal = 0; 530 int writeCal = 0;
527 while ( numCal < mNextAvailableCalendar ) { 531 while ( numCal < mNextAvailableCalendar ) {
528 KopiCalendarFile * kkf = mCalendars.first(); 532 KopiCalendarFile * kkf = mCalendars.first();
529 while ( kkf ) { 533 while ( kkf ) {
530 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); 534 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
531 if ( kkf->mCalNumber == numCal ) { 535 if ( kkf->mCalNumber == numCal ) {
532 ++writeCal; 536 ++writeCal;
533 //qDebug("Write calendar %d %d ", numCal , writeCal); 537 //qDebug("Write calendar %d %d ", numCal , writeCal);
534 QString prefix = "Cal_" + QString::number( writeCal ); 538 QString prefix = "Cal_" + QString::number( writeCal );
535 fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); 539 fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
536 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 540 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
537 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 541 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
538 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 542 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
539 fc.writeEntry( prefix+"_Name", kkf->mName); 543 fc.writeEntry( prefix+"_Name", kkf->mName);
540 fc.writeEntry( prefix+"_FileName", kkf->mFileName); 544 fc.writeEntry( prefix+"_FileName", kkf->mFileName);
541 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); 545 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
542 } 546 }
543 kkf = mCalendars.next(); 547 kkf = mCalendars.next();
544 } 548 }
545 ++numCal; 549 ++numCal;
546 } 550 }
547 fc.sync(); 551 fc.sync();
548 KPimPrefs::usrWriteConfig(); 552 KPimPrefs::usrWriteConfig();
549} 553}
550 554
551void KOPrefs::setCategoryColor(QString cat,const QColor & color) 555void KOPrefs::setCategoryColor(QString cat,const QColor & color)
552{ 556{
553 mCategoryColors.replace(cat,new QColor(color)); 557 mCategoryColors.replace(cat,new QColor(color));
554} 558}
555 559
556QColor *KOPrefs::categoryColor(QString cat) 560QColor *KOPrefs::categoryColor(QString cat)
557{ 561{
558 QColor *color = 0; 562 QColor *color = 0;
559 563
560 if (!cat.isEmpty()) color = mCategoryColors[cat]; 564 if (!cat.isEmpty()) color = mCategoryColors[cat];
561 565
562 if (color) return color; 566 if (color) return color;
563 else return &mDefaultCategoryColor; 567 else return &mDefaultCategoryColor;
564} 568}
565 569
566void KOPrefs::setFullName(const QString &name) 570void KOPrefs::setFullName(const QString &name)
567{ 571{
568 mName = name; 572 mName = name;
569} 573}
570 574
571void KOPrefs::setEmail(const QString &email) 575void KOPrefs::setEmail(const QString &email)
572{ 576{
573 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 577 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
574 mEmail = email; 578 mEmail = email;
575} 579}
576 580
577QString KOPrefs::fullName() 581QString KOPrefs::fullName()
578{ 582{
579 if (mEmailControlCenter) { 583 if (mEmailControlCenter) {
580 KEMailSettings settings; 584 KEMailSettings settings;
581 return settings.getSetting(KEMailSettings::RealName); 585 return settings.getSetting(KEMailSettings::RealName);
582 } else { 586 } else {
583 return mName; 587 return mName;
584 } 588 }
585} 589}
586 590
587QString KOPrefs::email() 591QString KOPrefs::email()
588{ 592{
589 if (mEmailControlCenter) { 593 if (mEmailControlCenter) {
590 KEMailSettings settings; 594 KEMailSettings settings;
591 return settings.getSetting(KEMailSettings::EmailAddress); 595 return settings.getSetting(KEMailSettings::EmailAddress);
592 } else { 596 } else {
593 return mEmail; 597 return mEmail;
594 } 598 }
595} 599}
596KConfig* KOPrefs::getConfig() 600KConfig* KOPrefs::getConfig()
597{ 601{
598 return config(); 602 return config();
599} 603}
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 2bf46b9..c9d1345 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,114 +1,115 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#include <stdlib.h> 14#include <stdlib.h>
15#endif 15#endif
16#include <qtextcodec.h> 16#include <qtextcodec.h>
17 17
18#include <qdir.h> 18#include <qdir.h>
19#include <kstandarddirs.h> 19#include <kstandarddirs.h>
20#include <kglobal.h> 20#include <kglobal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25 25
26 26
27int main( int argc, char **argv ) 27int main( int argc, char **argv )
28{ 28{
29#ifndef DESKTOP_VERSION 29#ifndef DESKTOP_VERSION
30 QPEApplication a( argc, argv ); 30 QPEApplication a( argc, argv );
31 a.setKeepRunning (); 31 a.setKeepRunning ();
32#else 32#else
33 QApplication a( argc, argv ); 33 QApplication a( argc, argv );
34 QApplication::setStyle( new QPlatinumStyle ()); 34 QApplication::setStyle( new QPlatinumStyle ());
35#ifdef _WIN32_ 35#ifdef _WIN32_
36 QString hdir ( getenv( "HOME") ); 36 QString hdir ( getenv( "HOME") );
37 if ( hdir.isEmpty() ) { 37 if ( hdir.isEmpty() ) {
38 QString hd ("C:/" ); 38 QString hd ("C:/" );
39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
40 if ( QDir::homeDirPath().lower() == hd.lower() ) { 40 if ( QDir::homeDirPath().lower() == hd.lower() ) {
41 _putenv( "HOME=C:"); 41 _putenv( "HOME=C:");
42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
43 } 43 }
44 } else { 44 } else {
45 QDir app_dir; 45 QDir app_dir;
46 if ( !app_dir.exists(hdir) ) 46 if ( !app_dir.exists(hdir) )
47 app_dir.mkdir (hdir); 47 app_dir.mkdir (hdir);
48 } 48 }
49#endif 49#endif
50#endif 50#endif
51 bool exitHelp = false; 51 bool exitHelp = false;
52 if ( argc > 1 ) { 52 if ( argc > 1 ) {
53 QString command = argv[1]; 53 QString command = argv[1];
54 if ( command == "-help" ){ 54 if ( command == "-help" ){
55 printf("KO/Pi command line commands:\n"); 55 printf("KO/Pi command line commands:\n");
56 printf(" no command: Start KO/Pi in usual way\n"); 56 printf(" no command: Start KO/Pi in usual way\n");
57 printf(" -help: This output\n"); 57 printf(" -help: This output\n");
58 printf("Next Option: Open or Show after start:\n"); 58 printf("Next Option: Open or Show after start:\n");
59 printf(" -newTodo: New Todo dialog\n"); 59 printf(" -newTodo: New Todo dialog\n");
60 printf(" -newEvent: New Event dialog\n"); 60 printf(" -newEvent: New Event dialog\n");
61 printf(" -showList: List view\n"); 61 printf(" -showList: List view\n");
62 printf(" -showDay: Day view\n"); 62 printf(" -showDay: Day view\n");
63 printf(" -showWWeek: Work Week view\n"); 63 printf(" -showWWeek: Work Week view\n");
64 printf(" -showWeek: Week view\n"); 64 printf(" -showWeek: Week view\n");
65 printf(" -showTodo: Todo view\n"); 65 printf(" -showTodo: Todo view\n");
66 printf(" -showJournal: Journal view\n"); 66 printf(" -showJournal: Journal view\n");
67 printf(" -showKO: Next Days view\n"); 67 printf(" -showKO: Next Days view\n");
68 printf(" -showWNext: What's Next view\n"); 68 printf(" -showWNext: What's Next view\n");
69 printf(" -showNextXView: Next X View\n"); 69 printf(" -showNextXView: Next X View\n");
70 printf(" -new[Y] and -show[X] may be used togehther\n"); 70 printf(" -new[Y] and -show[X] may be used togehther\n");
71 printf(" KO/Pi is exiting now. Bye!\n"); 71 printf(" KO/Pi is exiting now. Bye!\n");
72 exitHelp = true; 72 exitHelp = true;
73 } 73 }
74 } 74 }
75 if ( ! exitHelp ) { 75 if ( ! exitHelp ) {
76 KGlobal::setAppName( "korganizer" ); 76 KGlobal::setAppName( "korganizer" );
77 QString fileName ; 77 QString fileName ;
78#ifndef DESKTOP_VERSION 78#ifndef DESKTOP_VERSION
79 fileName = getenv("QPEDIR"); 79 fileName = getenv("QPEDIR");
80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
81#else 81#else
82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
84#endif 84#endif
85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
86 86
87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
88 KPimGlobalPrefs::instance()->setGlobalConfig();
88 MainWindow m; 89 MainWindow m;
89#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
90 91
91 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
92 a.showMainWidget(&m ); 93 a.showMainWidget(&m );
93#else 94#else
94 a.setMainWidget(&m ); 95 a.setMainWidget(&m );
95 m.show(); 96 m.show();
96 //m.resize( 800, 600 ); 97 //m.resize( 800, 600 );
97 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 98 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
98#endif 99#endif
99 if ( argc > 1 ) { 100 if ( argc > 1 ) {
100 QCString command = argv[1]; 101 QCString command = argv[1];
101 if ( argc > 2 ) 102 if ( argc > 2 )
102 command += argv[2]; 103 command += argv[2];
103 qApp->processEvents(); 104 qApp->processEvents();
104 m.recieve(command, QByteArray() ); 105 m.recieve(command, QByteArray() );
105 106
106 } 107 }
107 108
108 a.exec(); 109 a.exec();
109 dumpMissing(); 110 dumpMissing();
110 111
111 KPimGlobalPrefs::instance()->writeConfig(); 112 KPimGlobalPrefs::instance()->writeConfig();
112 } 113 }
113 qDebug("KO: Bye! "); 114 qDebug("KO: Bye! ");
114} 115}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b9d8742..68233e8 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,432 +1,432 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpemenubar.h> 24#include <qpe/qpemenubar.h>
25#include <qpe/qpetoolbar.h> 25#include <qpe/qpetoolbar.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qtopia/alarmserver.h> 28#include <qtopia/alarmserver.h>
29#include <qtopia/qcopenvelope_qws.h> 29#include <qtopia/qcopenvelope_qws.h>
30#include <unistd.h> // for sleep 30#include <unistd.h> // for sleep
31#else 31#else
32#include <qmenubar.h> 32#include <qmenubar.h>
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qapplication.h> 34#include <qapplication.h>
35//#include <resource.h> 35//#include <resource.h>
36 36
37#endif 37#endif
38#include <libkcal/calendarlocal.h> 38#include <libkcal/calendarlocal.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40#include <libkcal/phoneformat.h> 40#include <libkcal/phoneformat.h>
41#include <libkdepim/ksyncprofile.h> 41#include <libkdepim/ksyncprofile.h>
42#include <libkdepim/phoneaccess.h> 42#include <libkdepim/phoneaccess.h>
43#include <libkcal/kincidenceformatter.h> 43#include <libkcal/kincidenceformatter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "calendarview.h" 46#include "calendarview.h"
47#include "koviewmanager.h" 47#include "koviewmanager.h"
48#include "datenavigator.h" 48#include "datenavigator.h"
49#include "koagendaview.h" 49#include "koagendaview.h"
50#include "koagenda.h" 50#include "koagenda.h"
51#include "kodialogmanager.h" 51#include "kodialogmanager.h"
52#include "kdialogbase.h" 52#include "kdialogbase.h"
53#include "kapplication.h" 53#include "kapplication.h"
54#include "kofilterview.h" 54#include "kofilterview.h"
55#include "kstandarddirs.h" 55#include "kstandarddirs.h"
56#include "koprefs.h" 56#include "koprefs.h"
57#include "kfiledialog.h" 57#include "kfiledialog.h"
58#include "koglobals.h" 58#include "koglobals.h"
59#include "kglobal.h" 59#include "kglobal.h"
60#include "ktoolbar.h" 60#include "ktoolbar.h"
61#include "klocale.h" 61#include "klocale.h"
62#include "kconfig.h" 62#include "kconfig.h"
63#include "externalapphandler.h" 63#include "externalapphandler.h"
64#include <kglobalsettings.h> 64#include <kglobalsettings.h>
65 65
66using namespace KCal; 66using namespace KCal;
67#ifndef _WIN32_ 67#ifndef _WIN32_
68#include <unistd.h> 68#include <unistd.h>
69#else 69#else
70#ifdef _OL_IMPORT_ 70#ifdef _OL_IMPORT_
71#include "koimportoldialog.h" 71#include "koimportoldialog.h"
72#endif 72#endif
73#endif 73#endif
74#include "mainwindow.h" 74#include "mainwindow.h"
75 75
76 76
77class KOex2phonePrefs : public QDialog 77class KOex2phonePrefs : public QDialog
78{ 78{
79 public: 79 public:
80 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 80 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
81 QDialog( parent, name, true ) 81 QDialog( parent, name, true )
82 { 82 {
83 setCaption( i18n("Export to phone options") ); 83 setCaption( i18n("Export to phone options") );
84 QVBoxLayout* lay = new QVBoxLayout( this ); 84 QVBoxLayout* lay = new QVBoxLayout( this );
85 lay->setSpacing( 3 ); 85 lay->setSpacing( 3 );
86 lay->setMargin( 3 ); 86 lay->setMargin( 3 );
87 QLabel *lab; 87 QLabel *lab;
88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
89 lab->setAlignment (AlignHCenter ); 89 lab->setAlignment (AlignHCenter );
90 QHBox* temphb; 90 QHBox* temphb;
91 temphb = new QHBox( this ); 91 temphb = new QHBox( this );
92 new QLabel( i18n("I/O device: "), temphb ); 92 new QLabel( i18n("I/O device: "), temphb );
93 mPhoneDevice = new QLineEdit( temphb); 93 mPhoneDevice = new QLineEdit( temphb);
94 lay->addWidget( temphb ); 94 lay->addWidget( temphb );
95 temphb = new QHBox( this ); 95 temphb = new QHBox( this );
96 new QLabel( i18n("Connection: "), temphb ); 96 new QLabel( i18n("Connection: "), temphb );
97 mPhoneConnection = new QLineEdit( temphb); 97 mPhoneConnection = new QLineEdit( temphb);
98 lay->addWidget( temphb ); 98 lay->addWidget( temphb );
99 temphb = new QHBox( this ); 99 temphb = new QHBox( this );
100 new QLabel( i18n("Model(opt.): "), temphb ); 100 new QLabel( i18n("Model(opt.): "), temphb );
101 mPhoneModel = new QLineEdit( temphb); 101 mPhoneModel = new QLineEdit( temphb);
102 lay->addWidget( temphb ); 102 lay->addWidget( temphb );
103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
104 mWriteBackFuture->setChecked( true ); 104 mWriteBackFuture->setChecked( true );
105 lay->addWidget( mWriteBackFuture ); 105 lay->addWidget( mWriteBackFuture );
106 temphb = new QHBox( this ); 106 temphb = new QHBox( this );
107 new QLabel( i18n("Max. weeks in future: ") , temphb ); 107 new QLabel( i18n("Max. weeks in future: ") , temphb );
108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
109 mWriteBackFutureWeeks->setValue( 8 ); 109 mWriteBackFutureWeeks->setValue( 8 );
110 lay->addWidget( temphb ); 110 lay->addWidget( temphb );
111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
112 lab->setAlignment (AlignHCenter ); 112 lab->setAlignment (AlignHCenter );
113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
114 lay->addWidget( ok ); 114 lay->addWidget( ok );
115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
116 lay->addWidget( cancel ); 116 lay->addWidget( cancel );
117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
119 resize( 220, 240 ); 119 resize( 220, 240 );
120 qApp->processEvents(); 120 qApp->processEvents();
121 int dw = QApplication::desktop()->width(); 121 int dw = QApplication::desktop()->width();
122 int dh = QApplication::desktop()->height(); 122 int dh = QApplication::desktop()->height();
123 move( (dw-width())/2, (dh - height() )/2 ); 123 move( (dw-width())/2, (dh - height() )/2 );
124 } 124 }
125 125
126public: 126public:
127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
128 QCheckBox* mWriteBackFuture; 128 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 129 QSpinBox* mWriteBackFutureWeeks;
130}; 130};
131 131
132QPixmap* sgListViewCompletedPix[6]; 132QPixmap* sgListViewCompletedPix[6];
133 133
134 134
135int globalFlagBlockStartup; 135int globalFlagBlockStartup;
136MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 136MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
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 if ( sgListViewCompletedPix[5]->height() < 5 ) { 145 if ( sgListViewCompletedPix[5]->height() < 5 ) {
146 int size = 12; 146 int size = 12;
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 int half = size/2; 151 int half = size/2;
152 int heihei = size/2; 152 int heihei = size/2;
153 int x = 1; 153 int x = 1;
154 p.drawLine ( 2, 5, 4 , 7 ) ; 154 p.drawLine ( 2, 5, 4 , 7 ) ;
155 p.drawLine ( 4 , 7 , 8, 3) ; 155 p.drawLine ( 4 , 7 , 8, 3) ;
156 int iii = 0; 156 int iii = 0;
157 for ( iii = 0; iii < 5; ++iii ) { 157 for ( iii = 0; iii < 5; ++iii ) {
158 sgListViewCompletedPix[iii]->resize( 11, 11 ); 158 sgListViewCompletedPix[iii]->resize( 11, 11 );
159 sgListViewCompletedPix[iii]->fill( Qt::white ); 159 sgListViewCompletedPix[iii]->fill( Qt::white );
160 QPainter p ( sgListViewCompletedPix[iii] ); 160 QPainter p ( sgListViewCompletedPix[iii] );
161 p.drawRect( 0,0,11,11); 161 p.drawRect( 0,0,11,11);
162 if ( iii ) 162 if ( iii )
163 p.fillRect( 1,1,iii*2,9,Qt::gray ); 163 p.fillRect( 1,1,iii*2,9,Qt::gray );
164 } 164 }
165 } 165 }
166 mClosed = false; 166 mClosed = false;
167 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 167 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
168 QString confFile = locateLocal("config","korganizerrc"); 168 QString confFile = locateLocal("config","korganizerrc");
169 QFileInfo finf ( confFile ); 169 QFileInfo finf ( confFile );
170 bool showWarning = !finf.exists(); 170 bool showWarning = !finf.exists();
171 setIcon(SmallIcon( "ko24" ) ); 171 setIcon(SmallIcon( "ko24" ) );
172 mBlockAtStartup = true; 172 mBlockAtStartup = true;
173 mFlagKeyPressed = false; 173 mFlagKeyPressed = false;
174 setCaption("KO/Pi"); 174 setCaption("KO/Pi");
175 KOPrefs *p = KOPrefs::instance(); 175 KOPrefs *p = KOPrefs::instance();
176 KPimGlobalPrefs::instance()->setGlobalConfig(); 176 //KPimGlobalPrefs::instance()->setGlobalConfig();
177 p->mCurrentDisplayedView = 0; 177 p->mCurrentDisplayedView = 0;
178 if ( p->mHourSize > 22 ) 178 if ( p->mHourSize > 22 )
179 p->mHourSize = 22; 179 p->mHourSize = 22;
180 QMainWindow::ToolBarDock tbd; 180 QMainWindow::ToolBarDock tbd;
181 if ( p->mToolBarHor ) { 181 if ( p->mToolBarHor ) {
182 if ( p->mToolBarUp ) 182 if ( p->mToolBarUp )
183 tbd = Bottom; 183 tbd = Bottom;
184 else 184 else
185 tbd = Top; 185 tbd = Top;
186 } 186 }
187 else { 187 else {
188 if ( p->mToolBarUp ) 188 if ( p->mToolBarUp )
189 tbd = Right; 189 tbd = Right;
190 else 190 else
191 tbd = Left; 191 tbd = Left;
192 } 192 }
193 if ( KOPrefs::instance()->mUseAppColors ) 193 if ( KOPrefs::instance()->mUseAppColors )
194 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 194 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
195 globalFlagBlockStartup = 1; 195 globalFlagBlockStartup = 1;
196 iconToolBar = new QPEToolBar( this ); 196 iconToolBar = new QPEToolBar( this );
197 addToolBar (iconToolBar , tbd ); 197 addToolBar (iconToolBar , tbd );
198 198
199#ifdef DESKTOP_VERSION 199#ifdef DESKTOP_VERSION
200 if ( KOPrefs::instance()->mShowIconFilter ) 200 if ( KOPrefs::instance()->mShowIconFilter )
201#else 201#else
202 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 202 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
203#endif 203#endif
204 204
205{ 205{
206 if ( p->mToolBarHorF ) { 206 if ( p->mToolBarHorF ) {
207 if ( p->mToolBarUpF ) 207 if ( p->mToolBarUpF )
208 tbd = Bottom; 208 tbd = Bottom;
209 else 209 else
210 tbd = Top; 210 tbd = Top;
211 } 211 }
212 else { 212 else {
213 if ( p->mToolBarUpF ) 213 if ( p->mToolBarUpF )
214 tbd = Right; 214 tbd = Right;
215 else 215 else
216 tbd = Left; 216 tbd = Left;
217 } 217 }
218 filterToolBar = new QPEToolBar ( this ); 218 filterToolBar = new QPEToolBar ( this );
219 filterMenubar = new QMenuBar( 0 ); 219 filterMenubar = new QMenuBar( 0 );
220 QFontMetrics fm ( filterMenubar->font() ); 220 QFontMetrics fm ( filterMenubar->font() );
221 221
222 filterPopupMenu = new QPopupMenu( this ); 222 filterPopupMenu = new QPopupMenu( this );
223 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 223 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
224 QString addTest = "A"; 224 QString addTest = "A";
225 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 225 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
226#ifdef DESKTOP_VERSION 226#ifdef DESKTOP_VERSION
227 addTest = "AAABBBCCCx"; 227 addTest = "AAABBBCCCx";
228#else 228#else
229 addTest = "AAx"; 229 addTest = "AAx";
230#endif 230#endif
231 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 231 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
232 addToolBar (filterToolBar , tbd ); 232 addToolBar (filterToolBar , tbd );
233 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 233 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
234 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 234 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
235 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 235 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
236 filterToolBar->hide(); 236 filterToolBar->hide();
237 } else { 237 } else {
238 filterToolBar = 0; 238 filterToolBar = 0;
239 filterMenubar = 0; 239 filterMenubar = 0;
240 filterPopupMenu = 0; 240 filterPopupMenu = 0;
241 } 241 }
242 if ( p->mShowIconOnetoolbar ) { 242 if ( p->mShowIconOnetoolbar ) {
243 viewToolBar = iconToolBar ; 243 viewToolBar = iconToolBar ;
244 navigatorToolBar = iconToolBar ; 244 navigatorToolBar = iconToolBar ;
245 } else { 245 } else {
246#ifndef DESKTOP_VERSION 246#ifndef DESKTOP_VERSION
247 setToolBarsMovable( false ); 247 setToolBarsMovable( false );
248#endif 248#endif
249 if ( p->mToolBarHorV ) { 249 if ( p->mToolBarHorV ) {
250 if ( p->mToolBarUpV ) 250 if ( p->mToolBarUpV )
251 tbd = Bottom; 251 tbd = Bottom;
252 else 252 else
253 tbd = Top; 253 tbd = Top;
254 } 254 }
255 else { 255 else {
256 if ( p->mToolBarUpV ) 256 if ( p->mToolBarUpV )
257 tbd = Right; 257 tbd = Right;
258 else 258 else
259 tbd = Left; 259 tbd = Left;
260 } 260 }
261 viewToolBar = new QPEToolBar( this ); 261 viewToolBar = new QPEToolBar( this );
262 addToolBar (viewToolBar , tbd ); 262 addToolBar (viewToolBar , tbd );
263 if ( p->mToolBarHorN ) { 263 if ( p->mToolBarHorN ) {
264 if ( p->mToolBarUpN ) 264 if ( p->mToolBarUpN )
265 tbd = Bottom; 265 tbd = Bottom;
266 else 266 else
267 tbd = Top; 267 tbd = Top;
268 } 268 }
269 else { 269 else {
270 if ( p->mToolBarUpN ) 270 if ( p->mToolBarUpN )
271 tbd = Right; 271 tbd = Right;
272 else 272 else
273 tbd = Left; 273 tbd = Left;
274 } 274 }
275 navigatorToolBar = new QPEToolBar( this ); 275 navigatorToolBar = new QPEToolBar( this );
276 addToolBar (navigatorToolBar , tbd ); 276 addToolBar (navigatorToolBar , tbd );
277 } 277 }
278 278
279 279
280 280
281 mCalendarModifiedFlag = false; 281 mCalendarModifiedFlag = false;
282 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 282 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
283 splash->setAlignment ( AlignCenter ); 283 splash->setAlignment ( AlignCenter );
284 setCentralWidget( splash ); 284 setCentralWidget( splash );
285#ifndef DESKTOP_VERSION 285#ifndef DESKTOP_VERSION
286 showMaximized(); 286 showMaximized();
287#endif 287#endif
288 288
289 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 289 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
290 setDefaultPreferences(); 290 setDefaultPreferences();
291 mCalendar = new CalendarLocal(); 291 mCalendar = new CalendarLocal();
292 mView = new CalendarView( mCalendar, this,"mCalendar " ); 292 mView = new CalendarView( mCalendar, this,"mCalendar " );
293 mView->hide(); 293 mView->hide();
294 //mView->resize(splash->size() ); 294 //mView->resize(splash->size() );
295 initActions(); 295 initActions();
296 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 296 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
297 mSyncManager->setBlockSave(false); 297 mSyncManager->setBlockSave(false);
298 mView->setSyncManager(mSyncManager); 298 mView->setSyncManager(mSyncManager);
299#ifndef DESKTOP_VERSION 299#ifndef DESKTOP_VERSION
300 iconToolBar->show(); 300 iconToolBar->show();
301 qApp->processEvents(); 301 qApp->processEvents();
302#endif 302#endif
303 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 303 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
304 int vh = height() ; 304 int vh = height() ;
305 int vw = width(); 305 int vw = width();
306 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 306 //qDebug("Toolbar hei %d ",iconToolBar->height() );
307 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 307 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
308 vh -= iconToolBar->height(); 308 vh -= iconToolBar->height();
309 } else { 309 } else {
310 vw -= iconToolBar->height(); 310 vw -= iconToolBar->height();
311 } 311 }
312 //mView->setMaximumSize( splash->size() ); 312 //mView->setMaximumSize( splash->size() );
313 //mView->resize( splash->size() ); 313 //mView->resize( splash->size() );
314 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 314 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
315 mView->readSettings(); 315 mView->readSettings();
316 bool newFile = false; 316 bool newFile = false;
317 if( !QFile::exists( defaultFileName() ) ) { 317 if( !QFile::exists( defaultFileName() ) ) {
318 QFileInfo finfo ( defaultFileName() ); 318 QFileInfo finfo ( defaultFileName() );
319 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 319 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
320 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"; 320 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";
321 finfo.setFile( oldFile ); 321 finfo.setFile( oldFile );
322 if (finfo.exists() ) { 322 if (finfo.exists() ) {
323 KMessageBox::information( this, message); 323 KMessageBox::information( this, message);
324 mView->openCalendar( oldFile ); 324 mView->openCalendar( oldFile );
325 qApp->processEvents(); 325 qApp->processEvents();
326 } else { 326 } else {
327 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 327 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
328 finfo.setFile( oldFile ); 328 finfo.setFile( oldFile );
329 if (finfo.exists() ) { 329 if (finfo.exists() ) {
330 KMessageBox::information( this, message); 330 KMessageBox::information( this, message);
331 mView->openCalendar( oldFile ); 331 mView->openCalendar( oldFile );
332 qApp->processEvents(); 332 qApp->processEvents();
333 } 333 }
334 } 334 }
335 mView->saveCalendar( defaultFileName() ); 335 mView->saveCalendar( defaultFileName() );
336 newFile = true; 336 newFile = true;
337 } 337 }
338 338
339 QTime neededSaveTime = QDateTime::currentDateTime().time(); 339 QTime neededSaveTime = QDateTime::currentDateTime().time();
340 mView->loadCalendars(); 340 mView->loadCalendars();
341 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 341 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
342 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 342 qDebug("KO: Calendar loading time: %d ms",msNeeded );
343 343
344 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 344 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
345 KOPrefs::instance()->setAllDefaults(); 345 KOPrefs::instance()->setAllDefaults();
346 int count = mView->addCategories(); 346 int count = mView->addCategories();
347 } 347 }
348 processIncidenceSelection( 0 ); 348 processIncidenceSelection( 0 );
349 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 349 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
350 SLOT( processIncidenceSelection( Incidence * ) ) ); 350 SLOT( processIncidenceSelection( Incidence * ) ) );
351 connect( mView, SIGNAL( modifiedChanged( bool ) ), 351 connect( mView, SIGNAL( modifiedChanged( bool ) ),
352 SLOT( slotModifiedChanged( bool ) ) ); 352 SLOT( slotModifiedChanged( bool ) ) );
353 353
354 354
355 connect( mView, SIGNAL( tempDisableBR(bool) ), 355 connect( mView, SIGNAL( tempDisableBR(bool) ),
356 SLOT( disableBR(bool) ) ); 356 SLOT( disableBR(bool) ) );
357 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 357 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
358 mView->setModified( false ); 358 mView->setModified( false );
359 mBlockAtStartup = false; 359 mBlockAtStartup = false;
360 mView->setModified( false ); 360 mView->setModified( false );
361 setCentralWidget( mView ); 361 setCentralWidget( mView );
362 globalFlagBlockStartup = 0; 362 globalFlagBlockStartup = 0;
363 mView->show(); 363 mView->show();
364 delete splash; 364 delete splash;
365 if ( newFile ) 365 if ( newFile )
366 mView->updateConfig(); 366 mView->updateConfig();
367 // qApp->processEvents(); 367 // qApp->processEvents();
368 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 368 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
369 //fillSyncMenu(); 369 //fillSyncMenu();
370 370
371 371
372 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 372 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
373 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 373 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
374 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 374 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
375 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 375 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
376 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 376 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
377 mSyncManager->setDefaultFileName( sentSyncFile()); 377 mSyncManager->setDefaultFileName( sentSyncFile());
378 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 378 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
379 mSyncManager->fillSyncMenu(); 379 mSyncManager->fillSyncMenu();
380 380
381 381
382 382
383 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 383 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
384 if ( showWarning ) { 384 if ( showWarning ) {
385 KMessageBox::information( this, 385 KMessageBox::information( this,
386 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 386 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
387 qApp->processEvents(); 387 qApp->processEvents();
388 mView->dialogManager()->showSyncOptions(); 388 mView->dialogManager()->showSyncOptions();
389 } 389 }
390 390
391 //US listen for result adressed from Ka/Pi 391 //US listen for result adressed from Ka/Pi
392#ifndef DESKTOP_VERSION 392#ifndef DESKTOP_VERSION
393 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 393 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
394#endif 394#endif
395#ifndef DESKTOP_VERSION 395#ifndef DESKTOP_VERSION
396 infrared = 0; 396 infrared = 0;
397#endif 397#endif
398 updateFilterToolbar(); 398 updateFilterToolbar();
399 updateWeek( mView->startDate() ); 399 updateWeek( mView->startDate() );
400 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 400 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
401 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 401 SLOT( updateWeekNum( const KCal::DateList & ) ) );
402 mBRdisabled = false; 402 mBRdisabled = false;
403 //toggleBeamReceive(); 403 //toggleBeamReceive();
404 int tiint= 3000; 404 int tiint= 3000;
405#ifndef DESKTOP_VERSION 405#ifndef DESKTOP_VERSION
406 tiint = 5000; 406 tiint = 5000;
407#endif 407#endif
408 QTimer::singleShot( tiint, mView, SLOT ( checkAlarms() )); 408 QTimer::singleShot( tiint, mView, SLOT ( checkAlarms() ));
409} 409}
410MainWindow::~MainWindow() 410MainWindow::~MainWindow()
411{ 411{
412 //qDebug("MainWindow::~MainWindow() "); 412 //qDebug("MainWindow::~MainWindow() ");
413 //save toolbar location 413 //save toolbar location
414 delete mCalendar; 414 delete mCalendar;
415 delete mSyncManager; 415 delete mSyncManager;
416#ifndef DESKTOP_VERSION 416#ifndef DESKTOP_VERSION
417 if ( infrared ) 417 if ( infrared )
418 delete infrared; 418 delete infrared;
419#endif 419#endif
420 420
421 421
422} 422}
423 423
424void MainWindow::disableBR(bool b) 424void MainWindow::disableBR(bool b)
425{ 425{
426#ifndef DESKTOP_VERSION 426#ifndef DESKTOP_VERSION
427 if ( b ) { 427 if ( b ) {
428 if ( infrared ) { 428 if ( infrared ) {
429 toggleBeamReceive(); 429 toggleBeamReceive();
430 mBRdisabled = true; 430 mBRdisabled = true;
431 } 431 }
432 mBRdisabled = true; 432 mBRdisabled = true;
@@ -1470,513 +1470,513 @@ void MainWindow::timetrackinghowto()
1470 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); 1470 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" );
1471} 1471}
1472void MainWindow::kdesynchowto() 1472void MainWindow::kdesynchowto()
1473{ 1473{
1474 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1474 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1475} 1475}
1476void MainWindow::multisynchowto() 1476void MainWindow::multisynchowto()
1477{ 1477{
1478 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1478 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1479} 1479}
1480void MainWindow::synchowto() 1480void MainWindow::synchowto()
1481{ 1481{
1482 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1482 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1483} 1483}
1484void MainWindow::faq() 1484void MainWindow::faq()
1485{ 1485{
1486 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1486 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1487 1487
1488} 1488}
1489void MainWindow::whatsNew() 1489void MainWindow::whatsNew()
1490{ 1490{
1491 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1491 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1492 1492
1493} 1493}
1494void MainWindow::licence() 1494void MainWindow::licence()
1495{ 1495{
1496 KApplication::showLicence(); 1496 KApplication::showLicence();
1497 1497
1498} 1498}
1499void MainWindow::about() 1499void MainWindow::about()
1500{ 1500{
1501 QString version; 1501 QString version;
1502#include <../version> 1502#include <../version>
1503 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1503 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1504 i18n("KOrganizer/Platform-independent\n") + 1504 i18n("KOrganizer/Platform-independent\n") +
1505 "(KO/Pi) " + version + " - " + 1505 "(KO/Pi) " + version + " - " +
1506 1506
1507#ifdef DESKTOP_VERSION 1507#ifdef DESKTOP_VERSION
1508 i18n("Desktop Edition\n") + 1508 i18n("Desktop Edition\n") +
1509#else 1509#else
1510 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1510 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1511#endif 1511#endif
1512 i18n("(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!") ); 1512 i18n("(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!") );
1513} 1513}
1514void MainWindow::keyBindings() 1514void MainWindow::keyBindings()
1515{ 1515{
1516 QString cap = i18n("KO/Pi Keys + Colors"); 1516 QString cap = i18n("KO/Pi Keys + Colors");
1517 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1517 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1518 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1518 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1519 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1519 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1520 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1520 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1521 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1521 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1522 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1522 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1523 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ 1523 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
1524 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1524 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1525 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1525 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1526 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1526 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1527 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1527 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1528 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1528 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1529 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1529 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1530 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1530 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1531 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1531 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1532 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1532 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1533 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1533 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1534 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1534 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1535 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1535 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1536 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1536 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1537 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1537 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1538 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1538 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1539 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1539 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1540 i18n("<p><h3>In agenda view:</h3></p>\n") + 1540 i18n("<p><h3>In agenda view:</h3></p>\n") +
1541 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1541 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1542 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1542 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1543 i18n("<p><h3>In todo view:</h3></p>\n") + 1543 i18n("<p><h3>In todo view:</h3></p>\n") +
1544 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1544 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1545 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1545 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1546 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1546 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1547 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1547 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1548 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1548 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1549 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1549 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1550 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1550 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1551 i18n("<p><h3>In list view:</h3></p>\n") + 1551 i18n("<p><h3>In list view:</h3></p>\n") +
1552 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1552 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1553 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1553 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1554 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1554 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1555 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1555 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1556 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1556 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1557 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1557 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1558 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1558 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1559 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1559 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1560 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1560 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1561 i18n("<p><b>E</b>: Edit item</p>\n") + 1561 i18n("<p><b>E</b>: Edit item</p>\n") +
1562 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1562 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1563 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1563 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1564 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1564 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1565 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1565 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1566 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1566 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1567 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1567 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1568 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1568 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1569 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1569 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1570 i18n("<p><b>White</b>: Item readonly</p>\n"); 1570 i18n("<p><b>White</b>: Item readonly</p>\n");
1571 displayText( text, cap); 1571 displayText( text, cap);
1572} 1572}
1573void MainWindow::aboutAutoSaving() 1573void MainWindow::aboutAutoSaving()
1574{ 1574{
1575 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"); 1575 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");
1576 1576
1577 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1577 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1578 1578
1579} 1579}
1580void MainWindow::aboutKnownBugs() 1580void MainWindow::aboutKnownBugs()
1581{ 1581{
1582 QMessageBox* msg; 1582 QMessageBox* msg;
1583 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1583 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1584 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")+ 1584 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")+
1585 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1585 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1586 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1586 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1587 i18n("\nor report them in the bugtracker on\n") + 1587 i18n("\nor report them in the bugtracker on\n") +
1588 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1588 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1589 QMessageBox::NoIcon, 1589 QMessageBox::NoIcon,
1590 QMessageBox::Ok, 1590 QMessageBox::Ok,
1591 QMessageBox::NoButton, 1591 QMessageBox::NoButton,
1592 QMessageBox::NoButton); 1592 QMessageBox::NoButton);
1593 msg->exec(); 1593 msg->exec();
1594 delete msg; 1594 delete msg;
1595 1595
1596} 1596}
1597 1597
1598QString MainWindow::defaultFileName() 1598QString MainWindow::defaultFileName()
1599{ 1599{
1600 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1600 return locateLocal( "data", "korganizer/mycalendar.ics" );
1601} 1601}
1602QString MainWindow::syncFileName() 1602QString MainWindow::syncFileName()
1603{ 1603{
1604#ifdef DESKTOP_VERSION 1604#ifdef DESKTOP_VERSION
1605 return locateLocal( "tmp", "synccalendar.ics" ); 1605 return locateLocal( "tmp", "synccalendar.ics" );
1606#else 1606#else
1607 return QString( "/tmp/synccalendar.ics" ); 1607 return QString( "/tmp/synccalendar.ics" );
1608#endif 1608#endif
1609} 1609}
1610#include "koglobals.h" 1610#include "koglobals.h"
1611#include <kcalendarsystem.h> 1611#include <kcalendarsystem.h>
1612void MainWindow::updateWeek(QDate seda) 1612void MainWindow::updateWeek(QDate seda)
1613{ 1613{
1614 int weekNum = KGlobal::locale()->weekNum ( seda ); 1614 int weekNum = KGlobal::locale()->weekNum ( seda );
1615 mWeekPixmap.fill( mWeekBgColor ); 1615 mWeekPixmap.fill( mWeekBgColor );
1616 QPainter p ( &mWeekPixmap ); 1616 QPainter p ( &mWeekPixmap );
1617 p.setFont( mWeekFont ); 1617 p.setFont( mWeekFont );
1618 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1618 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1619 p.end(); 1619 p.end();
1620 QIconSet icon3 ( mWeekPixmap ); 1620 QIconSet icon3 ( mWeekPixmap );
1621 mWeekAction->setIconSet ( icon3 ); 1621 mWeekAction->setIconSet ( icon3 );
1622 1622
1623} 1623}
1624void MainWindow::updateWeekNum(const DateList &selectedDates) 1624void MainWindow::updateWeekNum(const DateList &selectedDates)
1625{ 1625{
1626 updateWeek( selectedDates.first() ); 1626 updateWeek( selectedDates.first() );
1627} 1627}
1628void MainWindow::processIncidenceSelection( Incidence *incidence ) 1628void MainWindow::processIncidenceSelection( Incidence *incidence )
1629{ 1629{
1630 1630
1631 if ( !incidence ) { 1631 if ( !incidence ) {
1632 enableIncidenceActions( false ); 1632 enableIncidenceActions( false );
1633 1633
1634 mNewSubTodoAction->setEnabled( false ); 1634 mNewSubTodoAction->setEnabled( false );
1635 setCaptionToDates(); 1635 setCaptionToDates();
1636 return; 1636 return;
1637 1637
1638 } 1638 }
1639 1639
1640 //KGlobal::locale()->formatDateTime(nextA, true); 1640 //KGlobal::locale()->formatDateTime(nextA, true);
1641 QString startString = ""; 1641 QString startString = "";
1642 if ( incidence->typeID() != todoID ) { 1642 if ( incidence->typeID() != todoID ) {
1643 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1643 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1644 if ( incidence->doesFloat() ) { 1644 if ( incidence->doesFloat() ) {
1645 startString += ": "+incidence->dtStartDateStr( true ); 1645 startString += ": "+incidence->dtStartDateStr( true );
1646 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1646 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1647 1647
1648 } else { 1648 } else {
1649 startString = ": "+incidence->dtStartStr(true); 1649 startString = ": "+incidence->dtStartStr(true);
1650 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1650 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1651 1651
1652 } 1652 }
1653 1653
1654 } else { 1654 } else {
1655 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1655 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1656 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1656 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1657 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1657 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1658 1658
1659 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1659 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1660 bool ok; 1660 bool ok;
1661 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1661 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1662 if ( ok ) { 1662 if ( ok ) {
1663 int years = noc.date().year() - incidence->dtStart().date().year(); 1663 int years = noc.date().year() - incidence->dtStart().date().year();
1664 startString += i18n(" (%1 y.)"). arg( years ); 1664 startString += i18n(" (%1 y.)"). arg( years );
1665 } 1665 }
1666 } 1666 }
1667 else 1667 else
1668 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1668 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1669 } 1669 }
1670 1670
1671 } 1671 }
1672 else 1672 else
1673 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1673 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1674 if ( !incidence->location().isEmpty() ) 1674 if ( !incidence->location().isEmpty() )
1675 startString += " (" +incidence->location()+")"; 1675 startString += " (" +incidence->location()+")";
1676 setCaption( incidence->summary()+startString); 1676 setCaption( incidence->summary()+startString);
1677 1677
1678 enableIncidenceActions( true ); 1678 enableIncidenceActions( true );
1679 1679
1680 if ( incidence->typeID() == eventID ) { 1680 if ( incidence->typeID() == eventID ) {
1681 mShowAction->setText( i18n("Show Event...") ); 1681 mShowAction->setText( i18n("Show Event...") );
1682 mEditAction->setText( i18n("Edit Event...") ); 1682 mEditAction->setText( i18n("Edit Event...") );
1683 mDeleteAction->setText( i18n("Delete Event...") ); 1683 mDeleteAction->setText( i18n("Delete Event...") );
1684 1684
1685 mNewSubTodoAction->setEnabled( false ); 1685 mNewSubTodoAction->setEnabled( false );
1686 } else if ( incidence->typeID() == todoID ) { 1686 } else if ( incidence->typeID() == todoID ) {
1687 mShowAction->setText( i18n("Show Todo...") ); 1687 mShowAction->setText( i18n("Show Todo...") );
1688 mEditAction->setText( i18n("Edit Todo...") ); 1688 mEditAction->setText( i18n("Edit Todo...") );
1689 mDeleteAction->setText( i18n("Delete Todo...") ); 1689 mDeleteAction->setText( i18n("Delete Todo...") );
1690 1690
1691 mNewSubTodoAction->setEnabled( true ); 1691 mNewSubTodoAction->setEnabled( true );
1692 } else { 1692 } else {
1693 mShowAction->setText( i18n("Show...") ); 1693 mShowAction->setText( i18n("Show...") );
1694 mShowAction->setText( i18n("Edit...") ); 1694 mShowAction->setText( i18n("Edit...") );
1695 mShowAction->setText( i18n("Delete...") ); 1695 mShowAction->setText( i18n("Delete...") );
1696 1696
1697 mNewSubTodoAction->setEnabled( false ); 1697 mNewSubTodoAction->setEnabled( false );
1698 } 1698 }
1699} 1699}
1700 1700
1701void MainWindow::enableIncidenceActions( bool enabled ) 1701void MainWindow::enableIncidenceActions( bool enabled )
1702{ 1702{
1703 mShowAction->setEnabled( enabled ); 1703 mShowAction->setEnabled( enabled );
1704 mEditAction->setEnabled( enabled ); 1704 mEditAction->setEnabled( enabled );
1705 mDeleteAction->setEnabled( enabled ); 1705 mDeleteAction->setEnabled( enabled );
1706 1706
1707 mCloneAction->setEnabled( enabled ); 1707 mCloneAction->setEnabled( enabled );
1708 mMoveAction->setEnabled( enabled ); 1708 mMoveAction->setEnabled( enabled );
1709 mBeamAction->setEnabled( enabled ); 1709 mBeamAction->setEnabled( enabled );
1710 mCancelAction->setEnabled( enabled ); 1710 mCancelAction->setEnabled( enabled );
1711} 1711}
1712 1712
1713void MainWindow::importOL() 1713void MainWindow::importOL()
1714{ 1714{
1715#ifdef _OL_IMPORT_ 1715#ifdef _OL_IMPORT_
1716 mView->clearAllViews(); 1716 mView->clearAllViews();
1717 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1717 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1718 id->exec(); 1718 id->exec();
1719 delete id; 1719 delete id;
1720 mView->calendar()->checkAlarmForIncidence( 0, true ); 1720 mView->calendar()->checkAlarmForIncidence( 0, true );
1721 mView->updateView(); 1721 mView->updateView();
1722#endif 1722#endif
1723} 1723}
1724void MainWindow::importBday() 1724void MainWindow::importBday()
1725{ 1725{
1726 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1726 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1727 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1727 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1728 i18n("Import!"), i18n("Cancel"), 0, 1728 i18n("Import!"), i18n("Cancel"), 0,
1729 0, 1 ); 1729 0, 1 );
1730 if ( result == 0 ) { 1730 if ( result == 0 ) {
1731 mView->importBday(); 1731 mView->importBday();
1732 1732
1733 } 1733 }
1734 1734
1735 1735
1736} 1736}
1737void MainWindow::importQtopia() 1737void MainWindow::importQtopia()
1738{ 1738{
1739 //#ifndef DESKTOP_VERSION 1739 //#ifndef DESKTOP_VERSION
1740 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"); 1740 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");
1741#ifdef DESKTOP_VERSION 1741#ifdef DESKTOP_VERSION
1742 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"); 1742 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");
1743#endif 1743#endif
1744 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1744 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1745 i18n("Import!"), i18n("Cancel"), 0, 1745 i18n("Import!"), i18n("Cancel"), 0,
1746 0, 1 ); 1746 0, 1 );
1747 if ( result == 0 ) { 1747 if ( result == 0 ) {
1748#ifndef DESKTOP_VERSION 1748#ifndef DESKTOP_VERSION
1749 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1749 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1750 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1750 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1751 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1751 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1752#else 1752#else
1753 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1753 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1754 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1754 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1755 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1755 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1756#endif 1756#endif
1757 mView->importQtopia( categories, datebook, todolist ); 1757 mView->importQtopia( categories, datebook, todolist );
1758 } 1758 }
1759 mView->calendar()->reInitAlarmSettings(); 1759 mView->calendar()->reInitAlarmSettings();
1760#if 0 1760#if 0
1761 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1761 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1762 i18n("Not supported \non desktop!\n"), 1762 i18n("Not supported \non desktop!\n"),
1763 i18n("Ok"), i18n("Cancel"), 0, 1763 i18n("Ok"), i18n("Cancel"), 0,
1764 0, 1 ); 1764 0, 1 );
1765 1765
1766#endif 1766#endif
1767} 1767}
1768 1768
1769void MainWindow::saveOnClose() 1769void MainWindow::saveOnClose()
1770{ 1770{
1771 KOPrefs *p = KOPrefs::instance(); 1771 KOPrefs *p = KOPrefs::instance();
1772 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1772 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1773 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1773 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1774 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1774 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1775 if ( filterToolBar ) { 1775 if ( filterToolBar ) {
1776 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1776 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1777 } 1777 }
1778#ifdef DESKTOP_VERSION 1778#ifdef DESKTOP_VERSION
1779 1779
1780 QPoint myP; 1780 QPoint myP;
1781 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1781 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1782 if ( p->mToolBarHor ) 1782 if ( p->mToolBarHor )
1783 p->mToolBarUp = myP.y() > height()/2; 1783 p->mToolBarUp = myP.y() > height()/2;
1784 else 1784 else
1785 p->mToolBarUp = myP.x() > width()/2; 1785 p->mToolBarUp = myP.x() > width()/2;
1786 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1786 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1787 if ( p->mToolBarHorV ) 1787 if ( p->mToolBarHorV )
1788 p->mToolBarUpV = myP.y() > height()/2; 1788 p->mToolBarUpV = myP.y() > height()/2;
1789 else 1789 else
1790 p->mToolBarUpV = myP.x() > width()/2 ; 1790 p->mToolBarUpV = myP.x() > width()/2 ;
1791 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1791 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1792 if ( p->mToolBarHorN ) 1792 if ( p->mToolBarHorN )
1793 p->mToolBarUpN = myP.y() > height()/2; 1793 p->mToolBarUpN = myP.y() > height()/2;
1794 else 1794 else
1795 p->mToolBarUpN = myP.x() > width()/2 ; 1795 p->mToolBarUpN = myP.x() > width()/2 ;
1796 if ( filterToolBar ) { 1796 if ( filterToolBar ) {
1797 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1797 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1798 if ( p->mToolBarHorF ) 1798 if ( p->mToolBarHorF )
1799 p->mToolBarUpF = myP.y() > height()/2; 1799 p->mToolBarUpF = myP.y() > height()/2;
1800 else 1800 else
1801 p->mToolBarUpF = myP.x() > width()/2 ; 1801 p->mToolBarUpF = myP.x() > width()/2 ;
1802 } 1802 }
1803#else 1803#else
1804 if ( p->mToolBarHor ) 1804 if ( p->mToolBarHor )
1805 p->mToolBarUp = iconToolBar->y() > height()/2; 1805 p->mToolBarUp = iconToolBar->y() > height()/2;
1806 else 1806 else
1807 p->mToolBarUp = iconToolBar->x() > width()/2; 1807 p->mToolBarUp = iconToolBar->x() > width()/2;
1808 if ( p->mToolBarHorV ) 1808 if ( p->mToolBarHorV )
1809 p->mToolBarUpV = viewToolBar->y() > height()/2; 1809 p->mToolBarUpV = viewToolBar->y() > height()/2;
1810 else 1810 else
1811 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1811 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1812 1812
1813 if ( p->mToolBarHorN ) 1813 if ( p->mToolBarHorN )
1814 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1814 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1815 else 1815 else
1816 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1816 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1817 if ( filterToolBar ) { 1817 if ( filterToolBar ) {
1818 if ( p->mToolBarHorF ) 1818 if ( p->mToolBarHorF )
1819 p->mToolBarUpF = filterToolBar->y() > height()/2; 1819 p->mToolBarUpF = filterToolBar->y() > height()/2;
1820 else 1820 else
1821 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1821 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1822 } 1822 }
1823#endif 1823#endif
1824 1824
1825 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1825 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1826 save(); 1826 save();
1827 mView->writeSettings(); 1827 mView->writeSettings();
1828} 1828}
1829void MainWindow::slotModifiedChanged( bool changed ) 1829void MainWindow::slotModifiedChanged( bool changed )
1830{ 1830{
1831 if ( mBlockAtStartup ) 1831 if ( mBlockAtStartup )
1832 return; 1832 return;
1833 1833
1834 int msec; 1834 int msec;
1835 // we store the changes after 1 minute, 1835 // we store the changes after 1 minute,
1836 // and for safety reasons after 10 minutes again 1836 // and for safety reasons after 10 minutes again
1837 if ( !mSyncManager->blockSave() ) 1837 if ( !mSyncManager->blockSave() )
1838 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1838 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1839 else 1839 else
1840 msec = 1000 * 600; 1840 msec = 1000 * 600;
1841 mSaveTimer.start( msec, true ); // 1 minute 1841 mSaveTimer.start( msec, true ); // 1 minute
1842 qDebug("KO: Saving File in %d secs!", msec/1000); 1842 qDebug("KO: Saving File in %d secs!", msec/1000);
1843 mCalendarModifiedFlag = true; 1843 mCalendarModifiedFlag = true;
1844} 1844}
1845void MainWindow::saveStopTimer() 1845void MainWindow::saveStopTimer()
1846{ 1846{
1847 mSaveTimer.stop(); 1847 mSaveTimer.stop();
1848} 1848}
1849void MainWindow::backupAllFiles() 1849void MainWindow::backupAllFiles()
1850{ 1850{
1851 QDate reference ( 2000,1,1); 1851 QDate reference ( 2000,1,1);
1852 int daysTo = reference.daysTo ( QDate::currentDate() ); 1852 int daysTo = reference.daysTo ( QDate::currentDate() );
1853 setCaption(i18n("Creating backup ... please wait ..." )); 1853 setCaption(i18n("Creating backup ... please wait ..." ));
1854 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1854 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1855 // we need the file path, the backup dir and the number of bups as param 1855 // we need the file path, the backup dir and the number of bups as param
1856 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1856 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1857 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1857 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1858 bupDir = KGlobalSettings::backupDataDir(); 1858 bupDir = KGlobalSettings::backupDataDir();
1859 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1859 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1860 if ( retval == 0 ) { 1860 if ( retval == 0 ) {
1861 setCaption(i18n("Backup cancelled" )); 1861 setCaption(i18n("Backup cancelled" ));
1862 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1862 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1863 // retval == 0 : backup skipped for today, try again tomorrow 1863 // retval == 0 : backup skipped for today, try again tomorrow
1864 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1864 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1865 } else if ( retval == 1 ){ 1865 } else if ( retval == 1 ){
1866 qDebug("KO: Backup created."); 1866 qDebug("KO: Backup created.");
1867 // backup ok 1867 // backup ok
1868 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1868 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1869 KopiCalendarFile * cal = calendars.first(); 1869 KopiCalendarFile * cal = calendars.first();
1870 cal = calendars.next(); 1870 cal = calendars.next();
1871 while ( cal ) { 1871 while ( cal ) {
1872 if ( !cal->mErrorOnLoad ) { 1872 if ( !cal->mErrorOnLoad ) {
1873 int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1873 int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1874 } 1874 }
1875 cal = calendars.next(); 1875 cal = calendars.next();
1876 } 1876 }
1877 KOPrefs::instance()->mLastBackupDate = daysTo; 1877 KOPrefs::instance()->mLastBackupDate = daysTo;
1878 setCaption(i18n("Backup succesfully finished" )); 1878 setCaption(i18n("Backup succesfully finished" ));
1879 } else if ( retval == 2 ){ 1879 } else if ( retval == 2 ){
1880 setCaption(i18n("Backup globally disabled" )); 1880 setCaption(i18n("Backup globally disabled" ));
1881 qDebug("KO: Backup globally cancelled."); 1881 qDebug("KO: Backup globally cancelled.");
1882 // backup globally cancelled 1882 // backup globally cancelled
1883 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1883 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1884 } 1884 }
1885 // retval == 3: do nothing, try again later 1885 // retval == 3: do nothing, try again later
1886} 1886}
1887void MainWindow::save() 1887void MainWindow::save()
1888{ 1888{
1889 if ( !mCalendarModifiedFlag ) { 1889 if ( !mCalendarModifiedFlag ) {
1890 qDebug("KO: Calendar not modified. Nothing saved."); 1890 qDebug("KO: Calendar not modified. Nothing saved.");
1891 return; 1891 return;
1892 } 1892 }
1893 if ( mSyncManager->blockSave() ) 1893 if ( mSyncManager->blockSave() )
1894 return; 1894 return;
1895 mSyncManager->setBlockSave(true); 1895 mSyncManager->setBlockSave(true);
1896 if ( mView->checkAllFileVersions() ) { 1896 if ( mView->checkAllFileVersions() ) {
1897 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 1897 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1898 QDate reference ( 2000,1,1); 1898 QDate reference ( 2000,1,1);
1899 int daysTo = reference.daysTo ( QDate::currentDate() ); 1899 int daysTo = reference.daysTo ( QDate::currentDate() );
1900 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 1900 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
1901 backupAllFiles(); 1901 backupAllFiles();
1902 } 1902 }
1903 ; // KPimGlobalPrefs::instance()->mLastBackupDate 1903 ; // KPimGlobalPrefs::instance()->mLastBackupDate
1904 } 1904 }
1905 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1905 QTime neededSaveTime = QDateTime::currentDateTime().time();
1906 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1906 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1907 qDebug("KO: Start saving data to file!"); 1907 qDebug("KO: Start saving data to file!");
1908 mView->saveCalendars(); 1908 mView->saveCalendars();
1909 mCalendarModifiedFlag = false; 1909 mCalendarModifiedFlag = false;
1910 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1910 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1911 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1911 qDebug("KO: Needed %d ms for saving.",msNeeded );
1912 QString savemes; 1912 QString savemes;
1913 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1913 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1914 setCaption(savemes); 1914 setCaption(savemes);
1915 } else 1915 } else
1916 setCaption(i18n("Saving cancelled!")); 1916 setCaption(i18n("Saving cancelled!"));
1917 mSyncManager->setBlockSave( false ); 1917 mSyncManager->setBlockSave( false );
1918} 1918}
1919 1919
1920void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1920void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1921{ 1921{
1922 if ( !e->isAutoRepeat() ) { 1922 if ( !e->isAutoRepeat() ) {
1923 mFlagKeyPressed = false; 1923 mFlagKeyPressed = false;
1924 } 1924 }
1925} 1925}
1926void MainWindow::keyPressEvent ( QKeyEvent * e ) 1926void MainWindow::keyPressEvent ( QKeyEvent * e )
1927{ 1927{
1928 qApp->processEvents(); 1928 qApp->processEvents();
1929 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1929 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1930 e->ignore(); 1930 e->ignore();
1931 // qDebug(" ignore %d",e->isAutoRepeat() ); 1931 // qDebug(" ignore %d",e->isAutoRepeat() );
1932 return; 1932 return;
1933 } 1933 }
1934 if (! e->isAutoRepeat() ) 1934 if (! e->isAutoRepeat() )
1935 mFlagKeyPressed = true; 1935 mFlagKeyPressed = true;
1936 KOPrefs *p = KOPrefs::instance(); 1936 KOPrefs *p = KOPrefs::instance();
1937 bool showSelectedDates = false; 1937 bool showSelectedDates = false;
1938 int size; 1938 int size;
1939 int pro = 0; 1939 int pro = 0;
1940 //qDebug("MainWindow::keyPressEvent "); 1940 //qDebug("MainWindow::keyPressEvent ");
1941 switch ( e->key() ) { 1941 switch ( e->key() ) {
1942 case Qt::Key_Right: 1942 case Qt::Key_Right:
1943 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1943 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1944 mView->goNextMonth(); 1944 mView->goNextMonth();
1945 else 1945 else
1946 mView->goNext(); 1946 mView->goNext();
1947 showSelectedDates = true; 1947 showSelectedDates = true;
1948 break; 1948 break;
1949 case Qt::Key_Left: 1949 case Qt::Key_Left:
1950 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1950 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1951 mView->goPreviousMonth(); 1951 mView->goPreviousMonth();
1952 else 1952 else
1953 mView->goPrevious(); 1953 mView->goPrevious();
1954 showSelectedDates = true; 1954 showSelectedDates = true;
1955 break; 1955 break;
1956 case Qt::Key_Down: 1956 case Qt::Key_Down:
1957 mView->viewManager()->agendaView()->scrollOneHourDown(); 1957 mView->viewManager()->agendaView()->scrollOneHourDown();
1958 break; 1958 break;
1959 case Qt::Key_Up: 1959 case Qt::Key_Up:
1960 mView->viewManager()->agendaView()->scrollOneHourUp(); 1960 mView->viewManager()->agendaView()->scrollOneHourUp();
1961 break; 1961 break;
1962 case Qt::Key_K: 1962 case Qt::Key_K:
1963 mView->viewManager()->showMonthViewWeek(); 1963 mView->viewManager()->showMonthViewWeek();
1964 break; 1964 break;
1965 case Qt::Key_I: 1965 case Qt::Key_I:
1966 mView->showIncidence(); 1966 mView->showIncidence();
1967 break; 1967 break;
1968 case Qt::Key_Delete: 1968 case Qt::Key_Delete:
1969 case Qt::Key_Backspace: 1969 case Qt::Key_Backspace:
1970 mView->deleteIncidence(); 1970 mView->deleteIncidence();
1971 break; 1971 break;
1972 case Qt::Key_D: 1972 case Qt::Key_D:
1973 mView->viewManager()->showDayView(); 1973 mView->viewManager()->showDayView();
1974 showSelectedDates = true; 1974 showSelectedDates = true;
1975 break; 1975 break;
1976 case Qt::Key_O: 1976 case Qt::Key_O:
1977 mView->toggleFilerEnabled( ); 1977 mView->toggleFilerEnabled( );
1978 break; 1978 break;
1979 case Qt::Key_0: 1979 case Qt::Key_0:
1980 case Qt::Key_1: 1980 case Qt::Key_1:
1981 case Qt::Key_2: 1981 case Qt::Key_2:
1982 case Qt::Key_3: 1982 case Qt::Key_3:
@@ -2057,499 +2057,502 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
2057 mView->showNextAlarms(); 2057 mView->showNextAlarms();
2058 else 2058 else
2059 mView->toggleAllDaySize(); 2059 mView->toggleAllDaySize();
2060 break; 2060 break;
2061 case Qt::Key_T: 2061 case Qt::Key_T:
2062 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2062 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2063 mView->newTodo(); 2063 mView->newTodo();
2064 else { 2064 else {
2065 mView->goToday(); 2065 mView->goToday();
2066 showSelectedDates = true; 2066 showSelectedDates = true;
2067 } 2067 }
2068 break; 2068 break;
2069 case Qt::Key_J: 2069 case Qt::Key_J:
2070 mView->viewManager()->showJournalView(); 2070 mView->viewManager()->showJournalView();
2071 break; 2071 break;
2072 case Qt::Key_B: 2072 case Qt::Key_B:
2073 mView->editIncidenceDescription();; 2073 mView->editIncidenceDescription();;
2074 break; 2074 break;
2075 // case Qt::Key_Return: 2075 // case Qt::Key_Return:
2076 case Qt::Key_E: 2076 case Qt::Key_E:
2077 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2077 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2078 mView->newEvent(); 2078 mView->newEvent();
2079 else 2079 else
2080 mView->editIncidence(); 2080 mView->editIncidence();
2081 break; 2081 break;
2082 case Qt::Key_Plus: 2082 case Qt::Key_Plus:
2083 size = p->mHourSize +2; 2083 size = p->mHourSize +2;
2084 if ( size <= 22 ) 2084 if ( size <= 22 )
2085 configureAgenda( size ); 2085 configureAgenda( size );
2086 break; 2086 break;
2087 case Qt::Key_Minus: 2087 case Qt::Key_Minus:
2088 size = p->mHourSize - 2; 2088 size = p->mHourSize - 2;
2089 if ( size >= 4 ) 2089 if ( size >= 4 )
2090 configureAgenda( size ); 2090 configureAgenda( size );
2091 break; 2091 break;
2092 2092
2093 2093
2094 default: 2094 default:
2095 e->ignore(); 2095 e->ignore();
2096 } 2096 }
2097 if ( pro > 0 ) { 2097 if ( pro > 0 ) {
2098 selectFilter( pro+1 ); 2098 selectFilter( pro+1 );
2099 } 2099 }
2100 if ( showSelectedDates ) { 2100 if ( showSelectedDates ) {
2101 ;// setCaptionToDates(); 2101 ;// setCaptionToDates();
2102 } 2102 }
2103 2103
2104} 2104}
2105void MainWindow::fillFilterMenuTB() 2105void MainWindow::fillFilterMenuTB()
2106{ 2106{
2107 selectFilterMenuTB->clear(); 2107 selectFilterMenuTB->clear();
2108 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2108 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2109 selectFilterMenuTB->insertSeparator(); 2109 selectFilterMenuTB->insertSeparator();
2110 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2110 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2111 2111
2112 selectFilterMenuTB->insertSeparator(); 2112 selectFilterMenuTB->insertSeparator();
2113 QPtrList<CalFilter> fili = mView->filters(); 2113 QPtrList<CalFilter> fili = mView->filters();
2114 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2114 CalFilter *curfilter = mView->filterView()->selectedFilter();
2115 CalFilter *filter = fili.first(); 2115 CalFilter *filter = fili.first();
2116 int iii = 2; 2116 int iii = 2;
2117 bool checkitem = mView->filterView()->filtersEnabled(); 2117 bool checkitem = mView->filterView()->filtersEnabled();
2118 while(filter) { 2118 while(filter) {
2119 selectFilterMenuTB->insertItem( filter->name(), iii ); 2119 selectFilterMenuTB->insertItem( filter->name(), iii );
2120 if ( filter == curfilter) 2120 if ( filter == curfilter)
2121 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2121 selectFilterMenuTB->setItemChecked( iii, checkitem );
2122 filter = fili.next(); 2122 filter = fili.next();
2123 ++iii; 2123 ++iii;
2124 } 2124 }
2125 if ( !checkitem ) 2125 if ( !checkitem )
2126 selectFilterMenuTB->setItemChecked( 1, true ); 2126 selectFilterMenuTB->setItemChecked( 1, true );
2127 2127
2128 int x = 0; 2128 int x = 0;
2129 int y = iconToolBar->height(); 2129 int y = iconToolBar->height();
2130 int dX = 0; 2130 int dX = 0;
2131 int dY = 0; 2131 int dY = 0;
2132 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2132 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2133 if ( iconToolBar->y() > height()/2 ) { 2133 if ( iconToolBar->y() > height()/2 ) {
2134 dY = selectFilterMenuTB->sizeHint().height()+8; 2134 dY = selectFilterMenuTB->sizeHint().height()+8;
2135 y = 0; 2135 y = 0;
2136 } 2136 }
2137 } else { 2137 } else {
2138 if ( iconToolBar->x() > width()/2 ) { // right side 2138 if ( iconToolBar->x() > width()/2 ) { // right side
2139 x=0; 2139 x=0;
2140 dX= selectFilterMenuTB->sizeHint().width()+8; 2140 dX= selectFilterMenuTB->sizeHint().width()+8;
2141 y = 0; 2141 y = 0;
2142 } else { 2142 } else {
2143 x= iconToolBar->width(); 2143 x= iconToolBar->width();
2144 y = 0; 2144 y = 0;
2145 } 2145 }
2146 } 2146 }
2147 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2147 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2148 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2148 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2149} 2149}
2150void MainWindow::fillFilterMenu() 2150void MainWindow::fillFilterMenu()
2151{ 2151{
2152 selectFilterMenu->clear(); 2152 selectFilterMenu->clear();
2153 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2153 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2154 selectFilterMenu->insertSeparator(); 2154 selectFilterMenu->insertSeparator();
2155 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2155 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2156 2156
2157 selectFilterMenu->insertSeparator(); 2157 selectFilterMenu->insertSeparator();
2158 QPtrList<CalFilter> fili = mView->filters(); 2158 QPtrList<CalFilter> fili = mView->filters();
2159 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2159 CalFilter *curfilter = mView->filterView()->selectedFilter();
2160 CalFilter *filter = fili.first(); 2160 CalFilter *filter = fili.first();
2161 int iii = 2; 2161 int iii = 2;
2162 bool checkitem = mView->filterView()->filtersEnabled(); 2162 bool checkitem = mView->filterView()->filtersEnabled();
2163 while(filter) { 2163 while(filter) {
2164 selectFilterMenu->insertItem( filter->name(), iii ); 2164 selectFilterMenu->insertItem( filter->name(), iii );
2165 if ( filter == curfilter) 2165 if ( filter == curfilter)
2166 selectFilterMenu->setItemChecked( iii, checkitem ); 2166 selectFilterMenu->setItemChecked( iii, checkitem );
2167 filter = fili.next(); 2167 filter = fili.next();
2168 ++iii; 2168 ++iii;
2169 } 2169 }
2170 if ( !checkitem ) 2170 if ( !checkitem )
2171 selectFilterMenu->setItemChecked( 1, true ); 2171 selectFilterMenu->setItemChecked( 1, true );
2172} 2172}
2173void MainWindow::fillFilterMenuPopup() 2173void MainWindow::fillFilterMenuPopup()
2174{ 2174{
2175 filterPopupMenu->clear(); 2175 filterPopupMenu->clear();
2176 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2176 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2177 2177
2178 filterPopupMenu->insertSeparator(); 2178 filterPopupMenu->insertSeparator();
2179 QPtrList<CalFilter> fili = mView->filters(); 2179 QPtrList<CalFilter> fili = mView->filters();
2180 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2180 CalFilter *curfilter = mView->filterView()->selectedFilter();
2181 CalFilter *filter = fili.first(); 2181 CalFilter *filter = fili.first();
2182 int iii = 1; 2182 int iii = 1;
2183 bool checkitem = mView->filterView()->filtersEnabled(); 2183 bool checkitem = mView->filterView()->filtersEnabled();
2184 while(filter) { 2184 while(filter) {
2185 filterPopupMenu->insertItem( filter->name(), iii ); 2185 filterPopupMenu->insertItem( filter->name(), iii );
2186 if ( filter == curfilter) 2186 if ( filter == curfilter)
2187 filterPopupMenu->setItemChecked( iii, checkitem ); 2187 filterPopupMenu->setItemChecked( iii, checkitem );
2188 filter = fili.next(); 2188 filter = fili.next();
2189 ++iii; 2189 ++iii;
2190 } 2190 }
2191 if ( !checkitem ) 2191 if ( !checkitem )
2192 filterPopupMenu->setItemChecked( 0, true ); 2192 filterPopupMenu->setItemChecked( 0, true );
2193} 2193}
2194void MainWindow::selectFilter( int fil ) 2194void MainWindow::selectFilter( int fil )
2195{ 2195{
2196 2196
2197 if ( fil == 0 ) { 2197 if ( fil == 0 ) {
2198 mView->editFilters( ); 2198 mView->editFilters( );
2199 } else if ( fil == 1 ){ 2199 } else if ( fil == 1 ){
2200 if ( mView->filterView()->filtersEnabled() ) 2200 if ( mView->filterView()->filtersEnabled() )
2201 mView->toggleFilerEnabled( ); 2201 mView->toggleFilerEnabled( );
2202 } else { 2202 } else {
2203 if ( !mView->filterView()->filtersEnabled() ) { 2203 if ( !mView->filterView()->filtersEnabled() ) {
2204 mView->filterView()->blockSignals( true ); 2204 mView->filterView()->blockSignals( true );
2205 mView->toggleFilerEnabled( ); 2205 mView->toggleFilerEnabled( );
2206 mView->filterView()->blockSignals( false ); 2206 mView->filterView()->blockSignals( false );
2207 } 2207 }
2208 mView->selectFilter( fil-2 ); 2208 mView->selectFilter( fil-2 );
2209 } 2209 }
2210} 2210}
2211void MainWindow::updateFilterToolbar() 2211void MainWindow::updateFilterToolbar()
2212{ 2212{
2213 if ( filterMenubar ) { 2213 if ( filterMenubar ) {
2214 if ( !mView->filterView()->filtersEnabled() ) { 2214 if ( !mView->filterView()->filtersEnabled() ) {
2215 filterMenubar->changeItem( 0, i18n("No Filter") ); 2215 filterMenubar->changeItem( 0, i18n("No Filter") );
2216 } else { 2216 } else {
2217 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2217 CalFilter *curfilter = mView->filterView()->selectedFilter();
2218 if ( curfilter ) { 2218 if ( curfilter ) {
2219 filterMenubar->changeItem( 0, curfilter->name() ); 2219 filterMenubar->changeItem( 0, curfilter->name() );
2220 } 2220 }
2221 } 2221 }
2222 } 2222 }
2223} 2223}
2224void MainWindow::selectFilterPopup( int fil ) 2224void MainWindow::selectFilterPopup( int fil )
2225{ 2225{
2226 selectFilter( fil + 1 ); 2226 selectFilter( fil + 1 );
2227 2227
2228} 2228}
2229void MainWindow::configureToolBar( int item ) 2229void MainWindow::configureToolBar( int item )
2230{ 2230{
2231 2231
2232 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2232 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2233 KOPrefs *p = KOPrefs::instance(); 2233 KOPrefs *p = KOPrefs::instance();
2234 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2234 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2235 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2235 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2236 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2236 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2237 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2237 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2238 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2238 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2239 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2239 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2240 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2240 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2241 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2241 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2242 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2242 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2243 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2243 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2244 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2244 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2245 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2245 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2246 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2246 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2247 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2247 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2248 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2248 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2249 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2249 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2250 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2250 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2251 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2251 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2252 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2252 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2253 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2253 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2254 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2254 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2255 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2255 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2256 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2256 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2257 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2257 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2258 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2258 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2259 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2259 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2260 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2260 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2261 // initActions(); 2261 // initActions();
2262} 2262}
2263void MainWindow::setCaption ( const QString & c ) 2263void MainWindow::setCaption ( const QString & c )
2264{ 2264{
2265 QString cap = c; 2265 QString cap = c;
2266 cap.replace( QRegExp("\n"), " " ); 2266 cap.replace( QRegExp("\n"), " " );
2267 cap = cap.stripWhiteSpace(); 2267 cap = cap.stripWhiteSpace();
2268 if ( cap.isEmpty() ) 2268 if ( cap.isEmpty() )
2269 cap = "KO/Pi"; 2269 cap = "KO/Pi";
2270 QWidget::setCaption( cap ); 2270 QWidget::setCaption( cap );
2271} 2271}
2272void MainWindow::setCaptionToDates() 2272void MainWindow::setCaptionToDates()
2273{ 2273{
2274 QString selDates; 2274 QString selDates;
2275 QDate date = mView->startDate(); 2275 QDate date = mView->startDate();
2276 if ( ! date.isValid() ) { 2276 if ( ! date.isValid() ) {
2277 setCaption(""); 2277 setCaption("");
2278 return; 2278 return;
2279 } 2279 }
2280 selDates = KGlobal::locale()->formatDate( date, true); 2280 selDates = KGlobal::locale()->formatDate( date, true);
2281 if (mView->startDate() < mView->endDate() ) 2281 if (mView->startDate() < mView->endDate() )
2282 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2282 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2283 else { 2283 else {
2284 QString addString; 2284 QString addString;
2285 if ( date == QDateTime::currentDateTime().date() ) 2285 if ( date == QDateTime::currentDateTime().date() )
2286 addString = i18n("Today"); 2286 addString = i18n("Today");
2287 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2287 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2288 addString = i18n("Tomorrow"); 2288 addString = i18n("Tomorrow");
2289 if ( !addString.isEmpty() ) 2289 if ( !addString.isEmpty() )
2290 selDates = addString+", "+selDates ; 2290 selDates = addString+", "+selDates ;
2291 } 2291 }
2292 setCaption( i18n("Dates: ") + selDates ); 2292 setCaption( i18n("Dates: ") + selDates );
2293 2293
2294} 2294}
2295void MainWindow::showConfigureAgenda( ) 2295void MainWindow::showConfigureAgenda( )
2296{ 2296{
2297 int iii; 2297 int iii;
2298 for ( iii = 1;iii<= 10 ;++iii ){ 2298 for ( iii = 1;iii<= 10 ;++iii ){
2299 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2299 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2300 } 2300 }
2301 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2301 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2302} 2302}
2303void MainWindow::configureAgenda( int item ) 2303void MainWindow::configureAgenda( int item )
2304{ 2304{
2305 if ( KOPrefs::instance()->mHourSize == item ) 2305 if ( KOPrefs::instance()->mHourSize == item )
2306 return; 2306 return;
2307 KOPrefs::instance()->mHourSize=item; 2307 KOPrefs::instance()->mHourSize=item;
2308 mView->viewManager()->agendaView()->updateConfig(); 2308 mView->viewManager()->agendaView()->updateConfig();
2309} 2309}
2310 2310
2311void MainWindow::saveCalendar() 2311void MainWindow::saveCalendar()
2312{ 2312{
2313
2314 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2313 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2315 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2314 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2316 bupDir = KGlobalSettings::backupDataDir(); 2315 bupDir = KGlobalSettings::backupDataDir();
2317 bupDir = KGlobal::formatMessage ( bupDir, 0 ); 2316 bupDir = KGlobal::formatMessage ( bupDir, 0 );
2318 QString bupHint; 2317 QString bupHint;
2319 if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) 2318 if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
2320 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); 2319 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
2321 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; 2320 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return;
2321 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
2322 KPimGlobalPrefs::instance()->mBackupEnabled = false;
2323 save();
2324 KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
2322 backupAllFiles(); 2325 backupAllFiles();
2323} 2326}
2324void MainWindow::loadCalendar() 2327void MainWindow::loadCalendar()
2325{ 2328{
2326 2329
2327 2330
2328#if 0 2331#if 0
2329 QString fn = KOPrefs::instance()->mLastLoadFile; 2332 QString fn = KOPrefs::instance()->mLastLoadFile;
2330 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2333 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2331 2334
2332 if ( fn == "" ) 2335 if ( fn == "" )
2333 return; 2336 return;
2334 QFileInfo info; 2337 QFileInfo info;
2335 info.setFile( fn ); 2338 info.setFile( fn );
2336 QString mess; 2339 QString mess;
2337 bool loadbup = true; 2340 bool loadbup = true;
2338 if ( info. exists() ) { 2341 if ( info. exists() ) {
2339 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2342 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2340 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2343 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2341 mess, 2344 mess,
2342 i18n("Load!"), i18n("Cancel"), 0, 2345 i18n("Load!"), i18n("Cancel"), 0,
2343 0, 1 ); 2346 0, 1 );
2344 if ( result != 0 ) { 2347 if ( result != 0 ) {
2345 loadbup = false; 2348 loadbup = false;
2346 } 2349 }
2347 } else { 2350 } else {
2348 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2351 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2349 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2352 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2350 0, 1 ); 2353 0, 1 );
2351 2354
2352 return; 2355 return;
2353 } 2356 }
2354 if ( loadbup ) { 2357 if ( loadbup ) {
2355 mView->openCalendar( fn ); 2358 mView->openCalendar( fn );
2356 KOPrefs::instance()->mLastLoadFile = fn; 2359 KOPrefs::instance()->mLastLoadFile = fn;
2357 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2360 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2358 setCaption(mess); 2361 setCaption(mess);
2359 } 2362 }
2360#endif 2363#endif
2361 2364
2362} 2365}
2363void MainWindow::quickImportIcal() 2366void MainWindow::quickImportIcal()
2364{ 2367{
2365 importFile( KOPrefs::instance()->mLastImportFile, false ); 2368 importFile( KOPrefs::instance()->mLastImportFile, false );
2366} 2369}
2367void MainWindow::importFile( QString fn, bool quick ) 2370void MainWindow::importFile( QString fn, bool quick )
2368{ 2371{
2369 QFileInfo info; 2372 QFileInfo info;
2370 info.setFile( fn ); 2373 info.setFile( fn );
2371 QString mess; 2374 QString mess;
2372 bool loadbup = true; 2375 bool loadbup = true;
2373 if ( !info. exists() ) { 2376 if ( !info. exists() ) {
2374 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2377 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2375 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2378 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2376 mess ); 2379 mess );
2377 return; 2380 return;
2378 } 2381 }
2379 int result = 0; 2382 int result = 0;
2380 if ( !quick ) { 2383 if ( !quick ) {
2381 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2384 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2382 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2385 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2383 mess, 2386 mess,
2384 "Import", "Cancel", 0, 2387 "Import", "Cancel", 0,
2385 0, 1 ); 2388 0, 1 );
2386 } 2389 }
2387 if ( result == 0 ) { 2390 if ( result == 0 ) {
2388 if ( mView->openCalendar( fn, true )) { 2391 if ( mView->openCalendar( fn, true )) {
2389 KOPrefs::instance()->mLastImportFile = fn; 2392 KOPrefs::instance()->mLastImportFile = fn;
2390 setCaption(i18n("Imported file successfully")); 2393 setCaption(i18n("Imported file successfully"));
2391 } else { 2394 } else {
2392 setCaption(i18n("Error importing file")); 2395 setCaption(i18n("Error importing file"));
2393 } 2396 }
2394 } 2397 }
2395} 2398}
2396 2399
2397void MainWindow::importIcal() 2400void MainWindow::importIcal()
2398{ 2401{
2399 2402
2400 QString fn =KOPrefs::instance()->mLastImportFile; 2403 QString fn =KOPrefs::instance()->mLastImportFile;
2401 2404
2402 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2405 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2403 if ( fn == "" ) 2406 if ( fn == "" )
2404 return; 2407 return;
2405 importFile( fn, true ); 2408 importFile( fn, true );
2406 2409
2407} 2410}
2408 2411
2409void MainWindow::exportVCalendar() 2412void MainWindow::exportVCalendar()
2410{ 2413{
2411 QString fn = KOPrefs::instance()->mLastVcalFile; 2414 QString fn = KOPrefs::instance()->mLastVcalFile;
2412 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2415 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2413 if ( fn == "" ) 2416 if ( fn == "" )
2414 return; 2417 return;
2415 QFileInfo info; 2418 QFileInfo info;
2416 info.setFile( fn ); 2419 info.setFile( fn );
2417 QString mes; 2420 QString mes;
2418 bool createbup = true; 2421 bool createbup = true;
2419 if ( info. exists() ) { 2422 if ( info. exists() ) {
2420 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2423 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2421 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2424 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2422 i18n("Overwrite!"), i18n("Cancel"), 0, 2425 i18n("Overwrite!"), i18n("Cancel"), 0,
2423 0, 1 ); 2426 0, 1 );
2424 if ( result != 0 ) { 2427 if ( result != 0 ) {
2425 createbup = false; 2428 createbup = false;
2426 } 2429 }
2427 } 2430 }
2428 if ( createbup ) { 2431 if ( createbup ) {
2429 if ( mView->exportVCalendar( fn ) ) { 2432 if ( mView->exportVCalendar( fn ) ) {
2430 KOPrefs::instance()->mLastVcalFile = fn; 2433 KOPrefs::instance()->mLastVcalFile = fn;
2431 if ( fn.length() > 20 ) 2434 if ( fn.length() > 20 )
2432 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2435 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2433 else 2436 else
2434 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2437 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2435 setCaption(mes); 2438 setCaption(mes);
2436 } 2439 }
2437 } 2440 }
2438 2441
2439} 2442}
2440QString MainWindow::sentSyncFile() 2443QString MainWindow::sentSyncFile()
2441{ 2444{
2442#ifdef DESKTOP_VERSION 2445#ifdef DESKTOP_VERSION
2443 return locateLocal( "tmp", "copysynccal.ics" ); 2446 return locateLocal( "tmp", "copysynccal.ics" );
2444#else 2447#else
2445 return QString( "/tmp/copysynccal.ics" ); 2448 return QString( "/tmp/copysynccal.ics" );
2446#endif 2449#endif
2447} 2450}
2448 2451
2449void MainWindow::syncFileRequest() 2452void MainWindow::syncFileRequest()
2450{ 2453{
2451 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2454 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2452 mSyncManager->slotSyncMenu( 999 ); 2455 mSyncManager->slotSyncMenu( 999 );
2453 } 2456 }
2454 2457
2455 setCaption(i18n("Saving Data to temp file ..." )); 2458 setCaption(i18n("Saving Data to temp file ..." ));
2456 mView->saveCalendar( sentSyncFile() ); 2459 mView->saveCalendar( sentSyncFile() );
2457 setCaption(i18n("Data saved to temp file!" )); 2460 setCaption(i18n("Data saved to temp file!" ));
2458 2461
2459} 2462}
2460void MainWindow::getFile( bool success ) 2463void MainWindow::getFile( bool success )
2461{ 2464{
2462 if ( ! success ) { 2465 if ( ! success ) {
2463 setCaption( i18n("Error receiving file. Nothing changed!") ); 2466 setCaption( i18n("Error receiving file. Nothing changed!") );
2464 return; 2467 return;
2465 } 2468 }
2466 mView->openCalendar( sentSyncFile() ); 2469 mView->openCalendar( sentSyncFile() );
2467 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2470 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2468 mSyncManager->slotSyncMenu( 999 ); 2471 mSyncManager->slotSyncMenu( 999 );
2469 } 2472 }
2470 setCaption( i18n("Pi-Sync successful!") ); 2473 setCaption( i18n("Pi-Sync successful!") );
2471} 2474}
2472void MainWindow::printListView() 2475void MainWindow::printListView()
2473{ 2476{
2474 2477
2475 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2478 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2476 2479
2477 KMessageBox::information( this, message); 2480 KMessageBox::information( this, message);
2478} 2481}
2479void MainWindow::printSel( ) 2482void MainWindow::printSel( )
2480{ 2483{
2481 mView->viewManager()->agendaView()->agenda()->printSelection(); 2484 mView->viewManager()->agendaView()->agenda()->printSelection();
2482} 2485}
2483 2486
2484void MainWindow::printCal() 2487void MainWindow::printCal()
2485{ 2488{
2486 mView->print();//mCp->showDialog(); 2489 mView->print();//mCp->showDialog();
2487} 2490}
2488 2491
2489 2492
2490#include "libkdepim/kdatepicker.h" 2493#include "libkdepim/kdatepicker.h"
2491#include <kdatetbl.h> 2494#include <kdatetbl.h>
2492 2495
2493void MainWindow::weekAction() 2496void MainWindow::weekAction()
2494{ 2497{
2495 int month; 2498 int month;
2496 KPopupFrame* popup = new KPopupFrame(this); 2499 KPopupFrame* popup = new KPopupFrame(this);
2497 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2500 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2498 // ----- 2501 // -----
2499 picker->resize(picker->sizeHint()); 2502 picker->resize(picker->sizeHint());
2500 popup->setMainWidget(picker); 2503 popup->setMainWidget(picker);
2501 picker->setFocus(); 2504 picker->setFocus();
2502 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2505 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2503 int x = 0; 2506 int x = 0;
2504 int y = iconToolBar->height(); 2507 int y = iconToolBar->height();
2505 int dX = 0; 2508 int dX = 0;
2506 int dY = 0; 2509 int dY = 0;
2507 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2510 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2508 if ( iconToolBar->y() > height()/2 ) { 2511 if ( iconToolBar->y() > height()/2 ) {
2509 dY = picker->sizeHint().height()+8; 2512 dY = picker->sizeHint().height()+8;
2510 y = 0; 2513 y = 0;
2511 } 2514 }
2512 } else { 2515 } else {
2513 if ( iconToolBar->x() > width()/2 ) { // right side 2516 if ( iconToolBar->x() > width()/2 ) { // right side
2514 x=0; 2517 x=0;
2515 dX= picker->sizeHint().width()+8; 2518 dX= picker->sizeHint().width()+8;
2516 y = 0; 2519 y = 0;
2517 } else { 2520 } else {
2518 x= iconToolBar->width(); 2521 x= iconToolBar->width();
2519 y = 0; 2522 y = 0;
2520 } 2523 }
2521 } 2524 }
2522 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2525 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2523 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2526 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2524 { 2527 {
2525 month = picker->getResult(); 2528 month = picker->getResult();
2526 emit selectWeek ( month ); 2529 emit selectWeek ( month );
2527 //qDebug("weekSelected %d ", month); 2530 //qDebug("weekSelected %d ", month);
2528 } 2531 }
2529 delete popup; 2532 delete popup;
2530} 2533}
2531 2534
2532void MainWindow::hideEvent ( QHideEvent * ) 2535void MainWindow::hideEvent ( QHideEvent * )
2533{ 2536{
2534 QString message; 2537 QString message;
2535 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2538 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2536 if ( nextA.isValid() ) { 2539 if ( nextA.isValid() ) {
2537 QString sum = mCalendar->nextSummary(); 2540 QString sum = mCalendar->nextSummary();
2538 2541
2539 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2542 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2540 setCaption( message ); 2543 setCaption( message );
2541 } 2544 }
2542} 2545}
2543 2546
2544void MainWindow::resizeEvent( QResizeEvent* e) 2547void MainWindow::resizeEvent( QResizeEvent* e)
2545{ 2548{
2546#ifndef DESKTOP_VERSION 2549#ifndef DESKTOP_VERSION
2547 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2550 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2548 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2551 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2549 filterToolBar->hide(); 2552 filterToolBar->hide();
2550 else 2553 else
2551 filterToolBar->show(); 2554 filterToolBar->show();
2552 } 2555 }
2553#endif 2556#endif
2554 QMainWindow::resizeEvent( e); 2557 QMainWindow::resizeEvent( e);
2555} 2558}