summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt8
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt3
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/kofilterview.h1
-rw-r--r--korganizer/komonthview.cpp8
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/mainwindow.cpp9
7 files changed, 25 insertions, 9 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 352ab63..30bb856 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,185 +1,193 @@
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.12 ************
4
5KO/Pi:
6Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus.
7Fixed a problem with the month view when file was saved but KO/Pi was not the active window.
8Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only).
9Fixed some other small problems.
10
3********** VERSION 2.1.11 ************ 11********** VERSION 2.1.11 ************
4 12
5KO/Pi: 13KO/Pi:
6Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. 14Because we can have many calendars now in KO/Pi we can have more than one journal entry per day.
7Added features to handle (and add ) more than one journal entry per day. 15Added features to handle (and add ) more than one journal entry per day.
8Added option for a journal title. 16Added option for a journal title.
9 17
10Added info about the calendar, the item belongs to, to the event/todo/journal viewer. 18Added info about the calendar, the item belongs to, to the event/todo/journal viewer.
11Fixed a problem of the alarm of completed recurring todos. 19Fixed a problem of the alarm of completed recurring todos.
12Added to the event/todo editor to set quickly the category of an item. 20Added to the event/todo editor to set quickly the category of an item.
13 21
14 22
15Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. 23Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet.
16 24
17Added KA/Pi multi sync to the multi sync called from the alarm applet. 25Added KA/Pi multi sync to the multi sync called from the alarm applet.
18 26
19********** VERSION 2.1.10 ************ 27********** VERSION 2.1.10 ************
20 28
21KO/Pi: 29KO/Pi:
22Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. 30Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file.
23When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. 31When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted.
24Fixed a bug in searching for a small timerange, i.e. one day. 32Fixed a bug in searching for a small timerange, i.e. one day.
25 33
26KA/Pi: 34KA/Pi:
27Fixed two problems in csv export. 35Fixed two problems in csv export.
28Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. 36Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi.
29 37
30********** VERSION 2.1.9 ************ 38********** VERSION 2.1.9 ************
31 39
32KO/Pi: 40KO/Pi:
33Fixed some problems of the new search options in the search dialog. 41Fixed some problems of the new search options in the search dialog.
34Fixed some problems in the new resource config options. 42Fixed some problems in the new resource config options.
35Changed 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. 43Changed 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.
36Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: 44Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown:
37Now 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. 45Now 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.
38 46
39Fixed a problem in recurrence range in syncing with DTM. 47Fixed a problem in recurrence range in syncing with DTM.
40 48
41KA/Pi: 49KA/Pi:
42Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) 50Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...)
43 51
44PwM/Pi: 52PwM/Pi:
45Added "sec" to the timeout config settings to make it clear the timeout values are seconds. 53Added "sec" to the timeout config settings to make it clear the timeout values are seconds.
46 54
47********** VERSION 2.1.8 ************ 55********** VERSION 2.1.8 ************
48 56
49KO/Pi: 57KO/Pi:
50Added info about the completion state of a todo in the ListView/Searchdialog. 58Added info about the completion state of a todo in the ListView/Searchdialog.
51If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 59If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
52Fixed some updating problems when changing the filter. 60Fixed some updating problems when changing the filter.
53 61
54KA/Pi: 62KA/Pi:
55In the addressee selection dialog now the formatted name is shown, if not empty. 63In the addressee selection dialog now the formatted name is shown, if not empty.
56Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. 64Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
57Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. 65Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
58 66
59Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 67Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
60Fixed the sorting for size in the file selector on the Z. 68Fixed the sorting for size in the file selector on the Z.
61 69
62Changed the color selection dialog on the Zaurus to a more user friendly version. 70Changed the color selection dialog on the Zaurus to a more user friendly version.
63 71
64********** VERSION 2.1.7 ************ 72********** VERSION 2.1.7 ************
65 73
66KO/Pi: 74KO/Pi:
67Fixed several problems in the new Resource handling. 75Fixed several problems in the new Resource handling.
68Added more options to the search dialog. 76Added more options to the search dialog.
69Fixed a problem in the Month view. 77Fixed a problem in the Month view.
70Added more options to the dialog when setting a todo to stopped. 78Added more options to the dialog when setting a todo to stopped.
71 79
72Fixed two small problems in KO/Pi Alarm applet. 80Fixed two small problems in KO/Pi Alarm applet.
73 81
74********** VERSION 2.1.6 ************ 82********** VERSION 2.1.6 ************
75 83
76This release is for testing only. 84This release is for testing only.
77 85
78KO/Pi: 86KO/Pi:
79Added to the list view (the list view is used in search dialog as well) the possibility to print it. 87Added to the list view (the list view is used in search dialog as well) the possibility to print it.
80Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 88Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
81Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 89Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
82Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 90Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
83Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 91Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
84Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 92Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
85 93
86Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 94Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
87In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 95In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
88Now on every sync the set of calendars is synced which are enabled in the resource view. 96Now on every sync the set of calendars is synced which are enabled in the resource view.
89 97
90A calendar is enabled in the resource view if the "eye" column is checked. 98A calendar is enabled in the resource view if the "eye" column is checked.
91You can set a calendar to be the default for new items( "+" column ). 99You can set a calendar to be the default for new items( "+" column ).
92You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 100You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
93To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 101To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
94 102
95 103
96********** VERSION 2.1.5 ************ 104********** VERSION 2.1.5 ************
97 105
98This is the new stable version. 106This is the new stable version.
99Bugfix: 107Bugfix:
100Fixed a problem with agenda popup on the desktop in KO/Pi. 108Fixed a problem with agenda popup on the desktop in KO/Pi.
101Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 109Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
102Added config option to not display completed todos in agenda view. 110Added config option to not display completed todos in agenda view.
103Addressee view is now using the formatted name, if defined. 111Addressee view is now using the formatted name, if defined.
104That makes it possible to display "lastname, firstname" in that view now. 112That makes it possible to display "lastname, firstname" in that view now.
105To set the formatted name for all contacts, please use menu: 113To set the formatted name for all contacts, please use menu:
106Edit->Change->Set formatted name. 114Edit->Change->Set formatted name.
107Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 115Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
108 116
109********** VERSION 2.1.4 ************ 117********** VERSION 2.1.4 ************
110 118
111Fixed two more bugs in the KA/Pi CSV import dialog: 119Fixed two more bugs in the KA/Pi CSV import dialog:
112Made it possible to read multi-line fields and import it to the "Note" field. 120Made it possible to read multi-line fields and import it to the "Note" field.
113Fixed a problem in mapping custom fields, whatever a custem field is... 121Fixed a problem in mapping custom fields, whatever a custem field is...
114 122
115********** VERSION 2.1.3 ************ 123********** VERSION 2.1.3 ************
116 124
117Changed the menu structure of the alarm applet: 125Changed the menu structure of the alarm applet:
118Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 126Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
119 127
120Fixed several problems in the KA/Pi CSV import dialog: 128Fixed several problems in the KA/Pi CSV import dialog:
121Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 129Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
122 130
123 131
124********** VERSION 2.1.2 ************ 132********** VERSION 2.1.2 ************
125 133
126Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 134Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
127 135
128Fixed a problem when importing data from Outlook with mutiple categories set. 136Fixed a problem when importing data from Outlook with mutiple categories set.
129 137
130Changed display of days in datenavigator: 138Changed display of days in datenavigator:
131Birthdays are now blue, not dark green. 139Birthdays are now blue, not dark green.
132When todo view is shown, no birtdays are shown and days with due todos are shown blue. 140When todo view is shown, no birtdays are shown and days with due todos are shown blue.
133When journal view is shown, only holidays are shown and days with journals are blue. 141When journal view is shown, only holidays are shown and days with journals are blue.
134 142
135Added Backup options to global config: 143Added Backup options to global config:
136You 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 ). 144You 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 ).
137It 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. 145It 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.
138The 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. 146The 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.
139 147
140********** VERSION 2.1.1 ************ 148********** VERSION 2.1.1 ************
141 149
142Stable release 2.1.1! 150Stable release 2.1.1!
143 151
144KO/Pi: 152KO/Pi:
145Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 153Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
146 154
147********** VERSION 2.1.0 ************ 155********** VERSION 2.1.0 ************
148 156
149Stable release 2.1.0! 157Stable release 2.1.0!
150 158
151Summary of changes/fixes compared to version 2.0.6: 159Summary of changes/fixes compared to version 2.0.6:
152 160
153Many bugs of version 2.0.6 fixed. 161Many bugs of version 2.0.6 fixed.
154Most of them were small bugs, but some of them were important. 162Most of them were small bugs, but some of them were important.
155It is recommended to use version 2.1.0 and not version 2.0.6. 163It is recommended to use version 2.1.0 and not version 2.0.6.
156 164
157Important changes: 165Important changes:
158 166
159Added recurring todos to KO/Pi. 167Added recurring todos to KO/Pi.
160 168
161Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 169Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
162 170
163Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 171Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
164 172
165Datenavigator can now display many months. Very useful on the desktop. 173Datenavigator can now display many months. Very useful on the desktop.
166 174
167KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 175KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
168 176
169Made alarm sound working on Linux desktop. 177Made alarm sound working on Linux desktop.
170 178
171Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 179Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
172 180
173Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 181Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
174 182
175Many other usebility enhancements. 183Many other usebility enhancements.
176Special thanks to Ben for his suggestions! 184Special thanks to Ben for his suggestions!
177 185
178You can find the complete changelog 186You can find the complete changelog
179from version 1.7.7 to 2.1.0 187from version 1.7.7 to 2.1.0
180in the source package or on 188in the source package or on
181 189
182http://www.pi-sync.net/html/changelog.html 190http://www.pi-sync.net/html/changelog.html
183 191
184 192
185 193
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 9c22730..5fece5b 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1,1497 +1,1496 @@
1{ "10 minutes","10 Minuten" }, 1{ "10 minutes","10 Minuten" },
2{ "10th","10." }, 2{ "10th","10." },
3{ "11th","11." }, 3{ "11th","11." },
4{ "12 pm Format","12 AM/PM Format" }, 4{ "12 pm Format","12 AM/PM Format" },
5{ "12th","12." }, 5{ "12th","12." },
6{ "13th","13." }, 6{ "13th","13." },
7{ "14th","14." }, 7{ "14th","14." },
8{ "15th","15." }, 8{ "15th","15." },
9{ "16th","16." }, 9{ "16th","16." },
10{ "17th","17." }, 10{ "17th","17." },
11{ "18th","18." }, 11{ "18th","18." },
12{ "19th","19." }, 12{ "19th","19." },
13{ "1 Day","1 Tag" }, 13{ "1 Day","1 Tag" },
14{ "1 h","1 Std" }, 14{ "1 h","1 Std" },
15{ "1 (high)","1 (hoch)" }, 15{ "1 (high)","1 (hoch)" },
16{ "5 (low)","5" }, 16{ "5 (low)","5" },
17{ "1st","1." }, 17{ "1st","1." },
18{ "20th","20." }, 18{ "20th","20." },
19{ "21st","21." }, 19{ "21st","21." },
20{ "22nd","22." }, 20{ "22nd","22." },
21{ "23rd","23." }, 21{ "23rd","23." },
22{ "24:00 Hour Format","24:00 Stunden Format" }, 22{ "24:00 Hour Format","24:00 Stunden Format" },
23{ "24th","24." }, 23{ "24th","24." },
24{ "25th","25." }, 24{ "25th","25." },
25{ "26th","26." }, 25{ "26th","26." },
26{ "27th","27." }, 26{ "27th","27." },
27{ "28th","28." }, 27{ "28th","28." },
28{ "29th","29." }, 28{ "29th","29." },
29{ "2nd","2." }, 29{ "2nd","2." },
30{ "30 minutes","30 Minuten" }, 30{ "30 minutes","30 Minuten" },
31{ "30th","30." }, 31{ "30th","30." },
32{ "31st","31." }, 32{ "31st","31." },
33{ "3rd","3." }, 33{ "3rd","3." },
34{ "4th","4." }, 34{ "4th","4." },
35{ "5 (lowest)","5 (Niedrigster)" }, 35{ "5 (lowest)","5 (Niedrigster)" },
36{ "5th","5." }, 36{ "5th","5." },
37{ "6th","6." }, 37{ "6th","6." },
38{ "7th","7." }, 38{ "7th","7." },
39{ "8th","8." }, 39{ "8th","8." },
40{ "9th","9." }, 40{ "9th","9." },
41{ "About...","Über..." }, 41{ "About...","Über..." },
42{ "&Accept","&Akzeptieren" }, 42{ "&Accept","&Akzeptieren" },
43{ "Accept","Akzeptieren" }, 43{ "Accept","Akzeptieren" },
44{ "Accept A&ll","A&lles Akzepieren" }, 44{ "Accept A&ll","A&lles Akzepieren" },
45{ "Access:","Zugriff:" }, 45{ "Access:","Zugriff:" },
46{ "A corresponding event is missing in your calendar!","Ein zugehöriger Termin fehlt in ihrem Kalender!" }, 46{ "A corresponding event is missing in your calendar!","Ein zugehöriger Termin fehlt in ihrem Kalender!" },
47{ "Actions","Aktionen" }, 47{ "Actions","Aktionen" },
48{ "Add Filter","Filter Hinzufügen" }, 48{ "Add Filter","Filter Hinzufügen" },
49{ "&Add","Hinzufügen" }, 49{ "&Add","Hinzufügen" },
50{ "Add","Hinzufügen" }, 50{ "Add","Hinzufügen" },
51{ "Additional email addresses:","Zusätzliche E-Mail Adressen:" }, 51{ "Additional email addresses:","Zusätzliche E-Mail Adressen:" },
52{ "Additional email address:","Zusätzliche E-Mail Adresse:" }, 52{ "Additional email address:","Zusätzliche E-Mail Adresse:" },
53{ "&Addressbook","&Adressbuch" }, 53{ "&Addressbook","&Adressbuch" },
54{ "Address &Book...","Adress&buch..." }, 54{ "Address &Book...","Adress&buch..." },
55{ "Agenda Size","Agende Größe" }, 55{ "Agenda Size","Agende Größe" },
56{ "Agenda Size:","Größe der Agenda:" }, 56{ "Agenda Size:","Größe der Agenda:" },
57{ "Agenda view:","Agenda Ansicht:" }, 57{ "Agenda view:","Agenda Ansicht:" },
58{ "Agenda view background color:","Hintergrund der Agenda Ansicht:" }, 58{ "Agenda view background color:","Hintergrund der Agenda Ansicht:" },
59{ "All attendees","Alle Teilnehmer" }, 59{ "All attendees","Alle Teilnehmer" },
60{ "AllDayAgenda Height:","Höhe Ganztages Agenda:" }, 60{ "AllDayAgenda Height:","Höhe Ganztages Agenda:" },
61{ "All day event","Ganztägig" }, 61{ "All day event","Ganztägig" },
62{ "Anonymous","Anonym" }, 62{ "Anonymous","Anonym" },
63{ "Apply","Anwenden" }, 63{ "Apply","Anwenden" },
64{ "Apr","Apr" }, 64{ "Apr","Apr" },
65{ "April","April" }, 65{ "April","April" },
66{"Ask for every entry on conflict","Frage bei Konflikten nach"}, 66{"Ask for every entry on conflict","Frage bei Konflikten nach"},
67{ "Ask for preferences before syncing","Vor dem Syncronisieren nachfragen" }, 67{ "Ask for preferences before syncing","Vor dem Syncronisieren nachfragen" },
68{ "Ask for quit when closing KO/Pi","Vor dem Beenden von KO/Pi nachfragen" }, 68{ "Ask for quit when closing KO/Pi","Vor dem Beenden von KO/Pi nachfragen" },
69{ "Attendees","Teilnehmer" }, 69{ "Attendees","Teilnehmer" },
70{ "Aug","Aug" }, 70{ "Aug","Aug" },
71{ "August","August" }, 71{ "August","August" },
72{ "Auto-Save","Automatisches Abspeichern" }, 72{ "Auto-Save","Automatisches Abspeichern" },
73{ "Auto save delay in minutes:","Verzög.autom.Speichern in Min" }, 73{ "Auto save delay in minutes:","Verzög.autom.Speichern in Min" },
74{ "Auto saving...","Automatische Sicherung..." }, 74{ "Auto saving...","Automatische Sicherung..." },
75{ "Begin on:","Starte mit:" }, 75{ "Begin on:","Starte mit:" },
76{ "Begins on: %1","Starte mit: %1" }, 76{ "Begins on: %1","Starte mit: %1" },
77{ "<b>From:</b> %1 <b>To:</b> %2","<b>Vom:</b> %1 <b>Zum:</b> %2" }, 77{ "<b>From:</b> %1 <b>To:</b> %2","<b>Vom:</b> %1 <b>Zum:</b> %2" },
78{ "<b>On:</b> %1","<b>Am:</b> %1" }, 78{ "<b>On:</b> %1","<b>Am:</b> %1" },
79{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3","<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" }, 79{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3","<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" },
80{ "<b>Original event:</b><p>","<b>Original Termin:</b><p>" }, 80{ "<b>Original event:</b><p>","<b>Original Termin:</b><p>" },
81{ " - both are modified after last sync"," - beide wurden nach der letzten Syncronisation verändert" }, 81{ " - both are modified after last sync"," - beide wurden nach der letzten Syncronisation verändert" },
82{ "Busy","Belegt" }, 82{ "Busy","Belegt" },
83{ "&Cancel","Abbre&chen" }, 83{ "&Cancel","Abbre&chen" },
84{ "Cancel","Abbrechen" }, 84{ "Cancel","Abbrechen" },
85{ "Cannot delete To-Do\nwhich has children.","Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" }, 85{ "Cannot delete To-Do\nwhich has children.","Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" },
86{ "Can't generate mail:\nNo event selected.","Kann e-Mail nicht erstellen:\nKein Termin ausgewählt." }, 86{ "Can't generate mail:\nNo event selected.","Kann e-Mail nicht erstellen:\nKein Termin ausgewählt." },
87{ "Categories...","Kategorien..." }, 87{ "Categories...","Kategorien..." },
88{ "Categories","Kategorien" }, 88{ "Categories","Kategorien" },
89{ "Category","Kategorie" }, 89{ "Category","Kategorie" },
90{ "Center View","Zentriere Ansicht" }, 90{ "Center View","Zentriere Ansicht" },
91{ "Change","Ändere" }, 91{ "Change","Ändere" },
92{ "Cinema","Kino" }, 92{ "Cinema","Kino" },
93{ "Click to add a new Todo","Hier klicken, um ein neues Todo anzulegen" }, 93{ "Click to add a new Todo","Hier klicken, um ein neues Todo anzulegen" },
94{ "Clone Item","Klone Eintrag" }, 94{ "Clone Item","Klone Eintrag" },
95{ "&Close","S&chließen" }, 95{ "&Close","S&chließen" },
96{ "Close","Schließen" }, 96{ "Close","Schließen" },
97{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" }, 97{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" },
98{ "Colors","Farben" }, 98{ "Colors","Farben" },
99{ "completed","erledigt" }, 99{ "completed","erledigt" },
100{ "completed on %1","erledigt am %1" }, 100{ "completed on %1","erledigt am %1" },
101{ "Complete","Erledigt" }, 101{ "Complete","Erledigt" },
102{ "Confidential","Vertraulich" }, 102{ "Confidential","Vertraulich" },
103{ "Configure...","Einstellungen..." }, 103{ "Configure...","Einstellungen..." },
104{ "Confirm &deletes","Löschvogang bestätigen" }, 104{ "Confirm &deletes","Löschvogang bestätigen" },
105{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." }, 105{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." },
106{ "Counter-event Viewer","Terminzähler Ansicht" }, 106{ "Counter-event Viewer","Terminzähler Ansicht" },
107{ "Daily ending hour:","Feierabend:" }, 107{ "Daily ending hour:","Feierabend:" },
108{ "Daily starting hour:","Anfangszeit:" }, 108{ "Daily starting hour:","Anfangszeit:" },
109{ "Daily","Täglich" }, 109{ "Daily","Täglich" },
110{ "Date Format","Datums Format" }, 110{ "Date Format","Datums Format" },
111{ "Date Format:","Datums Format:" }, 111{ "Date Format:","Datums Format:" },
112{ "DateNavigator:(nr)","Datums Navigator" }, 112{ "DateNavigator:(nr)","Datums Navigator" },
113{ "Dates: ","Datum: " }, 113{ "Dates: ","Datum: " },
114{ "Date && Time","Datum && Zeit" }, 114{ "Date && Time","Datum && Zeit" },
115{ "Day begins at:","Der Tag beginnt um:" }, 115{ "Day begins at:","Der Tag beginnt um:" },
116{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" }, 116{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" },
117{ "Days in What's Next:","Tage in What's Next:" }, 117{ "Days in What's Next:","Tage in What's Next:" },
118{ "day(s)","Tag(e)" }, 118{ "day(s)","Tag(e)" },
119{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" }, 119{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" },
120{ "day","Tag" }, 120{ "day","Tag" },
121{ "Dec","Dez" }, 121{ "Dec","Dez" },
122{ "December","Dezember" }, 122{ "December","Dezember" },
123{ "Default alarm time:","Standard Alarmzeit:" }, 123{ "Default alarm time:","Standard Alarmzeit:" },
124{ "Default appointment time:","Standard Termin Startzeit:" }, 124{ "Default appointment time:","Standard Termin Startzeit:" },
125{ "Default event color:","Standard Terminfarbe:" }, 125{ "Default event color:","Standard Terminfarbe:" },
126{ "Default","Standard" }, 126{ "Default","Standard" },
127{ "Def. duration of new app.:","Standard Termin Länge:" }, 127{ "Def. duration of new app.:","Standard Termin Länge:" },
128{ "Delete All","Lösche alles" }, 128{ "Delete All","Lösche alles" },
129{ "Delete all selected","Lösche alle Selektierten" }, 129{ "Delete all selected","Lösche alle Selektierten" },
130{ "Delete Current","Aktuellen löschen" }, 130{ "Delete Current","Aktuellen löschen" },
131{ "Delete Event...","Lösche Termin..." }, 131{ "Delete Event...","Lösche Termin..." },
132{ "Delete Event","Lösche Termin" }, 132{ "Delete Event","Lösche Termin" },
133{ "&Delete","Löschen" }, 133{ "&Delete","Löschen" },
134{ "Delete...","Löschen..." }, 134{ "Delete...","Löschen..." },
135{ "Delete","Löschen" }, 135{ "Delete","Löschen" },
136{ "Delete Todo...","Lösche Todo..." }, 136{ "Delete Todo...","Lösche Todo..." },
137{ "Delete To-Do","Lösche Todo" }, 137{ "Delete To-Do","Lösche Todo" },
138{ "Deleting item %d ...","Lösche Eintrag %d..." }, 138{ "Deleting item %d ...","Lösche Eintrag %d..." },
139{ "Descriptions","Beschreibungen" }, 139{ "Descriptions","Beschreibungen" },
140{ "Deselect all","Deselektiere Alle" }, 140{ "Deselect all","Deselektiere Alle" },
141{ "Details","Details" }, 141{ "Details","Details" },
142{ "Dinner","Abendessen" }, 142{ "Dinner","Abendessen" },
143{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, 143{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" },
144{ "Due Date","Fällig am" }, 144{ "Due Date","Fällig am" },
145{ "Due: ","Fällig: "}, 145{ "Due: ","Fällig: "},
146{ "Due Time","Fällig um" }, 146{ "Due Time","Fällig um" },
147{ "Due:","Fällig:"}, 147{ "Due:","Fällig:"},
148{ "Duration: ","Dauer: " }, 148{ "Duration: ","Dauer: " },
149{ "Edit...","Bearbeite..." }, 149{ "Edit...","Bearbeite..." },
150{ "Edit","Bearbeite" }, 150{ "Edit","Bearbeite" },
151{ "Edit Event...","Bearbeite Termin..." }, 151{ "Edit Event...","Bearbeite Termin..." },
152{ "Edit Event","Bearbeite Termin" }, 152{ "Edit Event","Bearbeite Termin" },
153{ "Edit exceptions","Bearbeite Ausnahmen" }, 153{ "Edit exceptions","Bearbeite Ausnahmen" },
154{ "EditorBox:","Editor Fenster:" }, 154{ "EditorBox:","Editor Fenster:" },
155{ "Edit Recurrence Range","Bearbeite Wiederholung" }, 155{ "Edit Recurrence Range","Bearbeite Wiederholung" },
156{ "Edit Todo...","Berabeite Todo..." }, 156{ "Edit Todo...","Berabeite Todo..." },
157{ "Edit To-Do","Todo bearbeiten" }, 157{ "Edit To-Do","Todo bearbeiten" },
158{ "E&mail address:","E&mail Adresse:" }, 158{ "E&mail address:","E&mail Adresse:" },
159{ "(EmptyEmail)","(KeineEmail)" }, 159{ "(EmptyEmail)","(KeineEmail)" },
160{ "(EmptyName)","(KeinName)" }, 160{ "(EmptyName)","(KeinName)" },
161{ "Enable Recurrence","Wiederholung anschalten" }, 161{ "Enable Recurrence","Wiederholung anschalten" },
162{ "End after","Endet nach"}, 162{ "End after","Endet nach"},
163{ "End by:","Endet am"}, 163{ "End by:","Endet am"},
164{ "End Date","End Datum" }, 164{ "End Date","End Datum" },
165{ "End:","Ende:" }, 165{ "End:","Ende:" },
166{ "End Time","End Zeit" }, 166{ "End Time","End Zeit" },
167{ "English","Englisch" }, 167{ "English","Englisch" },
168{ "Event","Termin" }, 168{ "Event","Termin" },
169{ "Event list","Termin Liste" }, 169{ "Event list","Termin Liste" },
170{ "Events","Termine" }, 170{ "Events","Termine" },
171{ "Event Viewer:","Termin Übersicht:" }, 171{ "Event Viewer:","Termin Übersicht:" },
172{ "every","jede" }, 172{ "every","jede" },
173{ "Exceptions...","Ausnahmen..." }, 173{ "Exceptions...","Ausnahmen..." },
174{ "Exceptions","Ausnahmen" }, 174{ "Exceptions","Ausnahmen" },
175{ "Exclude holidays","Ohne freie Tage" }, 175{ "Exclude holidays","Ohne freie Tage" },
176{ "Exclude Saturdays","Ohne Samstage" }, 176{ "Exclude Saturdays","Ohne Samstage" },
177{ "Feb","Feb" }, 177{ "Feb","Feb" },
178{ "February","Februar" }, 178{ "February","Februar" },
179{ "&Find","Suche!" }, 179{ "&Find","Suche!" },
180{ "Fonts","Schriftart" }, 180{ "Fonts","Schriftart" },
181{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, 181{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" },
182{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, 182{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"},
183{ "Free","Frei" }, 183{ "Free","Frei" },
184{ "Friday","Freitag" }, 184{ "Friday","Freitag" },
185{ "Fri","Fr" }, 185{ "Fri","Fr" },
186{ "From:","Vom:" }, 186{ "From:","Vom:" },
187{ "Full &name:","Vor- und &Nachname:" }, 187{ "Full &name:","Vor- und &Nachname:" },
188{ "General","Allgemein" }, 188{ "General","Allgemein" },
189{ "German","Deutsch" }, 189{ "German","Deutsch" },
190{ "Gifts","Geschenke" }, 190{ "Gifts","Geschenke" },
191{ "Go to Today","Heute anzeigen" }, 191{ "Go to Today","Heute anzeigen" },
192{ "Help","Hilfe" }, 192{ "Help","Hilfe" },
193{ "Hide Dates","Daten ausblenden" }, 193{ "Hide Dates","Daten ausblenden" },
194{ "Highlight color:","Markierungen:" }, 194{ "Highlight color:","Markierungen:" },
195{ "Holiday color:","Freie Tage:" }, 195{ "Holiday color:","Freie Tage:" },
196{ "hour(s)","Stunde(n)" }, 196{ "hour(s)","Stunde(n)" },
197{ "In %1 days: ","In %1 Tagen: " }, 197{ "In %1 days: ","In %1 Tagen: " },
198{ "Incomplete Todo:","Unerledigte Aufgaben:" }, 198{ "Incomplete Todo:","Unerledigte Aufgaben:" },
199{ "Information","Information" }, 199{ "Information","Information" },
200{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" }, 200{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" },
201{ "Jan","Jan" }, 201{ "Jan","Jan" },
202{ "January","Januar" }, 202{ "January","Januar" },
203{ "JournalView:","Journal Ansicht:" }, 203{ "JournalView:","Journal Ansicht:" },
204{ "Journals","Journale" }, 204{ "Journals","Journale" },
205{ "Jul","Jul" }, 205{ "Jul","Jul" },
206{ "July","Juli" }, 206{ "July","Juli" },
207{ "Jump to date","Springe zum Datum" }, 207{ "Jump to date","Springe zum Datum" },
208{ "June","Juni" }, 208{ "June","Juni" },
209{ "Jun","Jun" }, 209{ "Jun","Jun" },
210{ "Key Bindings...","Tastenzuordnung..." }, 210{ "Key Bindings...","Tastenzuordnung..." },
211{ "Kids","Kinder" }, 211{ "Kids","Kinder" },
212{ "Known Problems...","Bekannte Probleme..." }, 212{ "Known Problems...","Bekannte Probleme..." },
213{ "KO/Pi Find ","KO/Pi Suchdialog " }, 213{ "KO/Pi Find ","KO/Pi Suchdialog " },
214{ "KO/Pi Find: ","KO/Pi Suchen: " }, 214{ "KO/Pi Find: ","KO/Pi Suchen: " },
215{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." }, 215{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." },
216{ "Language:(needs restart)","Sprache (Neustart!)" }, 216{ "Language:(needs restart)","Sprache (Neustart!)" },
217{ "Language:","Sprache" }, 217{ "Language:","Sprache" },
218{ "Large","Etwas mehr" }, 218{ "Large","Etwas mehr" },
219{ "List View:","Listenansicht:" }, 219{ "List View:","Listenansicht:" },
220{ "List View","Listenansicht" }, 220{ "List View","Listenansicht" },
221{ "Load/Save","Laden/Speichern" }, 221{ "Load/Save","Laden/Speichern" },
222{ "Load Template","Lade Vorlage" }, 222{ "Load Template","Lade Vorlage" },
223{ "Locale","Localisation" }, 223{ "Locale","Localisation" },
224{ "Local temp file:","Lokale temp. Datei:" }, 224{ "Local temp file:","Lokale temp. Datei:" },
225{ "Location: ","Ort: " }, 225{ "Location: ","Ort: " },
226{ "Location:","Ort:" }, 226{ "Location:","Ort:" },
227{ "Mail client","Mail Programm" }, 227{ "Mail client","Mail Programm" },
228{ "Mail Client","Mail Programm" }, 228{ "Mail Client","Mail Programm" },
229{ "March","März" }, 229{ "March","März" },
230{ "Mar","Mär" }, 230{ "Mar","Mär" },
231{ "May","Mai" }, 231{ "May","Mai" },
232{ "M. Bains line:","M. Bains Linie:" }, 232{ "M. Bains line:","M. Bains Linie:" },
233{ "Medium","Medium" }, 233{ "Medium","Medium" },
234{ "Method","Methode" }, 234{ "Method","Methode" },
235{ "minute(s)","Minute(n)" }, 235{ "minute(s)","Minute(n)" },
236{ "Monday","Montag" }, 236{ "Monday","Montag" },
237{ "Mon","Mo" }, 237{ "Mon","Mo" },
238{ "Monthly","Monatlich" }, 238{ "Monthly","Monatlich" },
239{ "Month not long enough","Monat ist nicht lang genug" }, 239{ "Month not long enough","Monat ist nicht lang genug" },
240{ "month(s)","Monat(e)" }, 240{ "month(s)","Monat(e)" },
241{ "Month view:","Monatsansicht:" }, 241{ "Month view:","Monatsansicht:" },
242{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" }, 242{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" },
243{ "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" }, 243{ "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" },
244{ "Move &Down","Nach unten verschieben" }, 244{ "Move &Down","Nach unten verschieben" },
245{ "Move &Up","Nach oben verschieben" }, 245{ "Move &Up","Nach oben verschieben" },
246{ "Name:","Name:" }, 246{ "Name:","Name:" },
247{ "Name","Name" }, 247{ "Name","Name" },
248{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" }, 248{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" },
249{ "%n Days","%n Tage" }, 249{ "%n Days","%n Tage" },
250{ "Never","Nie" }, 250{ "Never","Nie" },
251{ "New event...","Neuer Termin..." }, 251{ "New event...","Neuer Termin..." },
252{ "New event","Neuer Termin" }, 252{ "New event","Neuer Termin" },
253{ "New Event...","Neuer Termin..." }, 253{ "New Event...","Neuer Termin..." },
254{ "New Events/Todos should","Neue Termine/Todos sollten" }, 254{ "New Events/Todos should","Neue Termine/Todos sollten" },
255{ "&New","&Neu" }, 255{ "&New","&Neu" },
256{ "New","Neu", }, 256{ "New","Neu", },
257{ "New Sub-Todo...","Neues Sub-Todo..." }, 257{ "New Sub-Todo...","Neues Sub-Todo..." },
258{ "New Todo...","Neues Todo..." }, 258{ "New Todo...","Neues Todo..." },
259{ "Next Alarm: ","Nächster Alarm: ", }, 259{ "Next Alarm: ","Nächster Alarm: ", },
260{ "&Next Day","&Nächster Tag", }, 260{ "&Next Day","&Nächster Tag", },
261{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" }, 261{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" },
262{ "Next month","Nächster Monat" }, 262{ "Next month","Nächster Monat" },
263{ "&Next Week","&Nächste Woche" }, 263{ "&Next Week","&Nächste Woche" },
264{ "Next year","Nächstes Jahr" }, 264{ "Next year","Nächstes Jahr" },
265{ "Next Year","Nächstes Jahr" }, 265{ "Next Year","Nächstes Jahr" },
266{ "%n h","%n Std" }, 266{ "%n h","%n Std" },
267{ "No ending date","Kein End-Datum", }, 267{ "No ending date","Kein End-Datum", },
268{ "No event, nothing to do.","Kein Termin, nichts zu tun.", }, 268{ "No event, nothing to do.","Kein Termin, nichts zu tun.", },
269{ "No event selected.","Kein Termin selektiert" }, 269{ "No event selected.","Kein Termin selektiert" },
270{ "No","Nein" }, 270{ "No","Nein" },
271{ "No program set","Kein Programm ausgewählt", }, 271{ "No program set","Kein Programm ausgewählt", },
272{ "Normal","Normal" }, 272{ "Normal","Normal" },
273{ "[No selection]","Keine Selektion", }, 273{ "[No selection]","Keine Selektion", },
274{ "No sound set","Kein Sound ausgewählt", }, 274{ "No sound set","Kein Sound ausgewählt", },
275{ "no time ","keine Zeit ", }, 275{ "no time ","keine Zeit ", },
276{ "no time","keine Zeit", }, 276{ "no time","keine Zeit", },
277{ "No Time","Keine Zeit" }, 277{ "No Time","Keine Zeit" },
278{ "November","November" }, 278{ "November","November" },
279{ "Nov","Nov", }, 279{ "Nov","Nov", },
280{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" }, 280{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" },
281{ "occurrence(s)","Vorkommen" }, 281{ "occurrence(s)","Vorkommen" },
282{ "October","Oktober" }, 282{ "October","Oktober" },
283{ "Oct","Okt", }, 283{ "Oct","Okt", },
284{ "O-due!","Ü-fällig! " }, 284{ "O-due!","Ü-fällig! " },
285{ "&OK","&OK" }, 285{ "&OK","&OK" },
286{ "Ok+Show!","Ok+Anzeigen" }, 286{ "Ok+Show!","Ok+Anzeigen" },
287{ "Organizer: %1","Organisator %1" }, 287{ "Organizer: %1","Organisator %1" },
288{ "Organizer","Organisator" }, 288{ "Organizer","Organisator" },
289{ "Owner: ","Besitzer: " }, 289{ "Owner: ","Besitzer: " },
290{ "Owner:","Besitzer:" }, 290{ "Owner:","Besitzer:" },
291{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 291{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
292{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" }, 292{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" },
293{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."}, 293{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."},
294{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." }, 294{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." },
295{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." }, 295{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." },
296{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." }, 296{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." },
297{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."}, 297{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."},
298{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." }, 298{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." },
299{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" }, 299{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" },
300{ "&Previous Day","Vorheriger Tag" }, 300{ "&Previous Day","Vorheriger Tag" },
301{ "Previous month","Vorheriger Monat" }, 301{ "Previous month","Vorheriger Monat" },
302{ "Previous Month","Vorheriger Monat" }, 302{ "Previous Month","Vorheriger Monat" },
303{ "&Previous Week","Vorherige Woche" }, 303{ "&Previous Week","Vorherige Woche" },
304{ "Previous year","Vorheriges Jahr" }, 304{ "Previous year","Vorheriges Jahr" },
305{ "Previous Year","Vorheriges Jahr" }, 305{ "Previous Year","Vorheriges Jahr" },
306{ "Printing","Drucken" }, 306{ "Printing","Drucken" },
307{ "Priority:","Priorität:" }, 307{ "Priority:","Priorität:" },
308{ "Private","Privat" }, 308{ "Private","Privat" },
309{ "Proceed","Weiter" }, 309{ "Proceed","Weiter" },
310{ "Public","Öffentlich" }, 310{ "Public","Öffentlich" },
311{ "Purge","Entferne" }, 311{ "Purge","Entferne" },
312{ "Purge Completed...","Entferne erledigte Todos..." }, 312{ "Purge Completed...","Entferne erledigte Todos..." },
313{ "Purge Todos","Todos bereinigen" }, 313{ "Purge Todos","Todos bereinigen" },
314{ "read-only","schreibgeschützt" }, 314{ "read-only","schreibgeschützt" },
315{ "Recur every","Wiederh. alle" }, 315{ "Recur every","Wiederh. alle" },
316{ "Recur in the month of","Wiederh. im Monat" }, 316{ "Recur in the month of","Wiederh. im Monat" },
317{ "Recur on the","Wiederh. am" }, 317{ "Recur on the","Wiederh. am" },
318{ "Recur on this day","Wiederh. am diesen Tag" }, 318{ "Recur on this day","Wiederh. am diesen Tag" },
319{ "Recurrence Range...","Wiederholungs Zeitraum..." }, 319{ "Recurrence Range...","Wiederholungs Zeitraum..." },
320{ "Recurrence Range","Wiederholungs Zeitraum" }, 320{ "Recurrence Range","Wiederholungs Zeitraum" },
321{ "Recurrence Rule","Wiederholungs Regel" }, 321{ "Recurrence Rule","Wiederholungs Regel" },
322{ "Recurrence","Wiederholung" }, 322{ "Recurrence","Wiederholung" },
323{ "Recurs","Wiederholung" }, 323{ "Recurs","Wiederholung" },
324{"&Reject","Abweisen"}, 324{"&Reject","Abweisen"},
325{ "Reminder:","Alarm:" }, 325{ "Reminder:","Alarm:" },
326{ "Rem.:","Alarm:" }, 326{ "Rem.:","Alarm:" },
327{ "Rem.","Alarm:" }, 327{ "Rem.","Alarm:" },
328{ "Remote file:","Remote Datei:"}, 328{ "Remote file:","Remote Datei:"},
329{ "Remote IP:","Remote (ferne) IP:" }, 329{ "Remote IP:","Remote (ferne) IP:" },
330{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " }, 330{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " },
331{ "Remote user:","Remote Benutzer"}, 331{ "Remote user:","Remote Benutzer"},
332{ "&Remove","Entfe&rnen" }, 332{ "&Remove","Entfe&rnen" },
333{ "Remove","Entfernen" }, 333{ "Remove","Entfernen" },
334{ "Request response","Bemerkung anfordern" }, 334{ "Request response","Bemerkung anfordern" },
335{ "Role:","Rolle:" }, 335{ "Role:","Rolle:" },
336{ "Role","Rolle" }, 336{ "Role","Rolle" },
337{ "Sat","Sa" }, 337{ "Sat","Sa" },
338{ "Saturday","Samstag" }, 338{ "Saturday","Samstag" },
339{ "Search for:","Suche nach:" }, 339{ "Search for:","Suche nach:" },
340{ "Search In","Suche in" }, 340{ "Search In","Suche in" },
341{ "Search...","Suche..." }, 341{ "Search...","Suche..." },
342{ "Search","Suche" }, 342{ "Search","Suche" },
343{ "Select Addresses","Wähle Adressen" }, 343{ "Select Addresses","Wähle Adressen" },
344{ "Select all","Selektiere Alle" }, 344{ "Select all","Selektiere Alle" },
345{ "Select a month","Wähle Monat" }, 345{ "Select a month","Wähle Monat" },
346{ "Select a week","Wähle Woche" }, 346{ "Select a week","Wähle Woche" },
347{ "Select a year","Wähle Jahr" }, 347{ "Select a year","Wähle Jahr" },
348{ "Send directly","Sende direkt" }, 348{ "Send directly","Sende direkt" },
349{ "&Send Messages","&Sende Nachrichten", }, 349{ "&Send Messages","&Sende Nachrichten", },
350{ "Sep","Sep" }, 350{ "Sep","Sep" },
351{ "September","September" }, 351{ "September","September" },
352{ "Shopping","Einkaufen" }, 352{ "Shopping","Einkaufen" },
353{ "Show Dates","Zeige Daten" }, 353{ "Show Dates","Zeige Daten" },
354{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, 354{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." },
355{ "Show Event...","Zeige Termin..." }, 355{ "Show Event...","Zeige Termin..." },
356{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, 356{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." },
357{ "Show Marcus Bains line","Zeige Marcus Bains Linie" }, 357{ "Show Marcus Bains line","Zeige Marcus Bains Linie" },
358{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, 358{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." },
359{ "Show time as:","Zeige Zeit als" }, 359{ "Show time as:","Zeige Zeit als" },
360{ "Show Todo...","Zeige To-Do" }, 360{ "Show Todo...","Zeige To-Do" },
361{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, 361{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" },
362{ "&Show","Zeige" }, 362{ "&Show","Zeige" },
363{ "Show...","Zeige..." }, 363{ "Show...","Zeige..." },
364{ "Show","Zeige" }, 364{ "Show","Zeige" },
365{ "Small","Klein" }, 365{ "Small","Klein" },
366{ "Sorry","Tut mir leid" }, 366{ "Sorry","Tut mir leid" },
367{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, 367{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"},
368{ "Start:","Start:" }, 368{ "Start:","Start:" },
369{ "Start Date","Start Datum" }, 369{ "Start Date","Start Datum" },
370{ "Start date: %1","Start Datum: %1" }, 370{ "Start date: %1","Start Datum: %1" },
371{ "Start Time","Start Zeit" }, 371{ "Start Time","Start Zeit" },
372{ "Status:","Status:" }, 372{ "Status:","Status:" },
373{ "Status","Status:" }, 373{ "Status","Status:" },
374{ "Summaries","Titel" }, 374{ "Summaries","Titel" },
375{ "Summary:","Titel:" }, 375{ "Summary:","Titel:" },
376{ "Summary","Titel" }, 376{ "Summary","Titel" },
377{ "Sunday","Sonntag" }, 377{ "Sunday","Sonntag" },
378{ "Sun","So" }, 378{ "Sun","So" },
379{ "Sync preferences:","Sync Einstellungen" }, 379{ "Sync preferences:","Sync Einstellungen" },
380{ "Sync Prefs","Sync Einstellungen" }, 380{ "Sync Prefs","Sync Einstellungen" },
381{ "Syncronize","Daten abgleich" }, 381{ "Syncronize","Daten abgleich" },
382{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, 382{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
383{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, 383{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
384{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, 384{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" },
385{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" }, 385{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" },
386{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, 386{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" },
387{ "Template...","Vorlage..." }, 387{ "Template...","Vorlage..." },
388{ "This day","Dieser Tag" }, 388{ "This day","Dieser Tag" },
389{ "This is an experimental feature. ","Dieses Feature ist experimentel" }, 389{ "This is an experimental feature. ","Dieses Feature ist experimentel" },
390{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." }, 390{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." },
391{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." }, 391{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." },
392{ "Thu","Do" }, 392{ "Thu","Do" },
393{ "Thursday","Donnerstag" }, 393{ "Thursday","Donnerstag" },
394{ "Time associated","Mit Zeit" }, 394{ "Time associated","Mit Zeit" },
395{ "Time bar:","Uhrzeit Zeile:" }, 395{ "Time bar:","Uhrzeit Zeile:" },
396{ "Time && Date","Zeit und Datum" }, 396{ "Time && Date","Zeit und Datum" },
397{ "Time Format","Zeit Format" }, 397{ "Time Format","Zeit Format" },
398{ "Time Format(nr):","Zeit Format(Neustart!)" }, 398{ "Time Format(nr):","Zeit Format(Neustart!)" },
399{ "Date Labels:","Datumsleiste:" }, 399{ "Date Labels:","Datumsleiste:" },
400{ "Time: ","Zeit: " }, 400{ "Time: ","Zeit: " },
401{ "Timezone:","Zeitzone:" }, 401{ "Timezone:","Zeitzone:" },
402{ "To: ","Bis: " }, 402{ "To: ","Bis: " },
403{ "To:","Bis:" }, 403{ "To:","Bis:" },
404{ "Today: ","Heute: " }, 404{ "Today: ","Heute: " },
405{ "Todo due today color:","Heute fällige To-Do's" }, 405{ "Todo due today color:","Heute fällige To-Do's" },
406{ "To-do items:","To-Do items:" }, 406{ "To-do items:","To-Do items:" },
407{ "Todo overdue color:","Überfällige To-Do's" }, 407{ "Todo overdue color:","Überfällige To-Do's" },
408{ "Todo","Todo" }, 408{ "Todo","Todo" },
409{ "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" }, 409{ "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" },
410{ "ToDoView:","Todo Ansicht:" }, 410{ "ToDoView:","Todo Ansicht:" },
411{ "Toggle Alarm","Wechsle Alarm" }, 411{ "Toggle Alarm","Wechsle Alarm" },
412{ "Toggle Allday","Umschalten Ganztag" }, 412{ "Toggle Allday","Umschalten Ganztag" },
413{ "Tomorrow: ","Morgen: " }, 413{ "Tomorrow: ","Morgen: " },
414{ "Tue","Di" }, 414{ "Tue","Di" },
415{ "Tuesday","Dienstag" }, 415{ "Tuesday","Dienstag" },
416{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" }, 416{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" },
417{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." }, 417{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." },
418{ "Unknown","Unbekannt" }, 418{ "Unknown","Unbekannt" },
419{ "Up","Hinauf" }, 419{ "Up","Hinauf" },
420{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" }, 420{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" },
421{ "User defined","Benutzerdefiniert" }, 421{ "User defined","Benutzerdefiniert" },
422{ "User long date:","Format langes Datum:" }, 422{ "User long date:","Format langes Datum:" },
423{ "User short date:","Forma kurzes Datum:" }, 423{ "User short date:","Forma kurzes Datum:" },
424{ "View","Ansicht" }, 424{ "View","Ansicht" },
425{ "View Fonts","Schriftarten Ansichten" }, 425{ "View Fonts","Schriftarten Ansichten" },
426{ "Views","Ansichten" }, 426{ "Views","Ansichten" },
427{ "Wed","Mi" }, 427{ "Wed","Mi" },
428{ "Wednesday","Mittwoch" }, 428{ "Wednesday","Mittwoch" },
429{ "Week %1","Woche %1" }, 429{ "Week %1","Woche %1" },
430{ "Weekly","Wöchentlich" }, 430{ "Weekly","Wöchentlich" },
431{ "Week starts on Sunday","Woche beginnt Sonntags" }, 431{ "Week starts on Sunday","Woche beginnt Sonntags" },
432{ "What's Next View:","What's Next Anz." }, 432{ "What's Next View:","What's Next Anz." },
433{ "What's next ?","Was kommt als nächstes?(What's Next)" }, 433{ "What's next ?","Was kommt als nächstes?(What's Next)" },
434{ "Working Hours","Tägliche Arbeitszeit" }, 434{ "Working Hours","Tägliche Arbeitszeit" },
435{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" }, 435{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" },
436{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" }, 436{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" },
437{ "Write back synced file","Syncronisierte Datei zurückschreiben" }, 437{ "Write back synced file","Syncronisierte Datei zurückschreiben" },
438{ "Yearly","Jährlich" }, 438{ "Yearly","Jährlich" },
439{ "year(s)","Jahr(e)" }, 439{ "year(s)","Jahr(e)" },
440{ "Yes","Ja" }, 440{ "Yes","Ja" },
441{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" }, 441{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" },
442{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." }, 442{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." },
443{ "week(s) on:","Woche(n) am: " }, 443{ "week(s) on:","Woche(n) am: " },
444{ "Full menu bar(nr)","Volle Menuleiste(bn)" }, 444{ "Full menu bar(nr)","Volle Menuleiste(bn)" },
445{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 445{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
446{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 446{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
447{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 447{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
448{ "Daylight start:","Sommerzeit Start:" }, 448{ "Daylight start:","Sommerzeit Start:" },
449{ "Daylight end:","Sommerzeit Ende:" }, 449{ "Daylight end:","Sommerzeit Ende:" },
450{ "Time Zone","Zeitzone" }, 450{ "Time Zone","Zeitzone" },
451{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, 451{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" },
452{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" }, 452{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" },
453{ "minutely","minütlich" }, 453{ "minutely","minütlich" },
454{ "hourly","stündlich" }, 454{ "hourly","stündlich" },
455{ "daily","täglich" }, 455{ "daily","täglich" },
456{ "weekly","wöchentlich" }, 456{ "weekly","wöchentlich" },
457{ "monthly","monatlich" }, 457{ "monthly","monatlich" },
458{ "day-monthly","tag-monatlich" }, 458{ "day-monthly","tag-monatlich" },
459{ "month-yearly","monat-jährlich" }, 459{ "month-yearly","monat-jährlich" },
460{ "day-yearly","tag-jährlich" }, 460{ "day-yearly","tag-jährlich" },
461{ "position-yearly","pos-jährlich" }, 461{ "position-yearly","pos-jährlich" },
462{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" }, 462{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" },
463{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" }, 463{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" },
464{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" }, 464{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" },
465{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" }, 465{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" },
466{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" }, 466{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" },
467{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." }, 467{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." },
468{ "Event list view uses full window","Listenansicht nutzt Vollbild" }, 468{ "Event list view uses full window","Listenansicht nutzt Vollbild" },
469{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" }, 469{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" },
470{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" }, 470{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" },
471{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" }, 471{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" },
472{ "ViewChange","Ansichtswechsel" }, 472{ "ViewChange","Ansichtswechsel" },
473{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" }, 473{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" },
474{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" }, 474{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" },
475{ "File","Datei" }, 475{ "File","Datei" },
476{ "Clone...","Dupliziere..." }, 476{ "Clone...","Dupliziere..." },
477{ "Move...","Bewege..." }, 477{ "Move...","Bewege..." },
478{ "Beam...","Sende via IR..." }, 478{ "Beam...","Sende via IR..." },
479{ "&Clone...","Dupliziere.." }, 479{ "&Clone...","Dupliziere.." },
480{ "&Move...","Bewege..." }, 480{ "&Move...","Bewege..." },
481{ "&Beam...","Sende via IR..." }, 481{ "&Beam...","Sende via IR..." },
482{ "Show Completed","Zeige erledigte Todos" }, 482{ "Show Completed","Zeige erledigte Todos" },
483{ "Show Quick Todo","Zeige Quick Todo" }, 483{ "Show Quick Todo","Zeige Quick Todo" },
484{ "Unparent Todo","Un-sub Todo" }, 484{ "Unparent Todo","Un-sub Todo" },
485{ "Save selected to file...","Speichere Selektierte..." }, 485{ "Save selected to file...","Speichere Selektierte..." },
486{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." }, 486{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." },
487{ "Set Categ. for selected...","Setze Kateg. für Selekt." }, 487{ "Set Categ. for selected...","Setze Kateg. für Selekt." },
488{ "Beam via IR","Sende via IR" }, 488{ "Beam via IR","Sende via IR" },
489{ "Search","Suchen" }, 489{ "Search","Suchen" },
490{ "Date Picker","Datum auswählen" }, 490{ "Date Picker","Datum auswählen" },
491{ "Day View","Tagesansicht" }, 491{ "Day View","Tagesansicht" },
492{ "Work Week","Arbeitswoche" }, 492{ "Work Week","Arbeitswoche" },
493{ "Week","Wochenansicht" }, 493{ "Week","Wochenansicht" },
494{ "Month","Monatsansicht" }, 494{ "Month","Monatsansicht" },
495{ "Todo View","Todo Liste" }, 495{ "Todo View","Todo Liste" },
496{ "Journal","Journal" }, 496{ "Journal","Journal" },
497{ "Next days","Nächste Tage" }, 497{ "Next days","Nächste Tage" },
498{ "Print agenda selection...","Drucke Agendaselektion..." }, 498{ "Print agenda selection...","Drucke Agendaselektion..." },
499{ "Toggle DateNavigator","Navigator umschalten" }, 499{ "Toggle DateNavigator","Navigator umschalten" },
500{ "Toggle FilterView","Filteransicht umschalten" }, 500{ "Toggle FilterView","Filteransicht umschalten" },
501{ "Prev. month","Vorheriger Monat" }, 501{ "Prev. month","Vorheriger Monat" },
502{ "Go backward","Gehe zurück" }, 502{ "Go backward","Gehe zurück" },
503{ "Go forward","Gehe weiter" }, 503{ "Go forward","Gehe weiter" },
504{ "Synchronize","Synchronisieren" }, 504{ "Synchronize","Synchronisieren" },
505{ "AgendaSize","Agendagröße" }, 505{ "AgendaSize","Agendagröße" },
506{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" }, 506{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" },
507{ "Import last file","Importiere letzte Datei" }, 507{ "Import last file","Importiere letzte Datei" },
508{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." }, 508{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." },
509{ "Save Backup...","Speichere Backup..." }, 509{ "Save Backup...","Speichere Backup..." },
510{ "Export VCalendar","Exportiere VCalendar" }, 510{ "Export VCalendar","Exportiere VCalendar" },
511{ "Manage new categories...","Verwalte neue Kategorien..." }, 511{ "Manage new categories...","Verwalte neue Kategorien..." },
512{ "Beam complete calendar...","Sende kompletten Kalender..." }, 512{ "Beam complete calendar...","Sende kompletten Kalender..." },
513{ "Beam filtered calendar...","Sende gefilterten Kalender..." }, 513{ "Beam filtered calendar...","Sende gefilterten Kalender..." },
514{ "Remote via ssh","Über Netzwerk via ssh" }, 514{ "Remote via ssh","Über Netzwerk via ssh" },
515{ "With local file","Mit lokaler Datei" }, 515{ "With local file","Mit lokaler Datei" },
516{ "With last file","Mit letzter Datei" }, 516{ "With last file","Mit letzter Datei" },
517{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, 517{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" },
518{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, 518{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" },
519{ "Save filename","Speichern: Dateinamen wählen" }, 519{ "Save filename","Speichern: Dateinamen wählen" },
520{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, 520{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" },
521{ "KO/Pi: Warning!","KO/Pi: Warnung!" }, 521{ "KO/Pi: Warning!","KO/Pi: Warnung!" },
522{ "Overwrite!","Überschreibe!" }, 522{ "Overwrite!","Überschreibe!" },
523{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 523{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
524{ "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" }, 524{ "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" },
525{ "KO/Pi Confirmation","KO/Pi Bestätigung" }, 525{ "KO/Pi Confirmation","KO/Pi Bestätigung" },
526{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, 526{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" },
527{ "Deleting item %d ...","Lösche Eintrag %d ..." }, 527{ "Deleting item %d ...","Lösche Eintrag %d ..." },
528{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, 528{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." },
529{ "Size","Größe" }, 529{ "Size","Größe" },
530{ "Date","Datum" }, 530{ "Date","Datum" },
531{ "Mime Type","Datei Typ" }, 531{ "Mime Type","Datei Typ" },
532{ "All Files","Alle Dateien" }, 532{ "All Files","Alle Dateien" },
533{ "Files","Dateien" }, 533{ "Files","Dateien" },
534{ "Documents","DoKumente" }, 534{ "Documents","DoKumente" },
535{ "Select Categories","Selektiere Kategorien" }, 535{ "Select Categories","Selektiere Kategorien" },
536{ " &Deselect All "," Auswahl aufheben " }, 536{ " &Deselect All "," Auswahl aufheben " },
537{ "A&dd","Hinzu" }, 537{ "A&dd","Hinzu" },
538{ "&Modify","Ändern" }, 538{ "&Modify","Ändern" },
539{ "Edit Categories","Editiere Kategorien" }, 539{ "Edit Categories","Editiere Kategorien" },
540{ " &Edit Categories "," &Editiere Kategorien " }, 540{ " &Edit Categories "," &Editiere Kategorien " },
541{ "Beam Options","Beam Einstellungen" }, 541{ "Beam Options","Beam Einstellungen" },
542{ " With timezone "," Mit Zeitzone " }, 542{ " With timezone "," Mit Zeitzone " },
543{ " Local time ", " Lokale Zeit " }, 543{ " Local time ", " Lokale Zeit " },
544{ "Manage new Categories","Verwalte neue Kategorien" }, 544{ "Manage new Categories","Verwalte neue Kategorien" },
545{ "Add to category list","Füge zur Kategorieliste hinzu" }, 545{ "Add to category list","Füge zur Kategorieliste hinzu" },
546{ "Remove from Events/Todos","Entferne von Terminen/Todos" }, 546{ "Remove from Events/Todos","Entferne von Terminen/Todos" },
547{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, 547{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
548{ "File format","Datei Format" }, 548{ "File format","Datei Format" },
549{ "Time format","Zeit Format" }, 549{ "Time format","Zeit Format" },
550{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, 550{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." },
551{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, 551{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" },
552{ "h","Std" }, 552{ "h","Std" },
553{ "min","Min" }, 553{ "min","Min" },
554{ "hou","Std" }, 554{ "hou","Std" },
555{ "day","Tag" }, 555{ "day","Tag" },
556{ "French","Französich" }, 556{ "French","Französich" },
557{ "Time","Zeit" }, 557{ "Time","Zeit" },
558{ "Event Viewer","Termin Ansicht" }, 558{ "Event Viewer","Termin Ansicht" },
559{ "Cancel Sync","Sync Abbrechen" }, 559{ "Cancel Sync","Sync Abbrechen" },
560{ "Remote","Fern" }, 560{ "Remote","Fern" },
561{ "Local","Lokal" }, 561{ "Local","Lokal" },
562{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, 562{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" },
563{ "Local: ","Lokal: " }, 563{ "Local: ","Lokal: " },
564{ "Remote: ","Fern: " }, 564{ "Remote: ","Fern: " },
565{ "Last modified: ","Zuletzt geändert: " }, 565{ "Last modified: ","Zuletzt geändert: " },
566{ "Location: ","Ort: " }, 566{ "Location: ","Ort: " },
567{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, 567{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" },
568{ "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, 568{ "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" },
569{ "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, 569{ "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " },
570{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, 570{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" },
571{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, 571{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " },
572{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, 572{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" },
573{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, 573{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." },
574{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, 574{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" },
575{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, 575{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" },
576{ "( %1 min before )","( %1 min vorher )" }, 576{ "( %1 min before )","( %1 min vorher )" },
577{ "<b>Alarm on: ","<b>Alarm am: " }, 577{ "<b>Alarm on: ","<b>Alarm am: " },
578{ "<b>Details: </b>","<b>Details: </b>" }, 578{ "<b>Details: </b>","<b>Details: </b>" },
579{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 579{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
580{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, 580{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" },
581{ "Organizer","Organisator" }, 581{ "Organizer","Organisator" },
582{ "Save","Speichern" }, 582{ "Save","Speichern" },
583{ "Exit (+save)","Beenden(+speichern)" }, 583{ "Exit (+save)","Beenden(+speichern)" },
584{ "Home","Zuhause" }, 584{ "Home","Zuhause" },
585{ "Office","Büro" }, 585{ "Office","Büro" },
586{ "Library","Bibliothek" }, 586{ "Library","Bibliothek" },
587{ "Doctor","Arzt" }, 587{ "Doctor","Arzt" },
588{ "Beach","Strand" }, 588{ "Beach","Strand" },
589{ "Conference room","Konferenzraum" }, 589{ "Conference room","Konferenzraum" },
590{ "Drive Home","Heimfahrt" }, 590{ "Drive Home","Heimfahrt" },
591{ "Watch TV","Tv gucken" }, 591{ "Watch TV","Tv gucken" },
592{ "Phone call","Telefonanruf" }, 592{ "Phone call","Telefonanruf" },
593{ "Pay bill","Rechnung bezahlen" }, 593{ "Pay bill","Rechnung bezahlen" },
594{ "Read book","Buch lesen" }, 594{ "Read book","Buch lesen" },
595{ "Watering plants","Pflanzen giessen" }, 595{ "Watering plants","Pflanzen giessen" },
596{"Appointment","Verabredung" }, 596{"Appointment","Verabredung" },
597{"Birthday","Geburtstag" }, 597{"Birthday","Geburtstag" },
598{"Business","Geschäft" }, 598{"Business","Geschäft" },
599{"Business Travel","Geschäftsreise" }, 599{"Business Travel","Geschäftsreise" },
600{"Cinema","Kino" }, 600{"Cinema","Kino" },
601{"Customer","Kunde" }, 601{"Customer","Kunde" },
602{"Break","Pause" }, 602{"Break","Pause" },
603{"Breakfast","Frühstück" }, 603{"Breakfast","Frühstück" },
604{"Competition","Wettkampf" }, 604{"Competition","Wettkampf" },
605{"Dinner","Abendessen" }, 605{"Dinner","Abendessen" },
606{"Education","Erziehung" }, 606{"Education","Erziehung" },
607{"Family","Familie" }, 607{"Family","Familie" },
608{"Favorites","Favoriten" }, 608{"Favorites","Favoriten" },
609{"Festival","Festival" }, 609{"Festival","Festival" },
610{"Fishing","Angeln" }, 610{"Fishing","Angeln" },
611{"Flight","Flug" }, 611{"Flight","Flug" },
612{"Gifts","Geschenk" }, 612{"Gifts","Geschenk" },
613{"Holiday","Feiertag" }, 613{"Holiday","Feiertag" },
614{"Holiday Cards","Ansichtskarten" }, 614{"Holiday Cards","Ansichtskarten" },
615{"Hot Contacts","Heisse Kontakte" }, 615{"Hot Contacts","Heisse Kontakte" },
616{"Hiking","Wandern" }, 616{"Hiking","Wandern" },
617{"Hunting","Jagen" }, 617{"Hunting","Jagen" },
618{"Key Customer","Wichtiger Kunde" }, 618{"Key Customer","Wichtiger Kunde" },
619{"Kids","Kinder" }, 619{"Kids","Kinder" },
620{"Lunch","Mittagessen" }, 620{"Lunch","Mittagessen" },
621{"Meeting","Treffen" }, 621{"Meeting","Treffen" },
622{"Miscellaneous","Verschiedenes" }, 622{"Miscellaneous","Verschiedenes" },
623{"Partner","Partner" }, 623{"Partner","Partner" },
624{"Party","Partie" }, 624{"Party","Partie" },
625{"Personal","Privat" }, 625{"Personal","Privat" },
626{"Personal Travel","Privatreise"}, 626{"Personal Travel","Privatreise"},
627{"PHB","PHB" }, 627{"PHB","PHB" },
628{"Phone Calls","Telefonanruf" }, 628{"Phone Calls","Telefonanruf" },
629{"Projects","Projekt" }, 629{"Projects","Projekt" },
630{"Recurring","Wiederholend" }, 630{"Recurring","Wiederholend" },
631{"School","Schule" }, 631{"School","Schule" },
632{"Shopping","Einkaufen" }, 632{"Shopping","Einkaufen" },
633{"Speach","Rede" }, 633{"Speach","Rede" },
634{"Special Occasion","Spez.Gelegenheit" }, 634{"Special Occasion","Spez.Gelegenheit" },
635{"Sports","Sport" }, 635{"Sports","Sport" },
636{"Talk","Vortrag" }, 636{"Talk","Vortrag" },
637{"Travel","Reise" }, 637{"Travel","Reise" },
638{"TV","TV" }, 638{"TV","TV" },
639{"Germany","Deutschland" }, 639{"Germany","Deutschland" },
640{"Sweden","Schweden" }, 640{"Sweden","Schweden" },
641{"Forest","Wald" }, 641{"Forest","Wald" },
642{ "Desert","Wüste" }, 642{ "Desert","Wüste" },
643{ "Kitchen","Küche" }, 643{ "Kitchen","Küche" },
644{ "Lake","See" }, 644{ "Lake","See" },
645{"University","Universität"}, 645{"University","Universität"},
646{"Vacation","Urlaub" }, 646{"Vacation","Urlaub" },
647{"VIP","VIP" }, 647{"VIP","VIP" },
648{ "Import Sharp Calendar","Importiere Sharp Kalender" }, 648{ "Import Sharp Calendar","Importiere Sharp Kalender" },
649{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, 649{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" },
650{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, 650{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" },
651{ "Cancelled","Gecancelt" }, 651{ "Cancelled","Gecancelt" },
652{ "Multiple sync","Mehrfach Sync" }, 652{ "Multiple sync","Mehrfach Sync" },
653{ "Local file","Lokale Datei" }, 653{ "Local file","Lokale Datei" },
654{ "Last file","Letzte Datei" }, 654{ "Last file","Letzte Datei" },
655{ "Keys + Colors...","Tasten + Farben..." }, 655{ "Keys + Colors...","Tasten + Farben..." },
656{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, 656{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" },
657{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, 657{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" },
658{ "Choose...","Wähle..." }, 658{ "Choose...","Wähle..." },
659{ "Use colors for application:","Setze Farben für Programm:" }, 659{ "Use colors for application:","Setze Farben für Programm:" },
660{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, 660{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" },
661{ "Frames, labels, etc.:","Rahmen, Label, etc.:" }, 661{ "Frames, labels, etc.:","Rahmen, Label, etc.:" },
662{ "Show parent To-Do's","Zeige Ober-Todos" }, 662{ "Show parent To-Do's","Zeige Ober-Todos" },
663{ "Show location","Zeige Orte" }, 663{ "Show location","Zeige Orte" },
664{ "Show events that recur ","Zeige Termine, die sich wiederholen:" }, 664{ "Show events that recur ","Zeige Termine, die sich wiederholen:" },
665{ "Show in every cell ","Zeige in jeder Zelle " }, 665{ "Show in every cell ","Zeige in jeder Zelle " },
666{ "short month","kurzen Monat" }, 666{ "short month","kurzen Monat" },
667{ "icons","Icons" }, 667{ "icons","Icons" },
668{ "Show Sat/Sun together","Zeige Sam/Son zusammen" }, 668{ "Show Sat/Sun together","Zeige Sam/Son zusammen" },
669{ "Category colors are applied to text","Kategorie Farben färben Text" }, 669{ "Category colors are applied to text","Kategorie Farben färben Text" },
670{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, 670{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" },
671{ "Day color odd months","Tagesfarbe ungerade Monate" }, 671{ "Day color odd months","Tagesfarbe ungerade Monate" },
672{ "Day color even months","Tagesfarbe gerade Monate" }, 672{ "Day color even months","Tagesfarbe gerade Monate" },
673{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, 673{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" },
674{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, 674{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" },
675{ "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, 675{ "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" },
676{ "Colors are applied to text","Farben werden auf Text angewendet" }, 676{ "Colors are applied to text","Farben werden auf Text angewendet" },
677{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, 677{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" },
678{ "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" }, 678{ "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" },
679{ "Play beeps count:","Anzahl der Alarmpiepse: " }, 679{ "Play beeps count:","Anzahl der Alarmpiepse: " },
680{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, 680{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " },
681{ "Default suspend time in min:","Standard Supendierungs Zeit: " }, 681{ "Default suspend time in min:","Standard Supendierungs Zeit: " },
682{ "Auto suspend count:","Anzahl der auto Suspendierungen" }, 682{ "Auto suspend count:","Anzahl der auto Suspendierungen" },
683{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, 683{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" },
684{ "New profile","Neues Profil" }, 684{ "New profile","Neues Profil" },
685{ "Clone profile","Klone Profil" }, 685{ "Clone profile","Klone Profil" },
686{ "Delete profile","Lösche Profil" }, 686{ "Delete profile","Lösche Profil" },
687{ "Profile:","Profil:" }, 687{ "Profile:","Profil:" },
688{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, 688{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" },
689{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, 689{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" },
690{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, 690{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" },
691{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, 691{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" },
692{ "Write back file","Schreibe Datei zurück" }, 692{ "Write back file","Schreibe Datei zurück" },
693{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, 693{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" },
694{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, 694{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" },
695{ "Local device name:","Name dieses Gerätes:" }, 695{ "Local device name:","Name dieses Gerätes:" },
696{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, 696{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" },
697{ "Sync preferences","Synchronisations Einstellungen" }, 697{ "Sync preferences","Synchronisations Einstellungen" },
698{ "Profile kind","Profil Art" }, 698{ "Profile kind","Profil Art" },
699{ "Local file","Lokale Datei" }, 699{ "Local file","Lokale Datei" },
700{ "Local file:","Lokale Datei:" }, 700{ "Local file:","Lokale Datei:" },
701{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, 701{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" },
702{ "Fill in default values for:","Setze Beispiel Werte ein für:" }, 702{ "Fill in default values for:","Setze Beispiel Werte ein für:" },
703{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, 703{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" },
704{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, 704{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"},
705{ "Device","Gerät:" }, 705{ "Device","Gerät:" },
706{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, 706{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" },
707{ "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","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, 707{ "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","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" },
708{ "Synchronization successful","Synchronisation erfolgreich" }, 708{ "Synchronization successful","Synchronisation erfolgreich" },
709{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, 709{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." },
710{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, 710{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" },
711{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, 711{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" },
712{ "Enter password","Passwort eingeben" }, 712{ "Enter password","Passwort eingeben" },
713{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, 713{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" },
714{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, 714{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." },
715{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, 715{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" },
716{ "Writing back file result: ","Resultat des Dateizurückschreibens: " }, 716{ "Writing back file result: ","Resultat des Dateizurückschreibens: " },
717{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, 717{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" },
718{ "Edit Calendar Filters","Editiere Kalendar Filter" }, 718{ "Edit Calendar Filters","Editiere Kalendar Filter" },
719{ "Enter filter name:","Neuer Filter Name:" }, 719{ "Enter filter name:","Neuer Filter Name:" },
720{ "Add Filter","Filter hinzufügen" }, 720{ "Add Filter","Filter hinzufügen" },
721{ "Question","Frage" }, 721{ "Question","Frage" },
722{ "Filter position: ","Filter Position: " }, 722{ "Filter position: ","Filter Position: " },
723{ "Month View","Monatsansicht" }, 723{ "Month View","Monatsansicht" },
724{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, 724{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" },
725{ "KO/Pi config error","KO/Pi Konfig. Fehler" }, 725{ "KO/Pi config error","KO/Pi Konfig. Fehler" },
726{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, 726{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" },
727{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, 727{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" },
728{ "Access: ","Zugriff: " }, 728{ "Access: ","Zugriff: " },
729{ "Needs Action","Aktion notwendig" }, 729{ "Needs Action","Aktion notwendig" },
730{ "Accepted","Akzeptiert" }, 730{ "Accepted","Akzeptiert" },
731{ "Declined","Abgelehnt" }, 731{ "Declined","Abgelehnt" },
732{ "Tentative","Vorläufig" }, 732{ "Tentative","Vorläufig" },
733{ "Delegated","Beauftragt" }, 733{ "Delegated","Beauftragt" },
734{ "Completed","Vollständig" }, 734{ "Completed","Vollständig" },
735{ "In Process","In Bearbeitung" }, 735{ "In Process","In Bearbeitung" },
736{ "Participant","Teilnehmer" }, 736{ "Participant","Teilnehmer" },
737{ "Optional Participant","Möglicher Teilnehmer" }, 737{ "Optional Participant","Möglicher Teilnehmer" },
738{ "Observer","Beobachter" }, 738{ "Observer","Beobachter" },
739{ "Chair","Vorsitzender" }, 739{ "Chair","Vorsitzender" },
740{ "Not supported \non desktop!\n","" }, 740{ "Not supported \non desktop!\n","" },
741{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die vertikale Auswahl zum Drucken zu bestimmen,\nbitte einen vertikalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen.\n(Es wird danach direkt der Termin Dialog angezeigt\n - dort bitte auf Abbrechen klicken) " }, 741{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die vertikale Auswahl zum Drucken zu bestimmen,\nbitte einen vertikalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen.\n(Es wird danach direkt der Termin Dialog angezeigt\n - dort bitte auf Abbrechen klicken) " },
742{ "Date range: ","Datums Zeitspanne: " }, 742{ "Date range: ","Datums Zeitspanne: " },
743{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, 743{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " },
744{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, 744{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." },
745{ "Add / remove events","Add./entferne Termine" }, 745{ "Add / remove events","Add./entferne Termine" },
746{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, 746{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." },
747{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, 747{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." },
748{ "\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie gepeicherte Datei wurde verändert!\nDatei Grösse: %1 Bytes.\nZuletzt geändert: %2\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
749{ "Overwrite","Überschreiben" }, 748{ "Overwrite","Überschreiben" },
750{ "Sync+save","Syncen+speichern" }, 749{ "Sync+save","Syncen+speichern" },
751{ "Default","Standard" }, 750{ "Default","Standard" },
752{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, 751{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " },
753{ " %d items?"," %d Einträge?" }, 752{ " %d items?"," %d Einträge?" },
754{ "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" }, 753{ "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" },
755{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, 754{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" },
756{ "Current","Aktuelle" }, 755{ "Current","Aktuelle" },
757{ "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" }, 756{ "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" },
758{ "All","Alle" }, 757{ "All","Alle" },
759{ "Data Loss Warning","Datenverlust Warnung" }, 758{ "Data Loss Warning","Datenverlust Warnung" },
760{ "Proceed","Weitermachen" }, 759{ "Proceed","Weitermachen" },
761{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, 760{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" },
762{ "Filter disabled ","Filter abgeschaltet" }, 761{ "Filter disabled ","Filter abgeschaltet" },
763{ "Filter selected: ","Gewählter Filter: " }, 762{ "Filter selected: ","Gewählter Filter: " },
764{ "Toggle Cancel","Gecancelt ändern" }, 763{ "Toggle Cancel","Gecancelt ändern" },
765{ "&Toggle Cancel","Gecancel&t ändern" }, 764{ "&Toggle Cancel","Gecancel&t ändern" },
766{ "Configure Toolbar","Konfiguriere Toolbar" }, 765{ "Configure Toolbar","Konfiguriere Toolbar" },
767{ "Stretched TB","Gedehnte TB" }, 766{ "Stretched TB","Gedehnte TB" },
768{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, 767{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" },
769{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, 768{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" },
770{ "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" }, 769{ "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" },
771{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, 770{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" },
772{ "Imported file successfully","Datei erfolgreich importiert" }, 771{ "Imported file successfully","Datei erfolgreich importiert" },
773{ "Error importing file","Fehler beim Importieren der Datei" }, 772{ "Error importing file","Fehler beim Importieren der Datei" },
774{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, 773{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" },
775{ "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, 774{ "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" },
776{ "Overwrite!","Überschreiben!" }, 775{ "Overwrite!","Überschreiben!" },
777{ "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" }, 776{ "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" },
778{ "Load backup filename","Lade Backup Dateiname" }, 777{ "Load backup filename","Lade Backup Dateiname" },
779{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, 778{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" },
780{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, 779{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" },
781{ "Save backup filename","Speichere Backup Dateiname" }, 780{ "Save backup filename","Speichere Backup Dateiname" },
782{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" }, 781{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" },
783{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 782{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
784{ "Details of attendee","Teilnehmerdetails" }, 783{ "Details of attendee","Teilnehmerdetails" },
785{ "Work phone:\n","Telefon Arbeit:\n" }, 784{ "Work phone:\n","Telefon Arbeit:\n" },
786{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, 785{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" },
787{ "Home phone:\n","Telefon privat:\n" }, 786{ "Home phone:\n","Telefon privat:\n" },
788{ "Mobile home phone:\n","Mobiltelefon privat:\n" }, 787{ "Mobile home phone:\n","Mobiltelefon privat:\n" },
789{ "Email:\n","Email:\n" }, 788{ "Email:\n","Email:\n" },
790{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, 789{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" },
791{ "Audio Al.: ","Audio Al.: " }, 790{ "Audio Al.: ","Audio Al.: " },
792{ "Proc.Al.: ","Proz.Al.: " }, 791{ "Proc.Al.: ","Proz.Al.: " },
793{ "No sound set","Kein Sound definiert" }, 792{ "No sound set","Kein Sound definiert" },
794{ "*.wav|Wav Files","*.wav|Wav Dateien" }, 793{ "*.wav|Wav Files","*.wav|Wav Dateien" },
795{ "No program set","Kein Programm definiert" }, 794{ "No program set","Kein Programm definiert" },
796{ "Running '%1'","Ausführen '%1'" }, 795{ "Running '%1'","Ausführen '%1'" },
797{ "Playing '%1'","Abspielen '%1'" }, 796{ "Playing '%1'","Abspielen '%1'" },
798{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, 797{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" },
799{ "Load!","Laden!" }, 798{ "Load!","Laden!" },
800{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" }, 799{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" },
801{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, 800{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" },
802{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, 801{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" },
803{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, 802{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" },
804{ "Features + hints...","Eigenschaften + Tipps..." }, 803{ "Features + hints...","Eigenschaften + Tipps..." },
805{ "User translation...","Benutzer Übersetzung..." }, 804{ "User translation...","Benutzer Übersetzung..." },
806{ "Sync HowTo...","Synchronisation HowTo..." }, 805{ "Sync HowTo...","Synchronisation HowTo..." },
807{ "Print calendar...","Drucke Kalender..." }, 806{ "Print calendar...","Drucke Kalender..." },
808{ "Anniversary","Jahrestag" }, 807{ "Anniversary","Jahrestag" },
809{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" }, 808{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" },
810{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, 809{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" },
811{ "Next recurrence is on: ","Nächste Wiederholung ist am:" }, 810{ "Next recurrence is on: ","Nächste Wiederholung ist am:" },
812{ "<b>Alarm on: </b>","<b>Alarm am: </b>" }, 811{ "<b>Alarm on: </b>","<b>Alarm am: </b>" },
813{ "<b>Access: </b>","<b>Zugriff: </b>" }, 812{ "<b>Access: </b>","<b>Zugriff: </b>" },
814{ "(%1 min before)","(%1 min vorher)" }, 813{ "(%1 min before)","(%1 min vorher)" },
815{ "<b>Categories: </b>","<b>Kategorien: </b>" }, 814{ "<b>Categories: </b>","<b>Kategorien: </b>" },
816{ "Save Journal/Description...","Speichere Journal/Details..." }, 815{ "Save Journal/Description...","Speichere Journal/Details..." },
817{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." }, 816{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." },
818{ "Continue","Weitermachen" }, 817{ "Continue","Weitermachen" },
819{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, 818{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" },
820{ "Attendee:","Teilnehmer:" }, 819{ "Attendee:","Teilnehmer:" },
821{ "Click OK to search ->","Klicke zum Suchen auf OK ->" }, 820{ "Click OK to search ->","Klicke zum Suchen auf OK ->" },
822{ "On day ","Am Tag " }, 821{ "On day ","Am Tag " },
823{ "%1 of ","%1 des Monats" }, 822{ "%1 of ","%1 des Monats" },
824{ "%1 of the year","%1 des Jahres" }, 823{ "%1 of the year","%1 des Jahres" },
825{ "Anonymous","Anonymo" }, 824{ "Anonymous","Anonymo" },
826{ "nobody@nowhere","niemand@nirgendwo" }, 825{ "nobody@nowhere","niemand@nirgendwo" },
827{ "calendar.html","calendar.html" }, 826{ "calendar.html","calendar.html" },
828{ " Local Time"," Lokale Zeit" }, 827{ " Local Time"," Lokale Zeit" },
829{ "Unknown Name","Unbekannter Name" }, 828{ "Unknown Name","Unbekannter Name" },
830{ "unknown@nowhere","unbekannt@nirgendwo" }, 829{ "unknown@nowhere","unbekannt@nirgendwo" },
831{ "Beam via IR!","Beam via IR!" }, 830{ "Beam via IR!","Beam via IR!" },
832{ "Next Month","Nächster Monat" }, 831{ "Next Month","Nächster Monat" },
833{ "Prio","Prio" }, 832{ "Prio","Prio" },
834{ "Reparent Todo","Mache Sub-Todo" }, 833{ "Reparent Todo","Mache Sub-Todo" },
835{ "tomorrow","morgen" }, 834{ "tomorrow","morgen" },
836{ "today","heute" }, 835{ "today","heute" },
837{ "yesterday","gestern" }, 836{ "yesterday","gestern" },
838{ "Ok","Ok" }, 837{ "Ok","Ok" },
839{ "Ok+Agenda","Ok+Agenda" }, 838{ "Ok+Agenda","Ok+Agenda" },
840{ "Email","Email" }, 839{ "Email","Email" },
841{ "RSVP","RSVP" }, 840{ "RSVP","RSVP" },
842{ "Email:","Email:" }, 841{ "Email:","Email:" },
843{ "Appointment Time ","Termin Zeit " }, 842{ "Appointment Time ","Termin Zeit " },
844{ "2","2" }, 843{ "2","2" },
845{ "3","3" }, 844{ "3","3" },
846{ "4","4" }, 845{ "4","4" },
847{ " 0 %"," 0 %" }, 846{ " 0 %"," 0 %" },
848{ " 20 %"," 20 %" }, 847{ " 20 %"," 20 %" },
849{ " 40 %"," 40 %" }, 848{ " 40 %"," 40 %" },
850{ " 60 %"," 60 %" }, 849{ " 60 %"," 60 %" },
851{ " 80 %"," 80 %" }, 850{ " 80 %"," 80 %" },
852{ "100 %","100 %" }, 851{ "100 %","100 %" },
853{ "Filter","Filter" }, 852{ "Filter","Filter" },
854{ "Configure","Konfiguriere" }, 853{ "Configure","Konfiguriere" },
855{ "What's Next","What's Next" }, 854{ "What's Next","What's Next" },
856{ "Complete calendar...","Kompletten Kalender..." }, 855{ "Complete calendar...","Kompletten Kalender..." },
857{ "Filtered calendar...","Gefilterten Kalender..." }, 856{ "Filtered calendar...","Gefilterten Kalender..." },
858{ "Export to phone","Exportiere zum Handy" }, 857{ "Export to phone","Exportiere zum Handy" },
859{ "Beam receive enabled","Beam Empfang an" }, 858{ "Beam receive enabled","Beam Empfang an" },
860{ "What's new?","Was ist neu?" }, 859{ "What's new?","Was ist neu?" },
861{ "FAQ...","FAQ..." }, 860{ "FAQ...","FAQ..." },
862{ "Licence...","Licence..." }, 861{ "Licence...","Licence..." },
863{ "What's This?","What's This?" }, 862{ "What's This?","What's This?" },
864{ "&Edit...","&Editiere..." }, 863{ "&Edit...","&Editiere..." },
865{ "Oktober","Oktober" }, 864{ "Oktober","Oktober" },
866{ "Title","Titel" }, 865{ "Title","Titel" },
867{ "%1 %","%1 %" }, 866{ "%1 %","%1 %" },
868{ "Enable Pi-Sync","Schalte Pi-Sync an" }, 867{ "Enable Pi-Sync","Schalte Pi-Sync an" },
869{ "Import!","Importiere!" }, 868{ "Import!","Importiere!" },
870{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, 869{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" },
871{ "Export to phone options","Export ans Handy Optionen" }, 870{ "Export to phone options","Export ans Handy Optionen" },
872{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 871{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
873{ "I/O device: ","I/O device: " }, 872{ "I/O device: ","I/O device: " },
874{ "Connection: ","Connection: " }, 873{ "Connection: ","Connection: " },
875{ "Model(opt.): ","Model(opt.): " }, 874{ "Model(opt.): ","Model(opt.): " },
876{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, 875{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" },
877{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, 876{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " },
878{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" }, 877{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" },
879{ "Export to mobile phone!","Exportiere auf das Handy!" }, 878{ "Export to mobile phone!","Exportiere auf das Handy!" },
880{ "Export complete calendar","Exportiere kompletten Kalender" }, 879{ "Export complete calendar","Exportiere kompletten Kalender" },
881{ "Writing to phone...","Sende Daten ans Handy..." }, 880{ "Writing to phone...","Sende Daten ans Handy..." },
882{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, 881{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
883{ "Retry","Nochmal versuchen" }, 882{ "Retry","Nochmal versuchen" },
884{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, 883{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
885{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, 884{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
886{ "Error exporting to phone!","Fehler beim Export auf das Handy!" }, 885{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
887{ "Export filtered calendar","Exportiere gefilterten Kalender" }, 886{ "Export filtered calendar","Exportiere gefilterten Kalender" },
888{ "Preferences","Vorlieben" }, 887{ "Preferences","Vorlieben" },
889{ "Global","Global" }, 888{ "Global","Global" },
890{ "Phone","Phone" }, 889{ "Phone","Phone" },
891{ "SMS","SMS" }, 890{ "SMS","SMS" },
892{ "Fax","Fax" }, 891{ "Fax","Fax" },
893{ "Pager","Pager" }, 892{ "Pager","Pager" },
894{ "SIP","SIP" }, 893{ "SIP","SIP" },
895{ "Italian","Italienisch" }, 894{ "Italian","Italienisch" },
896{ "24:00","24:00" }, 895{ "24:00","24:00" },
897{ "12:00am","12:00am" }, 896{ "12:00am","12:00am" },
898{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 897{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
899{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 898{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
900{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 899{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
901{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 900{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
902{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 901{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
903{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 902{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
904{ "Used Mail Client","Benutzter Mail Client" }, 903{ "Used Mail Client","Benutzter Mail Client" },
905{ "Channel:","Channel:" }, 904{ "Channel:","Channel:" },
906{ "Message:","Message:" }, 905{ "Message:","Message:" },
907{ "Parameters:","Parameter:" }, 906{ "Parameters:","Parameter:" },
908{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 907{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
909{ "extra Message:","extra Message:" }, 908{ "extra Message:","extra Message:" },
910{ "extra Parameters:","extra Parameter:" }, 909{ "extra Parameters:","extra Parameter:" },
911{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 910{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
912{ "External Apps.","Externe Appl." }, 911{ "External Apps.","Externe Appl." },
913{ "24 hours","24 Std." }, 912{ "24 hours","24 Std." },
914{ "3 hours","3 Std." }, 913{ "3 hours","3 Std." },
915{ "1 hour","1 Std." }, 914{ "1 hour","1 Std." },
916{ "15 minutes","15 Min." }, 915{ "15 minutes","15 Min." },
917{ "5 minutes","5 Min." }, 916{ "5 minutes","5 Min." },
918{ "1 minute","1 Min." }, 917{ "1 minute","1 Min." },
919{ "23","23" }, 918{ "23","23" },
920{ "Mon 15","Mon 15" }, 919{ "Mon 15","Mon 15" },
921{ "Configure KO","Konfiguriere KO" }, 920{ "Configure KO","Konfiguriere KO" },
922{ "Event text","Termin Text" }, 921{ "Event text","Termin Text" },
923{ "ToDo","Todo" }, 922{ "ToDo","Todo" },
924{ "Today","Heute" }, 923{ "Today","Heute" },
925{ "What's Next View","What's Next Ansicht" }, 924{ "What's Next View","What's Next Ansicht" },
926{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, 925{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" },
927{ "Alarm","Alarm" }, 926{ "Alarm","Alarm" },
928{ "Used %1 Client","Benutzter %1 Client" }, 927{ "Used %1 Client","Benutzter %1 Client" },
929{ "No email client installed","Kein Email Klient installiert" }, 928{ "No email client installed","Kein Email Klient installiert" },
930{ "Userdefined email client","Benutzerdef. Email Klient" }, 929{ "Userdefined email client","Benutzerdef. Email Klient" },
931{ "OM/Pi email client","OM/Pi Email Klient" }, 930{ "OM/Pi email client","OM/Pi Email Klient" },
932{ "Include in multiple ","Beziehe in multiple " }, 931{ "Include in multiple ","Beziehe in multiple " },
933{ "calendar ","Kalender " }, 932{ "calendar ","Kalender " },
934{ "addressbook ","Adressbuch " }, 933{ "addressbook ","Adressbuch " },
935{ "pwmanager","PWmanager" }, 934{ "pwmanager","PWmanager" },
936{ " sync"," Sync ein" }, 935{ " sync"," Sync ein" },
937{ "Write back synced data","Schreibe gesyncte Daten zurück" }, 936{ "Write back synced data","Schreibe gesyncte Daten zurück" },
938{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, 937{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" },
939{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, 938{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" },
940{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, 939{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " },
941{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, 940{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" },
942{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, 941{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" },
943{ "Help...","Hilfe..." }, 942{ "Help...","Hilfe..." },
944{ "Local file Cal:","Lokale Datei Kal:" }, 943{ "Local file Cal:","Lokale Datei Kal:" },
945{ "Local file ABook:","Lokale Datei ABuch:" }, 944{ "Local file ABook:","Lokale Datei ABuch:" },
946{ "Local file PWMgr:","Lokale Datei PWMgr:" }, 945{ "Local file PWMgr:","Lokale Datei PWMgr:" },
947{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, 946{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" },
948{ "Calendar:","Kalender:" }, 947{ "Calendar:","Kalender:" },
949{ "AddressBook:","AdressBuch:" }, 948{ "AddressBook:","AdressBuch:" },
950{ "PWManager:","PWManager:" }, 949{ "PWManager:","PWManager:" },
951{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, 950{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" },
952{ "ssh/scp","ssh/scp" }, 951{ "ssh/scp","ssh/scp" },
953{ "ftp","ftp" }, 952{ "ftp","ftp" },
954{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, 953{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" },
955{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, 954{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" },
956{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, 955{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" },
957{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, 956{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" },
958{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, 957{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" },
959{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, 958{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" },
960{ "KDE-Pim sync config","KDE-Pim sync Konfig" }, 959{ "KDE-Pim sync config","KDE-Pim sync Konfig" },
961{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, 960{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" },
962{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, 961{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" },
963{ "Port number (Default: %1)","Port Nummer (Default: %1)" }, 962{ "Port number (Default: %1)","Port Nummer (Default: %1)" },
964{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, 963{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
965{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, 964{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
966{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, 965{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
967{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, 966{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" },
968{ "Disable Pi-Sync","Schalte Pi-Sync aus" }, 967{ "Disable Pi-Sync","Schalte Pi-Sync aus" },
969{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, 968{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" },
970{ "KDE-Pim Sync","KDE-Pim Sync" }, 969{ "KDE-Pim Sync","KDE-Pim Sync" },
971{ "Multiple profiles","Multi-Sync Profile" }, 970{ "Multiple profiles","Multi-Sync Profile" },
972{ "Device: ","Gerät: " }, 971{ "Device: ","Gerät: " },
973{ "Multiple sync started.","Multi-Sync gestartet." }, 972{ "Multiple sync started.","Multi-Sync gestartet." },
974{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, 973{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" },
975{ "Turn filter on","Schalte Filter an" }, 974{ "Turn filter on","Schalte Filter an" },
976{ "Turn filter off","Schalte Filter aus" }, 975{ "Turn filter off","Schalte Filter aus" },
977{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, 976{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" },
978{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, 977{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" },
979{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, 978{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" },
980{ "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" }, 979{ "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" },
981{ "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" }, 980{ "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" },
982{ "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" }, 981{ "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" },
983{ "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" }, 982{ "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" },
984{ "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" }, 983{ "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" },
985{ "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" }, 984{ "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" },
986{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, 985{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" },
987{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, 986{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" },
988{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, 987{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" },
989{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, 988{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" },
990{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, 989{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" },
991{ "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" }, 990{ "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" },
992{ "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" }, 991{ "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" },
993{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, 992{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" },
994{ "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" }, 993{ "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" },
995{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, 994{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" },
996{ "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, 995{ "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" },
997{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, 996{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" },
998{ "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, 997{ "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" },
999{ "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, 998{ "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" },
1000{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, 999{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" },
1001{ "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, 1000{ "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" },
1002{ "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, 1001{ "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" },
1003{ "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, 1002{ "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" },
1004{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, 1003{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" },
1005{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, 1004{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" },
1006{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, 1005{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" },
1007{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, 1006{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" },
1008{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, 1007{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" },
1009{ "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, 1008{ "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" },
1010{ "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, 1009{ "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" },
1011{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, 1010{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" },
1012{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, 1011{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" },
1013{ "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, 1012{ "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" },
1014{ "<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X+ctrl</b>: Zeige/verstecke Datumsnavigator</p>\n" }, 1013{ "<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X+ctrl</b>: Zeige/verstecke Datumsnavigator</p>\n" },
1015{ "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, 1014{ "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" },
1016{ "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, 1015{ "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" },
1017{ "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" }, 1016{ "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" },
1018{ "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" }, 1017{ "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" },
1019{ "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, 1018{ "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" },
1020{ "<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ","<p><b>X</b>: Nächste-X-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, 1019{ "<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ","<p><b>X</b>: Nächste-X-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " },
1021{ "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, 1020{ "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" },
1022{ "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, 1021{ "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" },
1023{ "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, 1022{ "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" },
1024{ "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, 1023{ "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" },
1025{ "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, 1024{ "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" },
1026{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, 1025{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" },
1027{ "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","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, 1026{ "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","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" },
1028{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, 1027{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" },
1029{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, 1028{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" },
1030{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, 1029{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" },
1031{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, 1030{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" },
1032{ "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, 1031{ "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" },
1033{ "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","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, 1032{ "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","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" },
1034{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, 1033{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" },
1035{ "KO/Pi FAQ","KO/Pi FAQ" }, 1034{ "KO/Pi FAQ","KO/Pi FAQ" },
1036{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, 1035{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" },
1037{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, 1036{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" },
1038{ "About KOrganizer/Pi","Über KOrganizer/Pi" }, 1037{ "About KOrganizer/Pi","Über KOrganizer/Pi" },
1039{ "From: ","Von: " }, 1038{ "From: ","Von: " },
1040{ "Remove sync info","Entferne Sync Info" }, 1039{ "Remove sync info","Entferne Sync Info" },
1041{ "For all profiles","Für alle Profile" }, 1040{ "For all profiles","Für alle Profile" },
1042{ "Hide not Running","Verstecke nicht Laufende" }, 1041{ "Hide not Running","Verstecke nicht Laufende" },
1043{ "ME","ME" }, 1042{ "ME","ME" },
1044{ "Toolbar","Toolbar" }, 1043{ "Toolbar","Toolbar" },
1045{ "Undo Delete...","Undo Löschen..." }, 1044{ "Undo Delete...","Undo Löschen..." },
1046{ "Undo Delete","Löschen rückgängig machen" }, 1045{ "Undo Delete","Löschen rückgängig machen" },
1047{ "KDE Sync HowTo...","KDE Sync HowTo..." }, 1046{ "KDE Sync HowTo...","KDE Sync HowTo..." },
1048{ "Multi Sync HowTo...","Multi Sync HowTo..." }, 1047{ "Multi Sync HowTo...","Multi Sync HowTo..." },
1049{ "Januar","Januar" }, 1048{ "Januar","Januar" },
1050{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, 1049{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" },
1051{ "No Filter","Kein Filter" }, 1050{ "No Filter","Kein Filter" },
1052{ "Multiple Sync options","Multi Sync Optionen" }, 1051{ "Multiple Sync options","Multi Sync Optionen" },
1053{ "Sync algo options","Sync Ablauf Optionen" }, 1052{ "Sync algo options","Sync Ablauf Optionen" },
1054{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 1053{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
1055{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 1054{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
1056{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 1055{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
1057{ "Write back options","Optionen zum Zurückschreiben" }, 1056{ "Write back options","Optionen zum Zurückschreiben" },
1058{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 1057{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
1059{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 1058{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
1060{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 1059{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
1061{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 1060{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
1062{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 1061{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
1063{ "Time period","Zeitspanne" }, 1062{ "Time period","Zeitspanne" },
1064{ "From ","Von " }, 1063{ "From ","Von " },
1065{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 1064{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
1066{ " weeks in the future "," Wochen in der Zukunft " }, 1065{ " weeks in the future "," Wochen in der Zukunft " },
1067{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 1066{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
1068{ "Local temp file:","Lokale temp Datei:" }, 1067{ "Local temp file:","Lokale temp Datei:" },
1069{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 1068{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
1070{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 1069{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
1071{ "Language","Sprache" }, 1070{ "Language","Sprache" },
1072{ "Time Format","Zeit Format" }, 1071{ "Time Format","Zeit Format" },
1073{ "Time Zone","Zeit Zone" }, 1072{ "Time Zone","Zeit Zone" },
1074{ "%1 groups subscribed","%1 Guppen abboniert" }, 1073{ "%1 groups subscribed","%1 Guppen abboniert" },
1075{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, 1074{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" },
1076{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 1075{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
1077{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 1076{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
1078{ "Save settings","Speichere Einstellungen" }, 1077{ "Save settings","Speichere Einstellungen" },
1079{ "Save standard","Speichere Standard" }, 1078{ "Save standard","Speichere Standard" },
1080{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 1079{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
1081{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 1080{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
1082{ "Data storage path","Daten Speicherpfad" }, 1081{ "Data storage path","Daten Speicherpfad" },
1083{ "Language","Sprache" }, 1082{ "Language","Sprache" },
1084{ "Show time in agenda items","Zeige Zeit in Agenda Items" }, 1083{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
1085{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, 1084{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
1086{ "Show events that are done","Zeige abgelaufene Termine" }, 1085{ "Show events that are done","Zeige abgelaufene Termine" },
1087{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, 1086{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
1088{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 1087{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
1089{ "KO/Pi","KO/Pi" }, 1088{ "KO/Pi","KO/Pi" },
1090{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, 1089{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
1091{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, 1090{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
1092{ "Sound.Al.: ","Sound.Al.: " }, 1091{ "Sound.Al.: ","Sound.Al.: " },
1093{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, 1092{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
1094{ "Restore","Wiederherstellen" }, 1093{ "Restore","Wiederherstellen" },
1095{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" }, 1094{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" },
1096{ "% completed","% erledigt" }, 1095{ "% completed","% erledigt" },
1097{ "%d item(s) found.","%d Item(s) gefunden." }, 1096{ "%d item(s) found.","%d Item(s) gefunden." },
1098{ "Set complete","Setze auf erledigt" }, 1097{ "Set complete","Setze auf erledigt" },
1099{ "(cancelled)","(gecancelt)" }, 1098{ "(cancelled)","(gecancelt)" },
1100{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1099{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1101{ " Local time "," Locale Zeit " }, 1100{ " Local time "," Locale Zeit " },
1102{ "Form2","Form2" }, 1101{ "Form2","Form2" },
1103{ "Filter enabled","Filter angeschaltet" }, 1102{ "Filter enabled","Filter angeschaltet" },
1104{ "Edit Filters","Ändere Filter" }, 1103{ "Edit Filters","Ändere Filter" },
1105{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1104{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1106{ "Agenda","Agenda" }, 1105{ "Agenda","Agenda" },
1107{ " ("," (" }, 1106{ " ("," (" },
1108{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1107{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1109{ "Print","Print" }, 1108{ "Print","Print" },
1110{ "&Setup Printer...","Drucker &Setup..." }, 1109{ "&Setup Printer...","Drucker &Setup..." },
1111{ "View Type","Zeige Typ" }, 1110{ "View Type","Zeige Typ" },
1112{ "Page &orientation:","Seiten Ausrichtung:" }, 1111{ "Page &orientation:","Seiten Ausrichtung:" },
1113{ "Use Default of Selected Style","Default des selektierten Stils" }, 1112{ "Use Default of Selected Style","Default des selektierten Stils" },
1114{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1113{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1115{ "Portrait","Portrait" }, 1114{ "Portrait","Portrait" },
1116{ "Landscape","Landschaft" }, 1115{ "Landscape","Landschaft" },
1117{ "Print day","Drucke Tag" }, 1116{ "Print day","Drucke Tag" },
1118{ "CalPrintDay_Base","CalPrintDay_Base" }, 1117{ "CalPrintDay_Base","CalPrintDay_Base" },
1119{ "Date && Time Range","Datum && Zeitspanne" }, 1118{ "Date && Time Range","Datum && Zeitspanne" },
1120{ "&End date:","&Enddatum:" }, 1119{ "&End date:","&Enddatum:" },
1121{ "&Start date:","&Startdatum:" }, 1120{ "&Start date:","&Startdatum:" },
1122{ "Start &time:","Startzeit:" }, 1121{ "Start &time:","Startzeit:" },
1123{ "End ti&me:","Endzeit:" }, 1122{ "End ti&me:","Endzeit:" },
1124{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1123{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1125{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1124{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1126{ "Alt+D","Alt+D" }, 1125{ "Alt+D","Alt+D" },
1127{ "&Use colors","Nutze Farben" }, 1126{ "&Use colors","Nutze Farben" },
1128{ "Alt+U","Alt+U" }, 1127{ "Alt+U","Alt+U" },
1129{ "Print week","Drucke Woche" }, 1128{ "Print week","Drucke Woche" },
1130{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1129{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1131{ "Use &colors","Nutze Farben" }, 1130{ "Use &colors","Nutze Farben" },
1132{ "Type of View","Typ der Ansicht" }, 1131{ "Type of View","Typ der Ansicht" },
1133{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1132{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1134{ "Alt+F","Alt+F" }, 1133{ "Alt+F","Alt+F" },
1135{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1134{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1136{ "Alt+T","Alt+T" }, 1135{ "Alt+T","Alt+T" },
1137{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1136{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1138{ "Print month","Drucke Monat" }, 1137{ "Print month","Drucke Monat" },
1139{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1138{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1140{ "&Start month:","&Startmonat:" }, 1139{ "&Start month:","&Startmonat:" },
1141{ "&End month:","&Endmonat:" }, 1140{ "&End month:","&Endmonat:" },
1142{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1141{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1143{ "Print todos","Drucke Todos" }, 1142{ "Print todos","Drucke Todos" },
1144{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1143{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1145{ "Include &description of the item","Inclusive Itembeschreibung" }, 1144{ "Include &description of the item","Inclusive Itembeschreibung" },
1146{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1145{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1147{ "Include &priority of the item","Inclusive Priorität des Items" }, 1146{ "Include &priority of the item","Inclusive Priorität des Items" },
1148{ "Items to Print","Zu druckende Items" }, 1147{ "Items to Print","Zu druckende Items" },
1149{ "&From:","Von:" }, 1148{ "&From:","Von:" },
1150{ "&To:","Bis:" }, 1149{ "&To:","Bis:" },
1151{ "Print &all todo items","Drucke alle Todo Items" }, 1150{ "Print &all todo items","Drucke alle Todo Items" },
1152{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1151{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1153{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1152{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1154{ "Todo List","Todo Liste" }, 1153{ "Todo List","Todo Liste" },
1155{ "&Title:","&Titel:" }, 1154{ "&Title:","&Titel:" },
1156{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, 1155{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" },
1157{ "Todo list","Todo Liste" }, 1156{ "Todo list","Todo Liste" },
1158{ "&Print...","Drucke..." }, 1157{ "&Print...","Drucke..." },
1159{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1158{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1160{ "[Unconfigured]","[Unkonfiguriert]" }, 1159{ "[Unconfigured]","[Unkonfiguriert]" },
1161{ "OK","OK" }, 1160{ "OK","OK" },
1162{ "FilterEditor","FilterEditor" }, 1161{ "FilterEditor","FilterEditor" },
1163{ "Include","Inclusive" }, 1162{ "Include","Inclusive" },
1164{ "Exclude","Exclusive" }, 1163{ "Exclude","Exclusive" },
1165{ "Edit Selection...","Editiere Auswahl" }, 1164{ "Edit Selection...","Editiere Auswahl" },
1166{ "recurring events","wiederholende Termine" }, 1165{ "recurring events","wiederholende Termine" },
1167{ "recurr. events","wiederh.Termine" }, 1166{ "recurr. events","wiederh.Termine" },
1168{ "completed to-dos","erledigte Todos" }, 1167{ "completed to-dos","erledigte Todos" },
1169{ "events","Termine" }, 1168{ "events","Termine" },
1170{ "todos","Todos" }, 1169{ "todos","Todos" },
1171{ "journals","Journale" }, 1170{ "journals","Journale" },
1172{ "public","öffentl." }, 1171{ "public","öffentl." },
1173{ "private","privat" }, 1172{ "private","privat" },
1174{ "confidential","vertraul." }, 1173{ "confidential","vertraul." },
1175{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, 1174{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" },
1176{ "Yesterday","Gestern" }, 1175{ "Yesterday","Gestern" },
1177{ "Day after tomorrow","Übermorgen" }, 1176{ "Day after tomorrow","Übermorgen" },
1178{ "Tomorrow","Morgen" }, 1177{ "Tomorrow","Morgen" },
1179{ "Day before yesterday","Vorgestern" }, 1178{ "Day before yesterday","Vorgestern" },
1180{ "Size %1","Größe %1" }, 1179{ "Size %1","Größe %1" },
1181{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1180{ "New Agendasize: %1","Neue Agendagröße: %1" },
1182{ " (%1 y.)"," (%1 J.)" }, 1181{ " (%1 y.)"," (%1 J.)" },
1183{ "Allday:","Ganztägig:" }, 1182{ "Allday:","Ganztägig:" },
1184{ "compl.todos","erled.Todos" }, 1183{ "compl.todos","erled.Todos" },
1185{ "Day view","Tagesansicht" }, 1184{ "Day view","Tagesansicht" },
1186{ "Next days","Nächste Tage" }, 1185{ "Next days","Nächste Tage" },
1187{ "Next week","Nächste Woche" }, 1186{ "Next week","Nächste Woche" },
1188{ "Next two weeks","Nächste zwei Wochen" }, 1187{ "Next two weeks","Nächste zwei Wochen" },
1189{ "This month","Dieser Monat" }, 1188{ "This month","Dieser Monat" },
1190{ "Journal view","Journal" }, 1189{ "Journal view","Journal" },
1191{ "Display all opened","Zeige alle geöffnet" }, 1190{ "Display all opened","Zeige alle geöffnet" },
1192{ "Display all closed","Zeige alle geschlossen" }, 1191{ "Display all closed","Zeige alle geschlossen" },
1193{ "Display all flat","Zeige alle flach" }, 1192{ "Display all flat","Zeige alle flach" },
1194{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1193{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1195{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1194{ "Default todo done color:","Standard Todo erledigt Farbe" },
1196{ "Select week %1-%2","Wähle Woche %1-%2" }, 1195{ "Select week %1-%2","Wähle Woche %1-%2" },
1197{ "Select Week","Wähle Woche" }, 1196{ "Select Week","Wähle Woche" },
1198{ "Set alarm...","Setze Alarm..." }, 1197{ "Set alarm...","Setze Alarm..." },
1199{ "Set Alarm!","Setze Alarm!" }, 1198{ "Set Alarm!","Setze Alarm!" },
1200{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1199{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1201{ " and "," und " }, 1200{ " and "," und " },
1202{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1201{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1203{ "Mail to selected","Mail an Ausgewählte" }, 1202{ "Mail to selected","Mail an Ausgewählte" },
1204{ "Mail to all","Mail an Alle" }, 1203{ "Mail to all","Mail an Alle" },
1205{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1204{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1206{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1205{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1207{ " on"," am" }, 1206{ " on"," am" },
1208{ " completed on "," erledigt am " }, 1207{ " completed on "," erledigt am " },
1209{ "Save as Event template","Speichere als Vorlage" }, 1208{ "Save as Event template","Speichere als Vorlage" },
1210{ "Load Event template","Lade Termin Vorlage" }, 1209{ "Load Event template","Lade Termin Vorlage" },
1211{ "Save as Journal template","Speichere als Journal Vorlage" }, 1210{ "Save as Journal template","Speichere als Journal Vorlage" },
1212{ "Insert Journal template","Füge Journal Vorlage ein" }, 1211{ "Insert Journal template","Füge Journal Vorlage ein" },
1213{ "Sub todos:<br>","Unter Todos:<br>" }, 1212{ "Sub todos:<br>","Unter Todos:<br>" },
1214{ "Parent todo:<br>","Über Todo:<br>" }, 1213{ "Parent todo:<br>","Über Todo:<br>" },
1215{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1214{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1216{ " completed"," erledigt" }, 1215{ " completed"," erledigt" },
1217{ "(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!" }, 1216{ "(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!" },
1218{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1217{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1219{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1218{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1220{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1219{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1221{ "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?" }, 1220{ "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?" },
1222{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1221{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1223{ "Error","Fehler" }, 1222{ "Error","Fehler" },
1224{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1223{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1225{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1224{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1226{ "Warning","Warnung" }, 1225{ "Warning","Warnung" },
1227{ "Select week number","Wähle Wochen Nummer" }, 1226{ "Select week number","Wähle Wochen Nummer" },
1228{ "Februar","Februar" }, 1227{ "Februar","Februar" },
1229{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1228{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1230{ "W","W" }, 1229{ "W","W" },
1231{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1230{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1232{ "T: %1","T: %1" }, 1231{ "T: %1","T: %1" },
1233{ "Start: ","Start: " }, 1232{ "Start: ","Start: " },
1234{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1233{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1235{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1234{ "Password for remote access:","Passwort für fernen Zugriff:" },
1236{ "Remote IP address:","Ferne IP Adresse:" }, 1235{ "Remote IP address:","Ferne IP Adresse:" },
1237{ "Remote port number:","Ferne Port Nummer:" }, 1236{ "Remote port number:","Ferne Port Nummer:" },
1238{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1237{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1239{ "Remote from: ","Fern von: " }, 1238{ "Remote from: ","Fern von: " },
1240{ "Local from: ","Lokal von: " }, 1239{ "Local from: ","Lokal von: " },
1241{ "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" }, 1240{ "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" },
1242{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1241{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1243{ "Write back","Schreibe zurück" }, 1242{ "Write back","Schreibe zurück" },
1244{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1243{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1245{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1244{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1246{ "Received sync request","Sync Anfrage erhalten" }, 1245{ "Received sync request","Sync Anfrage erhalten" },
1247{ "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." }, 1246{ "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." },
1248{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1247{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1249{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1248{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1250{ "Sending file...","Sende Datei..." }, 1249{ "Sending file...","Sende Datei..." },
1251{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1250{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1252{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1251{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1253{ "Received %1 bytes","%1 Bytes erhalten" }, 1252{ "Received %1 bytes","%1 Bytes erhalten" },
1254{ "Writing file to disk...","Speichere Datei..." }, 1253{ "Writing file to disk...","Speichere Datei..." },
1255{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1254{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1256{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1255{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1257{ "Synchronize!","Synchronisiere!" }, 1256{ "Synchronize!","Synchronisiere!" },
1258{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1257{ "High clock skew!","Großer Uhrzeitunterschied!" },
1259{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1258{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1260{ "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!" }, 1259{ "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!" },
1261{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1260{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1262{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1261{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1263{ "List week view","Listenwochenansicht" }, 1262{ "List week view","Listenwochenansicht" },
1264{ "List week","Listenwochenansicht" }, 1263{ "List week","Listenwochenansicht" },
1265{ "Next Week","Nächste Woche" }, 1264{ "Next Week","Nächste Woche" },
1266{ "Previous Week","Vorherige Woche" }, 1265{ "Previous Week","Vorherige Woche" },
1267{ "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." }, 1266{ "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." },
1268{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1267{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1269{ "Details","Details" }, 1268{ "Details","Details" },
1270{ "Created time","Erstellt Zeit" }, 1269{ "Created time","Erstellt Zeit" },
1271{ "Last modified time","Geändert Zeit" }, 1270{ "Last modified time","Geändert Zeit" },
1272{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1271{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1273{ "View Options","Anzeige Optionen" }, 1272{ "View Options","Anzeige Optionen" },
1274{ "<b>Created: ","<b>Erstellt am: " }, 1273{ "<b>Created: ","<b>Erstellt am: " },
1275{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1274{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1276{ "Journal: ","Journal: " }, 1275{ "Journal: ","Journal: " },
1277{ "yearly","jährlich" }, 1276{ "yearly","jährlich" },
1278{ "(%1) ","%1-" }, 1277{ "(%1) ","%1-" },
1279{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1278{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1280{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1279{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1281{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1280{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1282{ "Summary/Loc.","Titel/Ort" }, 1281{ "Summary/Loc.","Titel/Ort" },
1283{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1282{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1284{ "Week Number","Wochennummer" }, 1283{ "Week Number","Wochennummer" },
1285{ "Import","Importiere" }, 1284{ "Import","Importiere" },
1286{ "Export","Exportiere" }, 1285{ "Export","Exportiere" },
1287{ "Beam","Beame" }, 1286{ "Beam","Beame" },
1288{ "Export","Exportiere" }, 1287{ "Export","Exportiere" },
1289{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1288{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1290{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1289{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1291{ "Journal/Details...","Journale/Details..." }, 1290{ "Journal/Details...","Journale/Details..." },
1292{ "Agenda View","Agenda Ansicht" }, 1291{ "Agenda View","Agenda Ansicht" },
1293{ "Show current time","Zeige aktuelle Zeit" }, 1292{ "Show current time","Zeige aktuelle Zeit" },
1294{ "Edit new item","Bearbeite neuen Eintrag" }, 1293{ "Edit new item","Bearbeite neuen Eintrag" },
1295{ "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" }, 1294{ "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" },
1296{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1295{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1297{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1296{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1298{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1297{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1299{ "%1 days\n","%1 Tagen\n" }, 1298{ "%1 days\n","%1 Tagen\n" },
1300{ "1 day\n","1 Tag\n" }, 1299{ "1 day\n","1 Tag\n" },
1301{ "%1 hours\n","%1 Stunden\n" }, 1300{ "%1 hours\n","%1 Stunden\n" },
1302{ "1 hour\n","1 Stunde\n" }, 1301{ "1 hour\n","1 Stunde\n" },
1303{ "%1 minutes\n","%1 Minuten\n" }, 1302{ "%1 minutes\n","%1 Minuten\n" },
1304{ "1 minute\n","1 Minute\n" }, 1303{ "1 minute\n","1 Minute\n" },
1305{ "Only one toolbar","Nur eine Toolbar" }, 1304{ "Only one toolbar","Nur eine Toolbar" },
1306{ "Print","Drucke" }, 1305{ "Print","Drucke" },
1307{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1306{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1308{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1307{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1309{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1308{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1310{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1309{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1311{ "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" }, 1310{ "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" },
1312{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1311{ "KO/Pi Printout","KO/Pi Ausdruck" },
1313{ "Print unscaled","Drucke unskaliert" }, 1312{ "Print unscaled","Drucke unskaliert" },
1314{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1313{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1315{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1314{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1316{ "Printout Mode","Druck Modus" }, 1315{ "Printout Mode","Druck Modus" },
1317{ "Filter menu icon","Filtermenu Icon" }, 1316{ "Filter menu icon","Filtermenu Icon" },
1318{ "<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" }, 1317{ "<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" },
1319{ "<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" }, 1318{ "<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" },
1320{ "%1d","%1t" }, 1319{ "%1d","%1t" },
1321{ "%1h","%1std" }, 1320{ "%1h","%1std" },
1322{ "%1min","%1min" }, 1321{ "%1min","%1min" },
1323{ "( %1 before )","( %1 vorher )" }, 1322{ "( %1 before )","( %1 vorher )" },
1324{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1323{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1325{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1324{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1326{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1325{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1327{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1326{ "Show Sync Events","Zeige Sync-Ereignisse" },
1328{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1327{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1329{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1328{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1330{ " on "," am " }, 1329{ " on "," am " },
1331{ "On: ","Am: " }, 1330{ "On: ","Am: " },
1332{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1331{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1333{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1332{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1334{ "Color for running todos:","Farbe für laufende Todos:" }, 1333{ "Color for running todos:","Farbe für laufende Todos:" },
1335{ "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?" }, 1334{ "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?" },
1336{ "Todo is started","Todo ist gestartet" }, 1335{ "Todo is started","Todo ist gestartet" },
1337{ "Stop todo","Stoppe Todo" }, 1336{ "Stop todo","Stoppe Todo" },
1338{ "Todo is stopped","Todo ist gestoppt" }, 1337{ "Todo is stopped","Todo ist gestoppt" },
1339{ "Start todo","Starte Todo" }, 1338{ "Start todo","Starte Todo" },
1340{ "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?" }, 1339{ "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?" },
1341{ "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?" }, 1340{ "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?" },
1342{ "Todo has subtodos","Todo hat Untertodos" }, 1341{ "Todo has subtodos","Todo hat Untertodos" },
1343{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1342{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1344{ "Colors","Farben" }, 1343{ "Colors","Farben" },
1345{ "Click on new parent item","Klicke auf neues Übertodo" }, 1344{ "Click on new parent item","Klicke auf neues Übertodo" },
1346{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1345{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1347{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1346{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1348{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1347{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1349{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1348{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1350{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1349{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1351{ "times","Zeiten" }, 1350{ "times","Zeiten" },
1352{ "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?" }, 1351{ "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?" },
1353{ "Backup enabled","Backup angeschaltet" }, 1352{ "Backup enabled","Backup angeschaltet" },
1354{ "Use standard backup dir","Standard Backupverzeichnis" }, 1353{ "Use standard backup dir","Standard Backupverzeichnis" },
1355{ "Number of Backups:","Anzahl der Backups" }, 1354{ "Number of Backups:","Anzahl der Backups" },
1356{ "Make backup every ","Mache ein Backup alle " }, 1355{ "Make backup every ","Mache ein Backup alle " },
1357{ " days"," Tage" }, 1356{ " days"," Tage" },
1358{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1357{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1359{ "Backup Failed!","Backup Problem!" }, 1358{ "Backup Failed!","Backup Problem!" },
1360{ "Try again now","Versuche jetzt nochmal" }, 1359{ "Try again now","Versuche jetzt nochmal" },
1361{ "Try again later","Versuche später nochmal" }, 1360{ "Try again later","Versuche später nochmal" },
1362{ "Try again tomorrow","Versuche morgen nochmal" }, 1361{ "Try again tomorrow","Versuche morgen nochmal" },
1363{ "Disable backup","Schalte Backup ab" }, 1362{ "Disable backup","Schalte Backup ab" },
1364{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1363{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1365{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1364{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1366{ "Choose action","Wähle Aktion" }, 1365{ "Choose action","Wähle Aktion" },
1367{ "Comment for todo:","Kommentar zum Todo:" }, 1366{ "Comment for todo:","Kommentar zum Todo:" },
1368{ "Stop+note","Stop+Notiz" }, 1367{ "Stop+note","Stop+Notiz" },
1369{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1368{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1370{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1369{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1371{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1370{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1372{ "Print complete list","Drucke komplette Liste" }, 1371{ "Print complete list","Drucke komplette Liste" },
1373{ "Hide all selected","Verstecke Selektierte" }, 1372{ "Hide all selected","Verstecke Selektierte" },
1374{ "Add items","hinzufügen" }, 1373{ "Add items","hinzufügen" },
1375{ "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?" }, 1374{ "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?" },
1376{ "Print List View...","Drucke Listenansicht..." }, 1375{ "Print List View...","Drucke Listenansicht..." },
1377{ "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." }, 1376{ "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." },
1378{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1377{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1379{ "Global Settings...","Globale Einstellungen..." }, 1378{ "Global Settings...","Globale Einstellungen..." },
1380{ "<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" }, 1379{ "<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" },
1381{ "(disabled)","(abgeschaltet)" }, 1380{ "(disabled)","(abgeschaltet)" },
1382{ "New Calendar","Neuer Kalender" }, 1381{ "New Calendar","Neuer Kalender" },
1383{ "Calendar","Kalender" }, 1382{ "Calendar","Kalender" },
1384{ "Filter selector","Filterauswahl" }, 1383{ "Filter selector","Filterauswahl" },
1385{ "Filtermenu","Filtermenu" }, 1384{ "Filtermenu","Filtermenu" },
1386{ "Toggle Fullscreen","Vollbild umschalten" }, 1385{ "Toggle Fullscreen","Vollbild umschalten" },
1387{ "Toggle Resource View","Resourcenansicht umschalten" }, 1386{ "Toggle Resource View","Resourcenansicht umschalten" },
1388{ "Storage HowTo...","Speicherort HowTo..." }, 1387{ "Storage HowTo...","Speicherort HowTo..." },
1389{ "Timetracking HowTo...","Timetracking HowTo..." }, 1388{ "Timetracking HowTo...","Timetracking HowTo..." },
1390{ "Juni","Juni" }, 1389{ "Juni","Juni" },
1391{ "Juli","Juli" }, 1390{ "Juli","Juli" },
1392{ "ToDo:","ToDo:" }, 1391{ "ToDo:","ToDo:" },
1393{ "Set Calendar","Setze Kalender" }, 1392{ "Set Calendar","Setze Kalender" },
1394{ "Todo: %1","Todo: %1" }, 1393{ "Todo: %1","Todo: %1" },
1395{ ": (Prio ",": (Prio " }, 1394{ ": (Prio ",": (Prio " },
1396{ "Todos","Todos" }, 1395{ "Todos","Todos" },
1397{ "Todo Viewer","Todo Viewer" }, 1396{ "Todo Viewer","Todo Viewer" },
1398{ "Todo ","Todo " }, 1397{ "Todo ","Todo " },
1399{ " Calendar \n Resource "," Kalender \n Resource " }, 1398{ " Calendar \n Resource "," Kalender \n Resource " },
1400{ " Color "," Farbe " }, 1399{ " Color "," Farbe " },
1401{ "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!)" }, 1400{ "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!)" },
1402{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1401{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1403{ "Add new Calendar","Füge Kalender hinzu" }, 1402{ "Add new Calendar","Füge Kalender hinzu" },
1404{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1403{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1405{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, 1404{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" },
1406{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1405{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1407{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1406{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1408{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1407{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1409{ "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>" }, 1408{ "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>" },
1410{ "Global application font for all apps:","Globale Schriftart:" }, 1409{ "Global application font for all apps:","Globale Schriftart:" },
1411{ "Application Font","Applikationsschriftart" }, 1410{ "Application Font","Applikationsschriftart" },
1412{ "Kx/Pi","Kx/Pi" }, 1411{ "Kx/Pi","Kx/Pi" },
1413{ "Backup","Backup" }, 1412{ "Backup","Backup" },
1414{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1413{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1415{ "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!" }, 1414{ "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!" },
1416{ "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!" }, 1415{ "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!" },
1417{ "Choose Color","Wähle Farbe" }, 1416{ "Choose Color","Wähle Farbe" },
1418{ " OK "," OK " }, 1417{ " OK "," OK " },
1419{ " Cancel "," Abbrechen " }, 1418{ " Cancel "," Abbrechen " },
1420{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1419{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1421{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1420{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1422{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1421{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1423{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1422{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1424{ "<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>" }, 1423{ "<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>" },
1425{ "%1\nis running!","%1\nist am Laufen!" }, 1424{ "%1\nis running!","%1\nist am Laufen!" },
1426{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1425{ "Additional Comment:","Zusätzlicher Kommentar:" },
1427{ "Stop and save","Stopp und Speichern" }, 1426{ "Stop and save","Stopp und Speichern" },
1428{ "Continue running","Weiter laufen lassen" }, 1427{ "Continue running","Weiter laufen lassen" },
1429{ "Stop - do not save","Stopp - nicht Speichern" }, 1428{ "Stop - do not save","Stopp - nicht Speichern" },
1430{ "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?" }, 1429{ "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?" },
1431{ "Time mismatch!","Zeiten stimmen nicht!" }, 1430{ "Time mismatch!","Zeiten stimmen nicht!" },
1432{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1431{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1433{ "Yes, stop todo","Ja, stoppe Todo" }, 1432{ "Yes, stop todo","Ja, stoppe Todo" },
1434{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1433{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1435{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1434{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1436{ "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." }, 1435{ "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." },
1437{ "Spouse","Ehegatte" }, 1436{ "Spouse","Ehegatte" },
1438{ "Notes","Notizen" }, 1437{ "Notes","Notizen" },
1439{ "Messanger","Messanger" }, 1438{ "Messanger","Messanger" },
1440{ "Assistant","Assistent" }, 1439{ "Assistant","Assistent" },
1441{ "Manager","Manager" }, 1440{ "Manager","Manager" },
1442{ "Secrecy","Sichtbar" }, 1441{ "Secrecy","Sichtbar" },
1443{ "male","männlich" }, 1442{ "male","männlich" },
1444{ "female","weiblich" }, 1443{ "female","weiblich" },
1445{ "Hide!","Verbergen!" }, 1444{ "Hide!","Verbergen!" },
1446{ "Show!","Anzeigen!" }, 1445{ "Show!","Anzeigen!" },
1447{ "Details","Details" }, 1446{ "Details","Details" },
1448{ "Profession","Beruf" }, 1447{ "Profession","Beruf" },
1449{ "Children","Kinder" }, 1448{ "Children","Kinder" },
1450{ "Department","Abteilung" }, 1449{ "Department","Abteilung" },
1451{ "Backup cancelled","Backup abgebrochen" }, 1450{ "Backup cancelled","Backup abgebrochen" },
1452{ "Backup globally disabled","Backup global abgeschaltet" }, 1451{ "Backup globally disabled","Backup global abgeschaltet" },
1453{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1452{ "Backup succesfully finished","Backup erfolgreich beendet" },
1454{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1453{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1455{ "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" }, 1454{ "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" },
1456{ "Birthdays","Geburtstage" }, 1455{ "Birthdays","Geburtstage" },
1457{ "KO/Pi import information!","KO/Pi Import Information!" }, 1456{ "KO/Pi import information!","KO/Pi Import Information!" },
1458{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1457{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1459{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1458{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1460{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, 1459{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" },
1461{ "Reload","Neu laden" }, 1460{ "Reload","Neu laden" },
1462{ "Timezone settings","Zeitzoneneinstellung" }, 1461{ "Timezone settings","Zeitzoneneinstellung" },
1463{ "Title: ","Titel: " }, 1462{ "Title: ","Titel: " },
1464{ "Journal from: ","Journal vom: " }, 1463{ "Journal from: ","Journal vom: " },
1465{ "Journal: %1 from ","Journal: %1 vom " }, 1464{ "Journal: %1 from ","Journal: %1 vom " },
1466{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1465{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1467{ "Selected Item","Ausgewähltes Item" }, 1466{ "Selected Item","Ausgewähltes Item" },
1468{ "Select Date...","Wähle Datum..." }, 1467{ "Select Date...","Wähle Datum..." },
1469{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, 1468{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" },
1470{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1469{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1471{ "Edit category list...","Ändere Kategorieliste..." }, 1470{ "Edit category list...","Ändere Kategorieliste..." },
1472{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1471{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1473{ "Filepath: ","Dateipfad: " }, 1472{ "Filepath: ","Dateipfad: " },
1474{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, 1473{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1475{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, 1474{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
1476{ "Pending Suspend Alarm","Laufender Suspend Alarm" }, 1475{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
1477{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, 1476{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
1478{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, 1477{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
1479{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, 1478{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
1480{ "Alarm Options","Alarm Einstellungen" }, 1479{ "Alarm Options","Alarm Einstellungen" },
1481{ "Delete selected...","Lösche Ausgewählte..." }, 1480{ "Delete selected...","Lösche Ausgewählte..." },
1482{ "None","Nichts" }, 1481{ "None","Nichts" },
1483{ "Selection","Auswahl" }, 1482{ "Selection","Auswahl" },
1484{ "Set categories","Setze Kategorien" }, 1483{ "Set categories","Setze Kategorien" },
1485{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, 1484{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" },
1486{ "Reset","Neu setzen" }, 1485{ "Reset","Neu setzen" },
1487{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, 1486{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" },
1488{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, 1487{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
1489{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, 1488{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
1490{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, 1489{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" },
1490{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
1491{ "","" }, 1491{ "","" },
1492{ "","" }, 1492{ "","" },
1493{ "","" }, 1493{ "","" },
1494{ "","" }, 1494{ "","" },
1495{ "","" }, 1495{ "","" },
1496{ "","" }, 1496{ "","" },
1497{ "","" }, \ No newline at end of file
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 678143d..5c88abd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,4595 +1,4595 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Requires the Qt and KDE widget libraries, available at no cost at 4 Requires the Qt and KDE widget libraries, available at no cost at
5 http://www.troll.no and http://www.kde.org respectively 5 http://www.troll.no and http://www.kde.org respectively
6 6
7 Copyright (c) 1997, 1998, 1999 7 Copyright (c) 1997, 1998, 1999
8 Preston Brown (preton.brown@yale.edu) 8 Preston Brown (preton.brown@yale.edu)
9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) 9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
10 Ian Dawes (iadawes@globalserve.net) 10 Ian Dawes (iadawes@globalserve.net)
11 Laszlo Boloni (boloni@cs.purdue.edu) 11 Laszlo Boloni (boloni@cs.purdue.edu)
12 12
13 Copyright (c) 2000, 2001, 2002 13 Copyright (c) 2000, 2001, 2002
14 Cornelius Schumacher <schumacher@kde.org> 14 Cornelius Schumacher <schumacher@kde.org>
15 15
16 This program is free software; you can redistribute it and/or modify 16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by 17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2 of the License, or 18 the Free Software Foundation; either version 2 of the License, or
19 (at your option) any later version. 19 (at your option) any later version.
20 20
21 This program is distributed in the hope that it will be useful, 21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <qbuttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <qprogressbar.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <qwidgetstack.h>
44#include <qptrlist.h> 44#include <qptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51#endif 51#endif
52 52
53#include <kglobal.h> 53#include <kglobal.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57#include <kmessagebox.h> 57#include <kmessagebox.h>
58#include <knotifyclient.h> 58#include <knotifyclient.h>
59#include <kconfig.h> 59#include <kconfig.h>
60 60
61#include <libkdepim/ksyncprefsdialog.h> 61#include <libkdepim/ksyncprefsdialog.h>
62#include <krun.h> 62#include <krun.h>
63#include <kdirwatch.h> 63#include <kdirwatch.h>
64#include <libkdepim/kdatepicker.h> 64#include <libkdepim/kdatepicker.h>
65#include <libkdepim/ksyncprofile.h> 65#include <libkdepim/ksyncprofile.h>
66#include <libkdepim/kpimglobalprefs.h> 66#include <libkdepim/kpimglobalprefs.h>
67 67
68#include <libkcal/vcaldrag.h> 68#include <libkcal/vcaldrag.h>
69#include <libkcal/icaldrag.h> 69#include <libkcal/icaldrag.h>
70#include <libkcal/icalformat.h> 70#include <libkcal/icalformat.h>
71#include <libkcal/vcalformat.h> 71#include <libkcal/vcalformat.h>
72#include <libkcal/scheduler.h> 72#include <libkcal/scheduler.h>
73#include <libkcal/calendarlocal.h> 73#include <libkcal/calendarlocal.h>
74#include <libkcal/journal.h> 74#include <libkcal/journal.h>
75#include <libkcal/calfilter.h> 75#include <libkcal/calfilter.h>
76#include <libkcal/attendee.h> 76#include <libkcal/attendee.h>
77#include <libkcal/dndfactory.h> 77#include <libkcal/dndfactory.h>
78#include <libkcal/freebusy.h> 78#include <libkcal/freebusy.h>
79#include <libkcal/filestorage.h> 79#include <libkcal/filestorage.h>
80#include <libkcal/calendarresources.h> 80#include <libkcal/calendarresources.h>
81#include <libkcal/qtopiaformat.h> 81#include <libkcal/qtopiaformat.h>
82#include "../kalarmd/alarmdialog.h" 82#include "../kalarmd/alarmdialog.h"
83 83
84#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
85#include <libkcal/sharpformat.h> 85#include <libkcal/sharpformat.h>
86#include <externalapphandler.h> 86#include <externalapphandler.h>
87#endif 87#endif
88#include <libkcal/phoneformat.h> 88#include <libkcal/phoneformat.h>
89#ifndef KORG_NOMAIL 89#ifndef KORG_NOMAIL
90#include "komailclient.h" 90#include "komailclient.h"
91#endif 91#endif
92#ifndef KORG_NOPRINTER 92#ifndef KORG_NOPRINTER
93#include "calprinter.h" 93#include "calprinter.h"
94#endif 94#endif
95#ifndef KORG_NOPLUGINS 95#ifndef KORG_NOPLUGINS
96#include "kocore.h" 96#include "kocore.h"
97#endif 97#endif
98#include "koeventeditor.h" 98#include "koeventeditor.h"
99#include "kotodoeditor.h" 99#include "kotodoeditor.h"
100#include "koprefs.h" 100#include "koprefs.h"
101#include "koeventviewerdialog.h" 101#include "koeventviewerdialog.h"
102#include "publishdialog.h" 102#include "publishdialog.h"
103#include "kofilterview.h" 103#include "kofilterview.h"
104#include "koglobals.h" 104#include "koglobals.h"
105#include "koviewmanager.h" 105#include "koviewmanager.h"
106#include "koagendaview.h" 106#include "koagendaview.h"
107#include "kodialogmanager.h" 107#include "kodialogmanager.h"
108#include "outgoingdialog.h" 108#include "outgoingdialog.h"
109#include "incomingdialog.h" 109#include "incomingdialog.h"
110#include "datenavigatorcontainer.h" 110#include "datenavigatorcontainer.h"
111#include "statusdialog.h" 111#include "statusdialog.h"
112#include "kdatenavigator.h" 112#include "kdatenavigator.h"
113#include "kotodoview.h" 113#include "kotodoview.h"
114#include "datenavigator.h" 114#include "datenavigator.h"
115#include "resourceview.h" 115#include "resourceview.h"
116#include "navigatorbar.h" 116#include "navigatorbar.h"
117#include "searchdialog.h" 117#include "searchdialog.h"
118#include "mainwindow.h" 118#include "mainwindow.h"
119#include "categoryeditdialog.h" 119#include "categoryeditdialog.h"
120 120
121#include "calendarview.h" 121#include "calendarview.h"
122#ifndef DESKTOP_VERSION 122#ifndef DESKTOP_VERSION
123#include <qtopia/alarmserver.h> 123#include <qtopia/alarmserver.h>
124#endif 124#endif
125#ifndef _WIN32_ 125#ifndef _WIN32_
126#include <stdlib.h> 126#include <stdlib.h>
127#include <stdio.h> 127#include <stdio.h>
128#include <unistd.h> 128#include <unistd.h>
129#else 129#else
130#include <qprocess.h> 130#include <qprocess.h>
131#endif 131#endif
132 132
133#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
134#include <kabc/stdaddressbook.h> 134#include <kabc/stdaddressbook.h>
135#endif 135#endif
136using namespace KOrg; 136using namespace KOrg;
137using namespace KCal; 137using namespace KCal;
138extern int globalFlagBlockAgenda; 138extern int globalFlagBlockAgenda;
139extern int globalFlagBlockStartup; 139extern int globalFlagBlockStartup;
140 140
141 141
142MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) 142MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
143 143
144{ 144{
145 mAlarms = alarms; 145 mAlarms = alarms;
146 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); 146 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
147 QString mText = "<table width=\"100%\">\n"; 147 QString mText = "<table width=\"100%\">\n";
148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
149#ifdef DESKTOP_VERSION 149#ifdef DESKTOP_VERSION
150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
151#else 151#else
152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>"; 152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
153#endif 153#endif
154 // mText += "<img src=\""; 154 // mText += "<img src=\"";
155 // mText += ipath; 155 // mText += ipath;
156 // mText += "\">"; 156 // mText += "\">";
157 //mEventDate = QDate::currentDate(); 157 //mEventDate = QDate::currentDate();
158#ifdef DESKTOP_VERSION 158#ifdef DESKTOP_VERSION
159 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>"; 159 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
160#else 160#else
161 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>"; 161 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
162#endif 162#endif
163 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 163 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
164 164
165 Incidence * inc = getNextInc( start ); 165 Incidence * inc = getNextInc( start );
166 int time = 0; 166 int time = 0;
167 //mText += "<table>"; 167 //mText += "<table>";
168 while ( inc ) { 168 while ( inc ) {
169 QDateTime dt ; 169 QDateTime dt ;
170 QString tempText = "<a "; 170 QString tempText = "<a ";
171 bool ok; 171 bool ok;
172 dt = inc->getNextOccurence( start, &ok ); 172 dt = inc->getNextOccurence( start, &ok );
173 if ( !ok ) continue; 173 if ( !ok ) continue;
174 if ( inc->typeID() == eventID ) { 174 if ( inc->typeID() == eventID ) {
175 tempText += "href=\"event:"; 175 tempText += "href=\"event:";
176 } else if ( inc->typeID() == todoID ) { 176 } else if ( inc->typeID() == todoID ) {
177 tempText += "href=\"todo:"; 177 tempText += "href=\"todo:";
178 } 178 }
179 tempText += inc->uid() + "\">"; 179 tempText += inc->uid() + "\">";
180 if ( inc->typeID() == todoID ) 180 if ( inc->typeID() == todoID )
181 tempText += i18n("Todo: "); 181 tempText += i18n("Todo: ");
182 if ( inc->summary().length() > 0 ) 182 if ( inc->summary().length() > 0 )
183 tempText += inc->summary(); 183 tempText += inc->summary();
184 else 184 else
185 tempText += i18n("-no summary-"); 185 tempText += i18n("-no summary-");
186 QString timestr; 186 QString timestr;
187 if (!inc->doesFloat()) 187 if (!inc->doesFloat())
188 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; 188 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
189 else 189 else
190 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 190 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
191 if ( dt.date() < QDate::currentDate() && time == 0 ) { 191 if ( dt.date() < QDate::currentDate() && time == 0 ) {
192 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 192 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
193 mText += "<table>"; 193 mText += "<table>";
194 time = 1; 194 time = 1;
195 } 195 }
196 if ( dt.date() == QDate::currentDate() && time <= 1 ) { 196 if ( dt.date() == QDate::currentDate() && time <= 1 ) {
197 if ( time > 0 ) 197 if ( time > 0 )
198 mText +="</table>"; 198 mText +="</table>";
199 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; 199 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
200 mText += "<table>"; 200 mText += "<table>";
201 time = 2; 201 time = 2;
202 202
203 } 203 }
204 if ( dt.date() > QDate::currentDate() && time <= 2 ) { 204 if ( dt.date() > QDate::currentDate() && time <= 2 ) {
205 if ( time > 0 ) 205 if ( time > 0 )
206 mText +="</table>"; 206 mText +="</table>";
207 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; 207 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
208 mText += "<table>"; 208 mText += "<table>";
209 time = 3; 209 time = 3;
210 } 210 }
211 mText +="<tr><td><b>"; 211 mText +="<tr><td><b>";
212 mText += timestr; 212 mText += timestr;
213 mText += "</b></td><td>"; 213 mText += "</b></td><td>";
214 mText += tempText; 214 mText += tempText;
215 mText += "</td></tr>\n"; 215 mText += "</td></tr>\n";
216 inc = getNextInc( start ); 216 inc = getNextInc( start );
217 } 217 }
218 mText +="</table>"; 218 mText +="</table>";
219 setText( mText ); 219 setText( mText );
220} 220}
221 221
222MissedAlarmTextBrowser::~MissedAlarmTextBrowser() 222MissedAlarmTextBrowser::~MissedAlarmTextBrowser()
223{ 223{
224 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() "); 224 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() ");
225} 225}
226Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) 226Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
227{ 227{
228 QDateTime dt ; 228 QDateTime dt ;
229 Incidence * retInc; 229 Incidence * retInc;
230 Incidence * inc = mAlarms.first(); 230 Incidence * inc = mAlarms.first();
231 if ( inc == 0 ) 231 if ( inc == 0 )
232 return 0; 232 return 0;
233 bool ok; 233 bool ok;
234 dt = inc->getNextOccurence( start, &ok ); 234 dt = inc->getNextOccurence( start, &ok );
235 if ( ! ok ) return 0; 235 if ( ! ok ) return 0;
236 QDateTime dtn ; 236 QDateTime dtn ;
237 retInc = inc; 237 retInc = inc;
238 inc = mAlarms.next(); 238 inc = mAlarms.next();
239 while ( inc ) { 239 while ( inc ) {
240 dtn = inc->getNextOccurence( start, &ok ); 240 dtn = inc->getNextOccurence( start, &ok );
241 if ( ! ok ) return 0; 241 if ( ! ok ) return 0;
242 if ( dtn < dt ) { 242 if ( dtn < dt ) {
243 dt = dtn; 243 dt = dtn;
244 retInc = inc; 244 retInc = inc;
245 } 245 }
246 inc = mAlarms.next(); 246 inc = mAlarms.next();
247 } 247 }
248 mAlarms.remove( retInc ); 248 mAlarms.remove( retInc );
249 return retInc; 249 return retInc;
250 250
251} 251}
252void MissedAlarmTextBrowser::setSource(const QString & n) 252void MissedAlarmTextBrowser::setSource(const QString & n)
253{ 253{
254 if (n.startsWith("event:")) { 254 if (n.startsWith("event:")) {
255#ifdef DESKTOP_VERSION 255#ifdef DESKTOP_VERSION
256 emit showIncidence(n.mid(8)); 256 emit showIncidence(n.mid(8));
257#else 257#else
258 emit showIncidence(n.mid(6)); 258 emit showIncidence(n.mid(6));
259#endif 259#endif
260 return; 260 return;
261 } else if (n.startsWith("todo:")) { 261 } else if (n.startsWith("todo:")) {
262#ifdef DESKTOP_VERSION 262#ifdef DESKTOP_VERSION
263 emit showIncidence(n.mid(7)); 263 emit showIncidence(n.mid(7));
264#else 264#else
265 emit showIncidence(n.mid(5)); 265 emit showIncidence(n.mid(5));
266#endif 266#endif
267 return; 267 return;
268 } 268 }
269} 269}
270 270
271 271
272class KOBeamPrefs : public QDialog 272class KOBeamPrefs : public QDialog
273{ 273{
274 public: 274 public:
275 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 275 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
276 QDialog( parent, name, true ) 276 QDialog( parent, name, true )
277 { 277 {
278 setCaption( i18n("Beam Options") ); 278 setCaption( i18n("Beam Options") );
279 QVBoxLayout* lay = new QVBoxLayout( this ); 279 QVBoxLayout* lay = new QVBoxLayout( this );
280 lay->setSpacing( 3 ); 280 lay->setSpacing( 3 );
281 lay->setMargin( 3 ); 281 lay->setMargin( 3 );
282 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 282 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
283 lay->addWidget( format ); 283 lay->addWidget( format );
284 format->setExclusive ( true ) ; 284 format->setExclusive ( true ) ;
285 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 285 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
286 lay->addWidget( time ); time->setExclusive ( true ) ; 286 lay->addWidget( time ); time->setExclusive ( true ) ;
287 vcal = new QRadioButton(" vCalendar ", format ); 287 vcal = new QRadioButton(" vCalendar ", format );
288 ical = new QRadioButton(" iCalendar ", format ); 288 ical = new QRadioButton(" iCalendar ", format );
289 vcal->setChecked( true ); 289 vcal->setChecked( true );
290 tz = new QRadioButton(i18n(" With timezone "), time ); 290 tz = new QRadioButton(i18n(" With timezone "), time );
291 local = new QRadioButton(i18n(" Local time "), time ); 291 local = new QRadioButton(i18n(" Local time "), time );
292 tz->setChecked( true ); 292 tz->setChecked( true );
293 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 293 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
294 lay->addWidget( ok ); 294 lay->addWidget( ok );
295 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 295 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
296 lay->addWidget( cancel ); 296 lay->addWidget( cancel );
297 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 297 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
298 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 298 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
299 resize( 200, 200 ); 299 resize( 200, 200 );
300 } 300 }
301 301
302 bool beamVcal() { return vcal->isChecked(); } 302 bool beamVcal() { return vcal->isChecked(); }
303 bool beamLocal() { return local->isChecked(); } 303 bool beamLocal() { return local->isChecked(); }
304private: 304private:
305 QRadioButton* vcal, *ical, *local, *tz; 305 QRadioButton* vcal, *ical, *local, *tz;
306}; 306};
307class KOCatPrefs : public QDialog 307class KOCatPrefs : public QDialog
308{ 308{
309 public: 309 public:
310 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 310 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
311 QDialog( parent, name, true ) 311 QDialog( parent, name, true )
312 { 312 {
313 setCaption( i18n("Manage new Categories") ); 313 setCaption( i18n("Manage new Categories") );
314 QVBoxLayout* lay = new QVBoxLayout( this ); 314 QVBoxLayout* lay = new QVBoxLayout( this );
315 lay->setSpacing( 3 ); 315 lay->setSpacing( 3 );
316 lay->setMargin( 3 ); 316 lay->setMargin( 3 );
317 QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this ); 317 QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this );
318 lay->addWidget( lab ); 318 lay->addWidget( lab );
319 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 319 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
320 lay->addWidget( format ); 320 lay->addWidget( format );
321 format->setExclusive ( true ) ; 321 format->setExclusive ( true ) ;
322 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 322 addCatBut = new QRadioButton(i18n("Add to category list"), format );
323 new QRadioButton(i18n("Remove from Events/Todos"), format ); 323 new QRadioButton(i18n("Remove from Events/Todos"), format );
324 addCatBut->setChecked( true ); 324 addCatBut->setChecked( true );
325 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); 325 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
326 lay->addWidget( ok ); 326 lay->addWidget( ok );
327 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 327 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
328 lay->addWidget( cancel ); 328 lay->addWidget( cancel );
329 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 329 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
330 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 330 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
331 resize( 200, 200 ); 331 resize( 200, 200 );
332 } 332 }
333 333
334 bool addCat() { return addCatBut->isChecked(); } 334 bool addCat() { return addCatBut->isChecked(); }
335private: 335private:
336 QRadioButton* addCatBut; 336 QRadioButton* addCatBut;
337}; 337};
338 338
339 339
340 340
341CalendarView::CalendarView( CalendarResources *calendar, 341CalendarView::CalendarView( CalendarResources *calendar,
342 QWidget *parent, const char *name ) 342 QWidget *parent, const char *name )
343 : CalendarViewBase( parent, name ), 343 : CalendarViewBase( parent, name ),
344 mCalendar( calendar ), 344 mCalendar( calendar ),
345 mResourceManager( calendar->resourceManager() ) 345 mResourceManager( calendar->resourceManager() )
346{ 346{
347 347
348 mEventEditor = 0; 348 mEventEditor = 0;
349 mTodoEditor = 0; 349 mTodoEditor = 0;
350 350
351 init(); 351 init();
352} 352}
353 353
354CalendarView::CalendarView( Calendar *calendar, 354CalendarView::CalendarView( Calendar *calendar,
355 QWidget *parent, const char *name ) 355 QWidget *parent, const char *name )
356 : CalendarViewBase( parent, name ), 356 : CalendarViewBase( parent, name ),
357 mCalendar( calendar ), 357 mCalendar( calendar ),
358 mResourceManager( 0 ) 358 mResourceManager( 0 )
359{ 359{
360 360
361 mEventEditor = 0; 361 mEventEditor = 0;
362 mTodoEditor = 0; 362 mTodoEditor = 0;
363 init(); 363 init();
364} 364}
365 365
366void CalendarView::init() 366void CalendarView::init()
367{ 367{
368 mNextAlarmDateTime = QDateTime::currentDateTime(); 368 mNextAlarmDateTime = QDateTime::currentDateTime();
369 setFocusPolicy ( NoFocus ); 369 setFocusPolicy ( NoFocus );
370 mViewerCallerIsSearchDialog = false; 370 mViewerCallerIsSearchDialog = false;
371 mBlockShowDates = false; 371 mBlockShowDates = false;
372 372
373 mDatePickerMode = 0; 373 mDatePickerMode = 0;
374 mCurrentSyncDevice = ""; 374 mCurrentSyncDevice = "";
375 mViewManager = new KOViewManager( this ); 375 mViewManager = new KOViewManager( this );
376 mDialogManager = new KODialogManager( this ); 376 mDialogManager = new KODialogManager( this );
377 mEventViewerDialog = 0; 377 mEventViewerDialog = 0;
378 mModified = false; 378 mModified = false;
379 mReadOnly = false; 379 mReadOnly = false;
380 mSelectedIncidence = 0; 380 mSelectedIncidence = 0;
381 mCalPrinter = 0; 381 mCalPrinter = 0;
382 mFilters.setAutoDelete(true); 382 mFilters.setAutoDelete(true);
383 383
384 mCalendar->registerObserver( this ); 384 mCalendar->registerObserver( this );
385 // TODO: Make sure that view is updated, when calendar is changed. 385 // TODO: Make sure that view is updated, when calendar is changed.
386 386
387 mStorage = new FileStorage( mCalendar ); 387 mStorage = new FileStorage( mCalendar );
388 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 388 mNavigator = new DateNavigator( this, "datevav", mViewManager );
389 389
390 QBoxLayout *topLayout = (QBoxLayout*)layout(); 390 QBoxLayout *topLayout = (QBoxLayout*)layout();
391#ifndef KORG_NOSPLITTER 391#ifndef KORG_NOSPLITTER
392 // create the main layout frames. 392 // create the main layout frames.
393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
394 topLayout->addWidget(mPanner); 394 topLayout->addWidget(mPanner);
395 395
396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
397 "CalendarView::LeftFrame"); 397 "CalendarView::LeftFrame");
398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
399 399
400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
401 "CalendarView::DateNavigator" ); 401 "CalendarView::DateNavigator" );
402 402
403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
405 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
407 407
408#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
409 mResourceView = 0; 409 mResourceView = 0;
410#else 410#else
411 if ( mResourceManager ) { 411 if ( mResourceManager ) {
412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
413 mResourceView->updateView(); 413 mResourceView->updateView();
414 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
415 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
416 } else { 416 } else {
417 mResourceView = 0; 417 mResourceView = 0;
418 } 418 }
419#endif 419#endif
420 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
422 422
423 mRightFrame = new QWidgetStack( rightBox ); 423 mRightFrame = new QWidgetStack( rightBox );
424 rightLayout->addWidget( mRightFrame, 1 ); 424 rightLayout->addWidget( mRightFrame, 1 );
425 425
426 mLeftFrame = mLeftSplitter; 426 mLeftFrame = mLeftSplitter;
427#else 427#else
428 //QWidget *mainBox = new QWidget( this ); 428 //QWidget *mainBox = new QWidget( this );
429 //QWidget *leftFrame = new QWidget( mainBox ); 429 //QWidget *leftFrame = new QWidget( mainBox );
430 //QBoxLayout * mainBoxLayout; 430 //QBoxLayout * mainBoxLayout;
431 if ( KOPrefs::instance()->mVerticalScreen ) { 431 if ( KOPrefs::instance()->mVerticalScreen ) {
432 //mainBoxLayout = new QVBoxLayout(mainBox); 432 //mainBoxLayout = new QVBoxLayout(mainBox);
433 //leftFrameLayout = new QHBoxLayout(leftFrame ); 433 //leftFrameLayout = new QHBoxLayout(leftFrame );
434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
438 } else { 438 } else {
439 //mainBoxLayout = new QHBoxLayout(mainBox); 439 //mainBoxLayout = new QHBoxLayout(mainBox);
440 //leftFrameLayout = new QVBoxLayout(leftFrame ); 440 //leftFrameLayout = new QVBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449#ifdef DESKTOP_VERSION 449#ifdef DESKTOP_VERSION
450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); 450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
451 topLayout->addWidget( mDateScrollBar ); 451 topLayout->addWidget( mDateScrollBar );
452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
453 if ( QApplication::desktop()->width() < 800 ) 453 if ( QApplication::desktop()->width() < 800 )
454 mDateScrollBar->hide(); 454 mDateScrollBar->hide();
455#endif 455#endif
456 //mainBoxLayout->addWidget (mLeftFrame); 456 //mainBoxLayout->addWidget (mLeftFrame);
457 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 457 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
458 "CalendarView::DateNavigator" ); 458 "CalendarView::DateNavigator" );
459#if 0 459#if 0
460 // FIXME 460 // FIXME
461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
462 "CalendarView::DateNavigator", QDate::currentDate()); 462 "CalendarView::DateNavigator", QDate::currentDate());
463#endif 463#endif
464 // mDateNavigator->blockSignals( true ); 464 // mDateNavigator->blockSignals( true );
465 //leftFrameLayout->addWidget( mDateNavigator ); 465 //leftFrameLayout->addWidget( mDateNavigator );
466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) );
472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
479 479
480 mTodoList->setNavigator( mNavigator ); 480 mTodoList->setNavigator( mNavigator );
481#if 0 481#if 0
482 if ( QApplication::desktop()->width() < 480 ) { 482 if ( QApplication::desktop()->width() < 480 ) {
483 leftFrameLayout->addWidget(mFilterView); 483 leftFrameLayout->addWidget(mFilterView);
484 leftFrameLayout->addWidget(mTodoList, 2 ); 484 leftFrameLayout->addWidget(mTodoList, 2 );
485 485
486 } else { 486 } else {
487 leftFrameLayout->addWidget(mTodoList,2 ); 487 leftFrameLayout->addWidget(mTodoList,2 );
488 leftFrameLayout->addWidget(mFilterView ); 488 leftFrameLayout->addWidget(mFilterView );
489 } 489 }
490#endif 490#endif
491 mFilterView->hide(); 491 mFilterView->hide();
492 mCalEditView->hide(); 492 mCalEditView->hide();
493 QWidget *rightBox = new QWidget( mMainFrame ); 493 QWidget *rightBox = new QWidget( mMainFrame );
494 //mainBoxLayout->addWidget ( rightBox, 10 ); 494 //mainBoxLayout->addWidget ( rightBox, 10 );
495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
496 mRightFrame = new QWidgetStack( rightBox ); 496 mRightFrame = new QWidgetStack( rightBox );
497 rightLayout->addWidget( mRightFrame, 10 ); 497 rightLayout->addWidget( mRightFrame, 10 );
498 498
499 //mLeftFrame = (QWidget *)leftFrame; 499 //mLeftFrame = (QWidget *)leftFrame;
500 if ( KOPrefs::instance()->mVerticalScreen ) { 500 if ( KOPrefs::instance()->mVerticalScreen ) {
501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
505 } else { 505 } else {
506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
509 } 509 }
510 if ( !KOPrefs::instance()->mShowDateNavigator) 510 if ( !KOPrefs::instance()->mShowDateNavigator)
511 mDateNavigator->hide(); 511 mDateNavigator->hide();
512 //qDebug("Calendarview Size %d %d ", width(), height()); 512 //qDebug("Calendarview Size %d %d ", width(), height());
513#endif 513#endif
514 514
515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
516 SLOT( showDates( const KCal::DateList & ) ) ); 516 SLOT( showDates( const KCal::DateList & ) ) );
517 517
518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
520 520
521 521
522 522
523 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 523 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
524 mViewManager, SLOT( showMonth( const QDate & ) ) ); 524 mViewManager, SLOT( showMonth( const QDate & ) ) );
525 525
526 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 526 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
527 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 527 mNavigator, SLOT( selectWeek( const QDate & ) ) );
528 528
529 connect( mDateNavigator, SIGNAL( goPrevYear() ), 529 connect( mDateNavigator, SIGNAL( goPrevYear() ),
530 mNavigator, SLOT( selectPreviousYear() ) ); 530 mNavigator, SLOT( selectPreviousYear() ) );
531 connect( mDateNavigator, SIGNAL( goNextYear() ), 531 connect( mDateNavigator, SIGNAL( goNextYear() ),
532 mNavigator, SLOT( selectNextYear() ) ); 532 mNavigator, SLOT( selectNextYear() ) );
533 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 533 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
534 mNavigator, SLOT( selectPreviousMonth() ) ); 534 mNavigator, SLOT( selectPreviousMonth() ) );
535 connect( mDateNavigator, SIGNAL( goNextMonth() ), 535 connect( mDateNavigator, SIGNAL( goNextMonth() ),
536 mNavigator, SLOT( selectNextMonth() ) ); 536 mNavigator, SLOT( selectNextMonth() ) );
537 537
538 connect( mDateNavigator, SIGNAL( goPrevious() ), 538 connect( mDateNavigator, SIGNAL( goPrevious() ),
539 mNavigator, SLOT( selectPrevious() ) ); 539 mNavigator, SLOT( selectPrevious() ) );
540 connect( mDateNavigator, SIGNAL( goNext() ), 540 connect( mDateNavigator, SIGNAL( goNext() ),
541 mNavigator, SLOT( selectNext() ) ); 541 mNavigator, SLOT( selectNext() ) );
542 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 542 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
543 mNavigator, SLOT( slotMonthSelect( int ) ) ); 543 mNavigator, SLOT( slotMonthSelect( int ) ) );
544 544
545 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 545 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
546 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 546 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
547#if 0 547#if 0
548 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 548 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
549 SLOT( incidenceAdded( Incidence *) ) ); 549 SLOT( incidenceAdded( Incidence *) ) );
550#endif 550#endif
551 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 551 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
552 552
553 connect( this, SIGNAL( configChanged() ), 553 connect( this, SIGNAL( configChanged() ),
554 mDateNavigator, SLOT( updateConfig() ) ); 554 mDateNavigator, SLOT( updateConfig() ) );
555 555
556 connect( mTodoList, SIGNAL( newTodoSignal() ), 556 connect( mTodoList, SIGNAL( newTodoSignal() ),
557 SLOT( newTodo() ) ); 557 SLOT( newTodo() ) );
558 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 558 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
559 SLOT( newSubTodo( Todo * ) ) ); 559 SLOT( newSubTodo( Todo * ) ) );
560 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 560 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
561 SLOT( editTodo( Todo * ) ) ); 561 SLOT( editTodo( Todo * ) ) );
562 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 562 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
563 SLOT( showTodo( Todo *) ) ); 563 SLOT( showTodo( Todo *) ) );
564 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 564 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
565 SLOT( deleteTodo( Todo *) ) ); 565 SLOT( deleteTodo( Todo *) ) );
566 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 566 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
567 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 567 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
568 SLOT( purgeCompleted() ) ); 568 SLOT( purgeCompleted() ) );
569 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 569 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
570 SIGNAL( todoModified( Todo *, int ) ) ); 570 SIGNAL( todoModified( Todo *, int ) ) );
571 571
572 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 572 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
573 this, SLOT ( cloneIncidence( Incidence * ) ) ); 573 this, SLOT ( cloneIncidence( Incidence * ) ) );
574 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 574 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
575 this, SLOT (cancelIncidence( Incidence * ) ) ); 575 this, SLOT (cancelIncidence( Incidence * ) ) );
576 576
577 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 577 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
578 this, SLOT ( moveIncidence( Incidence * ) ) ); 578 this, SLOT ( moveIncidence( Incidence * ) ) );
579 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 579 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
580 this, SLOT ( beamIncidence( Incidence * ) ) ); 580 this, SLOT ( beamIncidence( Incidence * ) ) );
581 581
582 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 582 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
583 this, SLOT ( todo_unsub( Todo * ) ) ); 583 this, SLOT ( todo_unsub( Todo * ) ) );
584 584
585 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 585 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
586 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 586 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
587 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 587 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
588 SLOT( updateTodo( Todo *, int ) ) ); 588 SLOT( updateTodo( Todo *, int ) ) );
589 connect( this, SIGNAL( todoModified( Todo *, int )), this, 589 connect( this, SIGNAL( todoModified( Todo *, int )), this,
590 SLOT( changeTodoDisplay( Todo *, int ) ) ); 590 SLOT( changeTodoDisplay( Todo *, int ) ) );
591 591
592 592
593 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 593 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
594 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 594 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
595 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 595 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
596 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 596 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
597 597
598 598
599 599
600 600
601 601
602 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 602 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
603 SLOT(checkClipboard())); 603 SLOT(checkClipboard()));
604 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 604 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
605 SLOT( processTodoListSelection( Incidence * ) ) ); 605 SLOT( processTodoListSelection( Incidence * ) ) );
606 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 606 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
607 607
608 // kdDebug() << "CalendarView::CalendarView() done" << endl; 608 // kdDebug() << "CalendarView::CalendarView() done" << endl;
609 609
610 mDateFrame = new QVBox(0,0,WType_Popup); 610 mDateFrame = new QVBox(0,0,WType_Popup);
611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
613 mDateFrame->setLineWidth(3); 613 mDateFrame->setLineWidth(3);
614 mDateFrame->hide(); 614 mDateFrame->hide();
615 mDateFrame->setCaption( i18n( "Pick a date to display")); 615 mDateFrame->setCaption( i18n( "Pick a date to display"));
616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
617 617
618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
619 619
620 mEventEditor = mDialogManager->getEventEditor(); 620 mEventEditor = mDialogManager->getEventEditor();
621 mTodoEditor = mDialogManager->getTodoEditor(); 621 mTodoEditor = mDialogManager->getTodoEditor();
622 622
623 mFlagEditDescription = false; 623 mFlagEditDescription = false;
624 624
625 mSuspendTimer = new QTimer( this ); 625 mSuspendTimer = new QTimer( this );
626 mAlarmTimer = new QTimer( this ); 626 mAlarmTimer = new QTimer( this );
627 mRecheckAlarmTimer = new QTimer( this ); 627 mRecheckAlarmTimer = new QTimer( this );
628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
631 mAlarmDialog = new AlarmDialog( this ); 631 mAlarmDialog = new AlarmDialog( this );
632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
633 mAlarmDialog->setServerNotification( false ); 633 mAlarmDialog->setServerNotification( false );
634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
635 635
636 636
637#ifndef DESKTOP_VERSION 637#ifndef DESKTOP_VERSION
638//US listen for arriving address resultsets 638//US listen for arriving address resultsets
639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
641#endif 641#endif
642 mDateNavigator->setCalendar( mCalendar ); 642 mDateNavigator->setCalendar( mCalendar );
643} 643}
644 644
645 645
646CalendarView::~CalendarView() 646CalendarView::~CalendarView()
647{ 647{
648 // kdDebug() << "~CalendarView()" << endl; 648 // kdDebug() << "~CalendarView()" << endl;
649 //qDebug("CalendarView::~CalendarView() "); 649 //qDebug("CalendarView::~CalendarView() ");
650 delete mDialogManager; 650 delete mDialogManager;
651 delete mViewManager; 651 delete mViewManager;
652 delete mStorage; 652 delete mStorage;
653 delete mDateFrame ; 653 delete mDateFrame ;
654 delete mEventViewerDialog; 654 delete mEventViewerDialog;
655 //kdDebug() << "~CalendarView() done" << endl; 655 //kdDebug() << "~CalendarView() done" << endl;
656} 656}
657void CalendarView::setScrollBarStep(int val ) 657void CalendarView::setScrollBarStep(int val )
658{ 658{
659#ifdef DESKTOP_VERSION 659#ifdef DESKTOP_VERSION
660 mDateScrollBar->setLineStep ( val ); 660 mDateScrollBar->setLineStep ( val );
661#endif 661#endif
662} 662}
663void CalendarView::scrollBarValue(int val ) 663void CalendarView::scrollBarValue(int val )
664{ 664{
665#ifdef DESKTOP_VERSION 665#ifdef DESKTOP_VERSION
666 if ( QApplication::desktop()->width() < 800 ) return; 666 if ( QApplication::desktop()->width() < 800 ) return;
667 static bool block = false; 667 static bool block = false;
668 if ( block ) return; 668 if ( block ) return;
669 block = true; 669 block = true;
670 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 670 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
671 //qDebug("VAL %d ",val ); 671 //qDebug("VAL %d ",val );
672 int count = mNavigator->selectedDates().count(); 672 int count = mNavigator->selectedDates().count();
673 int year = mNavigator->selectedDates().first().year(); 673 int year = mNavigator->selectedDates().first().year();
674 int day = mNavigator->selectedDates().first().dayOfYear(); 674 int day = mNavigator->selectedDates().first().dayOfYear();
675 if ( val == day -1 ) { 675 if ( val == day -1 ) {
676 block = false; 676 block = false;
677 return; 677 return;
678 } 678 }
679 QDate d ( year,1,1 ); 679 QDate d ( year,1,1 );
680 mNavigator->selectDates( d.addDays( val ), count ); 680 mNavigator->selectDates( d.addDays( val ), count );
681 block = false; 681 block = false;
682#endif 682#endif
683 683
684} 684}
685void CalendarView::checkFiles() 685void CalendarView::checkFiles()
686{ 686{
687 QString message; 687 QString message;
688 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 688 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
689 KopiCalendarFile * cal = calendars.first(); 689 KopiCalendarFile * cal = calendars.first();
690 while ( cal ) { 690 while ( cal ) {
691 if ( cal->mErrorOnLoad ) { 691 if ( cal->mErrorOnLoad ) {
692 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 692 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
693 } 693 }
694 cal = calendars.next(); 694 cal = calendars.next();
695 } 695 }
696 if ( !message.isEmpty() ) { 696 if ( !message.isEmpty() ) {
697 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 697 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
698 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 698 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
699 } 699 }
700 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 700 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
701} 701}
702void CalendarView::checkAlarms() 702void CalendarView::checkAlarms()
703{ 703{
704 704
705 705
706 KConfig *config = KOGlobals::config(); 706 KConfig *config = KOGlobals::config();
707 config->setGroup( "AppRun" ); 707 config->setGroup( "AppRun" );
708 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 708 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
709 int daysto = dt.daysTo( QDate::currentDate() ); 709 int daysto = dt.daysTo( QDate::currentDate() );
710 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 710 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
711 dt = dt.addDays( days ); 711 dt = dt.addDays( days );
712 int secto = dt.secsTo( QDateTime::currentDateTime() ); 712 int secto = dt.secsTo( QDateTime::currentDateTime() );
713 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 713 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
714 //qDebug("KO: Reading program stop %d ", secs); 714 //qDebug("KO: Reading program stop %d ", secs);
715 //secs -= ( 3600 * 24*3 ); // debug only 715 //secs -= ( 3600 * 24*3 ); // debug only
716 QDateTime latest = dt.addSecs ( secs ); 716 QDateTime latest = dt.addSecs ( secs );
717 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 717 qDebug("KO: Last termination on %s ", latest.toString().latin1());
718 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 718 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
719 QPtrList<Incidence> el = mCalendar->rawIncidences(); 719 QPtrList<Incidence> el = mCalendar->rawIncidences();
720 QPtrList<Incidence> al; 720 QPtrList<Incidence> al;
721 Incidence* inL = el.first(); 721 Incidence* inL = el.first();
722 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 722 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
723 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 723 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
724 while ( inL ) { 724 while ( inL ) {
725 bool ok = false; 725 bool ok = false;
726 int offset = 0; 726 int offset = 0;
727 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 727 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
728 if ( ok ) { 728 if ( ok ) {
729 //qDebug("OK %s",next.toString().latin1()); 729 //qDebug("OK %s",next.toString().latin1());
730 if ( next < cur ) { 730 if ( next < cur ) {
731 al.append( inL ); 731 al.append( inL );
732 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 732 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
733 } 733 }
734 } 734 }
735 inL = el.next(); 735 inL = el.next();
736 } 736 }
737 if ( al.count() ) { 737 if ( al.count() ) {
738 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 738 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
739 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 739 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
740 QVBoxLayout* lay = new QVBoxLayout( dia ); 740 QVBoxLayout* lay = new QVBoxLayout( dia );
741 lay->setSpacing( 0 ); 741 lay->setSpacing( 0 );
742 lay->setMargin( 0 ); 742 lay->setMargin( 0 );
743 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 743 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
744 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 744 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
745 lay->addWidget( matb ); 745 lay->addWidget( matb );
746 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 746 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
747 int wid = 210; 747 int wid = 210;
748 int x = QApplication::desktop()->width() - wid - 7; 748 int x = QApplication::desktop()->width() - wid - 7;
749 int y = QApplication::desktop()->height() - wid - 70; 749 int y = QApplication::desktop()->height() - wid - 70;
750 dia->setGeometry ( x,y,wid,wid); 750 dia->setGeometry ( x,y,wid,wid);
751 } else { 751 } else {
752 int si = 220; 752 int si = 220;
753 if ( QApplication::desktop()->width() > 470 ) 753 if ( QApplication::desktop()->width() > 470 )
754 si = 400; 754 si = 400;
755 dia->resize(si,si/2); 755 dia->resize(si,si/2);
756 } 756 }
757 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 757 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
758 dia->show(); 758 dia->show();
759 759
760 } 760 }
761} 761}
762void CalendarView::showDay( QDate d ) 762void CalendarView::showDay( QDate d )
763{ 763{
764 dateNavigator()->blockSignals( true ); 764 dateNavigator()->blockSignals( true );
765 dateNavigator()->selectDate( d ); 765 dateNavigator()->selectDate( d );
766 dateNavigator()->blockSignals( false ); 766 dateNavigator()->blockSignals( false );
767 mViewManager->showDayView(); 767 mViewManager->showDayView();
768 //dateNavigator()->selectDate( d ); 768 //dateNavigator()->selectDate( d );
769} 769}
770void CalendarView::timerAlarm() 770void CalendarView::timerAlarm()
771{ 771{
772 //qDebug("CalendarView::timerAlarm() "); 772 //qDebug("CalendarView::timerAlarm() ");
773 computeAlarm(mAlarmNotification ); 773 computeAlarm(mAlarmNotification );
774} 774}
775 775
776void CalendarView::suspendAlarm() 776void CalendarView::suspendAlarm()
777{ 777{
778 //qDebug(" CalendarView::suspendAlarm() "); 778 //qDebug(" CalendarView::suspendAlarm() ");
779 computeAlarm(mSuspendAlarmNotification ); 779 computeAlarm(mSuspendAlarmNotification );
780 780
781} 781}
782 782
783void CalendarView::startAlarm( QString mess , QString filename) 783void CalendarView::startAlarm( QString mess , QString filename)
784{ 784{
785 785
786 topLevelWidget()->showNormal(); 786 topLevelWidget()->showNormal();
787 topLevelWidget()->setActiveWindow(); 787 topLevelWidget()->setActiveWindow();
788 topLevelWidget()->raise(); 788 topLevelWidget()->raise();
789 789
790 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 790 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
791 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); 791 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
792 792
793} 793}
794 794
795void CalendarView::checkNextTimerAlarm() 795void CalendarView::checkNextTimerAlarm()
796{ 796{
797 mCalendar->checkAlarmForIncidence( 0, true ); 797 mCalendar->checkAlarmForIncidence( 0, true );
798} 798}
799 799
800void CalendarView::computeAlarm( QString msg ) 800void CalendarView::computeAlarm( QString msg )
801{ 801{
802 802
803 QString mess = msg; 803 QString mess = msg;
804 QString mAlarmMessage = mess.mid( 9 ); 804 QString mAlarmMessage = mess.mid( 9 );
805 QString filename = MainWindow::resourcePath(); 805 QString filename = MainWindow::resourcePath();
806 filename += "koalarm.wav"; 806 filename += "koalarm.wav";
807 QString tempfilename; 807 QString tempfilename;
808 if ( mess.left( 13 ) == "suspend_alarm") { 808 if ( mess.left( 13 ) == "suspend_alarm") {
809 bool error = false; 809 bool error = false;
810 int len = mess.mid( 13 ).find("+++"); 810 int len = mess.mid( 13 ).find("+++");
811 if ( len < 2 ) 811 if ( len < 2 )
812 error = true; 812 error = true;
813 else { 813 else {
814 tempfilename = mess.mid( 13, len ); 814 tempfilename = mess.mid( 13, len );
815 if ( !QFile::exists( tempfilename ) ) 815 if ( !QFile::exists( tempfilename ) )
816 error = true; 816 error = true;
817 } 817 }
818 if ( ! error ) { 818 if ( ! error ) {
819 filename = tempfilename; 819 filename = tempfilename;
820 } 820 }
821 mAlarmMessage = mess.mid( 13+len+3 ); 821 mAlarmMessage = mess.mid( 13+len+3 );
822 //qDebug("suspend file %s ",tempfilename.latin1() ); 822 //qDebug("suspend file %s ",tempfilename.latin1() );
823 startAlarm( mAlarmMessage, filename); 823 startAlarm( mAlarmMessage, filename);
824 return; 824 return;
825 } 825 }
826 if ( mess.left( 11 ) == "timer_alarm") { 826 if ( mess.left( 11 ) == "timer_alarm") {
827 //mTimerTime = 0; 827 //mTimerTime = 0;
828 startAlarm( mess.mid( 11 ), filename ); 828 startAlarm( mess.mid( 11 ), filename );
829 return; 829 return;
830 } 830 }
831 if ( mess.left( 10 ) == "proc_alarm") { 831 if ( mess.left( 10 ) == "proc_alarm") {
832 bool error = false; 832 bool error = false;
833 int len = mess.mid( 10 ).find("+++"); 833 int len = mess.mid( 10 ).find("+++");
834 if ( len < 2 ) 834 if ( len < 2 )
835 error = true; 835 error = true;
836 else { 836 else {
837 tempfilename = mess.mid( 10, len ); 837 tempfilename = mess.mid( 10, len );
838 if ( !QFile::exists( tempfilename ) ) 838 if ( !QFile::exists( tempfilename ) )
839 error = true; 839 error = true;
840 } 840 }
841 if ( error ) { 841 if ( error ) {
842 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 842 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
843 mAlarmMessage += mess.mid( 10+len+3+9 ); 843 mAlarmMessage += mess.mid( 10+len+3+9 );
844 } else { 844 } else {
845 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 845 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
846 //qDebug("-----system command %s ",tempfilename.latin1() ); 846 //qDebug("-----system command %s ",tempfilename.latin1() );
847#ifndef _WIN32_ 847#ifndef _WIN32_
848 if ( vfork () == 0 ) { 848 if ( vfork () == 0 ) {
849 execl ( tempfilename.latin1(), 0 ); 849 execl ( tempfilename.latin1(), 0 );
850 return; 850 return;
851 } 851 }
852#else 852#else
853 QProcess* p = new QProcess(); 853 QProcess* p = new QProcess();
854 p->addArgument( tempfilename.latin1() ); 854 p->addArgument( tempfilename.latin1() );
855 p->start(); 855 p->start();
856 return; 856 return;
857#endif 857#endif
858 858
859 return; 859 return;
860 } 860 }
861 861
862 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 862 //qDebug("+++++++system command %s ",tempfilename.latin1() );
863 } 863 }
864 if ( mess.left( 11 ) == "audio_alarm") { 864 if ( mess.left( 11 ) == "audio_alarm") {
865 bool error = false; 865 bool error = false;
866 int len = mess.mid( 11 ).find("+++"); 866 int len = mess.mid( 11 ).find("+++");
867 if ( len < 2 ) 867 if ( len < 2 )
868 error = true; 868 error = true;
869 else { 869 else {
870 tempfilename = mess.mid( 11, len ); 870 tempfilename = mess.mid( 11, len );
871 if ( !QFile::exists( tempfilename ) ) 871 if ( !QFile::exists( tempfilename ) )
872 error = true; 872 error = true;
873 } 873 }
874 if ( ! error ) { 874 if ( ! error ) {
875 filename = tempfilename; 875 filename = tempfilename;
876 } 876 }
877 mAlarmMessage = mess.mid( 11+len+3+9 ); 877 mAlarmMessage = mess.mid( 11+len+3+9 );
878 //qDebug("audio file command %s ",tempfilename.latin1() ); 878 //qDebug("audio file command %s ",tempfilename.latin1() );
879 } 879 }
880 if ( mess.left( 9 ) == "cal_alarm") { 880 if ( mess.left( 9 ) == "cal_alarm") {
881 mAlarmMessage = mess.mid( 9 ) ; 881 mAlarmMessage = mess.mid( 9 ) ;
882 } 882 }
883 883
884 startAlarm( mAlarmMessage, filename ); 884 startAlarm( mAlarmMessage, filename );
885 885
886 886
887} 887}
888 888
889void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 889void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
890{ 890{
891 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 891 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
892 892
893 mSuspendAlarmNotification = noti; 893 mSuspendAlarmNotification = noti;
894 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 894 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
895 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 895 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
896 mSuspendTimer->start( ms , true ); 896 mSuspendTimer->start( ms , true );
897 897
898} 898}
899 899
900void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 900void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
901{ 901{
902 mNextAlarmDateTime = qdt; 902 mNextAlarmDateTime = qdt;
903 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 903 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
904 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 904 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
905#ifndef DESKTOP_VERSION 905#ifndef DESKTOP_VERSION
906 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 906 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
907#endif 907#endif
908 return; 908 return;
909 } 909 }
910 int maxSec; 910 int maxSec;
911 //maxSec = 5; //testing only 911 //maxSec = 5; //testing only
912 maxSec = 86400+3600; // one day+1hour 912 maxSec = 86400+3600; // one day+1hour
913 mAlarmNotification = noti; 913 mAlarmNotification = noti;
914 int sec = QDateTime::currentDateTime().secsTo( qdt ); 914 int sec = QDateTime::currentDateTime().secsTo( qdt );
915 if ( sec > maxSec ) { 915 if ( sec > maxSec ) {
916 mRecheckAlarmTimer->start( maxSec * 1000 ); 916 mRecheckAlarmTimer->start( maxSec * 1000 );
917 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 917 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
918 return; 918 return;
919 } else { 919 } else {
920 mRecheckAlarmTimer->stop(); 920 mRecheckAlarmTimer->stop();
921 } 921 }
922 //qDebug("Alarm timer started with secs: %d ", sec); 922 //qDebug("Alarm timer started with secs: %d ", sec);
923 mAlarmTimer->start( sec *1000 , true ); 923 mAlarmTimer->start( sec *1000 , true );
924 924
925} 925}
926// called by mRecheckAlarmTimer to get next alarm 926// called by mRecheckAlarmTimer to get next alarm
927// we need this, because a QTimer has only a max range of 25 days 927// we need this, because a QTimer has only a max range of 25 days
928void CalendarView::recheckTimerAlarm() 928void CalendarView::recheckTimerAlarm()
929{ 929{
930 mAlarmTimer->stop(); 930 mAlarmTimer->stop();
931 mRecheckAlarmTimer->stop(); 931 mRecheckAlarmTimer->stop();
932 mCalendar->checkAlarmForIncidence( 0, true ); 932 mCalendar->checkAlarmForIncidence( 0, true );
933} 933}
934#ifndef DESKTOP_VERSION 934#ifndef DESKTOP_VERSION
935void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 935void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
936#else 936#else
937void CalendarView::removeAlarm(const QDateTime &, const QString & ) 937void CalendarView::removeAlarm(const QDateTime &, const QString & )
938#endif 938#endif
939{ 939{
940 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 940 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
941 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 941 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
942#ifndef DESKTOP_VERSION 942#ifndef DESKTOP_VERSION
943 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() ); 943 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() );
944#endif 944#endif
945 return; 945 return;
946 } 946 }
947 mAlarmTimer->stop(); 947 mAlarmTimer->stop();
948} 948}
949void CalendarView::selectWeekNum ( int num ) 949void CalendarView::selectWeekNum ( int num )
950{ 950{
951 dateNavigator()->blockSignals( true ); 951 dateNavigator()->blockSignals( true );
952 dateNavigator()->selectWeek( num ); 952 dateNavigator()->selectWeek( num );
953 dateNavigator()->blockSignals( false ); 953 dateNavigator()->blockSignals( false );
954 mViewManager->showWeekView(); 954 mViewManager->showWeekView();
955} 955}
956KOViewManager *CalendarView::viewManager() 956KOViewManager *CalendarView::viewManager()
957{ 957{
958 return mViewManager; 958 return mViewManager;
959} 959}
960 960
961KODialogManager *CalendarView::dialogManager() 961KODialogManager *CalendarView::dialogManager()
962{ 962{
963 return mDialogManager; 963 return mDialogManager;
964} 964}
965 965
966QDate CalendarView::startDate() 966QDate CalendarView::startDate()
967{ 967{
968 DateList dates = mNavigator->selectedDates(); 968 DateList dates = mNavigator->selectedDates();
969 969
970 return dates.first(); 970 return dates.first();
971} 971}
972 972
973QDate CalendarView::endDate() 973QDate CalendarView::endDate()
974{ 974{
975 DateList dates = mNavigator->selectedDates(); 975 DateList dates = mNavigator->selectedDates();
976 976
977 return dates.last(); 977 return dates.last();
978} 978}
979 979
980 980
981void CalendarView::createPrinter() 981void CalendarView::createPrinter()
982{ 982{
983#ifndef KORG_NOPRINTER 983#ifndef KORG_NOPRINTER
984 if (!mCalPrinter) { 984 if (!mCalPrinter) {
985 mCalPrinter = new CalPrinter(this, mCalendar); 985 mCalPrinter = new CalPrinter(this, mCalendar);
986 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 986 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
987 } 987 }
988#endif 988#endif
989} 989}
990 990
991 991
992//KOPrefs::instance()->mWriteBackFile 992//KOPrefs::instance()->mWriteBackFile
993//KOPrefs::instance()->mWriteBackExistingOnly 993//KOPrefs::instance()->mWriteBackExistingOnly
994 994
995// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 995// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
996// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 996// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
997// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 997// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
998// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 998// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
999// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 999// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
1000// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 1000// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
1001 1001
1002int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 1002int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
1003{ 1003{
1004 1004
1005 // 0 equal 1005 // 0 equal
1006 // 1 take local 1006 // 1 take local
1007 // 2 take remote 1007 // 2 take remote
1008 // 3 cancel 1008 // 3 cancel
1009 QDateTime lastSync = mLastCalendarSync; 1009 QDateTime lastSync = mLastCalendarSync;
1010 QDateTime localMod = local->lastModified(); 1010 QDateTime localMod = local->lastModified();
1011 QDateTime remoteMod = remote->lastModified(); 1011 QDateTime remoteMod = remote->lastModified();
1012 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1012 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1013 bool remCh, locCh; 1013 bool remCh, locCh;
1014 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 1014 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
1015 //if ( remCh ) 1015 //if ( remCh )
1016 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 1016 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
1017 locCh = ( localMod > mLastCalendarSync ); 1017 locCh = ( localMod > mLastCalendarSync );
1018 if ( !remCh && ! locCh ) { 1018 if ( !remCh && ! locCh ) {
1019 //qDebug("both not changed "); 1019 //qDebug("both not changed ");
1020 lastSync = localMod.addDays(1); 1020 lastSync = localMod.addDays(1);
1021 if ( mode <= SYNC_PREF_ASK ) 1021 if ( mode <= SYNC_PREF_ASK )
1022 return 0; 1022 return 0;
1023 } else { 1023 } else {
1024 if ( locCh ) { 1024 if ( locCh ) {
1025 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1()); 1025 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1());
1026 lastSync = localMod.addDays( -1 ); 1026 lastSync = localMod.addDays( -1 );
1027 if ( !remCh ) 1027 if ( !remCh )
1028 remoteMod = ( lastSync.addDays( -1 ) ); 1028 remoteMod = ( lastSync.addDays( -1 ) );
1029 } else { 1029 } else {
1030 //qDebug(" not loc changed "); 1030 //qDebug(" not loc changed ");
1031 lastSync = localMod.addDays( 1 ); 1031 lastSync = localMod.addDays( 1 );
1032 if ( remCh ) 1032 if ( remCh )
1033 remoteMod =( lastSync.addDays( 1 ) ); 1033 remoteMod =( lastSync.addDays( 1 ) );
1034 1034
1035 } 1035 }
1036 } 1036 }
1037 full = true; 1037 full = true;
1038 if ( mode < SYNC_PREF_ASK ) 1038 if ( mode < SYNC_PREF_ASK )
1039 mode = SYNC_PREF_ASK; 1039 mode = SYNC_PREF_ASK;
1040 } else { 1040 } else {
1041 if ( localMod == remoteMod ) 1041 if ( localMod == remoteMod )
1042 // if ( local->revision() == remote->revision() ) 1042 // if ( local->revision() == remote->revision() )
1043 return 0; 1043 return 0;
1044 1044
1045 } 1045 }
1046 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 1046 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
1047 1047
1048 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 1048 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
1049 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 1049 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
1050 //full = true; //debug only 1050 //full = true; //debug only
1051 if ( full ) { 1051 if ( full ) {
1052 bool equ = false; 1052 bool equ = false;
1053 if ( local->typeID() == eventID ) { 1053 if ( local->typeID() == eventID ) {
1054 equ = (*((Event*) local) == *((Event*) remote)); 1054 equ = (*((Event*) local) == *((Event*) remote));
1055 } 1055 }
1056 else if ( local->typeID() == todoID ) 1056 else if ( local->typeID() == todoID )
1057 equ = (*((Todo*) local) == (*(Todo*) remote)); 1057 equ = (*((Todo*) local) == (*(Todo*) remote));
1058 else if ( local->typeID() == journalID ) 1058 else if ( local->typeID() == journalID )
1059 equ = (*((Journal*) local) == *((Journal*) remote)); 1059 equ = (*((Journal*) local) == *((Journal*) remote));
1060 if ( equ ) { 1060 if ( equ ) {
1061 //qDebug("equal "); 1061 //qDebug("equal ");
1062 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1062 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1063 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 1063 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
1064 } 1064 }
1065 if ( mode < SYNC_PREF_FORCE_LOCAL ) 1065 if ( mode < SYNC_PREF_FORCE_LOCAL )
1066 return 0; 1066 return 0;
1067 1067
1068 }//else //debug only 1068 }//else //debug only
1069 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 1069 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
1070 } 1070 }
1071 int result; 1071 int result;
1072 bool localIsNew; 1072 bool localIsNew;
1073 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , localMod.toString().latin1() , remoteMod.toString().latin1() ); 1073 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , localMod.toString().latin1() , remoteMod.toString().latin1() );
1074 1074
1075 1075
1076 // ************************************************ 1076 // ************************************************
1077 // ************************************************ 1077 // ************************************************
1078 // ************************************************ 1078 // ************************************************
1079 // We may have that lastSync > remoteMod AND lastSync > localMod 1079 // We may have that lastSync > remoteMod AND lastSync > localMod
1080 // BUT remoteMod != localMod 1080 // BUT remoteMod != localMod
1081 1081
1082 1082
1083 if ( full && mode < SYNC_PREF_NEWEST ) 1083 if ( full && mode < SYNC_PREF_NEWEST )
1084 mode = SYNC_PREF_ASK; 1084 mode = SYNC_PREF_ASK;
1085 1085
1086 switch( mode ) { 1086 switch( mode ) {
1087 case SYNC_PREF_LOCAL: 1087 case SYNC_PREF_LOCAL:
1088 if ( lastSync > remoteMod ) 1088 if ( lastSync > remoteMod )
1089 return 1; 1089 return 1;
1090 if ( lastSync > localMod ) 1090 if ( lastSync > localMod )
1091 return 2; 1091 return 2;
1092 return 1; 1092 return 1;
1093 break; 1093 break;
1094 case SYNC_PREF_REMOTE: 1094 case SYNC_PREF_REMOTE:
1095 if ( lastSync > localMod ) 1095 if ( lastSync > localMod )
1096 return 2; 1096 return 2;
1097 if ( lastSync > remoteMod ) 1097 if ( lastSync > remoteMod )
1098 return 1; 1098 return 1;
1099 return 2; 1099 return 2;
1100 break; 1100 break;
1101 case SYNC_PREF_NEWEST: 1101 case SYNC_PREF_NEWEST:
1102 if ( localMod >= remoteMod ) 1102 if ( localMod >= remoteMod )
1103 return 1; 1103 return 1;
1104 else 1104 else
1105 return 2; 1105 return 2;
1106 break; 1106 break;
1107 case SYNC_PREF_ASK: 1107 case SYNC_PREF_ASK:
1108 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1108 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1109 if ( lastSync > remoteMod && lastSync > localMod) 1109 if ( lastSync > remoteMod && lastSync > localMod)
1110 return 0; 1110 return 0;
1111 if ( lastSync > remoteMod ) 1111 if ( lastSync > remoteMod )
1112 return 1; 1112 return 1;
1113 if ( lastSync > localMod ) 1113 if ( lastSync > localMod )
1114 return 2; 1114 return 2;
1115 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1115 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1116 localIsNew = localMod >= remoteMod; 1116 localIsNew = localMod >= remoteMod;
1117 if ( localIsNew ) 1117 if ( localIsNew )
1118 getEventViewerDialog()->setColorMode( 1 ); 1118 getEventViewerDialog()->setColorMode( 1 );
1119 else 1119 else
1120 getEventViewerDialog()->setColorMode( 2 ); 1120 getEventViewerDialog()->setColorMode( 2 );
1121 getEventViewerDialog()->setIncidence(local); 1121 getEventViewerDialog()->setIncidence(local);
1122 if ( localIsNew ) 1122 if ( localIsNew )
1123 getEventViewerDialog()->setColorMode( 2 ); 1123 getEventViewerDialog()->setColorMode( 2 );
1124 else 1124 else
1125 getEventViewerDialog()->setColorMode( 1 ); 1125 getEventViewerDialog()->setColorMode( 1 );
1126 getEventViewerDialog()->addIncidence(remote); 1126 getEventViewerDialog()->addIncidence(remote);
1127 getEventViewerDialog()->setColorMode( 0 ); 1127 getEventViewerDialog()->setColorMode( 0 );
1128 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 1128 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
1129 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 1129 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
1130 getEventViewerDialog()->showMe(); 1130 getEventViewerDialog()->showMe();
1131 result = getEventViewerDialog()->executeS( localIsNew ); 1131 result = getEventViewerDialog()->executeS( localIsNew );
1132 return result; 1132 return result;
1133 1133
1134 break; 1134 break;
1135 case SYNC_PREF_FORCE_LOCAL: 1135 case SYNC_PREF_FORCE_LOCAL:
1136 return 1; 1136 return 1;
1137 break; 1137 break;
1138 case SYNC_PREF_FORCE_REMOTE: 1138 case SYNC_PREF_FORCE_REMOTE:
1139 return 2; 1139 return 2;
1140 break; 1140 break;
1141 1141
1142 default: 1142 default:
1143 // SYNC_PREF_TAKE_BOTH not implemented 1143 // SYNC_PREF_TAKE_BOTH not implemented
1144 break; 1144 break;
1145 } 1145 }
1146 return 0; 1146 return 0;
1147} 1147}
1148Event* CalendarView::getLastSyncEvent() 1148Event* CalendarView::getLastSyncEvent()
1149{ 1149{
1150 Event* lse; 1150 Event* lse;
1151 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 1151 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
1152 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); 1152 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
1153 if (!lse) { 1153 if (!lse) {
1154 lse = new Event(); 1154 lse = new Event();
1155 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); 1155 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
1156 QString sum = ""; 1156 QString sum = "";
1157 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) 1157 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
1158 sum = "E: "; 1158 sum = "E: ";
1159 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); 1159 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
1160 lse->setDtStart( mLastCalendarSync ); 1160 lse->setDtStart( mLastCalendarSync );
1161 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1161 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1162 lse->setCategories( i18n("SyncEvent") ); 1162 lse->setCategories( i18n("SyncEvent") );
1163 lse->setReadOnly( true ); 1163 lse->setReadOnly( true );
1164 mCalendar->addEvent( lse ); 1164 mCalendar->addEvent( lse );
1165 } 1165 }
1166 1166
1167 return lse; 1167 return lse;
1168 1168
1169} 1169}
1170 1170
1171// we check, if the to delete event has a id for a profile 1171// we check, if the to delete event has a id for a profile
1172// if yes, we set this id in the profile to delete 1172// if yes, we set this id in the profile to delete
1173void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1173void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
1174{ 1174{
1175 if ( lastSync.count() == 0 ) { 1175 if ( lastSync.count() == 0 ) {
1176 //qDebug(" lastSync.count() == 0"); 1176 //qDebug(" lastSync.count() == 0");
1177 return; 1177 return;
1178 } 1178 }
1179 if ( toDelete->typeID() == journalID ) 1179 if ( toDelete->typeID() == journalID )
1180 return; 1180 return;
1181 1181
1182 Event* eve = lastSync.first(); 1182 Event* eve = lastSync.first();
1183 1183
1184 while ( eve ) { 1184 while ( eve ) {
1185 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1185 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
1186 if ( !id.isEmpty() ) { 1186 if ( !id.isEmpty() ) {
1187 QString des = eve->description(); 1187 QString des = eve->description();
1188 QString pref = "e"; 1188 QString pref = "e";
1189 if ( toDelete->typeID() == todoID ) 1189 if ( toDelete->typeID() == todoID )
1190 pref = "t"; 1190 pref = "t";
1191 des += pref+ id + ","; 1191 des += pref+ id + ",";
1192 eve->setReadOnly( false ); 1192 eve->setReadOnly( false );
1193 eve->setDescription( des ); 1193 eve->setDescription( des );
1194 //qDebug("setdes %s ", des.latin1()); 1194 //qDebug("setdes %s ", des.latin1());
1195 eve->setReadOnly( true ); 1195 eve->setReadOnly( true );
1196 } 1196 }
1197 eve = lastSync.next(); 1197 eve = lastSync.next();
1198 } 1198 }
1199 1199
1200} 1200}
1201void CalendarView::checkExternalId( Incidence * inc ) 1201void CalendarView::checkExternalId( Incidence * inc )
1202{ 1202{
1203 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 1203 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
1204 checkExternSyncEvent( lastSync, inc ); 1204 checkExternSyncEvent( lastSync, inc );
1205 1205
1206} 1206}
1207bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 1207bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
1208{ 1208{
1209 bool syncOK = true; 1209 bool syncOK = true;
1210 int addedEvent = 0; 1210 int addedEvent = 0;
1211 int addedEventR = 0; 1211 int addedEventR = 0;
1212 int deletedEventR = 0; 1212 int deletedEventR = 0;
1213 int deletedEventL = 0; 1213 int deletedEventL = 0;
1214 int changedLocal = 0; 1214 int changedLocal = 0;
1215 int changedRemote = 0; 1215 int changedRemote = 0;
1216 int filteredIN = 0; 1216 int filteredIN = 0;
1217 int filteredOUT = 0; 1217 int filteredOUT = 0;
1218 //QPtrList<Event> el = local->rawEvents(); 1218 //QPtrList<Event> el = local->rawEvents();
1219 Event* eventR; 1219 Event* eventR;
1220 QString uid; 1220 QString uid;
1221 int take; 1221 int take;
1222 Event* eventRSync; 1222 Event* eventRSync;
1223 Event* eventLSync; 1223 Event* eventLSync;
1224 clearAllViews(); 1224 clearAllViews();
1225 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1225 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1226 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1226 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1227 bool fullDateRange = false; 1227 bool fullDateRange = false;
1228 local->resetTempSyncStat(); 1228 local->resetTempSyncStat();
1229 mLastCalendarSync = QDateTime::currentDateTime(); 1229 mLastCalendarSync = QDateTime::currentDateTime();
1230 if ( mSyncManager->syncWithDesktop() ) { 1230 if ( mSyncManager->syncWithDesktop() ) {
1231 remote->resetPilotStat(1); 1231 remote->resetPilotStat(1);
1232 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1232 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1233 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1233 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1234 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1234 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1235 } else { 1235 } else {
1236 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1236 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1237 } 1237 }
1238 } 1238 }
1239 QDateTime modifiedCalendar = mLastCalendarSync; 1239 QDateTime modifiedCalendar = mLastCalendarSync;
1240 eventLSync = getLastSyncEvent(); 1240 eventLSync = getLastSyncEvent();
1241 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1241 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1242 if ( eventR ) { 1242 if ( eventR ) {
1243 eventRSync = (Event*) eventR->clone(); 1243 eventRSync = (Event*) eventR->clone();
1244 remote->deleteEvent(eventR ); 1244 remote->deleteEvent(eventR );
1245 1245
1246 } else { 1246 } else {
1247 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1247 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1248 eventRSync = (Event*)eventLSync->clone(); 1248 eventRSync = (Event*)eventLSync->clone();
1249 } else { 1249 } else {
1250 fullDateRange = true; 1250 fullDateRange = true;
1251 eventRSync = new Event(); 1251 eventRSync = new Event();
1252 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1252 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1253 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1253 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1254 eventRSync->setDtStart( mLastCalendarSync ); 1254 eventRSync->setDtStart( mLastCalendarSync );
1255 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1255 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1256 eventRSync->setCategories( i18n("SyncEvent") ); 1256 eventRSync->setCategories( i18n("SyncEvent") );
1257 } 1257 }
1258 } 1258 }
1259 if ( eventLSync->dtStart() == mLastCalendarSync ) 1259 if ( eventLSync->dtStart() == mLastCalendarSync )
1260 fullDateRange = true; 1260 fullDateRange = true;
1261 1261
1262 if ( ! fullDateRange ) { 1262 if ( ! fullDateRange ) {
1263 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1263 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1264 1264
1265 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1265 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1266 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1266 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1267 fullDateRange = true; 1267 fullDateRange = true;
1268 } 1268 }
1269 } 1269 }
1270 if ( mSyncManager->syncWithDesktop() ) { 1270 if ( mSyncManager->syncWithDesktop() ) {
1271 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1271 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1272 } 1272 }
1273 if ( fullDateRange ) 1273 if ( fullDateRange )
1274 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1274 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1275 else 1275 else
1276 mLastCalendarSync = eventLSync->dtStart(); 1276 mLastCalendarSync = eventLSync->dtStart();
1277 // for resyncing if own file has changed 1277 // for resyncing if own file has changed
1278 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1278 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1279 mLastCalendarSync = loadedFileVersion; 1279 mLastCalendarSync = loadedFileVersion;
1280 //qDebug("setting mLastCalendarSync "); 1280 //qDebug("setting mLastCalendarSync ");
1281 } 1281 }
1282 //qDebug("*************************** "); 1282 //qDebug("*************************** ");
1283 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1283 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1284 QPtrList<Incidence> er = remote->rawIncidences(); 1284 QPtrList<Incidence> er = remote->rawIncidences();
1285 Incidence* inR = er.first(); 1285 Incidence* inR = er.first();
1286 Incidence* inL; 1286 Incidence* inL;
1287 QProgressBar bar( er.count(),0 ); 1287 QProgressBar bar( er.count(),0 );
1288 bar.setCaption (i18n("Syncing - close to abort!") ); 1288 bar.setCaption (i18n("Syncing - close to abort!") );
1289 1289
1290 // ************** setting up filter ************* 1290 // ************** setting up filter *************
1291 CalFilter *filterIN = 0; 1291 CalFilter *filterIN = 0;
1292 CalFilter *filterOUT = 0; 1292 CalFilter *filterOUT = 0;
1293 CalFilter *filter = mFilters.first(); 1293 CalFilter *filter = mFilters.first();
1294 while(filter) { 1294 while(filter) {
1295 if ( filter->name() == mSyncManager->mFilterInCal ) 1295 if ( filter->name() == mSyncManager->mFilterInCal )
1296 filterIN = filter; 1296 filterIN = filter;
1297 if ( filter->name() == mSyncManager->mFilterOutCal ) 1297 if ( filter->name() == mSyncManager->mFilterOutCal )
1298 filterOUT = filter; 1298 filterOUT = filter;
1299 filter = mFilters.next(); 1299 filter = mFilters.next();
1300 } 1300 }
1301 int w = 300; 1301 int w = 300;
1302 if ( QApplication::desktop()->width() < 320 ) 1302 if ( QApplication::desktop()->width() < 320 )
1303 w = 220; 1303 w = 220;
1304 int h = bar.sizeHint().height() ; 1304 int h = bar.sizeHint().height() ;
1305 int dw = QApplication::desktop()->width(); 1305 int dw = QApplication::desktop()->width();
1306 int dh = QApplication::desktop()->height(); 1306 int dh = QApplication::desktop()->height();
1307 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1307 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1308 bar.show(); 1308 bar.show();
1309 int modulo = (er.count()/10)+1; 1309 int modulo = (er.count()/10)+1;
1310 int incCounter = 0; 1310 int incCounter = 0;
1311 while ( inR ) { 1311 while ( inR ) {
1312 if ( ! bar.isVisible() ) 1312 if ( ! bar.isVisible() )
1313 return false; 1313 return false;
1314 if ( incCounter % modulo == 0 ) 1314 if ( incCounter % modulo == 0 )
1315 bar.setProgress( incCounter ); 1315 bar.setProgress( incCounter );
1316 ++incCounter; 1316 ++incCounter;
1317 uid = inR->uid(); 1317 uid = inR->uid();
1318 bool skipIncidence = false; 1318 bool skipIncidence = false;
1319 if ( uid.left(15) == QString("last-syncEvent-") ) 1319 if ( uid.left(15) == QString("last-syncEvent-") )
1320 skipIncidence = true; 1320 skipIncidence = true;
1321 QString idS; 1321 QString idS;
1322 qApp->processEvents(); 1322 qApp->processEvents();
1323 if ( !skipIncidence ) { 1323 if ( !skipIncidence ) {
1324 inL = local->incidence( uid ); 1324 inL = local->incidence( uid );
1325 if ( inL ) { // maybe conflict - same uid in both calendars 1325 if ( inL ) { // maybe conflict - same uid in both calendars
1326 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1326 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1327 //qDebug("take %d %s ", take, inL->summary().latin1()); 1327 //qDebug("take %d %s ", take, inL->summary().latin1());
1328 if ( take == 3 ) 1328 if ( take == 3 )
1329 return false; 1329 return false;
1330 if ( take == 1 ) {// take local ********************** 1330 if ( take == 1 ) {// take local **********************
1331 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1331 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1332 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1332 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1333 else 1333 else
1334 idS = inR->IDStr(); 1334 idS = inR->IDStr();
1335 remote->deleteIncidence( inR ); 1335 remote->deleteIncidence( inR );
1336 inR = inL->clone(); 1336 inR = inL->clone();
1337 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1337 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1338 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1338 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1339 inR->setIDStr( idS ); 1339 inR->setIDStr( idS );
1340 remote->addIncidence( inR ); 1340 remote->addIncidence( inR );
1341 if ( mSyncManager->syncWithDesktop() ) 1341 if ( mSyncManager->syncWithDesktop() )
1342 inR->setPilotId( 2 ); 1342 inR->setPilotId( 2 );
1343 ++changedRemote; 1343 ++changedRemote;
1344 } else {// take remote ********************** 1344 } else {// take remote **********************
1345 idS = inL->IDStr(); 1345 idS = inL->IDStr();
1346 int pid = inL->pilotId(); 1346 int pid = inL->pilotId();
1347 local->deleteIncidence( inL ); 1347 local->deleteIncidence( inL );
1348 inL = inR->clone(); 1348 inL = inR->clone();
1349 if ( mSyncManager->syncWithDesktop() ) 1349 if ( mSyncManager->syncWithDesktop() )
1350 inL->setPilotId( pid ); 1350 inL->setPilotId( pid );
1351 inL->setIDStr( idS ); 1351 inL->setIDStr( idS );
1352 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1352 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1353 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1353 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1354 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1354 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1355 } 1355 }
1356 local->addIncidence( inL ); 1356 local->addIncidence( inL );
1357 ++changedLocal; 1357 ++changedLocal;
1358 } 1358 }
1359 } 1359 }
1360 } else { // no conflict ********** add or delete remote 1360 } else { // no conflict ********** add or delete remote
1361 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1361 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1362 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1362 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1363 QString des = eventLSync->description(); 1363 QString des = eventLSync->description();
1364 QString pref = "e"; 1364 QString pref = "e";
1365 if ( inR->typeID() == todoID ) 1365 if ( inR->typeID() == todoID )
1366 pref = "t"; 1366 pref = "t";
1367 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1367 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1368 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1368 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1369 //remote->deleteIncidence( inR ); 1369 //remote->deleteIncidence( inR );
1370 ++deletedEventR; 1370 ++deletedEventR;
1371 } else { 1371 } else {
1372 inR->setLastModified( modifiedCalendar ); 1372 inR->setLastModified( modifiedCalendar );
1373 inL = inR->clone(); 1373 inL = inR->clone();
1374 inL->setIDStr( ":" ); 1374 inL->setIDStr( ":" );
1375 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1375 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1376 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1376 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1377 local->addIncidence( inL ); 1377 local->addIncidence( inL );
1378 ++addedEvent; 1378 ++addedEvent;
1379 1379
1380 } 1380 }
1381 } else { 1381 } else {
1382 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1382 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1383 inR->setLastModified( modifiedCalendar ); 1383 inR->setLastModified( modifiedCalendar );
1384 inL = inR->clone(); 1384 inL = inR->clone();
1385 inL->setIDStr( ":" ); 1385 inL->setIDStr( ":" );
1386 local->addIncidence( inL ); 1386 local->addIncidence( inL );
1387 ++addedEvent; 1387 ++addedEvent;
1388 1388
1389 } else { 1389 } else {
1390 checkExternSyncEvent(eventRSyncSharp, inR); 1390 checkExternSyncEvent(eventRSyncSharp, inR);
1391 remote->deleteIncidence( inR ); 1391 remote->deleteIncidence( inR );
1392 ++deletedEventR; 1392 ++deletedEventR;
1393 } 1393 }
1394 } 1394 }
1395 } else { 1395 } else {
1396 ++filteredIN; 1396 ++filteredIN;
1397 } 1397 }
1398 } 1398 }
1399 } 1399 }
1400 inR = er.next(); 1400 inR = er.next();
1401 } 1401 }
1402 QPtrList<Incidence> el = local->rawIncidences(); 1402 QPtrList<Incidence> el = local->rawIncidences();
1403 inL = el.first(); 1403 inL = el.first();
1404 modulo = (el.count()/10)+1; 1404 modulo = (el.count()/10)+1;
1405 bar.setCaption (i18n("Add / remove events") ); 1405 bar.setCaption (i18n("Add / remove events") );
1406 bar.setTotalSteps ( el.count() ) ; 1406 bar.setTotalSteps ( el.count() ) ;
1407 bar.show(); 1407 bar.show();
1408 incCounter = 0; 1408 incCounter = 0;
1409 1409
1410 while ( inL ) { 1410 while ( inL ) {
1411 1411
1412 qApp->processEvents(); 1412 qApp->processEvents();
1413 if ( ! bar.isVisible() ) 1413 if ( ! bar.isVisible() )
1414 return false; 1414 return false;
1415 if ( incCounter % modulo == 0 ) 1415 if ( incCounter % modulo == 0 )
1416 bar.setProgress( incCounter ); 1416 bar.setProgress( incCounter );
1417 ++incCounter; 1417 ++incCounter;
1418 uid = inL->uid(); 1418 uid = inL->uid();
1419 bool skipIncidence = false; 1419 bool skipIncidence = false;
1420 if ( uid.left(15) == QString("last-syncEvent-") ) 1420 if ( uid.left(15) == QString("last-syncEvent-") )
1421 skipIncidence = true; 1421 skipIncidence = true;
1422 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1422 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1423 skipIncidence = true; 1423 skipIncidence = true;
1424 if ( !skipIncidence ) { 1424 if ( !skipIncidence ) {
1425 inR = remote->incidence( uid ); 1425 inR = remote->incidence( uid );
1426 if ( ! inR ) { 1426 if ( ! inR ) {
1427 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1427 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1428 // no conflict ********** add or delete local 1428 // no conflict ********** add or delete local
1429 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1429 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1430 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1430 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1431 checkExternSyncEvent(eventLSyncSharp, inL); 1431 checkExternSyncEvent(eventLSyncSharp, inL);
1432 local->deleteIncidence( inL ); 1432 local->deleteIncidence( inL );
1433 ++deletedEventL; 1433 ++deletedEventL;
1434 } else { 1434 } else {
1435 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1435 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1436 inL->removeID(mCurrentSyncDevice ); 1436 inL->removeID(mCurrentSyncDevice );
1437 ++addedEventR; 1437 ++addedEventR;
1438 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1438 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1439 inL->setLastModified( modifiedCalendar ); 1439 inL->setLastModified( modifiedCalendar );
1440 inR = inL->clone(); 1440 inR = inL->clone();
1441 inR->setIDStr( ":" ); 1441 inR->setIDStr( ":" );
1442 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1442 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1443 remote->addIncidence( inR ); 1443 remote->addIncidence( inR );
1444 } 1444 }
1445 } 1445 }
1446 } else { 1446 } else {
1447 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1447 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1448 checkExternSyncEvent(eventLSyncSharp, inL); 1448 checkExternSyncEvent(eventLSyncSharp, inL);
1449 local->deleteIncidence( inL ); 1449 local->deleteIncidence( inL );
1450 ++deletedEventL; 1450 ++deletedEventL;
1451 } else { 1451 } else {
1452 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1452 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1453 ++addedEventR; 1453 ++addedEventR;
1454 inL->setLastModified( modifiedCalendar ); 1454 inL->setLastModified( modifiedCalendar );
1455 inR = inL->clone(); 1455 inR = inL->clone();
1456 inR->setIDStr( ":" ); 1456 inR->setIDStr( ":" );
1457 remote->addIncidence( inR ); 1457 remote->addIncidence( inR );
1458 } 1458 }
1459 } 1459 }
1460 } 1460 }
1461 } else { 1461 } else {
1462 ++filteredOUT; 1462 ++filteredOUT;
1463 } 1463 }
1464 } 1464 }
1465 } 1465 }
1466 inL = el.next(); 1466 inL = el.next();
1467 } 1467 }
1468 int delFut = 0; 1468 int delFut = 0;
1469 int remRem = 0; 1469 int remRem = 0;
1470 if ( mSyncManager->mWriteBackInFuture ) { 1470 if ( mSyncManager->mWriteBackInFuture ) {
1471 er = remote->rawIncidences(); 1471 er = remote->rawIncidences();
1472 remRem = er.count(); 1472 remRem = er.count();
1473 inR = er.first(); 1473 inR = er.first();
1474 QDateTime dt; 1474 QDateTime dt;
1475 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1475 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1476 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1476 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1477 while ( inR ) { 1477 while ( inR ) {
1478 if ( inR->typeID() == todoID ) { 1478 if ( inR->typeID() == todoID ) {
1479 Todo * t = (Todo*)inR; 1479 Todo * t = (Todo*)inR;
1480 if ( t->hasDueDate() ) 1480 if ( t->hasDueDate() )
1481 dt = t->dtDue(); 1481 dt = t->dtDue();
1482 else 1482 else
1483 dt = cur.addSecs( 62 ); 1483 dt = cur.addSecs( 62 );
1484 } 1484 }
1485 else if (inR->typeID() == eventID ) { 1485 else if (inR->typeID() == eventID ) {
1486 bool ok; 1486 bool ok;
1487 dt = inR->getNextOccurence( cur, &ok ); 1487 dt = inR->getNextOccurence( cur, &ok );
1488 if ( !ok ) 1488 if ( !ok )
1489 dt = cur.addSecs( -62 ); 1489 dt = cur.addSecs( -62 );
1490 } 1490 }
1491 else 1491 else
1492 dt = inR->dtStart(); 1492 dt = inR->dtStart();
1493 if ( dt < cur || dt > end ) { 1493 if ( dt < cur || dt > end ) {
1494 remote->deleteIncidence( inR ); 1494 remote->deleteIncidence( inR );
1495 ++delFut; 1495 ++delFut;
1496 } 1496 }
1497 inR = er.next(); 1497 inR = er.next();
1498 } 1498 }
1499 } 1499 }
1500 bar.hide(); 1500 bar.hide();
1501 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1501 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1502 eventLSync->setReadOnly( false ); 1502 eventLSync->setReadOnly( false );
1503 eventLSync->setDtStart( mLastCalendarSync ); 1503 eventLSync->setDtStart( mLastCalendarSync );
1504 eventRSync->setDtStart( mLastCalendarSync ); 1504 eventRSync->setDtStart( mLastCalendarSync );
1505 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1505 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1506 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1506 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1507 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1507 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1508 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1508 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1509 eventLSync->setReadOnly( true ); 1509 eventLSync->setReadOnly( true );
1510 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1510 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1511 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1511 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1512 remote->addEvent( eventRSync ); 1512 remote->addEvent( eventRSync );
1513 else 1513 else
1514 delete eventRSync; 1514 delete eventRSync;
1515 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1515 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1516 QString mes; 1516 QString mes;
1517 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 ); 1517 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 );
1518 QString delmess; 1518 QString delmess;
1519 if ( delFut ) { 1519 if ( delFut ) {
1520 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); 1520 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);
1521 mes += delmess; 1521 mes += delmess;
1522 } 1522 }
1523 mes = i18n("Local calendar changed!\n") +mes; 1523 mes = i18n("Local calendar changed!\n") +mes;
1524 mCalendar->checkAlarmForIncidence( 0, true ); 1524 mCalendar->checkAlarmForIncidence( 0, true );
1525 qDebug( mes ); 1525 qDebug( mes );
1526 if ( mSyncManager->mShowSyncSummary ) { 1526 if ( mSyncManager->mShowSyncSummary ) {
1527 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1527 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1528 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1528 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1529 qDebug("KO: WB cancelled "); 1529 qDebug("KO: WB cancelled ");
1530 mSyncManager->mWriteBackFile = false; 1530 mSyncManager->mWriteBackFile = false;
1531 return syncOK; 1531 return syncOK;
1532 } 1532 }
1533 } 1533 }
1534 return syncOK; 1534 return syncOK;
1535} 1535}
1536 1536
1537void CalendarView::setSyncDevice( QString s ) 1537void CalendarView::setSyncDevice( QString s )
1538{ 1538{
1539 mCurrentSyncDevice= s; 1539 mCurrentSyncDevice= s;
1540} 1540}
1541void CalendarView::setSyncName( QString s ) 1541void CalendarView::setSyncName( QString s )
1542{ 1542{
1543 mCurrentSyncName= s; 1543 mCurrentSyncName= s;
1544} 1544}
1545bool CalendarView::syncCalendar(QString filename, int mode) 1545bool CalendarView::syncCalendar(QString filename, int mode)
1546{ 1546{
1547 //qDebug("syncCalendar %s ", filename.latin1()); 1547 //qDebug("syncCalendar %s ", filename.latin1());
1548 mGlobalSyncMode = SYNC_MODE_NORMAL; 1548 mGlobalSyncMode = SYNC_MODE_NORMAL;
1549 CalendarLocal* calendar = new CalendarLocal(); 1549 CalendarLocal* calendar = new CalendarLocal();
1550 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1550 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1551 FileStorage* storage = new FileStorage( calendar ); 1551 FileStorage* storage = new FileStorage( calendar );
1552 bool syncOK = false; 1552 bool syncOK = false;
1553 storage->setFileName( filename ); 1553 storage->setFileName( filename );
1554 // qDebug("loading ... "); 1554 // qDebug("loading ... ");
1555 if ( storage->load() ) { 1555 if ( storage->load() ) {
1556 getEventViewerDialog()->setSyncMode( true ); 1556 getEventViewerDialog()->setSyncMode( true );
1557 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1557 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1558 getEventViewerDialog()->setSyncMode( false ); 1558 getEventViewerDialog()->setSyncMode( false );
1559 if ( syncOK ) { 1559 if ( syncOK ) {
1560 if ( mSyncManager->mWriteBackFile ) 1560 if ( mSyncManager->mWriteBackFile )
1561 { 1561 {
1562 storage->setSaveFormat( new ICalFormat() ); 1562 storage->setSaveFormat( new ICalFormat() );
1563 storage->save(); 1563 storage->save();
1564 } 1564 }
1565 } 1565 }
1566 setModified( true ); 1566 setModified( true );
1567 } 1567 }
1568 delete storage; 1568 delete storage;
1569 delete calendar; 1569 delete calendar;
1570 if ( syncOK ) 1570 if ( syncOK )
1571 updateView(); 1571 updateView();
1572 return syncOK; 1572 return syncOK;
1573} 1573}
1574 1574
1575void CalendarView::syncExternal( int mode ) 1575void CalendarView::syncExternal( int mode )
1576{ 1576{
1577 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1577 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1578 1578
1579 qApp->processEvents(); 1579 qApp->processEvents();
1580 CalendarLocal* calendar = new CalendarLocal(); 1580 CalendarLocal* calendar = new CalendarLocal();
1581 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1581 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1582 bool syncOK = false; 1582 bool syncOK = false;
1583 bool loadSuccess = false; 1583 bool loadSuccess = false;
1584 PhoneFormat* phoneFormat = 0; 1584 PhoneFormat* phoneFormat = 0;
1585 emit tempDisableBR(true); 1585 emit tempDisableBR(true);
1586#ifndef DESKTOP_VERSION 1586#ifndef DESKTOP_VERSION
1587 SharpFormat* sharpFormat = 0; 1587 SharpFormat* sharpFormat = 0;
1588 if ( mode == 0 ) { // sharp 1588 if ( mode == 0 ) { // sharp
1589 sharpFormat = new SharpFormat () ; 1589 sharpFormat = new SharpFormat () ;
1590 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1590 loadSuccess = sharpFormat->load( calendar, mCalendar );
1591 1591
1592 } else 1592 } else
1593#endif 1593#endif
1594 if ( mode == 1 ) { // phone 1594 if ( mode == 1 ) { // phone
1595 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1595 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1596 mSyncManager->mPhoneDevice, 1596 mSyncManager->mPhoneDevice,
1597 mSyncManager->mPhoneConnection, 1597 mSyncManager->mPhoneConnection,
1598 mSyncManager->mPhoneModel); 1598 mSyncManager->mPhoneModel);
1599 loadSuccess = phoneFormat->load( calendar,mCalendar); 1599 loadSuccess = phoneFormat->load( calendar,mCalendar);
1600 1600
1601 } else { 1601 } else {
1602 emit tempDisableBR(false); 1602 emit tempDisableBR(false);
1603 return; 1603 return;
1604 } 1604 }
1605 if ( loadSuccess ) { 1605 if ( loadSuccess ) {
1606 getEventViewerDialog()->setSyncMode( true ); 1606 getEventViewerDialog()->setSyncMode( true );
1607 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1607 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1608 getEventViewerDialog()->setSyncMode( false ); 1608 getEventViewerDialog()->setSyncMode( false );
1609 qApp->processEvents(); 1609 qApp->processEvents();
1610 if ( syncOK ) { 1610 if ( syncOK ) {
1611 if ( mSyncManager->mWriteBackFile ) 1611 if ( mSyncManager->mWriteBackFile )
1612 { 1612 {
1613 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1613 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1614 Incidence* inc = iL.first(); 1614 Incidence* inc = iL.first();
1615 if ( phoneFormat ) { 1615 if ( phoneFormat ) {
1616 while ( inc ) { 1616 while ( inc ) {
1617 inc->removeID(mCurrentSyncDevice); 1617 inc->removeID(mCurrentSyncDevice);
1618 inc = iL.next(); 1618 inc = iL.next();
1619 } 1619 }
1620 } 1620 }
1621#ifndef DESKTOP_VERSION 1621#ifndef DESKTOP_VERSION
1622 if ( sharpFormat ) 1622 if ( sharpFormat )
1623 sharpFormat->save(calendar); 1623 sharpFormat->save(calendar);
1624#endif 1624#endif
1625 if ( phoneFormat ) 1625 if ( phoneFormat )
1626 phoneFormat->save(calendar); 1626 phoneFormat->save(calendar);
1627 iL = calendar->rawIncidences(); 1627 iL = calendar->rawIncidences();
1628 inc = iL.first(); 1628 inc = iL.first();
1629 Incidence* loc; 1629 Incidence* loc;
1630 while ( inc ) { 1630 while ( inc ) {
1631 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1631 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1632 loc = mCalendar->incidence(inc->uid() ); 1632 loc = mCalendar->incidence(inc->uid() );
1633 if ( loc ) { 1633 if ( loc ) {
1634 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1634 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1635 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1635 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1636 } 1636 }
1637 } 1637 }
1638 inc = iL.next(); 1638 inc = iL.next();
1639 } 1639 }
1640 Incidence* lse = getLastSyncEvent(); 1640 Incidence* lse = getLastSyncEvent();
1641 if ( lse ) { 1641 if ( lse ) {
1642 lse->setReadOnly( false ); 1642 lse->setReadOnly( false );
1643 lse->setDescription( "" ); 1643 lse->setDescription( "" );
1644 lse->setReadOnly( true ); 1644 lse->setReadOnly( true );
1645 } 1645 }
1646 } 1646 }
1647 } else { 1647 } else {
1648 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1648 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1649 } 1649 }
1650 setModified( true ); 1650 setModified( true );
1651 } else { 1651 } else {
1652 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1652 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1653 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1653 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1654 question, i18n("Ok")) ; 1654 question, i18n("Ok")) ;
1655 1655
1656 } 1656 }
1657 delete calendar; 1657 delete calendar;
1658 updateView(); 1658 updateView();
1659 emit tempDisableBR(false); 1659 emit tempDisableBR(false);
1660 return ;//syncOK; 1660 return ;//syncOK;
1661 1661
1662} 1662}
1663 1663
1664bool CalendarView::importBday() 1664bool CalendarView::importBday()
1665{ 1665{
1666#ifndef KORG_NOKABC 1666#ifndef KORG_NOKABC
1667 1667
1668#ifdef DESKTOP_VERSION 1668#ifdef DESKTOP_VERSION
1669 int curCal = mCalendar->defaultCalendar(); 1669 int curCal = mCalendar->defaultCalendar();
1670 int bd = mCalEditView->getBirtdayID(); 1670 int bd = mCalEditView->getBirtdayID();
1671 if ( bd == 0 ) 1671 if ( bd == 0 )
1672 return false; 1672 return false;
1673 mCalendar->setDefaultCalendar( bd ); 1673 mCalendar->setDefaultCalendar( bd );
1674 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1674 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1675 KABC::AddressBook::Iterator it; 1675 KABC::AddressBook::Iterator it;
1676 int count = 0; 1676 int count = 0;
1677 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1677 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1678 ++count; 1678 ++count;
1679 } 1679 }
1680 QProgressBar bar(count,0 ); 1680 QProgressBar bar(count,0 );
1681 int w = 300; 1681 int w = 300;
1682 if ( QApplication::desktop()->width() < 320 ) 1682 if ( QApplication::desktop()->width() < 320 )
1683 w = 220; 1683 w = 220;
1684 int h = bar.sizeHint().height() ; 1684 int h = bar.sizeHint().height() ;
1685 int dw = QApplication::desktop()->width(); 1685 int dw = QApplication::desktop()->width();
1686 int dh = QApplication::desktop()->height(); 1686 int dh = QApplication::desktop()->height();
1687 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1687 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1688 bar.show(); 1688 bar.show();
1689 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1689 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1690 qApp->processEvents(); 1690 qApp->processEvents();
1691 count = 0; 1691 count = 0;
1692 int addCount = 0; 1692 int addCount = 0;
1693 KCal::Attendee* a = 0; 1693 KCal::Attendee* a = 0;
1694 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1694 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1695 if ( ! bar.isVisible() ) 1695 if ( ! bar.isVisible() )
1696 return false; 1696 return false;
1697 bar.setProgress( count++ ); 1697 bar.setProgress( count++ );
1698 qApp->processEvents(); 1698 qApp->processEvents();
1699 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1699 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1700 if ( (*it).birthday().date().isValid() ){ 1700 if ( (*it).birthday().date().isValid() ){
1701 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1701 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1702 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1702 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1703 ++addCount; 1703 ++addCount;
1704 } 1704 }
1705 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1705 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1706 if ( anni.isValid() ){ 1706 if ( anni.isValid() ){
1707 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1707 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1708 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1708 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1709 ++addCount; 1709 ++addCount;
1710 } 1710 }
1711 } 1711 }
1712 mCalendar->setDefaultCalendar( curCal ); 1712 mCalendar->setDefaultCalendar( curCal );
1713 updateView(); 1713 updateView();
1714 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1714 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1715#else //DESKTOP_VERSION 1715#else //DESKTOP_VERSION
1716 1716
1717 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1717 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1718 // the result should now arrive through method insertBirthdays 1718 // the result should now arrive through method insertBirthdays
1719 1719
1720#endif //DESKTOP_VERSION 1720#endif //DESKTOP_VERSION
1721 1721
1722#endif //KORG_NOKABC 1722#endif //KORG_NOKABC
1723 1723
1724 1724
1725 return true; 1725 return true;
1726} 1726}
1727 1727
1728// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1728// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1729void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1729void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1730 const QStringList& anniversaryList, const QStringList& realNameList, 1730 const QStringList& anniversaryList, const QStringList& realNameList,
1731 const QStringList& emailList, const QStringList& assembledNameList, 1731 const QStringList& emailList, const QStringList& assembledNameList,
1732 const QStringList& uidList) 1732 const QStringList& uidList)
1733{ 1733{
1734 1734
1735 //qDebug("KO::CalendarView::insertBirthdays"); 1735 //qDebug("KO::CalendarView::insertBirthdays");
1736 if (uid == this->name()) 1736 if (uid == this->name())
1737 { 1737 {
1738 int curCal = mCalendar->defaultCalendar(); 1738 int curCal = mCalendar->defaultCalendar();
1739 int bd = mCalEditView->getBirtdayID(); 1739 int bd = mCalEditView->getBirtdayID();
1740 if ( bd == 0 ) 1740 if ( bd == 0 )
1741 return; 1741 return;
1742 mCalendar->setDefaultCalendar( bd ); 1742 mCalendar->setDefaultCalendar( bd );
1743 1743
1744 1744
1745 int count = birthdayList.count(); 1745 int count = birthdayList.count();
1746 int addCount = 0; 1746 int addCount = 0;
1747 KCal::Attendee* a = 0; 1747 KCal::Attendee* a = 0;
1748 1748
1749 //qDebug("CalView 1 %i", count); 1749 //qDebug("CalView 1 %i", count);
1750 1750
1751 QProgressBar bar(count,0 ); 1751 QProgressBar bar(count,0 );
1752 int w = 300; 1752 int w = 300;
1753 if ( QApplication::desktop()->width() < 320 ) 1753 if ( QApplication::desktop()->width() < 320 )
1754 w = 220; 1754 w = 220;
1755 int h = bar.sizeHint().height() ; 1755 int h = bar.sizeHint().height() ;
1756 int dw = QApplication::desktop()->width(); 1756 int dw = QApplication::desktop()->width();
1757 int dh = QApplication::desktop()->height(); 1757 int dh = QApplication::desktop()->height();
1758 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1758 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1759 bar.show(); 1759 bar.show();
1760 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1760 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1761 qApp->processEvents(); 1761 qApp->processEvents();
1762 1762
1763 QDate birthday; 1763 QDate birthday;
1764 QDate anniversary; 1764 QDate anniversary;
1765 QString realName; 1765 QString realName;
1766 QString email; 1766 QString email;
1767 QString assembledName; 1767 QString assembledName;
1768 QString uid; 1768 QString uid;
1769 bool ok = true; 1769 bool ok = true;
1770 for ( int i = 0; i < count; i++) 1770 for ( int i = 0; i < count; i++)
1771 { 1771 {
1772 if ( ! bar.isVisible() ) 1772 if ( ! bar.isVisible() )
1773 return; 1773 return;
1774 bar.setProgress( i ); 1774 bar.setProgress( i );
1775 qApp->processEvents(); 1775 qApp->processEvents();
1776 1776
1777 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1777 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1778 if (!ok) { 1778 if (!ok) {
1779 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1779 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1780 } 1780 }
1781 1781
1782 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1782 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1783 if (!ok) { 1783 if (!ok) {
1784 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1784 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1785 } 1785 }
1786 realName = realNameList[i]; 1786 realName = realNameList[i];
1787 email = emailList[i]; 1787 email = emailList[i];
1788 assembledName = assembledNameList[i]; 1788 assembledName = assembledNameList[i];
1789 uid = uidList[i]; 1789 uid = uidList[i];
1790 //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() ); 1790 //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() );
1791 1791
1792 if ( birthday.isValid() ){ 1792 if ( birthday.isValid() ){
1793 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1793 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1794 KCal::Attendee::ReqParticipant,uid) ; 1794 KCal::Attendee::ReqParticipant,uid) ;
1795 if ( addAnniversary( birthday, assembledName, a, true ) ) 1795 if ( addAnniversary( birthday, assembledName, a, true ) )
1796 ++addCount; 1796 ++addCount;
1797 } 1797 }
1798 1798
1799 if ( anniversary.isValid() ){ 1799 if ( anniversary.isValid() ){
1800 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1800 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1801 KCal::Attendee::ReqParticipant,uid) ; 1801 KCal::Attendee::ReqParticipant,uid) ;
1802 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1802 if ( addAnniversary( anniversary, assembledName, a, false ) )
1803 ++addCount; 1803 ++addCount;
1804 } 1804 }
1805 } 1805 }
1806 1806
1807 mCalendar->setDefaultCalendar( curCal ); 1807 mCalendar->setDefaultCalendar( curCal );
1808 updateView(); 1808 updateView();
1809 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1809 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1810 1810
1811 } 1811 }
1812 1812
1813} 1813}
1814 1814
1815 1815
1816 1816
1817bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1817bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1818{ 1818{
1819 //qDebug("addAnni "); 1819 //qDebug("addAnni ");
1820 Event * ev = new Event(); 1820 Event * ev = new Event();
1821 ev->setOrganizer(KOPrefs::instance()->email()); 1821 ev->setOrganizer(KOPrefs::instance()->email());
1822 if ( a ) { 1822 if ( a ) {
1823 ev->addAttendee( a ); 1823 ev->addAttendee( a );
1824 } 1824 }
1825 QString kind; 1825 QString kind;
1826 if ( birthday ) { 1826 if ( birthday ) {
1827 kind = i18n( "Birthday" ); 1827 kind = i18n( "Birthday" );
1828 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 1828 ev->setSummary( name + " (" + QString::number(date.year()) +")");
1829 } 1829 }
1830 else { 1830 else {
1831 kind = i18n( "Anniversary" ); 1831 kind = i18n( "Anniversary" );
1832 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 1832 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
1833 } 1833 }
1834 ev->setCategories( kind ); 1834 ev->setCategories( kind );
1835 ev->setDtStart( QDateTime(date) ); 1835 ev->setDtStart( QDateTime(date) );
1836 ev->setDtEnd( QDateTime(date) ); 1836 ev->setDtEnd( QDateTime(date) );
1837 ev->setFloats( true ); 1837 ev->setFloats( true );
1838 Recurrence * rec = ev->recurrence(); 1838 Recurrence * rec = ev->recurrence();
1839 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1839 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1840 rec->addYearlyNum( date.month() ); 1840 rec->addYearlyNum( date.month() );
1841 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1841 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1842 delete ev; 1842 delete ev;
1843 return false; 1843 return false;
1844 } 1844 }
1845 return true; 1845 return true;
1846 1846
1847} 1847}
1848bool CalendarView::importQtopia( const QString &categories, 1848bool CalendarView::importQtopia( const QString &categories,
1849 const QString &datebook, 1849 const QString &datebook,
1850 const QString &todolist ) 1850 const QString &todolist )
1851{ 1851{
1852 1852
1853 QtopiaFormat qtopiaFormat; 1853 QtopiaFormat qtopiaFormat;
1854 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1854 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1855 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1855 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1856 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1856 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1857 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1857 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1858 1858
1859 updateView(); 1859 updateView();
1860 return true; 1860 return true;
1861 1861
1862#if 0 1862#if 0
1863 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1863 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1864 mCurrentSyncDevice = "qtopia-XML"; 1864 mCurrentSyncDevice = "qtopia-XML";
1865 if ( mSyncManager->mAskForPreferences ) 1865 if ( mSyncManager->mAskForPreferences )
1866 edit_sync_options(); 1866 edit_sync_options();
1867 qApp->processEvents(); 1867 qApp->processEvents();
1868 CalendarLocal* calendar = new CalendarLocal(); 1868 CalendarLocal* calendar = new CalendarLocal();
1869 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1869 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1870 bool syncOK = false; 1870 bool syncOK = false;
1871 QtopiaFormat qtopiaFormat; 1871 QtopiaFormat qtopiaFormat;
1872 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1872 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1873 bool loadOk = true; 1873 bool loadOk = true;
1874 if ( !categories.isEmpty() ) 1874 if ( !categories.isEmpty() )
1875 loadOk = qtopiaFormat.load( calendar, categories ); 1875 loadOk = qtopiaFormat.load( calendar, categories );
1876 if ( loadOk && !datebook.isEmpty() ) 1876 if ( loadOk && !datebook.isEmpty() )
1877 loadOk = qtopiaFormat.load( calendar, datebook ); 1877 loadOk = qtopiaFormat.load( calendar, datebook );
1878 if ( loadOk && !todolist.isEmpty() ) 1878 if ( loadOk && !todolist.isEmpty() )
1879 loadOk = qtopiaFormat.load( calendar, todolist ); 1879 loadOk = qtopiaFormat.load( calendar, todolist );
1880 1880
1881 if ( loadOk ) { 1881 if ( loadOk ) {
1882 getEventViewerDialog()->setSyncMode( true ); 1882 getEventViewerDialog()->setSyncMode( true );
1883 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1883 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1884 getEventViewerDialog()->setSyncMode( false ); 1884 getEventViewerDialog()->setSyncMode( false );
1885 qApp->processEvents(); 1885 qApp->processEvents();
1886 if ( syncOK ) { 1886 if ( syncOK ) {
1887 if ( mSyncManager->mWriteBackFile ) 1887 if ( mSyncManager->mWriteBackFile )
1888 { 1888 {
1889 // write back XML file 1889 // write back XML file
1890 1890
1891 } 1891 }
1892 setModified( true ); 1892 setModified( true );
1893 } 1893 }
1894 } else { 1894 } else {
1895 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1895 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1896 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1896 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1897 question, i18n("Ok")) ; 1897 question, i18n("Ok")) ;
1898 } 1898 }
1899 delete calendar; 1899 delete calendar;
1900 updateView(); 1900 updateView();
1901 return syncOK; 1901 return syncOK;
1902 1902
1903 1903
1904#endif 1904#endif
1905 1905
1906} 1906}
1907 1907
1908void CalendarView::setSyncEventsReadOnly() 1908void CalendarView::setSyncEventsReadOnly()
1909{ 1909{
1910 mCalendar->setSyncEventsReadOnly(); 1910 mCalendar->setSyncEventsReadOnly();
1911} 1911}
1912 1912
1913bool CalendarView::loadCalendars() 1913bool CalendarView::loadCalendars()
1914{ 1914{
1915 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1915 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1916 KopiCalendarFile * cal = calendars.first(); 1916 KopiCalendarFile * cal = calendars.first();
1917 mCalendar->setDefaultCalendar( 1 ); 1917 mCalendar->setDefaultCalendar( 1 );
1918 openCalendar( MainWindow::defaultFileName(), false ); 1918 openCalendar( MainWindow::defaultFileName(), false );
1919 cal = calendars.next(); 1919 cal = calendars.next();
1920 while ( cal ) { 1920 while ( cal ) {
1921 addCalendar( cal ); 1921 addCalendar( cal );
1922 cal = calendars.next(); 1922 cal = calendars.next();
1923 } 1923 }
1924 restoreCalendarSettings(); 1924 restoreCalendarSettings();
1925 return true; 1925 return true;
1926} 1926}
1927bool CalendarView::restoreCalendarSettings() 1927bool CalendarView::restoreCalendarSettings()
1928{ 1928{
1929 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1929 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1930 KopiCalendarFile * cal = calendars.first(); 1930 KopiCalendarFile * cal = calendars.first();
1931 while ( cal ) { 1931 while ( cal ) {
1932 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 1932 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
1933 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 1933 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
1934 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 1934 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
1935 if ( cal->isStandard ) 1935 if ( cal->isStandard )
1936 mCalendar->setDefaultCalendar( cal->mCalNumber ); 1936 mCalendar->setDefaultCalendar( cal->mCalNumber );
1937 cal = calendars.next(); 1937 cal = calendars.next();
1938 } 1938 }
1939 setSyncEventsReadOnly(); 1939 setSyncEventsReadOnly();
1940 mCalendar->reInitAlarmSettings(); 1940 mCalendar->reInitAlarmSettings();
1941 updateUnmanagedViews(); 1941 updateUnmanagedViews();
1942 updateView(); 1942 updateView();
1943 return true; 1943 return true;
1944} 1944}
1945void CalendarView::addCalendarId( int id ) 1945void CalendarView::addCalendarId( int id )
1946{ 1946{
1947 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 1947 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
1948 if ( cal ) 1948 if ( cal )
1949 addCalendar( cal ); 1949 addCalendar( cal );
1950} 1950}
1951bool CalendarView::addCalendar( KopiCalendarFile * cal ) 1951bool CalendarView::addCalendar( KopiCalendarFile * cal )
1952{ 1952{
1953 cal->mErrorOnLoad = false; 1953 cal->mErrorOnLoad = false;
1954 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 1954 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
1955 cal->mLoadDt = QDateTime::currentDateTime(); 1955 cal->mLoadDt = QDateTime::currentDateTime();
1956 return true; 1956 return true;
1957 } 1957 }
1958 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); 1958 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
1959 cal->mErrorOnLoad = true; 1959 cal->mErrorOnLoad = true;
1960 return false; 1960 return false;
1961} 1961}
1962bool CalendarView::openCalendar(QString filename, bool merge) 1962bool CalendarView::openCalendar(QString filename, bool merge)
1963{ 1963{
1964 1964
1965 if (filename.isEmpty()) { 1965 if (filename.isEmpty()) {
1966 return false; 1966 return false;
1967 } 1967 }
1968 1968
1969 if (!QFile::exists(filename)) { 1969 if (!QFile::exists(filename)) {
1970 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1970 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1971 return false; 1971 return false;
1972 } 1972 }
1973 1973
1974 globalFlagBlockAgenda = 1; 1974 globalFlagBlockAgenda = 1;
1975 clearAllViews(); 1975 clearAllViews();
1976 if (!merge) { 1976 if (!merge) {
1977 mViewManager->setDocumentId( filename ); 1977 mViewManager->setDocumentId( filename );
1978 mCalendar->close(); 1978 mCalendar->close();
1979 } 1979 }
1980 mStorage->setFileName( filename ); 1980 mStorage->setFileName( filename );
1981 1981
1982 if ( mStorage->load() ) { 1982 if ( mStorage->load() ) {
1983 if ( merge ) ;//setModified( true ); 1983 if ( merge ) ;//setModified( true );
1984 else { 1984 else {
1985 //setModified( true ); 1985 //setModified( true );
1986 mViewManager->setDocumentId( filename ); 1986 mViewManager->setDocumentId( filename );
1987 mDialogManager->setDocumentId( filename ); 1987 mDialogManager->setDocumentId( filename );
1988 mTodoList->setDocumentId( filename ); 1988 mTodoList->setDocumentId( filename );
1989 } 1989 }
1990 globalFlagBlockAgenda = 2; 1990 globalFlagBlockAgenda = 2;
1991 // if ( getLastSyncEvent() ) 1991 // if ( getLastSyncEvent() )
1992 // getLastSyncEvent()->setReadOnly( true ); 1992 // getLastSyncEvent()->setReadOnly( true );
1993 mCalendar->reInitAlarmSettings(); 1993 mCalendar->reInitAlarmSettings();
1994 setSyncEventsReadOnly(); 1994 setSyncEventsReadOnly();
1995 updateUnmanagedViews(); 1995 updateUnmanagedViews();
1996 updateView(); 1996 updateView();
1997 if ( filename != MainWindow::defaultFileName() ) { 1997 if ( filename != MainWindow::defaultFileName() ) {
1998 saveCalendar( MainWindow::defaultFileName() ); 1998 saveCalendar( MainWindow::defaultFileName() );
1999 } else { 1999 } else {
2000 QFileInfo finf ( MainWindow::defaultFileName()); 2000 QFileInfo finf ( MainWindow::defaultFileName());
2001 if ( finf.exists() ) { 2001 if ( finf.exists() ) {
2002 setLoadedFileVersion( finf.lastModified () ); 2002 setLoadedFileVersion( finf.lastModified () );
2003 } 2003 }
2004 } 2004 }
2005 return true; 2005 return true;
2006 } else { 2006 } else {
2007 // while failing to load, the calendar object could 2007 // while failing to load, the calendar object could
2008 // have become partially populated. Clear it out. 2008 // have become partially populated. Clear it out.
2009 if ( !merge ) { 2009 if ( !merge ) {
2010 mCalendar->close(); 2010 mCalendar->close();
2011 mViewManager->setDocumentId( filename ); 2011 mViewManager->setDocumentId( filename );
2012 mDialogManager->setDocumentId( filename ); 2012 mDialogManager->setDocumentId( filename );
2013 mTodoList->setDocumentId( filename ); 2013 mTodoList->setDocumentId( filename );
2014 } 2014 }
2015 2015
2016 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2016 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
2017 2017
2018 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2018 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
2019 globalFlagBlockAgenda = 2; 2019 globalFlagBlockAgenda = 2;
2020 mCalendar->reInitAlarmSettings(); 2020 mCalendar->reInitAlarmSettings();
2021 setSyncEventsReadOnly(); 2021 setSyncEventsReadOnly();
2022 updateUnmanagedViews(); 2022 updateUnmanagedViews();
2023 updateView(); 2023 updateView();
2024 } 2024 }
2025 return false; 2025 return false;
2026} 2026}
2027void CalendarView::showOpenError() 2027void CalendarView::showOpenError()
2028{ 2028{
2029 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2029 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2030} 2030}
2031void CalendarView::setLoadedFileVersion(QDateTime dt) 2031void CalendarView::setLoadedFileVersion(QDateTime dt)
2032{ 2032{
2033 loadedFileVersion = dt; 2033 loadedFileVersion = dt;
2034} 2034}
2035bool CalendarView::checkFileChanged(QString fn) 2035bool CalendarView::checkFileChanged(QString fn)
2036{ 2036{
2037 QFileInfo finf ( fn ); 2037 QFileInfo finf ( fn );
2038 if ( !finf.exists() ) 2038 if ( !finf.exists() )
2039 return true; 2039 return true;
2040 QDateTime dt = finf.lastModified (); 2040 QDateTime dt = finf.lastModified ();
2041 if ( dt <= loadedFileVersion ) 2041 if ( dt <= loadedFileVersion )
2042 return false; 2042 return false;
2043 return true; 2043 return true;
2044 2044
2045} 2045}
2046void CalendarView::watchSavedFile() 2046void CalendarView::watchSavedFile()
2047{ 2047{
2048 QFileInfo finf ( MainWindow::defaultFileName()); 2048 QFileInfo finf ( MainWindow::defaultFileName());
2049 if ( !finf.exists() ) 2049 if ( !finf.exists() )
2050 return; 2050 return;
2051 QDateTime dt = finf.lastModified (); 2051 QDateTime dt = finf.lastModified ();
2052 if ( dt < loadedFileVersion ) { 2052 if ( dt < loadedFileVersion ) {
2053 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2053 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2054 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2054 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2055 return; 2055 return;
2056 } 2056 }
2057 loadedFileVersion = dt; 2057 loadedFileVersion = dt;
2058} 2058}
2059bool CalendarView::checkAllFileVersions() 2059bool CalendarView::checkAllFileVersions()
2060{ 2060{
2061 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2061 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2062 KopiCalendarFile * cal = calendars.first(); 2062 KopiCalendarFile * cal = calendars.first();
2063 mCalendar->setDefaultCalendar( 1 ); 2063 mCalendar->setDefaultCalendar( 1 );
2064 mCalendar->setDefaultCalendarEnabledOnly(); 2064 mCalendar->setDefaultCalendarEnabledOnly();
2065 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2065 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2066 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2066 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2067 restoreCalendarSettings(); 2067 restoreCalendarSettings();
2068 return false; 2068 return false;
2069 } 2069 }
2070 } 2070 }
2071 cal = calendars.next(); 2071 cal = calendars.next();
2072 QDateTime storeTemp = loadedFileVersion; 2072 QDateTime storeTemp = loadedFileVersion;
2073 while ( cal ) { 2073 while ( cal ) {
2074 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2074 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2075 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2075 mCalendar->setDefaultCalendar( cal->mCalNumber );
2076 mCalendar->setDefaultCalendarEnabledOnly(); 2076 mCalendar->setDefaultCalendarEnabledOnly();
2077 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2077 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2078 if ( !checkFileVersion(cal->mFileName )) { 2078 if ( !checkFileVersion(cal->mFileName )) {
2079 loadedFileVersion = storeTemp; 2079 loadedFileVersion = storeTemp;
2080 restoreCalendarSettings(); 2080 restoreCalendarSettings();
2081 return false; 2081 return false;
2082 } 2082 }
2083 } 2083 }
2084 cal = calendars.next(); 2084 cal = calendars.next();
2085 } 2085 }
2086 loadedFileVersion = storeTemp; 2086 loadedFileVersion = storeTemp;
2087 return true; 2087 return true;
2088} 2088}
2089bool CalendarView::checkFileVersion(QString fn) 2089bool CalendarView::checkFileVersion(QString fn)
2090{ 2090{
2091 QFileInfo finf ( fn ); 2091 QFileInfo finf ( fn );
2092 if ( !finf.exists() ) 2092 if ( !finf.exists() )
2093 return true; 2093 return true;
2094 QDateTime dt = finf.lastModified (); 2094 QDateTime dt = finf.lastModified ();
2095 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2095 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2096 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2096 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2097 if ( dt <= loadedFileVersion ) 2097 if ( dt <= loadedFileVersion )
2098 return true; 2098 return true;
2099 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\n on disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(fn).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 2099 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
2100 i18n("KO/Pi Warning"),i18n("Overwrite"), 2100 i18n("KO/Pi Warning"),i18n("Overwrite"),
2101 i18n("Sync+save")); 2101 i18n("Sync+save"));
2102 2102
2103 if ( km == KMessageBox::Cancel ) 2103 if ( km == KMessageBox::Cancel )
2104 return false; 2104 return false;
2105 if ( km == KMessageBox::Yes ) 2105 if ( km == KMessageBox::Yes )
2106 return true; 2106 return true;
2107 2107
2108 setSyncDevice("deleteaftersync" ); 2108 setSyncDevice("deleteaftersync" );
2109 mSyncManager->mAskForPreferences = true; 2109 mSyncManager->mAskForPreferences = true;
2110 mSyncManager->mSyncAlgoPrefs = 3; 2110 mSyncManager->mSyncAlgoPrefs = 3;
2111 mSyncManager->mWriteBackFile = false; 2111 mSyncManager->mWriteBackFile = false;
2112 mSyncManager->mWriteBackExistingOnly = false; 2112 mSyncManager->mWriteBackExistingOnly = false;
2113 mSyncManager->mShowSyncSummary = false; 2113 mSyncManager->mShowSyncSummary = false;
2114 syncCalendar( fn, 3 ); 2114 syncCalendar( fn, 3 );
2115 Event * e = getLastSyncEvent(); 2115 Event * e = getLastSyncEvent();
2116 if ( e ) 2116 if ( e )
2117 mCalendar->deleteEvent( e ); 2117 mCalendar->deleteEvent( e );
2118 return true; 2118 return true;
2119} 2119}
2120bool CalendarView::saveCalendars() 2120bool CalendarView::saveCalendars()
2121{ 2121{
2122 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2122 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2123 KopiCalendarFile * cal = calendars.first(); 2123 KopiCalendarFile * cal = calendars.first();
2124 mCalendar->setDefaultCalendar( 1 ); 2124 mCalendar->setDefaultCalendar( 1 );
2125 mCalendar->setDefaultCalendarEnabledOnly(); 2125 mCalendar->setDefaultCalendarEnabledOnly();
2126 saveCalendar( MainWindow::defaultFileName() ); 2126 saveCalendar( MainWindow::defaultFileName() );
2127 cal = calendars.next(); 2127 cal = calendars.next();
2128 while ( cal ) { 2128 while ( cal ) {
2129 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2129 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2130 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2130 mCalendar->setDefaultCalendar( cal->mCalNumber );
2131 mCalendar->setDefaultCalendarEnabledOnly(); 2131 mCalendar->setDefaultCalendarEnabledOnly();
2132 if ( saveCalendar( cal->mFileName ) ) 2132 if ( saveCalendar( cal->mFileName ) )
2133 cal->mLoadDt = QDateTime::currentDateTime(); 2133 cal->mLoadDt = QDateTime::currentDateTime();
2134 } 2134 }
2135 cal = calendars.next(); 2135 cal = calendars.next();
2136 } 2136 }
2137 restoreCalendarSettings(); 2137 restoreCalendarSettings();
2138 return true; 2138 return true;
2139} 2139}
2140bool CalendarView::saveCalendar( QString filename ) 2140bool CalendarView::saveCalendar( QString filename )
2141{ 2141{
2142 2142
2143 // Store back all unsaved data into calendar object 2143 // Store back all unsaved data into calendar object
2144 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2144 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2145 if ( mViewManager->currentView() ) 2145 if ( mViewManager->currentView() )
2146 mViewManager->currentView()->flushView(); 2146 mViewManager->currentView()->flushView();
2147 2147
2148 2148
2149 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2149 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2150 mStorage->setSaveFormat( new ICalFormat() ); 2150 mStorage->setSaveFormat( new ICalFormat() );
2151 mStorage->setFileName( filename ); 2151 mStorage->setFileName( filename );
2152 bool success; 2152 bool success;
2153 success = mStorage->save(); 2153 success = mStorage->save();
2154 if ( !success ) { 2154 if ( !success ) {
2155 return false; 2155 return false;
2156 } 2156 }
2157 if ( filename == MainWindow::defaultFileName() ) { 2157 if ( filename == MainWindow::defaultFileName() ) {
2158 setLoadedFileVersion( lfv ); 2158 setLoadedFileVersion( lfv );
2159 watchSavedFile(); 2159 watchSavedFile();
2160 } 2160 }
2161 return true; 2161 return true;
2162} 2162}
2163 2163
2164void CalendarView::closeCalendar() 2164void CalendarView::closeCalendar()
2165{ 2165{
2166 2166
2167 // child windows no longer valid 2167 // child windows no longer valid
2168 clearAllViews(); 2168 clearAllViews();
2169 emit closingDown(); 2169 emit closingDown();
2170 2170
2171 mCalendar->close(); 2171 mCalendar->close();
2172 setModified(false); 2172 setModified(false);
2173 updateView(); 2173 updateView();
2174} 2174}
2175 2175
2176void CalendarView::archiveCalendar() 2176void CalendarView::archiveCalendar()
2177{ 2177{
2178 mDialogManager->showArchiveDialog(); 2178 mDialogManager->showArchiveDialog();
2179} 2179}
2180 2180
2181 2181
2182void CalendarView::readSettings() 2182void CalendarView::readSettings()
2183{ 2183{
2184 2184
2185 2185
2186 // mViewManager->showAgendaView(); 2186 // mViewManager->showAgendaView();
2187 QString str; 2187 QString str;
2188 //qDebug("CalendarView::readSettings() "); 2188 //qDebug("CalendarView::readSettings() ");
2189 // read settings from the KConfig, supplying reasonable 2189 // read settings from the KConfig, supplying reasonable
2190 // defaults where none are to be found 2190 // defaults where none are to be found
2191 KConfig *config = KOGlobals::config(); 2191 KConfig *config = KOGlobals::config();
2192#ifndef KORG_NOSPLITTER 2192#ifndef KORG_NOSPLITTER
2193 config->setGroup("KOrganizer Geometry"); 2193 config->setGroup("KOrganizer Geometry");
2194 2194
2195 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2195 QValueList<int> sizes = config->readIntListEntry("Separator1");
2196 if (sizes.count() != 2) { 2196 if (sizes.count() != 2) {
2197 sizes << mDateNavigator->minimumSizeHint().width(); 2197 sizes << mDateNavigator->minimumSizeHint().width();
2198 sizes << 300; 2198 sizes << 300;
2199 } 2199 }
2200 mPanner->setSizes(sizes); 2200 mPanner->setSizes(sizes);
2201 2201
2202 sizes = config->readIntListEntry("Separator2"); 2202 sizes = config->readIntListEntry("Separator2");
2203 if ( ( mResourceView && sizes.count() == 4 ) || 2203 if ( ( mResourceView && sizes.count() == 4 ) ||
2204 ( !mResourceView && sizes.count() == 3 ) ) { 2204 ( !mResourceView && sizes.count() == 3 ) ) {
2205 mLeftSplitter->setSizes(sizes); 2205 mLeftSplitter->setSizes(sizes);
2206 } 2206 }
2207#endif 2207#endif
2208 globalFlagBlockAgenda = 1; 2208 globalFlagBlockAgenda = 1;
2209 mViewManager->showAgendaView(); 2209 mViewManager->showAgendaView();
2210 //mViewManager->readSettings( config ); 2210 //mViewManager->readSettings( config );
2211 mTodoList->restoreLayout(config,QString("Todo Layout")); 2211 mTodoList->restoreLayout(config,QString("Todo Layout"));
2212 readFilterSettings(config); 2212 readFilterSettings(config);
2213 2213
2214#ifdef DESKTOP_VERSION 2214#ifdef DESKTOP_VERSION
2215 config->setGroup("WidgetLayout"); 2215 config->setGroup("WidgetLayout");
2216 QStringList list; 2216 QStringList list;
2217 list = config->readListEntry("MainLayout"); 2217 list = config->readListEntry("MainLayout");
2218 int x,y,w,h; 2218 int x,y,w,h;
2219 if ( ! list.isEmpty() ) { 2219 if ( ! list.isEmpty() ) {
2220 x = list[0].toInt(); 2220 x = list[0].toInt();
2221 y = list[1].toInt(); 2221 y = list[1].toInt();
2222 w = list[2].toInt(); 2222 w = list[2].toInt();
2223 h = list[3].toInt(); 2223 h = list[3].toInt();
2224 KApplication::testCoords( &x,&y,&w,&h ); 2224 KApplication::testCoords( &x,&y,&w,&h );
2225 topLevelWidget()->setGeometry(x,y,w,h); 2225 topLevelWidget()->setGeometry(x,y,w,h);
2226 2226
2227 } else { 2227 } else {
2228 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2228 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2229 } 2229 }
2230 list = config->readListEntry("EditEventLayout"); 2230 list = config->readListEntry("EditEventLayout");
2231 if ( ! list.isEmpty() ) { 2231 if ( ! list.isEmpty() ) {
2232 x = list[0].toInt(); 2232 x = list[0].toInt();
2233 y = list[1].toInt(); 2233 y = list[1].toInt();
2234 w = list[2].toInt(); 2234 w = list[2].toInt();
2235 h = list[3].toInt(); 2235 h = list[3].toInt();
2236 KApplication::testCoords( &x,&y,&w,&h ); 2236 KApplication::testCoords( &x,&y,&w,&h );
2237 mEventEditor->setGeometry(x,y,w,h); 2237 mEventEditor->setGeometry(x,y,w,h);
2238 2238
2239 } 2239 }
2240 list = config->readListEntry("EditTodoLayout"); 2240 list = config->readListEntry("EditTodoLayout");
2241 if ( ! list.isEmpty() ) { 2241 if ( ! list.isEmpty() ) {
2242 x = list[0].toInt(); 2242 x = list[0].toInt();
2243 y = list[1].toInt(); 2243 y = list[1].toInt();
2244 w = list[2].toInt(); 2244 w = list[2].toInt();
2245 h = list[3].toInt(); 2245 h = list[3].toInt();
2246 KApplication::testCoords( &x,&y,&w,&h ); 2246 KApplication::testCoords( &x,&y,&w,&h );
2247 mTodoEditor->setGeometry(x,y,w,h); 2247 mTodoEditor->setGeometry(x,y,w,h);
2248 2248
2249 } 2249 }
2250 list = config->readListEntry("ViewerLayout"); 2250 list = config->readListEntry("ViewerLayout");
2251 if ( ! list.isEmpty() ) { 2251 if ( ! list.isEmpty() ) {
2252 x = list[0].toInt(); 2252 x = list[0].toInt();
2253 y = list[1].toInt(); 2253 y = list[1].toInt();
2254 w = list[2].toInt(); 2254 w = list[2].toInt();
2255 h = list[3].toInt(); 2255 h = list[3].toInt();
2256 KApplication::testCoords( &x,&y,&w,&h ); 2256 KApplication::testCoords( &x,&y,&w,&h );
2257 getEventViewerDialog()->setGeometry(x,y,w,h); 2257 getEventViewerDialog()->setGeometry(x,y,w,h);
2258 } 2258 }
2259#endif 2259#endif
2260 config->setGroup( "Views" ); 2260 config->setGroup( "Views" );
2261 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2261 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2262 2262
2263 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2263 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2264 2264
2265 int resetval = 0; 2265 int resetval = 0;
2266 int maxVal = 0; 2266 int maxVal = 0;
2267 if (sizes.count() != 3) { 2267 if (sizes.count() != 3) {
2268 if ( KOPrefs::instance()->mVerticalScreen ) { 2268 if ( KOPrefs::instance()->mVerticalScreen ) {
2269 resetval = mDateNavigator->sizeHint().width()+2; 2269 resetval = mDateNavigator->sizeHint().width()+2;
2270 } else { 2270 } else {
2271 resetval = mDateNavigator->sizeHint().height()+2; 2271 resetval = mDateNavigator->sizeHint().height()+2;
2272 } 2272 }
2273 } 2273 }
2274 if ( resetval ) { 2274 if ( resetval ) {
2275 sizes.clear(); 2275 sizes.clear();
2276 if ( KOPrefs::instance()->mVerticalScreen ) { 2276 if ( KOPrefs::instance()->mVerticalScreen ) {
2277 maxVal = QApplication::desktop()->width() -10; 2277 maxVal = QApplication::desktop()->width() -10;
2278 } else { 2278 } else {
2279 maxVal = QApplication::desktop()->height()-10; 2279 maxVal = QApplication::desktop()->height()-10;
2280 } 2280 }
2281 sizes << resetval; 2281 sizes << resetval;
2282 if ( maxVal < resetval + resetval) 2282 if ( maxVal < resetval + resetval)
2283 resetval = maxVal - resetval; 2283 resetval = maxVal - resetval;
2284 sizes << resetval; 2284 sizes << resetval;
2285 sizes << 100; 2285 sizes << 100;
2286 } 2286 }
2287 mLeftFrame->setSizes(sizes); 2287 mLeftFrame->setSizes(sizes);
2288 sizes = config->readIntListEntry("Main Splitter Frame"); 2288 sizes = config->readIntListEntry("Main Splitter Frame");
2289 resetval = 0; 2289 resetval = 0;
2290 maxVal = 0; 2290 maxVal = 0;
2291 if (sizes.count() != 2) { 2291 if (sizes.count() != 2) {
2292 if ( !KOPrefs::instance()->mVerticalScreen ) { 2292 if ( !KOPrefs::instance()->mVerticalScreen ) {
2293 resetval = mDateNavigator->sizeHint().width()+2; 2293 resetval = mDateNavigator->sizeHint().width()+2;
2294 } else { 2294 } else {
2295 resetval = mDateNavigator->sizeHint().height()+2; 2295 resetval = mDateNavigator->sizeHint().height()+2;
2296 } 2296 }
2297 } 2297 }
2298 if ( resetval ) { 2298 if ( resetval ) {
2299 sizes.clear(); 2299 sizes.clear();
2300 if ( !KOPrefs::instance()->mVerticalScreen ) { 2300 if ( !KOPrefs::instance()->mVerticalScreen ) {
2301 maxVal = QApplication::desktop()->width() -10; 2301 maxVal = QApplication::desktop()->width() -10;
2302 } else { 2302 } else {
2303 maxVal = QApplication::desktop()->height()-10; 2303 maxVal = QApplication::desktop()->height()-10;
2304 } 2304 }
2305 sizes << resetval; 2305 sizes << resetval;
2306 if ( maxVal < resetval + resetval) 2306 if ( maxVal < resetval + resetval)
2307 resetval = maxVal - resetval; 2307 resetval = maxVal - resetval;
2308 sizes << resetval; 2308 sizes << resetval;
2309 } 2309 }
2310 mMainFrame->setSizes(sizes); 2310 mMainFrame->setSizes(sizes);
2311 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2311 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2312 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2312 else if ( dateCount == 7 ) mNavigator->selectWeek();
2313 else mNavigator->selectDates( dateCount ); 2313 else mNavigator->selectDates( dateCount );
2314 // mViewManager->readSettings( config ); 2314 // mViewManager->readSettings( config );
2315 updateConfig(); 2315 updateConfig();
2316 globalFlagBlockAgenda = 2; 2316 globalFlagBlockAgenda = 2;
2317 mViewManager->readSettings( config ); 2317 mViewManager->readSettings( config );
2318 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2318 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2319} 2319}
2320 2320
2321void CalendarView::checkSuspendAlarm() 2321void CalendarView::checkSuspendAlarm()
2322{ 2322{
2323 if ( mSuspendTimer->isActive() ) { 2323 if ( mSuspendTimer->isActive() ) {
2324 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2324 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2325 } 2325 }
2326} 2326}
2327void CalendarView::writeSettings() 2327void CalendarView::writeSettings()
2328{ 2328{
2329 // kdDebug() << "CalendarView::writeSettings" << endl; 2329 // kdDebug() << "CalendarView::writeSettings" << endl;
2330 2330
2331 KConfig *config = KOGlobals::config(); 2331 KConfig *config = KOGlobals::config();
2332 2332
2333 mViewManager->writeSettings( config ); 2333 mViewManager->writeSettings( config );
2334 mTodoList->saveLayout(config,QString("Todo Layout")); 2334 mTodoList->saveLayout(config,QString("Todo Layout"));
2335 mDialogManager->writeSettings( config ); 2335 mDialogManager->writeSettings( config );
2336 //KOPrefs::instance()->usrWriteConfig(); 2336 //KOPrefs::instance()->usrWriteConfig();
2337 KOPrefs::instance()->writeConfig(); 2337 KOPrefs::instance()->writeConfig();
2338 2338
2339 writeFilterSettings(config); 2339 writeFilterSettings(config);
2340 config->setGroup( "AppRun" ); 2340 config->setGroup( "AppRun" );
2341 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2341 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2342 int days = dt.daysTo( QDate::currentDate() ); 2342 int days = dt.daysTo( QDate::currentDate() );
2343 dt = dt.addDays( days ); 2343 dt = dt.addDays( days );
2344 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2344 int secs = dt.secsTo( QDateTime::currentDateTime() );
2345 config->writeEntry( "LatestProgramStopDays", days ); 2345 config->writeEntry( "LatestProgramStopDays", days );
2346 config->writeEntry( "LatestProgramStopSecs", secs ); 2346 config->writeEntry( "LatestProgramStopSecs", secs );
2347 //qDebug("KO: Writing stop time: %d ", secs); 2347 //qDebug("KO: Writing stop time: %d ", secs);
2348 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2348 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2349 //QDateTime latest = dt.addSecs ( secs ); 2349 //QDateTime latest = dt.addSecs ( secs );
2350 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2350 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2351 config->setGroup( "Views" ); 2351 config->setGroup( "Views" );
2352 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2352 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2353 2353
2354#if 0 2354#if 0
2355 qDebug("********************* "); 2355 qDebug("********************* ");
2356 qDebug("Testcode secsto "); 2356 qDebug("Testcode secsto ");
2357 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2357 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2358 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2358 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2359 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2359 int secsto = dt_nodaylight.secsTo( dt_daylight );
2360 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2360 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2361 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2361 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2362 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2362 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2363 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2363 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2364 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2364 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2365 qDebug("********************* testcode end"); 2365 qDebug("********************* testcode end");
2366 2366
2367#endif 2367#endif
2368 2368
2369 QValueList<int> listINT = mLeftFrame->sizes(); 2369 QValueList<int> listINT = mLeftFrame->sizes();
2370 config->writeEntry("Left Splitter Frame",listINT); 2370 config->writeEntry("Left Splitter Frame",listINT);
2371 QValueList<int> listINT2 = mMainFrame->sizes(); 2371 QValueList<int> listINT2 = mMainFrame->sizes();
2372 config->writeEntry("Main Splitter Frame",listINT2); 2372 config->writeEntry("Main Splitter Frame",listINT2);
2373#ifdef DESKTOP_VERSION 2373#ifdef DESKTOP_VERSION
2374 config->setGroup("WidgetLayout"); 2374 config->setGroup("WidgetLayout");
2375 QStringList list ;//= config->readListEntry("MainLayout"); 2375 QStringList list ;//= config->readListEntry("MainLayout");
2376 int x,y,w,h; 2376 int x,y,w,h;
2377 QWidget* wid; 2377 QWidget* wid;
2378 wid = topLevelWidget(); 2378 wid = topLevelWidget();
2379 x = wid->geometry().x(); 2379 x = wid->geometry().x();
2380 y = wid->geometry().y(); 2380 y = wid->geometry().y();
2381 w = wid->width(); 2381 w = wid->width();
2382 h = wid->height(); 2382 h = wid->height();
2383 list.clear(); 2383 list.clear();
2384 list << QString::number( x ); 2384 list << QString::number( x );
2385 list << QString::number( y ); 2385 list << QString::number( y );
2386 list << QString::number( w ); 2386 list << QString::number( w );
2387 list << QString::number( h ); 2387 list << QString::number( h );
2388 config->writeEntry("MainLayout",list ); 2388 config->writeEntry("MainLayout",list );
2389 2389
2390 wid = mEventEditor; 2390 wid = mEventEditor;
2391 x = wid->geometry().x(); 2391 x = wid->geometry().x();
2392 y = wid->geometry().y(); 2392 y = wid->geometry().y();
2393 w = wid->width(); 2393 w = wid->width();
2394 h = wid->height(); 2394 h = wid->height();
2395 list.clear(); 2395 list.clear();
2396 list << QString::number( x ); 2396 list << QString::number( x );
2397 list << QString::number( y ); 2397 list << QString::number( y );
2398 list << QString::number( w ); 2398 list << QString::number( w );
2399 list << QString::number( h ); 2399 list << QString::number( h );
2400 config->writeEntry("EditEventLayout",list ); 2400 config->writeEntry("EditEventLayout",list );
2401 2401
2402 wid = mTodoEditor; 2402 wid = mTodoEditor;
2403 x = wid->geometry().x(); 2403 x = wid->geometry().x();
2404 y = wid->geometry().y(); 2404 y = wid->geometry().y();
2405 w = wid->width(); 2405 w = wid->width();
2406 h = wid->height(); 2406 h = wid->height();
2407 list.clear(); 2407 list.clear();
2408 list << QString::number( x ); 2408 list << QString::number( x );
2409 list << QString::number( y ); 2409 list << QString::number( y );
2410 list << QString::number( w ); 2410 list << QString::number( w );
2411 list << QString::number( h ); 2411 list << QString::number( h );
2412 config->writeEntry("EditTodoLayout",list ); 2412 config->writeEntry("EditTodoLayout",list );
2413 wid = getEventViewerDialog(); 2413 wid = getEventViewerDialog();
2414 x = wid->geometry().x(); 2414 x = wid->geometry().x();
2415 y = wid->geometry().y(); 2415 y = wid->geometry().y();
2416 w = wid->width(); 2416 w = wid->width();
2417 h = wid->height(); 2417 h = wid->height();
2418 list.clear(); 2418 list.clear();
2419 list << QString::number( x ); 2419 list << QString::number( x );
2420 list << QString::number( y ); 2420 list << QString::number( y );
2421 list << QString::number( w ); 2421 list << QString::number( w );
2422 list << QString::number( h ); 2422 list << QString::number( h );
2423 config->writeEntry("ViewerLayout",list ); 2423 config->writeEntry("ViewerLayout",list );
2424 wid = mDialogManager->getSearchDialog(); 2424 wid = mDialogManager->getSearchDialog();
2425 if ( wid ) { 2425 if ( wid ) {
2426 x = wid->geometry().x(); 2426 x = wid->geometry().x();
2427 y = wid->geometry().y(); 2427 y = wid->geometry().y();
2428 w = wid->width(); 2428 w = wid->width();
2429 h = wid->height(); 2429 h = wid->height();
2430 list.clear(); 2430 list.clear();
2431 list << QString::number( x ); 2431 list << QString::number( x );
2432 list << QString::number( y ); 2432 list << QString::number( y );
2433 list << QString::number( w ); 2433 list << QString::number( w );
2434 list << QString::number( h ); 2434 list << QString::number( h );
2435 config->writeEntry("SearchLayout",list ); 2435 config->writeEntry("SearchLayout",list );
2436 } 2436 }
2437#endif 2437#endif
2438 2438
2439 2439
2440 config->sync(); 2440 config->sync();
2441} 2441}
2442 2442
2443void CalendarView::readFilterSettings(KConfig *config) 2443void CalendarView::readFilterSettings(KConfig *config)
2444{ 2444{
2445 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2445 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2446 2446
2447 mFilters.clear(); 2447 mFilters.clear();
2448 2448
2449 config->setGroup("General"); 2449 config->setGroup("General");
2450 QStringList filterList = config->readListEntry("CalendarFilters"); 2450 QStringList filterList = config->readListEntry("CalendarFilters");
2451 2451
2452 QStringList::ConstIterator it = filterList.begin(); 2452 QStringList::ConstIterator it = filterList.begin();
2453 QStringList::ConstIterator end = filterList.end(); 2453 QStringList::ConstIterator end = filterList.end();
2454 while(it != end) { 2454 while(it != end) {
2455 // kdDebug() << " filter: " << (*it) << endl; 2455 // kdDebug() << " filter: " << (*it) << endl;
2456 2456
2457 CalFilter *filter; 2457 CalFilter *filter;
2458 filter = new CalFilter(*it); 2458 filter = new CalFilter(*it);
2459 config->setGroup("Filter_" + (*it).utf8()); 2459 config->setGroup("Filter_" + (*it).utf8());
2460 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2460 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2461 filter->setCriteria(config->readNumEntry("Criteria",0)); 2461 filter->setCriteria(config->readNumEntry("Criteria",0));
2462 filter->setCategoryList(config->readListEntry("CategoryList")); 2462 filter->setCategoryList(config->readListEntry("CategoryList"));
2463 mFilters.append(filter); 2463 mFilters.append(filter);
2464 2464
2465 ++it; 2465 ++it;
2466 } 2466 }
2467 2467
2468 if (mFilters.count() == 0) { 2468 if (mFilters.count() == 0) {
2469 CalFilter *filter = new CalFilter(i18n("Default")); 2469 CalFilter *filter = new CalFilter(i18n("Default"));
2470 mFilters.append(filter); 2470 mFilters.append(filter);
2471 } 2471 }
2472 mFilterView->updateFilters(); 2472 mFilterView->updateFilters();
2473 config->setGroup("FilterView"); 2473 config->setGroup("FilterView");
2474 2474
2475 mFilterView->blockSignals(true); 2475 mFilterView->blockSignals(true);
2476 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2476 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2477 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2477 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2478 mFilterView->blockSignals(false); 2478 mFilterView->blockSignals(false);
2479 // We do it manually to avoid it being done twice by the above calls 2479 // We do it manually to avoid it being done twice by the above calls
2480 updateFilter(); 2480 updateFilter();
2481} 2481}
2482 2482
2483void CalendarView::writeFilterSettings(KConfig *config) 2483void CalendarView::writeFilterSettings(KConfig *config)
2484{ 2484{
2485 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2485 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2486 2486
2487 QStringList filterList; 2487 QStringList filterList;
2488 2488
2489 CalFilter *filter = mFilters.first(); 2489 CalFilter *filter = mFilters.first();
2490 while(filter) { 2490 while(filter) {
2491 // kdDebug() << " fn: " << filter->name() << endl; 2491 // kdDebug() << " fn: " << filter->name() << endl;
2492 filterList << filter->name(); 2492 filterList << filter->name();
2493 config->setGroup("Filter_" + filter->name().utf8()); 2493 config->setGroup("Filter_" + filter->name().utf8());
2494 config->writeEntry("Criteria",filter->criteria()); 2494 config->writeEntry("Criteria",filter->criteria());
2495 config->writeEntry("CategoryList",filter->categoryList()); 2495 config->writeEntry("CategoryList",filter->categoryList());
2496 filter = mFilters.next(); 2496 filter = mFilters.next();
2497 } 2497 }
2498 config->setGroup("General"); 2498 config->setGroup("General");
2499 config->writeEntry("CalendarFilters",filterList); 2499 config->writeEntry("CalendarFilters",filterList);
2500 2500
2501 config->setGroup("FilterView"); 2501 config->setGroup("FilterView");
2502 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2502 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2503 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2503 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2504} 2504}
2505 2505
2506 2506
2507void CalendarView::goToday() 2507void CalendarView::goToday()
2508{ 2508{
2509 if ( mViewManager->currentView()->isMonthView() ) 2509 if ( mViewManager->currentView()->isMonthView() )
2510 mNavigator->selectTodayMonth(); 2510 mNavigator->selectTodayMonth();
2511 else 2511 else
2512 mNavigator->selectToday(); 2512 mNavigator->selectToday();
2513} 2513}
2514 2514
2515void CalendarView::goNext() 2515void CalendarView::goNext()
2516{ 2516{
2517 mNavigator->selectNext(); 2517 mNavigator->selectNext();
2518} 2518}
2519 2519
2520void CalendarView::goPrevious() 2520void CalendarView::goPrevious()
2521{ 2521{
2522 mNavigator->selectPrevious(); 2522 mNavigator->selectPrevious();
2523} 2523}
2524void CalendarView::goNextMonth() 2524void CalendarView::goNextMonth()
2525{ 2525{
2526 mNavigator->selectNextMonth(); 2526 mNavigator->selectNextMonth();
2527} 2527}
2528 2528
2529void CalendarView::goPreviousMonth() 2529void CalendarView::goPreviousMonth()
2530{ 2530{
2531 mNavigator->selectPreviousMonth(); 2531 mNavigator->selectPreviousMonth();
2532} 2532}
2533 2533
2534void CalendarView::updateConfig() 2534void CalendarView::updateConfig()
2535{ 2535{
2536 if ( KOPrefs::instance()->mUseAppColors ) 2536 if ( KOPrefs::instance()->mUseAppColors )
2537 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2537 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2538 emit configChanged(); 2538 emit configChanged();
2539 mTodoList->updateConfig(); 2539 mTodoList->updateConfig();
2540 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2540 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2541 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2541 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2542 // To make the "fill window" configurations work 2542 // To make the "fill window" configurations work
2543 //mViewManager->raiseCurrentView(); 2543 //mViewManager->raiseCurrentView();
2544} 2544}
2545 2545
2546 2546
2547void CalendarView::eventChanged(Event *event) 2547void CalendarView::eventChanged(Event *event)
2548{ 2548{
2549 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2549 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2550 //updateUnmanagedViews(); 2550 //updateUnmanagedViews();
2551} 2551}
2552 2552
2553void CalendarView::eventAdded(Event *event) 2553void CalendarView::eventAdded(Event *event)
2554{ 2554{
2555 changeEventDisplay(event,KOGlobals::EVENTADDED); 2555 changeEventDisplay(event,KOGlobals::EVENTADDED);
2556} 2556}
2557 2557
2558void CalendarView::eventToBeDeleted(Event *) 2558void CalendarView::eventToBeDeleted(Event *)
2559{ 2559{
2560 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2560 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2561} 2561}
2562 2562
2563void CalendarView::eventDeleted() 2563void CalendarView::eventDeleted()
2564{ 2564{
2565 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2565 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2566} 2566}
2567void CalendarView::changeTodoDisplay(Todo *which, int action) 2567void CalendarView::changeTodoDisplay(Todo *which, int action)
2568{ 2568{
2569 changeIncidenceDisplay((Incidence *)which, action); 2569 changeIncidenceDisplay((Incidence *)which, action);
2570 mDateNavigator->updateView(); //LR 2570 mDateNavigator->updateView(); //LR
2571 //mDialogManager->updateSearchDialog(); 2571 //mDialogManager->updateSearchDialog();
2572 2572
2573 if (which) { 2573 if (which) {
2574 mViewManager->updateWNview(); 2574 mViewManager->updateWNview();
2575 //mTodoList->updateView(); 2575 //mTodoList->updateView();
2576 } 2576 }
2577 2577
2578} 2578}
2579 2579
2580void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2580void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2581{ 2581{
2582 updateUnmanagedViews(); 2582 updateUnmanagedViews();
2583 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2583 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2584 if ( action == KOGlobals::EVENTDELETED ) { //delete 2584 if ( action == KOGlobals::EVENTDELETED ) { //delete
2585 mCalendar->checkAlarmForIncidence( 0, true ); 2585 mCalendar->checkAlarmForIncidence( 0, true );
2586 if ( mEventViewerDialog ) 2586 if ( mEventViewerDialog )
2587 mEventViewerDialog->hide(); 2587 mEventViewerDialog->hide();
2588 } 2588 }
2589 else 2589 else
2590 mCalendar->checkAlarmForIncidence( which , false ); 2590 mCalendar->checkAlarmForIncidence( which , false );
2591} 2591}
2592 2592
2593// most of the changeEventDisplays() right now just call the view's 2593// most of the changeEventDisplays() right now just call the view's
2594// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2594// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2595void CalendarView::changeEventDisplay(Event *which, int action) 2595void CalendarView::changeEventDisplay(Event *which, int action)
2596{ 2596{
2597 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2597 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2598 changeIncidenceDisplay((Incidence *)which, action); 2598 changeIncidenceDisplay((Incidence *)which, action);
2599 mDateNavigator->updateView(); 2599 mDateNavigator->updateView();
2600 //mDialogManager->updateSearchDialog(); 2600 //mDialogManager->updateSearchDialog();
2601 2601
2602 if (which) { 2602 if (which) {
2603 // If there is an event view visible update the display 2603 // If there is an event view visible update the display
2604 mViewManager->currentView()->changeEventDisplay(which,action); 2604 mViewManager->currentView()->changeEventDisplay(which,action);
2605 // TODO: check, if update needed 2605 // TODO: check, if update needed
2606 // if (which->getTodoStatus()) { 2606 // if (which->getTodoStatus()) {
2607 mTodoList->updateView(); 2607 mTodoList->updateView();
2608 // } 2608 // }
2609 } else { 2609 } else {
2610 mViewManager->currentView()->updateView(); 2610 mViewManager->currentView()->updateView();
2611 } 2611 }
2612} 2612}
2613 2613
2614 2614
2615void CalendarView::updateTodoViews() 2615void CalendarView::updateTodoViews()
2616{ 2616{
2617 mTodoList->updateView(); 2617 mTodoList->updateView();
2618 mViewManager->currentView()->updateView(); 2618 mViewManager->currentView()->updateView();
2619 2619
2620} 2620}
2621 2621
2622 2622
2623void CalendarView::updateView(const QDate &start, const QDate &end) 2623void CalendarView::updateView(const QDate &start, const QDate &end)
2624{ 2624{
2625#ifdef DESKTOP_VERSION 2625#ifdef DESKTOP_VERSION
2626 mDateScrollBar->blockSignals( true ); 2626 mDateScrollBar->blockSignals( true );
2627 mDateScrollBar->setValue( start.dayOfYear()-1); 2627 mDateScrollBar->setValue( start.dayOfYear()-1);
2628 mDateScrollBar->blockSignals( false ); 2628 mDateScrollBar->blockSignals( false );
2629#endif 2629#endif
2630 mTodoList->updateView(); 2630 mTodoList->updateView();
2631 mViewManager->updateView(start, end); 2631 mViewManager->updateView(start, end);
2632 //mDateNavigator->updateView(); 2632 //mDateNavigator->updateView();
2633} 2633}
2634 2634
2635void CalendarView::clearAllViews() 2635void CalendarView::clearAllViews()
2636{ 2636{
2637 mTodoList->clearList(); 2637 mTodoList->clearList();
2638 mViewManager->clearAllViews(); 2638 mViewManager->clearAllViews();
2639 SearchDialog * sd = mDialogManager->getSearchDialog(); 2639 SearchDialog * sd = mDialogManager->getSearchDialog();
2640 if ( sd ) { 2640 if ( sd ) {
2641 KOListView* kol = sd->listview(); 2641 KOListView* kol = sd->listview();
2642 if ( kol ) 2642 if ( kol )
2643 kol->clearList(); 2643 kol->clearList();
2644 } 2644 }
2645} 2645}
2646void CalendarView::updateView() 2646void CalendarView::updateView()
2647{ 2647{
2648 DateList tmpList = mNavigator->selectedDates(); 2648 DateList tmpList = mNavigator->selectedDates();
2649 2649
2650 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2650 if ( KOPrefs::instance()->mHideNonStartedTodos )
2651 mTodoList->updateView(); 2651 mTodoList->updateView();
2652 // We assume that the navigator only selects consecutive days. 2652 // We assume that the navigator only selects consecutive days.
2653 updateView( tmpList.first(), tmpList.last() ); 2653 updateView( tmpList.first(), tmpList.last() );
2654} 2654}
2655 2655
2656void CalendarView::updateUnmanagedViews() 2656void CalendarView::updateUnmanagedViews()
2657{ 2657{
2658 mDateNavigator->updateDayMatrix(); 2658 mDateNavigator->updateDayMatrix();
2659} 2659}
2660 2660
2661int CalendarView::msgItemDelete(const QString name) 2661int CalendarView::msgItemDelete(const QString name)
2662{ 2662{
2663 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2663 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2664 i18n("This item will be\npermanently deleted."), 2664 i18n("This item will be\npermanently deleted."),
2665 i18n("KO/Pi Confirmation"),i18n("Delete")); 2665 i18n("KO/Pi Confirmation"),i18n("Delete"));
2666} 2666}
2667 2667
2668 2668
2669void CalendarView::edit_cut() 2669void CalendarView::edit_cut()
2670{ 2670{
2671 Event *anEvent=0; 2671 Event *anEvent=0;
2672 2672
2673 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2673 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2674 2674
2675 if (mViewManager->currentView()->isEventView()) { 2675 if (mViewManager->currentView()->isEventView()) {
2676 if ( incidence && incidence->typeID() == eventID ) { 2676 if ( incidence && incidence->typeID() == eventID ) {
2677 anEvent = static_cast<Event *>(incidence); 2677 anEvent = static_cast<Event *>(incidence);
2678 } 2678 }
2679 } 2679 }
2680 2680
2681 if (!anEvent) { 2681 if (!anEvent) {
2682 KNotifyClient::beep(); 2682 KNotifyClient::beep();
2683 return; 2683 return;
2684 } 2684 }
2685 DndFactory factory( mCalendar ); 2685 DndFactory factory( mCalendar );
2686 factory.cutIncidence(anEvent); 2686 factory.cutIncidence(anEvent);
2687 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2687 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2688} 2688}
2689 2689
2690void CalendarView::edit_copy() 2690void CalendarView::edit_copy()
2691{ 2691{
2692 Event *anEvent=0; 2692 Event *anEvent=0;
2693 2693
2694 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2694 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2695 2695
2696 if (mViewManager->currentView()->isEventView()) { 2696 if (mViewManager->currentView()->isEventView()) {
2697 if ( incidence && incidence->typeID() == eventID ) { 2697 if ( incidence && incidence->typeID() == eventID ) {
2698 anEvent = static_cast<Event *>(incidence); 2698 anEvent = static_cast<Event *>(incidence);
2699 } 2699 }
2700 } 2700 }
2701 2701
2702 if (!anEvent) { 2702 if (!anEvent) {
2703 KNotifyClient::beep(); 2703 KNotifyClient::beep();
2704 return; 2704 return;
2705 } 2705 }
2706 DndFactory factory( mCalendar ); 2706 DndFactory factory( mCalendar );
2707 factory.copyIncidence(anEvent); 2707 factory.copyIncidence(anEvent);
2708} 2708}
2709 2709
2710void CalendarView::edit_paste() 2710void CalendarView::edit_paste()
2711{ 2711{
2712 QDate date = mNavigator->selectedDates().first(); 2712 QDate date = mNavigator->selectedDates().first();
2713 2713
2714 DndFactory factory( mCalendar ); 2714 DndFactory factory( mCalendar );
2715 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2715 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2716 2716
2717 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2717 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2718} 2718}
2719void CalendarView::edit_global_options() 2719void CalendarView::edit_global_options()
2720{ 2720{
2721 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2721 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2722 emit save(); 2722 emit save();
2723 emit saveStopTimer(); 2723 emit saveStopTimer();
2724 mDialogManager->showGlobalOptionsDialog(); 2724 mDialogManager->showGlobalOptionsDialog();
2725 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2725 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2726 emit saveStopTimer(); 2726 emit saveStopTimer();
2727 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 2727 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
2728 i18n("Timezone settings"),i18n("Reload"))) { 2728 i18n("Timezone settings"),i18n("Reload"))) {
2729 qDebug("KO: TZ reload cancelled "); 2729 qDebug("KO: TZ reload cancelled ");
2730 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2730 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2731 return; 2731 return;
2732 } 2732 }
2733 qDebug("KO: Timezone change "); 2733 qDebug("KO: Timezone change ");
2734 loadCalendars(); 2734 loadCalendars();
2735 setModified(true); 2735 setModified(true);
2736 } 2736 }
2737 else 2737 else
2738 qDebug("KO: No tz change "); 2738 qDebug("KO: No tz change ");
2739} 2739}
2740void CalendarView::edit_options() 2740void CalendarView::edit_options()
2741{ 2741{
2742 mDialogManager->showOptionsDialog(); 2742 mDialogManager->showOptionsDialog();
2743} 2743}
2744 2744
2745 2745
2746void CalendarView::slotSelectPickerDate( QDate d) 2746void CalendarView::slotSelectPickerDate( QDate d)
2747{ 2747{
2748 mDateFrame->hide(); 2748 mDateFrame->hide();
2749 if ( mDatePickerMode == 1 ) { 2749 if ( mDatePickerMode == 1 ) {
2750 mNavigator->slotDaySelect( d ); 2750 mNavigator->slotDaySelect( d );
2751 } else if ( mDatePickerMode == 2 ) { 2751 } else if ( mDatePickerMode == 2 ) {
2752 if ( mMoveIncidence->typeID() == todoID ) { 2752 if ( mMoveIncidence->typeID() == todoID ) {
2753 Todo * to = (Todo *) mMoveIncidence; 2753 Todo * to = (Todo *) mMoveIncidence;
2754 QTime tim; 2754 QTime tim;
2755 int len = 0; 2755 int len = 0;
2756 if ( to->hasStartDate() && to->hasDueDate() ) 2756 if ( to->hasStartDate() && to->hasDueDate() )
2757 len = to->dtStart().secsTo( to->dtDue()); 2757 len = to->dtStart().secsTo( to->dtDue());
2758 if ( to->hasDueDate() ) 2758 if ( to->hasDueDate() )
2759 tim = to->dtDue().time(); 2759 tim = to->dtDue().time();
2760 else { 2760 else {
2761 tim = QTime ( 0,0,0 ); 2761 tim = QTime ( 0,0,0 );
2762 to->setFloats( true ); 2762 to->setFloats( true );
2763 to->setHasDueDate( true ); 2763 to->setHasDueDate( true );
2764 } 2764 }
2765 QDateTime dt ( d,tim ); 2765 QDateTime dt ( d,tim );
2766 to->setDtDue( dt ); 2766 to->setDtDue( dt );
2767 2767
2768 if ( to->hasStartDate() ) { 2768 if ( to->hasStartDate() ) {
2769 if ( len>0 ) 2769 if ( len>0 )
2770 to->setDtStart(to->dtDue().addSecs( -len )); 2770 to->setDtStart(to->dtDue().addSecs( -len ));
2771 else 2771 else
2772 if (to->dtStart() > to->dtDue() ) 2772 if (to->dtStart() > to->dtDue() )
2773 to->setDtStart(to->dtDue().addDays( -3 )); 2773 to->setDtStart(to->dtDue().addDays( -3 ));
2774 } 2774 }
2775 2775
2776 todoChanged( to ); 2776 todoChanged( to );
2777 } else { 2777 } else {
2778 if ( mMoveIncidence->doesRecur() ) { 2778 if ( mMoveIncidence->doesRecur() ) {
2779#if 0 2779#if 0
2780 // PENDING implement this 2780 // PENDING implement this
2781 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2781 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2782 mCalendar()->addIncidence( newInc ); 2782 mCalendar()->addIncidence( newInc );
2783 if ( mMoveIncidence->typeID() == todoID ) 2783 if ( mMoveIncidence->typeID() == todoID )
2784 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2784 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2785 else 2785 else
2786 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2786 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2787 mMoveIncidence = newInc; 2787 mMoveIncidence = newInc;
2788 2788
2789#endif 2789#endif
2790 } 2790 }
2791 QTime tim = mMoveIncidence->dtStart().time(); 2791 QTime tim = mMoveIncidence->dtStart().time();
2792 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2792 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2793 QDateTime dt ( d,tim ); 2793 QDateTime dt ( d,tim );
2794 mMoveIncidence->setDtStart( dt ); 2794 mMoveIncidence->setDtStart( dt );
2795 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2795 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2796 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2796 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2797 } 2797 }
2798 2798
2799 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2799 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2800 } 2800 }
2801} 2801}
2802 2802
2803void CalendarView::removeCategories() 2803void CalendarView::removeCategories()
2804{ 2804{
2805 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2805 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2806 QStringList catList = KOPrefs::instance()->mCustomCategories; 2806 QStringList catList = KOPrefs::instance()->mCustomCategories;
2807 QStringList catIncList; 2807 QStringList catIncList;
2808 QStringList newCatList; 2808 QStringList newCatList;
2809 Incidence* inc = incList.first(); 2809 Incidence* inc = incList.first();
2810 uint i; 2810 uint i;
2811 while ( inc ) { 2811 while ( inc ) {
2812 newCatList.clear(); 2812 newCatList.clear();
2813 catIncList = inc->categories() ; 2813 catIncList = inc->categories() ;
2814 for( i = 0; i< catIncList.count(); ++i ) { 2814 for( i = 0; i< catIncList.count(); ++i ) {
2815 if ( catList.contains (catIncList[i])) 2815 if ( catList.contains (catIncList[i]))
2816 newCatList.append( catIncList[i] ); 2816 newCatList.append( catIncList[i] );
2817 } 2817 }
2818 newCatList.sort(); 2818 newCatList.sort();
2819 inc->setCategories( newCatList.join(",") ); 2819 inc->setCategories( newCatList.join(",") );
2820 inc = incList.next(); 2820 inc = incList.next();
2821 } 2821 }
2822} 2822}
2823 2823
2824int CalendarView::addCategories() 2824int CalendarView::addCategories()
2825{ 2825{
2826 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2826 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2827 QStringList catList = KOPrefs::instance()->mCustomCategories; 2827 QStringList catList = KOPrefs::instance()->mCustomCategories;
2828 QStringList catIncList; 2828 QStringList catIncList;
2829 Incidence* inc = incList.first(); 2829 Incidence* inc = incList.first();
2830 uint i; 2830 uint i;
2831 int count = 0; 2831 int count = 0;
2832 while ( inc ) { 2832 while ( inc ) {
2833 catIncList = inc->categories() ; 2833 catIncList = inc->categories() ;
2834 for( i = 0; i< catIncList.count(); ++i ) { 2834 for( i = 0; i< catIncList.count(); ++i ) {
2835 if ( !catList.contains (catIncList[i])) { 2835 if ( !catList.contains (catIncList[i])) {
2836 catList.append( catIncList[i] ); 2836 catList.append( catIncList[i] );
2837 //qDebug("add cat %s ", catIncList[i].latin1()); 2837 //qDebug("add cat %s ", catIncList[i].latin1());
2838 ++count; 2838 ++count;
2839 } 2839 }
2840 } 2840 }
2841 inc = incList.next(); 2841 inc = incList.next();
2842 } 2842 }
2843 catList.sort(); 2843 catList.sort();
2844 KOPrefs::instance()->mCustomCategories = catList; 2844 KOPrefs::instance()->mCustomCategories = catList;
2845 return count; 2845 return count;
2846} 2846}
2847 2847
2848void CalendarView::editCategories() 2848void CalendarView::editCategories()
2849{ 2849{
2850 qDebug("CalendarView::editCategories() "); 2850 qDebug("CalendarView::editCategories() ");
2851 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 2851 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
2852 ced.exec(); 2852 ced.exec();
2853} 2853}
2854void CalendarView::manageCategories() 2854void CalendarView::manageCategories()
2855{ 2855{
2856 KOCatPrefs* cp = new KOCatPrefs(); 2856 KOCatPrefs* cp = new KOCatPrefs();
2857 cp->show(); 2857 cp->show();
2858 int w =cp->sizeHint().width() ; 2858 int w =cp->sizeHint().width() ;
2859 int h = cp->sizeHint().height() ; 2859 int h = cp->sizeHint().height() ;
2860 int dw = QApplication::desktop()->width(); 2860 int dw = QApplication::desktop()->width();
2861 int dh = QApplication::desktop()->height(); 2861 int dh = QApplication::desktop()->height();
2862 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2862 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2863 if ( !cp->exec() ) { 2863 if ( !cp->exec() ) {
2864 delete cp; 2864 delete cp;
2865 return; 2865 return;
2866 } 2866 }
2867 int count = 0; 2867 int count = 0;
2868 if ( cp->addCat() ) { 2868 if ( cp->addCat() ) {
2869 count = addCategories(); 2869 count = addCategories();
2870 if ( count ) { 2870 if ( count ) {
2871 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2871 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2872 writeSettings(); 2872 writeSettings();
2873 } else 2873 } else
2874 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2874 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2875 } else { 2875 } else {
2876 removeCategories(); 2876 removeCategories();
2877 updateView(); 2877 updateView();
2878 } 2878 }
2879 delete cp; 2879 delete cp;
2880} 2880}
2881 2881
2882void CalendarView::beamIncidence(Incidence * Inc) 2882void CalendarView::beamIncidence(Incidence * Inc)
2883{ 2883{
2884 QPtrList<Incidence> delSel ; 2884 QPtrList<Incidence> delSel ;
2885 delSel.append(Inc); 2885 delSel.append(Inc);
2886 beamIncidenceList( delSel ); 2886 beamIncidenceList( delSel );
2887} 2887}
2888void CalendarView::beamCalendar() 2888void CalendarView::beamCalendar()
2889{ 2889{
2890 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2890 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2891 //qDebug("beamCalendar() "); 2891 //qDebug("beamCalendar() ");
2892 beamIncidenceList( delSel ); 2892 beamIncidenceList( delSel );
2893} 2893}
2894void CalendarView::beamFilteredCalendar() 2894void CalendarView::beamFilteredCalendar()
2895{ 2895{
2896 QPtrList<Incidence> delSel = mCalendar->incidences(); 2896 QPtrList<Incidence> delSel = mCalendar->incidences();
2897 //qDebug("beamFilteredCalendar() "); 2897 //qDebug("beamFilteredCalendar() ");
2898 beamIncidenceList( delSel ); 2898 beamIncidenceList( delSel );
2899} 2899}
2900void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2900void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2901{ 2901{
2902 2902
2903 KOBeamPrefs beamDialog; 2903 KOBeamPrefs beamDialog;
2904 if ( beamDialog.exec () == QDialog::Rejected ) 2904 if ( beamDialog.exec () == QDialog::Rejected )
2905 return; 2905 return;
2906#ifdef DESKTOP_VERSION 2906#ifdef DESKTOP_VERSION
2907 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2907 QString fn = locateLocal( "tmp", "kopibeamfile" );
2908#else 2908#else
2909 QString fn = "/tmp/kopibeamfile"; 2909 QString fn = "/tmp/kopibeamfile";
2910#endif 2910#endif
2911 QString mes; 2911 QString mes;
2912 bool createbup = true; 2912 bool createbup = true;
2913 if ( createbup ) { 2913 if ( createbup ) {
2914 QString description = "\n"; 2914 QString description = "\n";
2915 CalendarLocal* cal = new CalendarLocal(); 2915 CalendarLocal* cal = new CalendarLocal();
2916 if ( beamDialog.beamLocal() ) 2916 if ( beamDialog.beamLocal() )
2917 cal->setLocalTime(); 2917 cal->setLocalTime();
2918 else 2918 else
2919 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2919 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2920 Incidence *incidence = delSel.first(); 2920 Incidence *incidence = delSel.first();
2921 bool addText = false; 2921 bool addText = false;
2922 if ( delSel.count() < 10 ) 2922 if ( delSel.count() < 10 )
2923 addText = true; 2923 addText = true;
2924 else { 2924 else {
2925 description.sprintf(i18n(" %d items?"),delSel.count() ); 2925 description.sprintf(i18n(" %d items?"),delSel.count() );
2926 } 2926 }
2927 while ( incidence ) { 2927 while ( incidence ) {
2928 Incidence *in = incidence->clone(); 2928 Incidence *in = incidence->clone();
2929 if ( ! in->summary().isEmpty() ) { 2929 if ( ! in->summary().isEmpty() ) {
2930 in->setDescription(""); 2930 in->setDescription("");
2931 } else { 2931 } else {
2932 in->setSummary( in->description().left(20)); 2932 in->setSummary( in->description().left(20));
2933 in->setDescription(""); 2933 in->setDescription("");
2934 } 2934 }
2935 if ( addText ) 2935 if ( addText )
2936 description += in->summary() + "\n"; 2936 description += in->summary() + "\n";
2937 cal->addIncidence( in ); 2937 cal->addIncidence( in );
2938 incidence = delSel.next(); 2938 incidence = delSel.next();
2939 } 2939 }
2940 if ( beamDialog.beamVcal() ) { 2940 if ( beamDialog.beamVcal() ) {
2941 fn += ".vcs"; 2941 fn += ".vcs";
2942 FileStorage storage( cal, fn, new VCalFormat ); 2942 FileStorage storage( cal, fn, new VCalFormat );
2943 storage.save(); 2943 storage.save();
2944 } else { 2944 } else {
2945 fn += ".ics"; 2945 fn += ".ics";
2946 FileStorage storage( cal, fn, new ICalFormat( ) ); 2946 FileStorage storage( cal, fn, new ICalFormat( ) );
2947 storage.save(); 2947 storage.save();
2948 } 2948 }
2949 delete cal; 2949 delete cal;
2950 mes = i18n("KO/Pi: Ready for beaming"); 2950 mes = i18n("KO/Pi: Ready for beaming");
2951 topLevelWidget()->setCaption(mes); 2951 topLevelWidget()->setCaption(mes);
2952 KApplication::convert2latin1( fn ); 2952 KApplication::convert2latin1( fn );
2953#ifndef DESKTOP_VERSION 2953#ifndef DESKTOP_VERSION
2954 Ir *ir = new Ir( this ); 2954 Ir *ir = new Ir( this );
2955 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2955 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2956 ir->send( fn, description, "text/x-vCalendar" ); 2956 ir->send( fn, description, "text/x-vCalendar" );
2957#endif 2957#endif
2958 } 2958 }
2959} 2959}
2960 2960
2961#ifndef DESKTOP_VERSION 2961#ifndef DESKTOP_VERSION
2962void CalendarView::beamDone( Ir *ir ) 2962void CalendarView::beamDone( Ir *ir )
2963{ 2963{
2964 delete ir; 2964 delete ir;
2965 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2965 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2966 topLevelWidget()->raise(); 2966 topLevelWidget()->raise();
2967} 2967}
2968#else 2968#else
2969void CalendarView::beamDone( Ir *){;} 2969void CalendarView::beamDone( Ir *){;}
2970#endif 2970#endif
2971void CalendarView::moveIncidence(Incidence * inc ) 2971void CalendarView::moveIncidence(Incidence * inc )
2972{ 2972{
2973 if ( !inc ) return; 2973 if ( !inc ) return;
2974 showDatePickerPopup(); 2974 showDatePickerPopup();
2975 mDatePickerMode = 2; 2975 mDatePickerMode = 2;
2976 mMoveIncidence = inc ; 2976 mMoveIncidence = inc ;
2977 QDate da; 2977 QDate da;
2978 if ( mMoveIncidence->typeID() == todoID ) { 2978 if ( mMoveIncidence->typeID() == todoID ) {
2979 Todo * to = (Todo *) mMoveIncidence; 2979 Todo * to = (Todo *) mMoveIncidence;
2980 if ( to->hasDueDate() ) 2980 if ( to->hasDueDate() )
2981 da = to->dtDue().date(); 2981 da = to->dtDue().date();
2982 else 2982 else
2983 da = QDate::currentDate(); 2983 da = QDate::currentDate();
2984 } else { 2984 } else {
2985 da = mMoveIncidence->dtStart().date(); 2985 da = mMoveIncidence->dtStart().date();
2986 } 2986 }
2987 //PENDING set date for recurring incidence to date of recurrence 2987 //PENDING set date for recurring incidence to date of recurrence
2988 //mMoveIncidenceOldDate; 2988 //mMoveIncidenceOldDate;
2989 mDatePicker->setDate( da ); 2989 mDatePicker->setDate( da );
2990} 2990}
2991void CalendarView::showDatePickerPopup() 2991void CalendarView::showDatePickerPopup()
2992{ 2992{
2993 if ( mDateFrame->isVisible() ) 2993 if ( mDateFrame->isVisible() )
2994 mDateFrame->hide(); 2994 mDateFrame->hide();
2995 else { 2995 else {
2996 int offX = 0, offY = 0; 2996 int offX = 0, offY = 0;
2997#ifdef DESKTOP_VERSION 2997#ifdef DESKTOP_VERSION
2998 int w =mDatePicker->sizeHint().width() ; 2998 int w =mDatePicker->sizeHint().width() ;
2999 int h = mDatePicker->sizeHint().height() ; 2999 int h = mDatePicker->sizeHint().height() ;
3000 int dw = topLevelWidget()->width(); 3000 int dw = topLevelWidget()->width();
3001 int dh = topLevelWidget()->height(); 3001 int dh = topLevelWidget()->height();
3002 offX = topLevelWidget()->x(); 3002 offX = topLevelWidget()->x();
3003 offY = topLevelWidget()->y(); 3003 offY = topLevelWidget()->y();
3004#else 3004#else
3005 int w =mDatePicker->sizeHint().width() ; 3005 int w =mDatePicker->sizeHint().width() ;
3006 int h = mDatePicker->sizeHint().height() ; 3006 int h = mDatePicker->sizeHint().height() ;
3007 int dw = QApplication::desktop()->width(); 3007 int dw = QApplication::desktop()->width();
3008 int dh = QApplication::desktop()->height(); 3008 int dh = QApplication::desktop()->height();
3009#endif 3009#endif
3010 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 3010 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
3011 mDateFrame->show(); 3011 mDateFrame->show();
3012 } 3012 }
3013} 3013}
3014void CalendarView::showDatePicker( ) 3014void CalendarView::showDatePicker( )
3015{ 3015{
3016 showDatePickerPopup(); 3016 showDatePickerPopup();
3017 mDatePickerMode = 1; 3017 mDatePickerMode = 1;
3018 mDatePicker->setDate( mNavigator->selectedDates().first() ); 3018 mDatePicker->setDate( mNavigator->selectedDates().first() );
3019} 3019}
3020 3020
3021void CalendarView::showEventEditor() 3021void CalendarView::showEventEditor()
3022{ 3022{
3023#ifdef DESKTOP_VERSION 3023#ifdef DESKTOP_VERSION
3024 int x,y,w,h; 3024 int x,y,w,h;
3025 x = mEventEditor->geometry().x(); 3025 x = mEventEditor->geometry().x();
3026 y = mEventEditor->geometry().y(); 3026 y = mEventEditor->geometry().y();
3027 w = mEventEditor->width(); 3027 w = mEventEditor->width();
3028 h = mEventEditor->height(); 3028 h = mEventEditor->height();
3029 mEventEditor->show(); 3029 mEventEditor->show();
3030 mEventEditor->setGeometry(x,y,w,h); 3030 mEventEditor->setGeometry(x,y,w,h);
3031#else 3031#else
3032 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 3032 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
3033 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3033 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3034 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 3034 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
3035 qApp->processEvents(); 3035 qApp->processEvents();
3036 delete mEventEditor; 3036 delete mEventEditor;
3037 mEventEditor = mDialogManager->getEventEditor(); 3037 mEventEditor = mDialogManager->getEventEditor();
3038 topLevelWidget()->setCaption( i18n("") ); 3038 topLevelWidget()->setCaption( i18n("") );
3039 } 3039 }
3040 mEventEditor->showMaximized(); 3040 mEventEditor->showMaximized();
3041#endif 3041#endif
3042} 3042}
3043void CalendarView::showTodoEditor() 3043void CalendarView::showTodoEditor()
3044{ 3044{
3045#ifdef DESKTOP_VERSION 3045#ifdef DESKTOP_VERSION
3046 int x,y,w,h; 3046 int x,y,w,h;
3047 x = mTodoEditor->geometry().x(); 3047 x = mTodoEditor->geometry().x();
3048 y = mTodoEditor->geometry().y(); 3048 y = mTodoEditor->geometry().y();
3049 w = mTodoEditor->width(); 3049 w = mTodoEditor->width();
3050 h = mTodoEditor->height(); 3050 h = mTodoEditor->height();
3051 mTodoEditor->show(); 3051 mTodoEditor->show();
3052 mTodoEditor->setGeometry(x,y,w,h); 3052 mTodoEditor->setGeometry(x,y,w,h);
3053#else 3053#else
3054 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 3054 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
3055 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3055 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3056 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 3056 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
3057 qApp->processEvents(); 3057 qApp->processEvents();
3058 delete mTodoEditor; 3058 delete mTodoEditor;
3059 mTodoEditor = mDialogManager->getTodoEditor(); 3059 mTodoEditor = mDialogManager->getTodoEditor();
3060 topLevelWidget()->setCaption( i18n("") ); 3060 topLevelWidget()->setCaption( i18n("") );
3061 } 3061 }
3062 mTodoEditor->showMaximized(); 3062 mTodoEditor->showMaximized();
3063#endif 3063#endif
3064} 3064}
3065 3065
3066void CalendarView::cloneIncidence() 3066void CalendarView::cloneIncidence()
3067{ 3067{
3068 Incidence *incidence = currentSelection(); 3068 Incidence *incidence = currentSelection();
3069 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3069 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3070 if ( incidence ) { 3070 if ( incidence ) {
3071 cloneIncidence(incidence); 3071 cloneIncidence(incidence);
3072 } 3072 }
3073} 3073}
3074void CalendarView::moveIncidence() 3074void CalendarView::moveIncidence()
3075{ 3075{
3076 Incidence *incidence = currentSelection(); 3076 Incidence *incidence = currentSelection();
3077 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3077 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3078 if ( incidence ) { 3078 if ( incidence ) {
3079 moveIncidence(incidence); 3079 moveIncidence(incidence);
3080 } 3080 }
3081} 3081}
3082void CalendarView::beamIncidence() 3082void CalendarView::beamIncidence()
3083{ 3083{
3084 Incidence *incidence = currentSelection(); 3084 Incidence *incidence = currentSelection();
3085 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3085 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3086 if ( incidence ) { 3086 if ( incidence ) {
3087 beamIncidence(incidence); 3087 beamIncidence(incidence);
3088 } 3088 }
3089} 3089}
3090void CalendarView::toggleCancelIncidence() 3090void CalendarView::toggleCancelIncidence()
3091{ 3091{
3092 Incidence *incidence = currentSelection(); 3092 Incidence *incidence = currentSelection();
3093 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3093 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3094 if ( incidence ) { 3094 if ( incidence ) {
3095 cancelIncidence(incidence); 3095 cancelIncidence(incidence);
3096 } 3096 }
3097} 3097}
3098 3098
3099 3099
3100void CalendarView::cancelIncidence(Incidence * inc ) 3100void CalendarView::cancelIncidence(Incidence * inc )
3101{ 3101{
3102 inc->setCancelled( ! inc->cancelled() ); 3102 inc->setCancelled( ! inc->cancelled() );
3103 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 3103 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
3104 updateView(); 3104 updateView();
3105} 3105}
3106void CalendarView::cloneIncidence(Incidence * orgInc ) 3106void CalendarView::cloneIncidence(Incidence * orgInc )
3107{ 3107{
3108 Incidence * newInc = orgInc->clone(); 3108 Incidence * newInc = orgInc->clone();
3109 newInc->recreate(); 3109 newInc->recreate();
3110 3110
3111 if ( newInc->typeID() == todoID ) { 3111 if ( newInc->typeID() == todoID ) {
3112 Todo* t = (Todo*) newInc; 3112 Todo* t = (Todo*) newInc;
3113 bool cloneSub = false; 3113 bool cloneSub = false;
3114 if ( orgInc->relations().count() ) { 3114 if ( orgInc->relations().count() ) {
3115 int result = KMessageBox::warningYesNoCancel(this, 3115 int result = KMessageBox::warningYesNoCancel(this,
3116 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), 3116 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ),
3117 i18n("Todo has subtodos"), 3117 i18n("Todo has subtodos"),
3118 i18n("Yes"), 3118 i18n("Yes"),
3119 i18n("No")); 3119 i18n("No"));
3120 3120
3121 if ( result == KMessageBox::Cancel ) { 3121 if ( result == KMessageBox::Cancel ) {
3122 delete t; 3122 delete t;
3123 return; 3123 return;
3124 } 3124 }
3125 if (result == KMessageBox::Yes) cloneSub = true; 3125 if (result == KMessageBox::Yes) cloneSub = true;
3126 } 3126 }
3127 showTodoEditor(); 3127 showTodoEditor();
3128 mTodoEditor->editTodo( t ); 3128 mTodoEditor->editTodo( t );
3129 if ( mTodoEditor->exec() ) { 3129 if ( mTodoEditor->exec() ) {
3130 if ( cloneSub ) { 3130 if ( cloneSub ) {
3131 orgInc->cloneRelations( t ); 3131 orgInc->cloneRelations( t );
3132 mCalendar->addIncidenceBranch( t ); 3132 mCalendar->addIncidenceBranch( t );
3133 updateView(); 3133 updateView();
3134 3134
3135 } else { 3135 } else {
3136 mCalendar->addTodo( t ); 3136 mCalendar->addTodo( t );
3137 updateView(); 3137 updateView();
3138 } 3138 }
3139 } else { 3139 } else {
3140 delete t; 3140 delete t;
3141 } 3141 }
3142 } 3142 }
3143 else { 3143 else {
3144 Event* e = (Event*) newInc; 3144 Event* e = (Event*) newInc;
3145 showEventEditor(); 3145 showEventEditor();
3146 mEventEditor->editEvent( e ); 3146 mEventEditor->editEvent( e );
3147 if ( mEventEditor->exec() ) { 3147 if ( mEventEditor->exec() ) {
3148 mCalendar->addEvent( e ); 3148 mCalendar->addEvent( e );
3149 updateView(); 3149 updateView();
3150 } else { 3150 } else {
3151 delete e; 3151 delete e;
3152 } 3152 }
3153 } 3153 }
3154 setActiveWindow(); 3154 setActiveWindow();
3155} 3155}
3156 3156
3157void CalendarView::newEvent() 3157void CalendarView::newEvent()
3158{ 3158{
3159 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 3159 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
3160 KOAgendaView *aView = mViewManager->agendaView(); 3160 KOAgendaView *aView = mViewManager->agendaView();
3161 if (aView) { 3161 if (aView) {
3162 if (aView->selectionStart().isValid()) { 3162 if (aView->selectionStart().isValid()) {
3163 if (aView->selectedIsAllDay()) { 3163 if (aView->selectedIsAllDay()) {
3164 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 3164 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
3165 } else { 3165 } else {
3166 newEvent(aView->selectionStart(),aView->selectionEnd()); 3166 newEvent(aView->selectionStart(),aView->selectionEnd());
3167 } 3167 }
3168 return; 3168 return;
3169 } 3169 }
3170 } 3170 }
3171 3171
3172 QDate date = mNavigator->selectedDates().first(); 3172 QDate date = mNavigator->selectedDates().first();
3173 QDateTime current = QDateTime::currentDateTime(); 3173 QDateTime current = QDateTime::currentDateTime();
3174 if ( date <= current.date() ) { 3174 if ( date <= current.date() ) {
3175 int hour = current.time().hour() +1; 3175 int hour = current.time().hour() +1;
3176 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3176 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3177 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3177 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3178 } else 3178 } else
3179 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3179 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3180 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3180 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3181 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3181 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3182} 3182}
3183 3183
3184void CalendarView::newEvent(QDateTime fh) 3184void CalendarView::newEvent(QDateTime fh)
3185{ 3185{
3186 newEvent(fh, 3186 newEvent(fh,
3187 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 3187 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
3188} 3188}
3189 3189
3190void CalendarView::newEvent(QDate dt) 3190void CalendarView::newEvent(QDate dt)
3191{ 3191{
3192 newEvent(QDateTime(dt, QTime(0,0,0)), 3192 newEvent(QDateTime(dt, QTime(0,0,0)),
3193 QDateTime(dt, QTime(0,0,0)), true); 3193 QDateTime(dt, QTime(0,0,0)), true);
3194} 3194}
3195void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 3195void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
3196{ 3196{
3197 newEvent(fromHint, toHint, false); 3197 newEvent(fromHint, toHint, false);
3198} 3198}
3199void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 3199void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
3200{ 3200{
3201 3201
3202 showEventEditor(); 3202 showEventEditor();
3203 mEventEditor->newEvent(fromHint,toHint,allDay); 3203 mEventEditor->newEvent(fromHint,toHint,allDay);
3204 if ( mFilterView->filtersEnabled() ) { 3204 if ( mFilterView->filtersEnabled() ) {
3205 CalFilter *filter = mFilterView->selectedFilter(); 3205 CalFilter *filter = mFilterView->selectedFilter();
3206 if (filter && filter->showCategories()) { 3206 if (filter && filter->showCategories()) {
3207 mEventEditor->setCategories(filter->categoryList().join(",") ); 3207 mEventEditor->setCategories(filter->categoryList().join(",") );
3208 } 3208 }
3209 if ( filter ) 3209 if ( filter )
3210 mEventEditor->setSecrecy( filter->getSecrecy() ); 3210 mEventEditor->setSecrecy( filter->getSecrecy() );
3211 } 3211 }
3212 mEventEditor->exec(); 3212 mEventEditor->exec();
3213 setActiveWindow(); 3213 setActiveWindow();
3214} 3214}
3215void CalendarView::todoAdded(Todo * t) 3215void CalendarView::todoAdded(Todo * t)
3216{ 3216{
3217 3217
3218 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 3218 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
3219 updateTodoViews(); 3219 updateTodoViews();
3220} 3220}
3221void CalendarView::todoChanged(Todo * t) 3221void CalendarView::todoChanged(Todo * t)
3222{ 3222{
3223 emit todoModified( t, 4 ); 3223 emit todoModified( t, 4 );
3224 // updateTodoViews(); 3224 // updateTodoViews();
3225} 3225}
3226void CalendarView::todoToBeDeleted(Todo *) 3226void CalendarView::todoToBeDeleted(Todo *)
3227{ 3227{
3228 //qDebug("todoToBeDeleted(Todo *) "); 3228 //qDebug("todoToBeDeleted(Todo *) ");
3229 updateTodoViews(); 3229 updateTodoViews();
3230} 3230}
3231void CalendarView::todoDeleted() 3231void CalendarView::todoDeleted()
3232{ 3232{
3233 //qDebug(" todoDeleted()"); 3233 //qDebug(" todoDeleted()");
3234 updateTodoViews(); 3234 updateTodoViews();
3235} 3235}
3236 3236
3237 3237
3238void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 3238void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
3239{ 3239{
3240 showTodoEditor(); 3240 showTodoEditor();
3241 mTodoEditor->newTodo(dt,0,allday); 3241 mTodoEditor->newTodo(dt,0,allday);
3242 if ( mFilterView->filtersEnabled() ) { 3242 if ( mFilterView->filtersEnabled() ) {
3243 CalFilter *filter = mFilterView->selectedFilter(); 3243 CalFilter *filter = mFilterView->selectedFilter();
3244 if (filter && filter->showCategories()) { 3244 if (filter && filter->showCategories()) {
3245 mTodoEditor->setCategories(filter->categoryList().join(",") ); 3245 mTodoEditor->setCategories(filter->categoryList().join(",") );
3246 } 3246 }
3247 if ( filter ) 3247 if ( filter )
3248 mTodoEditor->setSecrecy( filter->getSecrecy() ); 3248 mTodoEditor->setSecrecy( filter->getSecrecy() );
3249 } 3249 }
3250 mTodoEditor->exec(); 3250 mTodoEditor->exec();
3251 setActiveWindow(); 3251 setActiveWindow();
3252} 3252}
3253 3253
3254void CalendarView::newTodo() 3254void CalendarView::newTodo()
3255{ 3255{
3256 newTodoDateTime( QDateTime(),true ); 3256 newTodoDateTime( QDateTime(),true );
3257} 3257}
3258 3258
3259void CalendarView::newSubTodo() 3259void CalendarView::newSubTodo()
3260{ 3260{
3261 Todo *todo = selectedTodo(); 3261 Todo *todo = selectedTodo();
3262 if ( todo ) newSubTodo( todo ); 3262 if ( todo ) newSubTodo( todo );
3263} 3263}
3264 3264
3265void CalendarView::newSubTodo(Todo *parentEvent) 3265void CalendarView::newSubTodo(Todo *parentEvent)
3266{ 3266{
3267 3267
3268 showTodoEditor(); 3268 showTodoEditor();
3269 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 3269 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
3270 mTodoEditor->exec(); 3270 mTodoEditor->exec();
3271 setActiveWindow(); 3271 setActiveWindow();
3272} 3272}
3273 3273
3274void CalendarView::newFloatingEvent() 3274void CalendarView::newFloatingEvent()
3275{ 3275{
3276 DateList tmpList = mNavigator->selectedDates(); 3276 DateList tmpList = mNavigator->selectedDates();
3277 QDate date = tmpList.first(); 3277 QDate date = tmpList.first();
3278 3278
3279 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 3279 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
3280 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 3280 QDateTime( date, QTime( 12, 0, 0 ) ), true );
3281} 3281}
3282 3282
3283 3283
3284void CalendarView::editEvent( Event *event ) 3284void CalendarView::editEvent( Event *event )
3285{ 3285{
3286 3286
3287 if ( !event ) return; 3287 if ( !event ) return;
3288 if ( event->isReadOnly() ) { 3288 if ( event->isReadOnly() ) {
3289 showEvent( event ); 3289 showEvent( event );
3290 return; 3290 return;
3291 } 3291 }
3292 showEventEditor(); 3292 showEventEditor();
3293 mEventEditor->editEvent( event , mFlagEditDescription); 3293 mEventEditor->editEvent( event , mFlagEditDescription);
3294 mEventEditor->exec(); 3294 mEventEditor->exec();
3295 setActiveWindow(); 3295 setActiveWindow();
3296 3296
3297} 3297}
3298void CalendarView::editJournal( Journal *jour ) 3298void CalendarView::editJournal( Journal *jour )
3299{ 3299{
3300 if ( !jour ) return; 3300 if ( !jour ) return;
3301 mDialogManager->hideSearchDialog(); 3301 mDialogManager->hideSearchDialog();
3302 mViewManager->showJournalView(); 3302 mViewManager->showJournalView();
3303 mNavigator->slotDaySelect( jour->dtStart().date() ); 3303 mNavigator->slotDaySelect( jour->dtStart().date() );
3304} 3304}
3305void CalendarView::editTodo( Todo *todo ) 3305void CalendarView::editTodo( Todo *todo )
3306{ 3306{
3307 if ( !todo ) return; 3307 if ( !todo ) return;
3308 3308
3309 if ( todo->isReadOnly() ) { 3309 if ( todo->isReadOnly() ) {
3310 showTodo( todo ); 3310 showTodo( todo );
3311 return; 3311 return;
3312 } 3312 }
3313 showTodoEditor(); 3313 showTodoEditor();
3314 mTodoEditor->editTodo( todo ,mFlagEditDescription); 3314 mTodoEditor->editTodo( todo ,mFlagEditDescription);
3315 mTodoEditor->exec(); 3315 mTodoEditor->exec();
3316 setActiveWindow(); 3316 setActiveWindow();
3317 3317
3318} 3318}
3319 3319
3320KOEventViewerDialog* CalendarView::getEventViewerDialog() 3320KOEventViewerDialog* CalendarView::getEventViewerDialog()
3321{ 3321{
3322 if ( !mEventViewerDialog ) { 3322 if ( !mEventViewerDialog ) {
3323 mEventViewerDialog = new KOEventViewerDialog(0); 3323 mEventViewerDialog = new KOEventViewerDialog(0);
3324 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 3324 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
3325 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 3325 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
3326 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 3326 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
3327 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 3327 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
3328 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 3328 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
3329 viewManager(), SLOT( showAgendaView( bool ) ) ); 3329 viewManager(), SLOT( showAgendaView( bool ) ) );
3330 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), 3330 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
3331 this, SLOT( slotViewerClosed() ) ); 3331 this, SLOT( slotViewerClosed() ) );
3332 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 3332 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
3333 this, SLOT( todoChanged(Todo *) ) ); 3333 this, SLOT( todoChanged(Todo *) ) );
3334 mEventViewerDialog->resize( 640, 480 ); 3334 mEventViewerDialog->resize( 640, 480 );
3335 3335
3336 } 3336 }
3337 return mEventViewerDialog; 3337 return mEventViewerDialog;
3338} 3338}
3339void CalendarView::showEvent(Event *event) 3339void CalendarView::showEvent(Event *event)
3340{ 3340{
3341 getEventViewerDialog()->setEvent(event); 3341 getEventViewerDialog()->setEvent(event);
3342 getEventViewerDialog()->showMe(); 3342 getEventViewerDialog()->showMe();
3343} 3343}
3344 3344
3345void CalendarView::showTodo(Todo *event) 3345void CalendarView::showTodo(Todo *event)
3346{ 3346{
3347 getEventViewerDialog()->setTodo(event); 3347 getEventViewerDialog()->setTodo(event);
3348 getEventViewerDialog()->showMe(); 3348 getEventViewerDialog()->showMe();
3349} 3349}
3350void CalendarView::showJournal( Journal *jour ) 3350void CalendarView::showJournal( Journal *jour )
3351{ 3351{
3352 getEventViewerDialog()->setJournal(jour); 3352 getEventViewerDialog()->setJournal(jour);
3353 getEventViewerDialog()->showMe(); 3353 getEventViewerDialog()->showMe();
3354 3354
3355} 3355}
3356// void CalendarView::todoModified (Todo *event, int changed) 3356// void CalendarView::todoModified (Todo *event, int changed)
3357// { 3357// {
3358// // if (mDialogList.find (event) != mDialogList.end ()) { 3358// // if (mDialogList.find (event) != mDialogList.end ()) {
3359// // kdDebug() << "Todo modified and open" << endl; 3359// // kdDebug() << "Todo modified and open" << endl;
3360// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 3360// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
3361// // temp->modified (changed); 3361// // temp->modified (changed);
3362 3362
3363// // } 3363// // }
3364 3364
3365// mViewManager->updateView(); 3365// mViewManager->updateView();
3366// } 3366// }
3367 3367
3368void CalendarView::appointment_show() 3368void CalendarView::appointment_show()
3369{ 3369{
3370 Event *anEvent = 0; 3370 Event *anEvent = 0;
3371 3371
3372 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3372 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3373 3373
3374 if (mViewManager->currentView()->isEventView()) { 3374 if (mViewManager->currentView()->isEventView()) {
3375 if ( incidence && incidence->typeID() == eventID ) { 3375 if ( incidence && incidence->typeID() == eventID ) {
3376 anEvent = static_cast<Event *>(incidence); 3376 anEvent = static_cast<Event *>(incidence);
3377 } 3377 }
3378 } 3378 }
3379 3379
3380 if (!anEvent) { 3380 if (!anEvent) {
3381 KNotifyClient::beep(); 3381 KNotifyClient::beep();
3382 return; 3382 return;
3383 } 3383 }
3384 3384
3385 showEvent(anEvent); 3385 showEvent(anEvent);
3386} 3386}
3387 3387
3388void CalendarView::appointment_edit() 3388void CalendarView::appointment_edit()
3389{ 3389{
3390 Event *anEvent = 0; 3390 Event *anEvent = 0;
3391 3391
3392 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3392 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3393 3393
3394 if (mViewManager->currentView()->isEventView()) { 3394 if (mViewManager->currentView()->isEventView()) {
3395 if ( incidence && incidence->typeID() == eventID ) { 3395 if ( incidence && incidence->typeID() == eventID ) {
3396 anEvent = static_cast<Event *>(incidence); 3396 anEvent = static_cast<Event *>(incidence);
3397 } 3397 }
3398 } 3398 }
3399 3399
3400 if (!anEvent) { 3400 if (!anEvent) {
3401 KNotifyClient::beep(); 3401 KNotifyClient::beep();
3402 return; 3402 return;
3403 } 3403 }
3404 3404
3405 editEvent(anEvent); 3405 editEvent(anEvent);
3406} 3406}
3407 3407
3408void CalendarView::appointment_delete() 3408void CalendarView::appointment_delete()
3409{ 3409{
3410 Event *anEvent = 0; 3410 Event *anEvent = 0;
3411 3411
3412 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3412 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3413 3413
3414 if (mViewManager->currentView()->isEventView()) { 3414 if (mViewManager->currentView()->isEventView()) {
3415 if ( incidence && incidence->typeID() == eventID ) { 3415 if ( incidence && incidence->typeID() == eventID ) {
3416 anEvent = static_cast<Event *>(incidence); 3416 anEvent = static_cast<Event *>(incidence);
3417 } 3417 }
3418 } 3418 }
3419 3419
3420 if (!anEvent) { 3420 if (!anEvent) {
3421 KNotifyClient::beep(); 3421 KNotifyClient::beep();
3422 return; 3422 return;
3423 } 3423 }
3424 3424
3425 deleteEvent(anEvent); 3425 deleteEvent(anEvent);
3426} 3426}
3427 3427
3428void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3428void CalendarView::todo_resub( Todo * parent, Todo * sub )
3429{ 3429{
3430 if (!sub) return; 3430 if (!sub) return;
3431 if ( sub->relatedTo() == parent ) 3431 if ( sub->relatedTo() == parent )
3432 return; 3432 return;
3433 sub->setRelatedTo(parent); 3433 sub->setRelatedTo(parent);
3434 sub->updated(); 3434 sub->updated();
3435 setModified(true); 3435 setModified(true);
3436 updateView(); 3436 updateView();
3437} 3437}
3438void CalendarView::todo_unsub(Todo *anTodo ) 3438void CalendarView::todo_unsub(Todo *anTodo )
3439{ 3439{
3440 todo_resub( 0, anTodo ); 3440 todo_resub( 0, anTodo );
3441} 3441}
3442 3442
3443void CalendarView::deleteTodo(Todo *todo) 3443void CalendarView::deleteTodo(Todo *todo)
3444{ 3444{
3445 if (!todo) { 3445 if (!todo) {
3446 KNotifyClient::beep(); 3446 KNotifyClient::beep();
3447 return; 3447 return;
3448 } 3448 }
3449 if (KOPrefs::instance()->mConfirm) { 3449 if (KOPrefs::instance()->mConfirm) {
3450 QString text = todo->summary().left(20); 3450 QString text = todo->summary().left(20);
3451 if (!todo->relations().isEmpty()) { 3451 if (!todo->relations().isEmpty()) {
3452 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3452 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
3453 3453
3454 } 3454 }
3455 switch (msgItemDelete(text)) { 3455 switch (msgItemDelete(text)) {
3456 case KMessageBox::Continue: // OK 3456 case KMessageBox::Continue: // OK
3457 bool deleteT = false; 3457 bool deleteT = false;
3458 if (!todo->relations().isEmpty()) { 3458 if (!todo->relations().isEmpty()) {
3459 deleteT = removeCompletedSubTodos( todo ); 3459 deleteT = removeCompletedSubTodos( todo );
3460 } 3460 }
3461 // deleteT == true: todo already deleted in removeCompletedSubTodos 3461 // deleteT == true: todo already deleted in removeCompletedSubTodos
3462 if ( !deleteT ) { 3462 if ( !deleteT ) {
3463 checkExternalId( todo ); 3463 checkExternalId( todo );
3464 calendar()->deleteTodo(todo); 3464 calendar()->deleteTodo(todo);
3465 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3465 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3466 updateView(); 3466 updateView();
3467 } 3467 }
3468 break; 3468 break;
3469 } // switch 3469 } // switch
3470 } else { 3470 } else {
3471 checkExternalId( todo ); 3471 checkExternalId( todo );
3472 mCalendar->deleteTodo(todo); 3472 mCalendar->deleteTodo(todo);
3473 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3473 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3474 updateView(); 3474 updateView();
3475 } 3475 }
3476 3476
3477 emit updateSearchDialog(); 3477 emit updateSearchDialog();
3478} 3478}
3479void CalendarView::deleteJournal(Journal *jour) 3479void CalendarView::deleteJournal(Journal *jour)
3480{ 3480{
3481 if (!jour) { 3481 if (!jour) {
3482 KNotifyClient::beep(); 3482 KNotifyClient::beep();
3483 return; 3483 return;
3484 } 3484 }
3485 if (KOPrefs::instance()->mConfirm) { 3485 if (KOPrefs::instance()->mConfirm) {
3486 switch (msgItemDelete( jour->description().left(20))) { 3486 switch (msgItemDelete( jour->description().left(20))) {
3487 case KMessageBox::Continue: // OK 3487 case KMessageBox::Continue: // OK
3488 calendar()->deleteJournal(jour); 3488 calendar()->deleteJournal(jour);
3489 updateView(); 3489 updateView();
3490 break; 3490 break;
3491 } // switch 3491 } // switch
3492 } else { 3492 } else {
3493 calendar()->deleteJournal(jour);; 3493 calendar()->deleteJournal(jour);;
3494 updateView(); 3494 updateView();
3495 } 3495 }
3496 emit updateSearchDialog(); 3496 emit updateSearchDialog();
3497} 3497}
3498 3498
3499void CalendarView::deleteEvent(Event *anEvent) 3499void CalendarView::deleteEvent(Event *anEvent)
3500{ 3500{
3501 if (!anEvent) { 3501 if (!anEvent) {
3502 KNotifyClient::beep(); 3502 KNotifyClient::beep();
3503 return; 3503 return;
3504 } 3504 }
3505 3505
3506 if (anEvent->recurrence()->doesRecur()) { 3506 if (anEvent->recurrence()->doesRecur()) {
3507 QDate itemDate = mViewManager->currentSelectionDate(); 3507 QDate itemDate = mViewManager->currentSelectionDate();
3508 int km; 3508 int km;
3509 if (!itemDate.isValid()) { 3509 if (!itemDate.isValid()) {
3510 //kdDebug() << "Date Not Valid" << endl; 3510 //kdDebug() << "Date Not Valid" << endl;
3511 if (KOPrefs::instance()->mConfirm) { 3511 if (KOPrefs::instance()->mConfirm) {
3512 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3512 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
3513 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 3513 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
3514 i18n("KO/Pi Confirmation"),i18n("Delete All")); 3514 i18n("KO/Pi Confirmation"),i18n("Delete All"));
3515 if ( km == KMessageBox::Continue ) 3515 if ( km == KMessageBox::Continue )
3516 km = KMessageBox::No; // No = all below 3516 km = KMessageBox::No; // No = all below
3517 } else 3517 } else
3518 km = KMessageBox::No; 3518 km = KMessageBox::No;
3519 } else { 3519 } else {
3520 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + 3520 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
3521 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 3521 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
3522 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 3522 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
3523 i18n("KO/Pi Confirmation"),i18n("Current"), 3523 i18n("KO/Pi Confirmation"),i18n("Current"),
3524 i18n("All")); 3524 i18n("All"));
3525 } 3525 }
3526 switch(km) { 3526 switch(km) {
3527 3527
3528 case KMessageBox::No: // Continue // all 3528 case KMessageBox::No: // Continue // all
3529 //qDebug("KMessageBox::No "); 3529 //qDebug("KMessageBox::No ");
3530 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3530 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3531 schedule(Scheduler::Cancel,anEvent); 3531 schedule(Scheduler::Cancel,anEvent);
3532 3532
3533 checkExternalId( anEvent); 3533 checkExternalId( anEvent);
3534 mCalendar->deleteEvent(anEvent); 3534 mCalendar->deleteEvent(anEvent);
3535 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 3535 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
3536 break; 3536 break;
3537 3537
3538 // Disabled because it does not work 3538 // Disabled because it does not work
3539 //#if 0 3539 //#if 0
3540 case KMessageBox::Yes: // just this one 3540 case KMessageBox::Yes: // just this one
3541 //QDate qd = mNavigator->selectedDates().first(); 3541 //QDate qd = mNavigator->selectedDates().first();
3542 //if (!qd.isValid()) { 3542 //if (!qd.isValid()) {
3543 // kdDebug() << "no date selected, or invalid date" << endl; 3543 // kdDebug() << "no date selected, or invalid date" << endl;
3544 // KNotifyClient::beep(); 3544 // KNotifyClient::beep();
3545 // return; 3545 // return;
3546 //} 3546 //}
3547 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 3547 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
3548 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 3548 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
3549 anEvent->addExDate(itemDate); 3549 anEvent->addExDate(itemDate);
3550 int duration = anEvent->recurrence()->duration(); 3550 int duration = anEvent->recurrence()->duration();
3551 if ( duration > 0 ) { 3551 if ( duration > 0 ) {
3552 anEvent->recurrence()->setDuration( duration - 1 ); 3552 anEvent->recurrence()->setDuration( duration - 1 );
3553 } 3553 }
3554 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 3554 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
3555 } 3555 }
3556 break; 3556 break;
3557 //#endif 3557 //#endif
3558 } // switch 3558 } // switch
3559 } else { 3559 } else {
3560 if (KOPrefs::instance()->mConfirm) { 3560 if (KOPrefs::instance()->mConfirm) {
3561 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3561 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
3562 i18n("\nAre you sure you want\nto delete this event?"), 3562 i18n("\nAre you sure you want\nto delete this event?"),
3563 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 3563 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
3564 case KMessageBox::Continue: // OK 3564 case KMessageBox::Continue: // OK
3565 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3565 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3566 schedule(Scheduler::Cancel,anEvent); 3566 schedule(Scheduler::Cancel,anEvent);
3567 checkExternalId( anEvent); 3567 checkExternalId( anEvent);
3568 mCalendar->deleteEvent(anEvent); 3568 mCalendar->deleteEvent(anEvent);
3569 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3569 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3570 break; 3570 break;
3571 } // switch 3571 } // switch
3572 } else { 3572 } else {
3573 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3573 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3574 schedule(Scheduler::Cancel,anEvent); 3574 schedule(Scheduler::Cancel,anEvent);
3575 checkExternalId( anEvent); 3575 checkExternalId( anEvent);
3576 mCalendar->deleteEvent(anEvent); 3576 mCalendar->deleteEvent(anEvent);
3577 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3577 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3578 } 3578 }
3579 } // if-else 3579 } // if-else
3580 emit updateSearchDialog(); 3580 emit updateSearchDialog();
3581} 3581}
3582 3582
3583bool CalendarView::deleteEvent(const QString &uid) 3583bool CalendarView::deleteEvent(const QString &uid)
3584{ 3584{
3585 Event *ev = mCalendar->event(uid); 3585 Event *ev = mCalendar->event(uid);
3586 if (ev) { 3586 if (ev) {
3587 deleteEvent(ev); 3587 deleteEvent(ev);
3588 return true; 3588 return true;
3589 } else { 3589 } else {
3590 return false; 3590 return false;
3591 } 3591 }
3592} 3592}
3593 3593
3594/*****************************************************************************/ 3594/*****************************************************************************/
3595 3595
3596void CalendarView::action_mail() 3596void CalendarView::action_mail()
3597{ 3597{
3598#ifndef KORG_NOMAIL 3598#ifndef KORG_NOMAIL
3599 KOMailClient mailClient; 3599 KOMailClient mailClient;
3600 3600
3601 Incidence *incidence = currentSelection(); 3601 Incidence *incidence = currentSelection();
3602 3602
3603 if (!incidence) { 3603 if (!incidence) {
3604 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3604 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3605 return; 3605 return;
3606 } 3606 }
3607 if(incidence->attendeeCount() == 0 ) { 3607 if(incidence->attendeeCount() == 0 ) {
3608 KMessageBox::sorry(this, 3608 KMessageBox::sorry(this,
3609 i18n("Can't generate mail:\nNo attendees defined.\n")); 3609 i18n("Can't generate mail:\nNo attendees defined.\n"));
3610 return; 3610 return;
3611 } 3611 }
3612 3612
3613 CalendarLocal cal_tmp; 3613 CalendarLocal cal_tmp;
3614 Event *event = 0; 3614 Event *event = 0;
3615 Event *ev = 0; 3615 Event *ev = 0;
3616 if ( incidence && incidence->typeID() == eventID ) { 3616 if ( incidence && incidence->typeID() == eventID ) {
3617 event = static_cast<Event *>(incidence); 3617 event = static_cast<Event *>(incidence);
3618 ev = new Event(*event); 3618 ev = new Event(*event);
3619 cal_tmp.addEvent(ev); 3619 cal_tmp.addEvent(ev);
3620 } 3620 }
3621 ICalFormat mForm(); 3621 ICalFormat mForm();
3622 QString attachment = mForm.toString( &cal_tmp ); 3622 QString attachment = mForm.toString( &cal_tmp );
3623 if (ev) delete(ev); 3623 if (ev) delete(ev);
3624 3624
3625 mailClient.mailAttendees(currentSelection(), attachment); 3625 mailClient.mailAttendees(currentSelection(), attachment);
3626 3626
3627#endif 3627#endif
3628 3628
3629#if 0 3629#if 0
3630 Event *anEvent = 0; 3630 Event *anEvent = 0;
3631 if (mViewManager->currentView()->isEventView()) { 3631 if (mViewManager->currentView()->isEventView()) {
3632 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3632 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3633 } 3633 }
3634 3634
3635 if (!anEvent) { 3635 if (!anEvent) {
3636 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3636 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3637 return; 3637 return;
3638 } 3638 }
3639 if(anEvent->attendeeCount() == 0 ) { 3639 if(anEvent->attendeeCount() == 0 ) {
3640 KMessageBox::sorry(this, 3640 KMessageBox::sorry(this,
3641 i18n("Can't generate mail:\nNo attendees defined.\n")); 3641 i18n("Can't generate mail:\nNo attendees defined.\n"));
3642 return; 3642 return;
3643 } 3643 }
3644 3644
3645 mailobject.emailEvent(anEvent); 3645 mailobject.emailEvent(anEvent);
3646#endif 3646#endif
3647} 3647}
3648 3648
3649 3649
3650void CalendarView::schedule_publish(Incidence *incidence) 3650void CalendarView::schedule_publish(Incidence *incidence)
3651{ 3651{
3652 Event *event = 0; 3652 Event *event = 0;
3653 Todo *todo = 0; 3653 Todo *todo = 0;
3654 3654
3655 if (incidence == 0) { 3655 if (incidence == 0) {
3656 incidence = mViewManager->currentView()->selectedIncidences().first(); 3656 incidence = mViewManager->currentView()->selectedIncidences().first();
3657 if (incidence == 0) { 3657 if (incidence == 0) {
3658 incidence = mTodoList->selectedIncidences().first(); 3658 incidence = mTodoList->selectedIncidences().first();
3659 } 3659 }
3660 } 3660 }
3661 if ( incidence && incidence->typeID() == eventID ) { 3661 if ( incidence && incidence->typeID() == eventID ) {
3662 event = static_cast<Event *>(incidence); 3662 event = static_cast<Event *>(incidence);
3663 } else { 3663 } else {
3664 if ( incidence && incidence->typeID() == todoID ) { 3664 if ( incidence && incidence->typeID() == todoID ) {
3665 todo = static_cast<Todo *>(incidence); 3665 todo = static_cast<Todo *>(incidence);
3666 } 3666 }
3667 } 3667 }
3668 3668
3669 if (!event && !todo) { 3669 if (!event && !todo) {
3670 KMessageBox::sorry(this,i18n("No event selected.")); 3670 KMessageBox::sorry(this,i18n("No event selected."));
3671 return; 3671 return;
3672 } 3672 }
3673 3673
3674 PublishDialog *publishdlg = new PublishDialog(); 3674 PublishDialog *publishdlg = new PublishDialog();
3675 if (incidence->attendeeCount()>0) { 3675 if (incidence->attendeeCount()>0) {
3676 QPtrList<Attendee> attendees = incidence->attendees(); 3676 QPtrList<Attendee> attendees = incidence->attendees();
3677 attendees.first(); 3677 attendees.first();
3678 while ( attendees.current()!=0 ) { 3678 while ( attendees.current()!=0 ) {
3679 publishdlg->addAttendee(attendees.current()); 3679 publishdlg->addAttendee(attendees.current());
3680 attendees.next(); 3680 attendees.next();
3681 } 3681 }
3682 } 3682 }
3683 bool send = true; 3683 bool send = true;
3684 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3684 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3685 if ( publishdlg->exec() != QDialog::Accepted ) 3685 if ( publishdlg->exec() != QDialog::Accepted )
3686 send = false; 3686 send = false;
3687 } 3687 }
3688 if ( send ) { 3688 if ( send ) {
3689 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3689 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3690 if ( event ) { 3690 if ( event ) {
3691 Event *ev = new Event(*event); 3691 Event *ev = new Event(*event);
3692 ev->registerObserver(0); 3692 ev->registerObserver(0);
3693 ev->clearAttendees(); 3693 ev->clearAttendees();
3694 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3694 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3695 delete(ev); 3695 delete(ev);
3696 } 3696 }
3697 } else { 3697 } else {
3698 if ( todo ) { 3698 if ( todo ) {
3699 Todo *ev = new Todo(*todo); 3699 Todo *ev = new Todo(*todo);
3700 ev->registerObserver(0); 3700 ev->registerObserver(0);
3701 ev->clearAttendees(); 3701 ev->clearAttendees();
3702 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3702 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3703 delete(ev); 3703 delete(ev);
3704 } 3704 }
3705 } 3705 }
3706 } 3706 }
3707 } 3707 }
3708 delete publishdlg; 3708 delete publishdlg;
3709} 3709}
3710 3710
3711void CalendarView::schedule_request(Incidence *incidence) 3711void CalendarView::schedule_request(Incidence *incidence)
3712{ 3712{
3713 schedule(Scheduler::Request,incidence); 3713 schedule(Scheduler::Request,incidence);
3714} 3714}
3715 3715
3716void CalendarView::schedule_refresh(Incidence *incidence) 3716void CalendarView::schedule_refresh(Incidence *incidence)
3717{ 3717{
3718 schedule(Scheduler::Refresh,incidence); 3718 schedule(Scheduler::Refresh,incidence);
3719} 3719}
3720 3720
3721void CalendarView::schedule_cancel(Incidence *incidence) 3721void CalendarView::schedule_cancel(Incidence *incidence)
3722{ 3722{
3723 schedule(Scheduler::Cancel,incidence); 3723 schedule(Scheduler::Cancel,incidence);
3724} 3724}
3725 3725
3726void CalendarView::schedule_add(Incidence *incidence) 3726void CalendarView::schedule_add(Incidence *incidence)
3727{ 3727{
3728 schedule(Scheduler::Add,incidence); 3728 schedule(Scheduler::Add,incidence);
3729} 3729}
3730 3730
3731void CalendarView::schedule_reply(Incidence *incidence) 3731void CalendarView::schedule_reply(Incidence *incidence)
3732{ 3732{
3733 schedule(Scheduler::Reply,incidence); 3733 schedule(Scheduler::Reply,incidence);
3734} 3734}
3735 3735
3736void CalendarView::schedule_counter(Incidence *incidence) 3736void CalendarView::schedule_counter(Incidence *incidence)
3737{ 3737{
3738 schedule(Scheduler::Counter,incidence); 3738 schedule(Scheduler::Counter,incidence);
3739} 3739}
3740 3740
3741void CalendarView::schedule_declinecounter(Incidence *incidence) 3741void CalendarView::schedule_declinecounter(Incidence *incidence)
3742{ 3742{
3743 schedule(Scheduler::Declinecounter,incidence); 3743 schedule(Scheduler::Declinecounter,incidence);
3744} 3744}
3745 3745
3746void CalendarView::schedule_publish_freebusy(int daysToPublish) 3746void CalendarView::schedule_publish_freebusy(int daysToPublish)
3747{ 3747{
3748 QDateTime start = QDateTime::currentDateTime(); 3748 QDateTime start = QDateTime::currentDateTime();
3749 QDateTime end = start.addDays(daysToPublish); 3749 QDateTime end = start.addDays(daysToPublish);
3750 3750
3751 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3751 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3752 freebusy->setOrganizer(KOPrefs::instance()->email()); 3752 freebusy->setOrganizer(KOPrefs::instance()->email());
3753 3753
3754 3754
3755 PublishDialog *publishdlg = new PublishDialog(); 3755 PublishDialog *publishdlg = new PublishDialog();
3756 if ( publishdlg->exec() == QDialog::Accepted ) { 3756 if ( publishdlg->exec() == QDialog::Accepted ) {
3757 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3757 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3758 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3758 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3759 delete(freebusy); 3759 delete(freebusy);
3760 } 3760 }
3761 } 3761 }
3762 delete publishdlg; 3762 delete publishdlg;
3763} 3763}
3764 3764
3765void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 3765void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3766{ 3766{
3767 Event *event = 0; 3767 Event *event = 0;
3768 Todo *todo = 0; 3768 Todo *todo = 0;
3769 3769
3770 if (incidence == 0) { 3770 if (incidence == 0) {
3771 incidence = mViewManager->currentView()->selectedIncidences().first(); 3771 incidence = mViewManager->currentView()->selectedIncidences().first();
3772 if (incidence == 0) { 3772 if (incidence == 0) {
3773 incidence = mTodoList->selectedIncidences().first(); 3773 incidence = mTodoList->selectedIncidences().first();
3774 } 3774 }
3775 } 3775 }
3776 if ( incidence && incidence->typeID() == eventID ) { 3776 if ( incidence && incidence->typeID() == eventID ) {
3777 event = static_cast<Event *>(incidence); 3777 event = static_cast<Event *>(incidence);
3778 } 3778 }
3779 if ( incidence && incidence->typeID() == todoID ) { 3779 if ( incidence && incidence->typeID() == todoID ) {
3780 todo = static_cast<Todo *>(incidence); 3780 todo = static_cast<Todo *>(incidence);
3781 } 3781 }
3782 3782
3783 if (!event && !todo) { 3783 if (!event && !todo) {
3784 KMessageBox::sorry(this,i18n("No event selected.")); 3784 KMessageBox::sorry(this,i18n("No event selected."));
3785 return; 3785 return;
3786 } 3786 }
3787 3787
3788 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 3788 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
3789 KMessageBox::sorry(this,i18n("The event has no attendees.")); 3789 KMessageBox::sorry(this,i18n("The event has no attendees."));
3790 return; 3790 return;
3791 } 3791 }
3792 3792
3793 Event *ev = 0; 3793 Event *ev = 0;
3794 if (event) ev = new Event(*event); 3794 if (event) ev = new Event(*event);
3795 Todo *to = 0; 3795 Todo *to = 0;
3796 if (todo) to = new Todo(*todo); 3796 if (todo) to = new Todo(*todo);
3797 3797
3798 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 3798 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
3799 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 3799 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
3800 if (!me) { 3800 if (!me) {
3801 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 3801 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
3802 return; 3802 return;
3803 } 3803 }
3804 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 3804 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
3805 StatusDialog *statdlg = new StatusDialog(this); 3805 StatusDialog *statdlg = new StatusDialog(this);
3806 if (!statdlg->exec()==QDialog::Accepted) return; 3806 if (!statdlg->exec()==QDialog::Accepted) return;
3807 me->setStatus( statdlg->status() ); 3807 me->setStatus( statdlg->status() );
3808 delete(statdlg); 3808 delete(statdlg);
3809 } 3809 }
3810 Attendee *menew = new Attendee(*me); 3810 Attendee *menew = new Attendee(*me);
3811 if (ev) { 3811 if (ev) {
3812 ev->clearAttendees(); 3812 ev->clearAttendees();
3813 ev->addAttendee(menew,false); 3813 ev->addAttendee(menew,false);
3814 } else { 3814 } else {
3815 if (to) { 3815 if (to) {
3816 todo->clearAttendees(); 3816 todo->clearAttendees();
3817 todo->addAttendee(menew,false); 3817 todo->addAttendee(menew,false);
3818 } 3818 }
3819 } 3819 }
3820 } 3820 }
3821 3821
3822 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3822 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3823 if (ev) { 3823 if (ev) {
3824 if ( !dlg->addMessage(ev,method) ) delete(ev); 3824 if ( !dlg->addMessage(ev,method) ) delete(ev);
3825 } else { 3825 } else {
3826 if (to) { 3826 if (to) {
3827 if ( !dlg->addMessage(to,method) ) delete(to); 3827 if ( !dlg->addMessage(to,method) ) delete(to);
3828 } 3828 }
3829 } 3829 }
3830} 3830}
3831 3831
3832void CalendarView::openAddressbook() 3832void CalendarView::openAddressbook()
3833{ 3833{
3834 KRun::runCommand("kaddressbook"); 3834 KRun::runCommand("kaddressbook");
3835} 3835}
3836 3836
3837void CalendarView::setModified(bool modified) 3837void CalendarView::setModified(bool modified)
3838{ 3838{
3839 if ( modified ) 3839 if ( modified )
3840 emit signalmodified(); 3840 emit signalmodified();
3841 if (mModified != modified) { 3841 if (mModified != modified) {
3842 mModified = modified; 3842 mModified = modified;
3843 emit modifiedChanged(mModified); 3843 emit modifiedChanged(mModified);
3844 } 3844 }
3845} 3845}
3846 3846
3847bool CalendarView::isReadOnly() 3847bool CalendarView::isReadOnly()
3848{ 3848{
3849 return mReadOnly; 3849 return mReadOnly;
3850} 3850}
3851 3851
3852void CalendarView::setReadOnly(bool readOnly) 3852void CalendarView::setReadOnly(bool readOnly)
3853{ 3853{
3854 if (mReadOnly != readOnly) { 3854 if (mReadOnly != readOnly) {
3855 mReadOnly = readOnly; 3855 mReadOnly = readOnly;
3856 emit readOnlyChanged(mReadOnly); 3856 emit readOnlyChanged(mReadOnly);
3857 } 3857 }
3858} 3858}
3859 3859
3860bool CalendarView::isModified() 3860bool CalendarView::isModified()
3861{ 3861{
3862 return mModified; 3862 return mModified;
3863} 3863}
3864void CalendarView::slotprintSelInc() 3864void CalendarView::slotprintSelInc()
3865{ 3865{
3866 if ( currentSelection() == 0 ) { 3866 if ( currentSelection() == 0 ) {
3867 KMessageBox::sorry(this,i18n("There is nothing selected!")); 3867 KMessageBox::sorry(this,i18n("There is nothing selected!"));
3868 return; 3868 return;
3869 } 3869 }
3870 showIncidence(); 3870 showIncidence();
3871 getEventViewerDialog()->print(); 3871 getEventViewerDialog()->print();
3872 3872
3873} 3873}
3874void CalendarView::printSetup() 3874void CalendarView::printSetup()
3875{ 3875{
3876#ifndef KORG_NOPRINTER 3876#ifndef KORG_NOPRINTER
3877 createPrinter(); 3877 createPrinter();
3878 3878
3879 mCalPrinter->setupPrinter(); 3879 mCalPrinter->setupPrinter();
3880#endif 3880#endif
3881} 3881}
3882 3882
3883void CalendarView::print() 3883void CalendarView::print()
3884{ 3884{
3885#ifndef KORG_NOPRINTER 3885#ifndef KORG_NOPRINTER
3886 createPrinter(); 3886 createPrinter();
3887 3887
3888 DateList tmpDateList = mNavigator->selectedDates(); 3888 DateList tmpDateList = mNavigator->selectedDates();
3889 mCalPrinter->print(CalPrinter::Month, 3889 mCalPrinter->print(CalPrinter::Month,
3890 tmpDateList.first(), tmpDateList.last()); 3890 tmpDateList.first(), tmpDateList.last());
3891#endif 3891#endif
3892} 3892}
3893 3893
3894void CalendarView::printPreview() 3894void CalendarView::printPreview()
3895{ 3895{
3896#ifndef KORG_NOPRINTER 3896#ifndef KORG_NOPRINTER
3897 kdDebug() << "CalendarView::printPreview()" << endl; 3897 kdDebug() << "CalendarView::printPreview()" << endl;
3898 3898
3899 createPrinter(); 3899 createPrinter();
3900 3900
3901 DateList tmpDateList = mNavigator->selectedDates(); 3901 DateList tmpDateList = mNavigator->selectedDates();
3902 3902
3903 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 3903 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
3904 tmpDateList.last()); 3904 tmpDateList.last());
3905#endif 3905#endif
3906} 3906}
3907 3907
3908void CalendarView::exportICalendar() 3908void CalendarView::exportICalendar()
3909{ 3909{
3910 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 3910 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
3911 3911
3912 // Force correct extension 3912 // Force correct extension
3913 if (filename.right(4) != ".ics") filename += ".ics"; 3913 if (filename.right(4) != ".ics") filename += ".ics";
3914 3914
3915 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3915 FileStorage storage( mCalendar, filename, new ICalFormat() );
3916 storage.save(); 3916 storage.save();
3917} 3917}
3918 3918
3919bool CalendarView::exportVCalendar( QString filename ) 3919bool CalendarView::exportVCalendar( QString filename )
3920{ 3920{
3921 if (mCalendar->journals().count() > 0) { 3921 if (mCalendar->journals().count() > 0) {
3922 int result = KMessageBox::warningContinueCancel(this, 3922 int result = KMessageBox::warningContinueCancel(this,
3923 i18n("The journal entries can not be\nexported to a vCalendar file."), 3923 i18n("The journal entries can not be\nexported to a vCalendar file."),
3924 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3924 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3925 true); 3925 true);
3926 if (result != KMessageBox::Continue) return false; 3926 if (result != KMessageBox::Continue) return false;
3927 } 3927 }
3928 3928
3929 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3929 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3930 3930
3931 // Force correct extension 3931 // Force correct extension
3932 if (filename.right(4) != ".vcs") filename += ".vcs"; 3932 if (filename.right(4) != ".vcs") filename += ".vcs";
3933 3933
3934 FileStorage storage( mCalendar, filename, new VCalFormat ); 3934 FileStorage storage( mCalendar, filename, new VCalFormat );
3935 return storage.save(); 3935 return storage.save();
3936 3936
3937} 3937}
3938 3938
3939void CalendarView::eventUpdated(Incidence *) 3939void CalendarView::eventUpdated(Incidence *)
3940{ 3940{
3941 setModified(); 3941 setModified();
3942 // Don't call updateView here. The code, which has caused the update of the 3942 // Don't call updateView here. The code, which has caused the update of the
3943 // event is responsible for updating the view. 3943 // event is responsible for updating the view.
3944 // updateView(); 3944 // updateView();
3945} 3945}
3946 3946
3947void CalendarView::adaptNavigationUnits() 3947void CalendarView::adaptNavigationUnits()
3948{ 3948{
3949 if (mViewManager->currentView()->isEventView()) { 3949 if (mViewManager->currentView()->isEventView()) {
3950 int days = mViewManager->currentView()->currentDateCount(); 3950 int days = mViewManager->currentView()->currentDateCount();
3951 if (days == 1) { 3951 if (days == 1) {
3952 emit changeNavStringPrev(i18n("&Previous Day")); 3952 emit changeNavStringPrev(i18n("&Previous Day"));
3953 emit changeNavStringNext(i18n("&Next Day")); 3953 emit changeNavStringNext(i18n("&Next Day"));
3954 } else { 3954 } else {
3955 emit changeNavStringPrev(i18n("&Previous Week")); 3955 emit changeNavStringPrev(i18n("&Previous Week"));
3956 emit changeNavStringNext(i18n("&Next Week")); 3956 emit changeNavStringNext(i18n("&Next Week"));
3957 } 3957 }
3958 } 3958 }
3959} 3959}
3960 3960
3961void CalendarView::processMainViewSelection( Incidence *incidence ) 3961void CalendarView::processMainViewSelection( Incidence *incidence )
3962{ 3962{
3963 if ( incidence ) mTodoList->clearSelection(); 3963 if ( incidence ) mTodoList->clearSelection();
3964 processIncidenceSelection( incidence ); 3964 processIncidenceSelection( incidence );
3965} 3965}
3966 3966
3967void CalendarView::processTodoListSelection( Incidence *incidence ) 3967void CalendarView::processTodoListSelection( Incidence *incidence )
3968{ 3968{
3969 if ( incidence && mViewManager->currentView() ) { 3969 if ( incidence && mViewManager->currentView() ) {
3970 mViewManager->currentView()->clearSelection(); 3970 mViewManager->currentView()->clearSelection();
3971 } 3971 }
3972 processIncidenceSelection( incidence ); 3972 processIncidenceSelection( incidence );
3973} 3973}
3974 3974
3975void CalendarView::processIncidenceSelection( Incidence *incidence ) 3975void CalendarView::processIncidenceSelection( Incidence *incidence )
3976{ 3976{
3977 if ( incidence == mSelectedIncidence ) return; 3977 if ( incidence == mSelectedIncidence ) return;
3978 3978
3979 mSelectedIncidence = incidence; 3979 mSelectedIncidence = incidence;
3980 3980
3981 emit incidenceSelected( mSelectedIncidence ); 3981 emit incidenceSelected( mSelectedIncidence );
3982 3982
3983 if ( incidence && incidence->typeID() == eventID ) { 3983 if ( incidence && incidence->typeID() == eventID ) {
3984 Event *event = static_cast<Event *>( incidence ); 3984 Event *event = static_cast<Event *>( incidence );
3985 if ( event->organizer() == KOPrefs::instance()->email() ) { 3985 if ( event->organizer() == KOPrefs::instance()->email() ) {
3986 emit organizerEventsSelected( true ); 3986 emit organizerEventsSelected( true );
3987 } else { 3987 } else {
3988 emit organizerEventsSelected(false); 3988 emit organizerEventsSelected(false);
3989 } 3989 }
3990 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3990 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3991 KOPrefs::instance()->email() ) ) { 3991 KOPrefs::instance()->email() ) ) {
3992 emit groupEventsSelected( true ); 3992 emit groupEventsSelected( true );
3993 } else { 3993 } else {
3994 emit groupEventsSelected(false); 3994 emit groupEventsSelected(false);
3995 } 3995 }
3996 return; 3996 return;
3997 } else { 3997 } else {
3998 if ( incidence && incidence->typeID() == todoID ) { 3998 if ( incidence && incidence->typeID() == todoID ) {
3999 emit todoSelected( true ); 3999 emit todoSelected( true );
4000 Todo *event = static_cast<Todo *>( incidence ); 4000 Todo *event = static_cast<Todo *>( incidence );
4001 if ( event->organizer() == KOPrefs::instance()->email() ) { 4001 if ( event->organizer() == KOPrefs::instance()->email() ) {
4002 emit organizerEventsSelected( true ); 4002 emit organizerEventsSelected( true );
4003 } else { 4003 } else {
4004 emit organizerEventsSelected(false); 4004 emit organizerEventsSelected(false);
4005 } 4005 }
4006 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4006 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4007 KOPrefs::instance()->email() ) ) { 4007 KOPrefs::instance()->email() ) ) {
4008 emit groupEventsSelected( true ); 4008 emit groupEventsSelected( true );
4009 } else { 4009 } else {
4010 emit groupEventsSelected(false); 4010 emit groupEventsSelected(false);
4011 } 4011 }
4012 return; 4012 return;
4013 } else { 4013 } else {
4014 emit todoSelected( false ); 4014 emit todoSelected( false );
4015 emit organizerEventsSelected(false); 4015 emit organizerEventsSelected(false);
4016 emit groupEventsSelected(false); 4016 emit groupEventsSelected(false);
4017 } 4017 }
4018 return; 4018 return;
4019 } 4019 }
4020 4020
4021 /* if ( incidence && incidence->typeID() == todoID ) { 4021 /* if ( incidence && incidence->typeID() == todoID ) {
4022 emit todoSelected( true ); 4022 emit todoSelected( true );
4023 } else { 4023 } else {
4024 emit todoSelected( false ); 4024 emit todoSelected( false );
4025 }*/ 4025 }*/
4026} 4026}
4027 4027
4028 4028
4029void CalendarView::checkClipboard() 4029void CalendarView::checkClipboard()
4030{ 4030{
4031#ifndef KORG_NODND 4031#ifndef KORG_NODND
4032 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 4032 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
4033 emit pasteEnabled(true); 4033 emit pasteEnabled(true);
4034 } else { 4034 } else {
4035 emit pasteEnabled(false); 4035 emit pasteEnabled(false);
4036 } 4036 }
4037#endif 4037#endif
4038} 4038}
4039 4039
4040void CalendarView::showDates(const DateList &selectedDates) 4040void CalendarView::showDates(const DateList &selectedDates)
4041{ 4041{
4042 // kdDebug() << "CalendarView::selectDates()" << endl; 4042 // kdDebug() << "CalendarView::selectDates()" << endl;
4043 4043
4044 4044
4045 if ( !mBlockShowDates ) { 4045 if ( !mBlockShowDates ) {
4046 if ( mViewManager->currentView() ) { 4046 if ( mViewManager->currentView() ) {
4047 updateView( selectedDates.first(), selectedDates.last() ); 4047 updateView( selectedDates.first(), selectedDates.last() );
4048 } else { 4048 } else {
4049 mViewManager->showAgendaView(); 4049 mViewManager->showAgendaView();
4050 } 4050 }
4051 } 4051 }
4052 4052
4053 QDate date = selectedDates.first(); 4053 QDate date = selectedDates.first();
4054 if ( ! date.isValid() ) { 4054 if ( ! date.isValid() ) {
4055 topLevelWidget()->setCaption(""); 4055 topLevelWidget()->setCaption("");
4056 return; 4056 return;
4057 } 4057 }
4058 4058
4059 QString selDates; 4059 QString selDates;
4060 selDates = KGlobal::locale()->formatDate( date, true); 4060 selDates = KGlobal::locale()->formatDate( date, true);
4061 if (selectedDates.first() < selectedDates.last() ) 4061 if (selectedDates.first() < selectedDates.last() )
4062 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 4062 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
4063 else { 4063 else {
4064 QString addString; 4064 QString addString;
4065 if ( date == QDateTime::currentDateTime().date() ) 4065 if ( date == QDateTime::currentDateTime().date() )
4066 addString = i18n("Today"); 4066 addString = i18n("Today");
4067 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 4067 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
4068 addString = i18n("Tomorrow"); 4068 addString = i18n("Tomorrow");
4069 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 4069 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
4070 addString = i18n("Yesterday"); 4070 addString = i18n("Yesterday");
4071 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 4071 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
4072 addString = i18n("Day before yesterday"); 4072 addString = i18n("Day before yesterday");
4073 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 4073 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
4074 addString = i18n("Day after tomorrow"); 4074 addString = i18n("Day after tomorrow");
4075 if ( !addString.isEmpty() ) { 4075 if ( !addString.isEmpty() ) {
4076 topLevelWidget()->setCaption( addString+", " + selDates ); 4076 topLevelWidget()->setCaption( addString+", " + selDates );
4077 return; 4077 return;
4078 } 4078 }
4079 } 4079 }
4080 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 4080 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
4081 4081
4082} 4082}
4083 4083
4084QPtrList<CalFilter> CalendarView::filters() 4084QPtrList<CalFilter> CalendarView::filters()
4085{ 4085{
4086 return mFilters; 4086 return mFilters;
4087 4087
4088} 4088}
4089void CalendarView::editFilters() 4089void CalendarView::editFilters()
4090{ 4090{
4091 // kdDebug() << "CalendarView::editFilters()" << endl; 4091 // kdDebug() << "CalendarView::editFilters()" << endl;
4092 4092
4093 CalFilter *filter = mFilters.first(); 4093 CalFilter *filter = mFilters.first();
4094 while(filter) { 4094 while(filter) {
4095 filter = mFilters.next(); 4095 filter = mFilters.next();
4096 } 4096 }
4097 4097
4098 mDialogManager->showFilterEditDialog(&mFilters); 4098 mDialogManager->showFilterEditDialog(&mFilters);
4099 updateFilter(); 4099 updateFilter();
4100} 4100}
4101void CalendarView::toggleFilter() 4101void CalendarView::toggleFilter()
4102{ 4102{
4103 if ( mLeftFrame->isHidden() ) { 4103 if ( mLeftFrame->isHidden() ) {
4104 toggleExpand(); 4104 toggleExpand();
4105 showFilter( true ); 4105 showFilter( true );
4106 } else 4106 } else
4107 showFilter(! mCalEditView->isVisible()); 4107 showFilter(! mCalEditView->isVisible());
4108} 4108}
4109 4109
4110KOFilterView *CalendarView::filterView() 4110KOFilterView *CalendarView::filterView()
4111{ 4111{
4112 return mFilterView; 4112 return mFilterView;
4113} 4113}
4114void CalendarView::selectFilter( int fil ) 4114void CalendarView::selectFilter( int fil )
4115{ 4115{
4116 mFilterView->setSelectedFilter( fil ); 4116 mFilterView->setSelectedFilter( fil );
4117 updateUnmanagedViews(); 4117 updateUnmanagedViews();
4118} 4118}
4119void CalendarView::showFilter(bool visible) 4119void CalendarView::showFilter(bool visible)
4120{ 4120{
4121#if 1 4121#if 1
4122 if (visible) { 4122 if (visible) {
4123 mCalEditView->readConfig(); 4123 mCalEditView->readConfig();
4124 mCalEditView->show(); 4124 mCalEditView->show();
4125 QValueList<int> sizes; 4125 QValueList<int> sizes;
4126 sizes = mLeftFrame->sizes(); 4126 sizes = mLeftFrame->sizes();
4127 if ( sizes.count() == 4 && sizes[3] < 20 ) { 4127 if ( sizes.count() == 4 && sizes[3] < 20 ) {
4128 sizes.clear(); 4128 sizes.clear();
4129 sizes << 100; 4129 sizes << 100;
4130 sizes << 0; 4130 sizes << 0;
4131 sizes << 0; 4131 sizes << 0;
4132 sizes << 100; 4132 sizes << 100;
4133 mLeftFrame->setSizes(sizes); 4133 mLeftFrame->setSizes(sizes);
4134 } 4134 }
4135#if 0 4135#if 0
4136 sizes = mLeftFrame->sizes(); 4136 sizes = mLeftFrame->sizes();
4137 int ccc = 0; 4137 int ccc = 0;
4138 while ( ccc < sizes.count()) { 4138 while ( ccc < sizes.count()) {
4139 qDebug("size %d %d ", ccc, sizes[ccc]); 4139 qDebug("size %d %d ", ccc, sizes[ccc]);
4140 ++ccc; 4140 ++ccc;
4141 } 4141 }
4142#endif 4142#endif
4143 4143
4144 } 4144 }
4145 else { 4145 else {
4146 mCalEditView->hide(); 4146 mCalEditView->hide();
4147 } 4147 }
4148#else 4148#else
4149 if (visible) mFilterView->show(); 4149 if (visible) mFilterView->show();
4150 else mFilterView->hide(); 4150 else mFilterView->hide();
4151#endif 4151#endif
4152} 4152}
4153void CalendarView::toggleFilerEnabled( ) 4153void CalendarView::toggleFilerEnabled( )
4154{ 4154{
4155 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 4155 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
4156 if ( !mFilterView->filtersEnabled() ) 4156 if ( !mFilterView->filtersEnabled() )
4157 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 4157 topLevelWidget()->setCaption( i18n("Filter disabled ") );
4158 updateUnmanagedViews(); 4158 updateUnmanagedViews();
4159 4159
4160} 4160}
4161void CalendarView::updateFilter() 4161void CalendarView::updateFilter()
4162{ 4162{
4163 CalFilter *filter = mFilterView->selectedFilter(); 4163 CalFilter *filter = mFilterView->selectedFilter();
4164 if (filter) { 4164 if (filter) {
4165 QString mess; 4165 QString mess;
4166 if (mFilterView->filtersEnabled()) { 4166 if (mFilterView->filtersEnabled()) {
4167 mess = i18n("Filter selected: ")+filter->name(); 4167 mess = i18n("Filter selected: ")+filter->name();
4168 filter->setEnabled(true); 4168 filter->setEnabled(true);
4169 } 4169 }
4170 else filter->setEnabled(false); 4170 else filter->setEnabled(false);
4171 mCalendar->setFilter(filter); 4171 mCalendar->setFilter(filter);
4172 updateView(); 4172 updateView();
4173 if ( !mess.isEmpty() ) 4173 if ( !mess.isEmpty() )
4174 topLevelWidget()->setCaption( mess ); 4174 topLevelWidget()->setCaption( mess );
4175 4175
4176 } 4176 }
4177 emit filtersUpdated(); 4177 emit filtersUpdated();
4178} 4178}
4179 4179
4180void CalendarView::filterEdited() 4180void CalendarView::filterEdited()
4181{ 4181{
4182 mFilterView->updateFilters(); 4182 mFilterView->updateFilters();
4183 updateFilter(); 4183 updateFilter();
4184 writeSettings(); 4184 writeSettings();
4185} 4185}
4186 4186
4187 4187
4188void CalendarView::takeOverEvent() 4188void CalendarView::takeOverEvent()
4189{ 4189{
4190 Incidence *incidence = currentSelection(); 4190 Incidence *incidence = currentSelection();
4191 4191
4192 if (!incidence) return; 4192 if (!incidence) return;
4193 4193
4194 incidence->setOrganizer(KOPrefs::instance()->email()); 4194 incidence->setOrganizer(KOPrefs::instance()->email());
4195 incidence->recreate(); 4195 incidence->recreate();
4196 incidence->setReadOnly(false); 4196 incidence->setReadOnly(false);
4197 4197
4198 updateView(); 4198 updateView();
4199} 4199}
4200 4200
4201void CalendarView::takeOverCalendar() 4201void CalendarView::takeOverCalendar()
4202{ 4202{
4203 // TODO: Create Calendar::allIncidences() function and use it here 4203 // TODO: Create Calendar::allIncidences() function and use it here
4204 4204
4205 clearAllViews(); 4205 clearAllViews();
4206 QPtrList<Event> events = mCalendar->events(); 4206 QPtrList<Event> events = mCalendar->events();
4207 for(uint i=0; i<events.count(); ++i) { 4207 for(uint i=0; i<events.count(); ++i) {
4208 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4208 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4209 events.at(i)->recreate(); 4209 events.at(i)->recreate();
4210 events.at(i)->setReadOnly(false); 4210 events.at(i)->setReadOnly(false);
4211 } 4211 }
4212 4212
4213 QPtrList<Todo> todos = mCalendar->todos(); 4213 QPtrList<Todo> todos = mCalendar->todos();
4214 for(uint i=0; i<todos.count(); ++i) { 4214 for(uint i=0; i<todos.count(); ++i) {
4215 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4215 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4216 todos.at(i)->recreate(); 4216 todos.at(i)->recreate();
4217 todos.at(i)->setReadOnly(false); 4217 todos.at(i)->setReadOnly(false);
4218 } 4218 }
4219 4219
4220 QPtrList<Journal> journals = mCalendar->journals(); 4220 QPtrList<Journal> journals = mCalendar->journals();
4221 for(uint i=0; i<journals.count(); ++i) { 4221 for(uint i=0; i<journals.count(); ++i) {
4222 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4222 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4223 journals.at(i)->recreate(); 4223 journals.at(i)->recreate();
4224 journals.at(i)->setReadOnly(false); 4224 journals.at(i)->setReadOnly(false);
4225 } 4225 }
4226 4226
4227 updateView(); 4227 updateView();
4228} 4228}
4229 4229
4230void CalendarView::showIntro() 4230void CalendarView::showIntro()
4231{ 4231{
4232 kdDebug() << "To be implemented." << endl; 4232 kdDebug() << "To be implemented." << endl;
4233} 4233}
4234 4234
4235QWidgetStack *CalendarView::viewStack() 4235QWidgetStack *CalendarView::viewStack()
4236{ 4236{
4237 return mRightFrame; 4237 return mRightFrame;
4238} 4238}
4239 4239
4240QWidget *CalendarView::leftFrame() 4240QWidget *CalendarView::leftFrame()
4241{ 4241{
4242 return ( QWidget *)mLeftFrame; 4242 return ( QWidget *)mLeftFrame;
4243} 4243}
4244 4244
4245DateNavigator *CalendarView::dateNavigator() 4245DateNavigator *CalendarView::dateNavigator()
4246{ 4246{
4247 return mNavigator; 4247 return mNavigator;
4248} 4248}
4249 4249
4250KDateNavigator* CalendarView::dateNavigatorWidget() 4250KDateNavigator* CalendarView::dateNavigatorWidget()
4251{ 4251{
4252 return mDateNavigator->navigatorView(); 4252 return mDateNavigator->navigatorView();
4253} 4253}
4254void CalendarView::toggleDateNavigatorWidget() 4254void CalendarView::toggleDateNavigatorWidget()
4255{ 4255{
4256 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4256 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4257 4257
4258 if (!KOPrefs::instance()->mShowDateNavigator ) 4258 if (!KOPrefs::instance()->mShowDateNavigator )
4259 mDateNavigator->hide(); 4259 mDateNavigator->hide();
4260 else 4260 else
4261 mDateNavigator->show(); 4261 mDateNavigator->show();
4262} 4262}
4263void CalendarView::addView(KOrg::BaseView *view) 4263void CalendarView::addView(KOrg::BaseView *view)
4264{ 4264{
4265 mViewManager->addView(view); 4265 mViewManager->addView(view);
4266} 4266}
4267 4267
4268void CalendarView::showView(KOrg::BaseView *view) 4268void CalendarView::showView(KOrg::BaseView *view)
4269{ 4269{
4270 mViewManager->showView(view, mLeftFrame->isVisible()); 4270 mViewManager->showView(view, mLeftFrame->isVisible());
4271} 4271}
4272 4272
4273Incidence *CalendarView::currentSelection() 4273Incidence *CalendarView::currentSelection()
4274{ 4274{
4275 return mViewManager->currentSelection(); 4275 return mViewManager->currentSelection();
4276} 4276}
4277void CalendarView::toggleAllDaySize() 4277void CalendarView::toggleAllDaySize()
4278{ 4278{
4279 /* 4279 /*
4280 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4280 if ( KOPrefs::instance()->mAllDaySize > 47 )
4281 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4281 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4282 else 4282 else
4283 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4283 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4284 */ 4284 */
4285 viewManager()->agendaView()->toggleAllDay(); 4285 viewManager()->agendaView()->toggleAllDay();
4286} 4286}
4287void CalendarView::toggleExpand() 4287void CalendarView::toggleExpand()
4288{ 4288{
4289 // if ( mLeftFrame->isHidden() ) { 4289 // if ( mLeftFrame->isHidden() ) {
4290 // mLeftFrame->show(); 4290 // mLeftFrame->show();
4291 // emit calendarViewExpanded( false ); 4291 // emit calendarViewExpanded( false );
4292 // } else { 4292 // } else {
4293 // mLeftFrame->hide(); 4293 // mLeftFrame->hide();
4294 // emit calendarViewExpanded( true ); 4294 // emit calendarViewExpanded( true );
4295 // } 4295 // }
4296 //qDebug(" CalendarView::toggleExpand()"); 4296 //qDebug(" CalendarView::toggleExpand()");
4297 globalFlagBlockAgenda = 1; 4297 globalFlagBlockAgenda = 1;
4298 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4298 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4299 globalFlagBlockAgenda = 5; 4299 globalFlagBlockAgenda = 5;
4300 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4300 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4301 //mViewManager->showView( 0, true ); 4301 //mViewManager->showView( 0, true );
4302} 4302}
4303 4303
4304void CalendarView::calendarModified( bool modified, Calendar * ) 4304void CalendarView::calendarModified( bool modified, Calendar * )
4305{ 4305{
4306 setModified( modified ); 4306 setModified( modified );
4307} 4307}
4308 4308
4309Todo *CalendarView::selectedTodo() 4309Todo *CalendarView::selectedTodo()
4310{ 4310{
4311 Incidence *incidence = currentSelection(); 4311 Incidence *incidence = currentSelection();
4312 if ( incidence && incidence->typeID() == todoID ) { 4312 if ( incidence && incidence->typeID() == todoID ) {
4313 return static_cast<Todo *>( incidence ); 4313 return static_cast<Todo *>( incidence );
4314 } 4314 }
4315 4315
4316 incidence = mTodoList->selectedIncidences().first(); 4316 incidence = mTodoList->selectedIncidences().first();
4317 if ( incidence && incidence->typeID() == todoID ) { 4317 if ( incidence && incidence->typeID() == todoID ) {
4318 return static_cast<Todo *>( incidence ); 4318 return static_cast<Todo *>( incidence );
4319 } 4319 }
4320 4320
4321 return 0; 4321 return 0;
4322} 4322}
4323 4323
4324void CalendarView::showIncidence() 4324void CalendarView::showIncidence()
4325{ 4325{
4326 mViewerCallerIsSearchDialog = false; 4326 mViewerCallerIsSearchDialog = false;
4327 Incidence *incidence = currentSelection(); 4327 Incidence *incidence = currentSelection();
4328 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4328 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4329 if ( incidence ) { 4329 if ( incidence ) {
4330 ShowIncidenceVisitor v; 4330 ShowIncidenceVisitor v;
4331 v.act( incidence, this ); 4331 v.act( incidence, this );
4332 } 4332 }
4333} 4333}
4334void CalendarView::editIncidenceDescription() 4334void CalendarView::editIncidenceDescription()
4335{ 4335{
4336 mFlagEditDescription = true; 4336 mFlagEditDescription = true;
4337 editIncidence(); 4337 editIncidence();
4338 mFlagEditDescription = false; 4338 mFlagEditDescription = false;
4339} 4339}
4340void CalendarView::editIncidence() 4340void CalendarView::editIncidence()
4341{ 4341{
4342 // qDebug("editIncidence() "); 4342 // qDebug("editIncidence() ");
4343 Incidence *incidence = currentSelection(); 4343 Incidence *incidence = currentSelection();
4344 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4344 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4345 if ( incidence ) { 4345 if ( incidence ) {
4346 EditIncidenceVisitor v; 4346 EditIncidenceVisitor v;
4347 v.act( incidence, this ); 4347 v.act( incidence, this );
4348 } 4348 }
4349} 4349}
4350 4350
4351void CalendarView::deleteIncidence() 4351void CalendarView::deleteIncidence()
4352{ 4352{
4353 Incidence *incidence = currentSelection(); 4353 Incidence *incidence = currentSelection();
4354 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4354 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4355 if ( incidence ) { 4355 if ( incidence ) {
4356 deleteIncidence(incidence); 4356 deleteIncidence(incidence);
4357 } 4357 }
4358} 4358}
4359void CalendarView::showIncidence(QString uid) 4359void CalendarView::showIncidence(QString uid)
4360{ 4360{
4361 Incidence *inc = mCalendar->incidence( uid ); 4361 Incidence *inc = mCalendar->incidence( uid );
4362 if ( inc ) 4362 if ( inc )
4363 showIncidence( inc ); 4363 showIncidence( inc );
4364} 4364}
4365void CalendarView::showIncidence(Incidence *incidence) 4365void CalendarView::showIncidence(Incidence *incidence)
4366{ 4366{
4367 mViewerCallerIsSearchDialog = false; 4367 mViewerCallerIsSearchDialog = false;
4368 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); 4368 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
4369 if ( sender() && mDialogManager->getSearchDialog() ) { 4369 if ( sender() && mDialogManager->getSearchDialog() ) {
4370 if ( sender () == mDialogManager->getSearchDialog()->listview() ) { 4370 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
4371 mViewerCallerIsSearchDialog = true; 4371 mViewerCallerIsSearchDialog = true;
4372 } 4372 }
4373 } 4373 }
4374 if ( incidence ) { 4374 if ( incidence ) {
4375 ShowIncidenceVisitor v; 4375 ShowIncidenceVisitor v;
4376 v.act( incidence, this ); 4376 v.act( incidence, this );
4377 } 4377 }
4378} 4378}
4379 4379
4380void CalendarView::editIncidence(Incidence *incidence) 4380void CalendarView::editIncidence(Incidence *incidence)
4381{ 4381{
4382 if ( incidence ) { 4382 if ( incidence ) {
4383 4383
4384 EditIncidenceVisitor v; 4384 EditIncidenceVisitor v;
4385 v.act( incidence, this ); 4385 v.act( incidence, this );
4386 4386
4387 } 4387 }
4388} 4388}
4389 4389
4390void CalendarView::deleteIncidence(Incidence *incidence) 4390void CalendarView::deleteIncidence(Incidence *incidence)
4391{ 4391{
4392 //qDebug(" CalendarView::deleteIncidence "); 4392 //qDebug(" CalendarView::deleteIncidence ");
4393 if ( incidence ) { 4393 if ( incidence ) {
4394 DeleteIncidenceVisitor v; 4394 DeleteIncidenceVisitor v;
4395 v.act( incidence, this ); 4395 v.act( incidence, this );
4396 } 4396 }
4397} 4397}
4398 4398
4399 4399
4400void CalendarView::lookForOutgoingMessages() 4400void CalendarView::lookForOutgoingMessages()
4401{ 4401{
4402 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 4402 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
4403 ogd->loadMessages(); 4403 ogd->loadMessages();
4404} 4404}
4405 4405
4406void CalendarView::lookForIncomingMessages() 4406void CalendarView::lookForIncomingMessages()
4407{ 4407{
4408 IncomingDialog *icd = mDialogManager->incomingDialog(); 4408 IncomingDialog *icd = mDialogManager->incomingDialog();
4409 icd->retrieve(); 4409 icd->retrieve();
4410} 4410}
4411 4411
4412bool CalendarView::removeCompletedSubTodos( Todo* t ) 4412bool CalendarView::removeCompletedSubTodos( Todo* t )
4413{ 4413{
4414 bool deleteTodo = true; 4414 bool deleteTodo = true;
4415 QPtrList<Incidence> subTodos; 4415 QPtrList<Incidence> subTodos;
4416 Incidence *aTodo; 4416 Incidence *aTodo;
4417 subTodos = t->relations(); 4417 subTodos = t->relations();
4418 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 4418 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
4419 if (! removeCompletedSubTodos( (Todo*) aTodo )) 4419 if (! removeCompletedSubTodos( (Todo*) aTodo ))
4420 deleteTodo = false; 4420 deleteTodo = false;
4421 } 4421 }
4422 if ( deleteTodo ) { 4422 if ( deleteTodo ) {
4423 if ( t->isCompleted() && !t->doesRecur()) { 4423 if ( t->isCompleted() && !t->doesRecur()) {
4424 checkExternalId( t ); 4424 checkExternalId( t );
4425 mCalendar->deleteTodo( t ); 4425 mCalendar->deleteTodo( t );
4426 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 4426 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
4427 } 4427 }
4428 else 4428 else
4429 deleteTodo = false; 4429 deleteTodo = false;
4430 } 4430 }
4431 return deleteTodo; 4431 return deleteTodo;
4432 4432
4433} 4433}
4434void CalendarView::purgeCompleted() 4434void CalendarView::purgeCompleted()
4435{ 4435{
4436 int result = KMessageBox::warningContinueCancel(this, 4436 int result = KMessageBox::warningContinueCancel(this,
4437 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); 4437 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
4438 4438
4439 if (result == KMessageBox::Continue) { 4439 if (result == KMessageBox::Continue) {
4440 4440
4441 QPtrList<Todo> todoCal; 4441 QPtrList<Todo> todoCal;
4442 QPtrList<Todo> rootTodos; 4442 QPtrList<Todo> rootTodos;
4443 //QPtrList<Incidence> rel; 4443 //QPtrList<Incidence> rel;
4444 Todo *aTodo; 4444 Todo *aTodo;
4445 todoCal = calendar()->todos(); 4445 todoCal = calendar()->todos();
4446 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 4446 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
4447 if ( !aTodo->relatedTo() ) 4447 if ( !aTodo->relatedTo() )
4448 rootTodos.append( aTodo ); 4448 rootTodos.append( aTodo );
4449 } 4449 }
4450 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 4450 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
4451 removeCompletedSubTodos( aTodo ); 4451 removeCompletedSubTodos( aTodo );
4452 } 4452 }
4453 4453
4454 updateView(); 4454 updateView();
4455 } 4455 }
4456} 4456}
4457 4457
4458void CalendarView::slotCalendarChanged() 4458void CalendarView::slotCalendarChanged()
4459{ 4459{
4460 ; 4460 ;
4461} 4461}
4462 4462
4463void CalendarView::keyPressEvent ( QKeyEvent *e) 4463void CalendarView::keyPressEvent ( QKeyEvent *e)
4464{ 4464{
4465 //qDebug(" alendarView::keyPressEvent "); 4465 //qDebug(" alendarView::keyPressEvent ");
4466 e->ignore(); 4466 e->ignore();
4467} 4467}
4468 4468
4469 4469
4470bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 4470bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
4471{ 4471{
4472 4472
4473 if ( manager != mSyncManager) 4473 if ( manager != mSyncManager)
4474 qDebug("KO: Internal error-1. SyncManager mismatch "); 4474 qDebug("KO: Internal error-1. SyncManager mismatch ");
4475 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 4475 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
4476 qDebug("KO: SyncKDE request detected!"); 4476 qDebug("KO: SyncKDE request detected!");
4477 } 4477 }
4478 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4478 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4479 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4479 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4480 return syncCalendar( filename, mode ); 4480 return syncCalendar( filename, mode );
4481} 4481}
4482bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 4482bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
4483{ 4483{
4484 //mSyncManager = manager; 4484 //mSyncManager = manager;
4485 if ( manager != mSyncManager) 4485 if ( manager != mSyncManager)
4486 qDebug("KO: Internal error-2. SyncManager mismatch "); 4486 qDebug("KO: Internal error-2. SyncManager mismatch ");
4487 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4487 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4488 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4488 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4489 if ( resource == "sharp" ) 4489 if ( resource == "sharp" )
4490 syncExternal( 0 ); 4490 syncExternal( 0 );
4491 if ( resource == "phone" ) 4491 if ( resource == "phone" )
4492 syncExternal( 1 ); 4492 syncExternal( 1 );
4493 // pending setmodified 4493 // pending setmodified
4494 return true; 4494 return true;
4495} 4495}
4496void CalendarView::setSyncManager(KSyncManager* manager) 4496void CalendarView::setSyncManager(KSyncManager* manager)
4497{ 4497{
4498 mSyncManager = manager; 4498 mSyncManager = manager;
4499} 4499}
4500 4500
4501void CalendarView::removeSyncInfo( QString syncProfile) 4501void CalendarView::removeSyncInfo( QString syncProfile)
4502{ 4502{
4503 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); 4503 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1());
4504 mCalendar->removeSyncInfo( syncProfile ); 4504 mCalendar->removeSyncInfo( syncProfile );
4505 4505
4506} 4506}
4507 4507
4508void CalendarView::undo_delete() 4508void CalendarView::undo_delete()
4509{ 4509{
4510 //qDebug("undo_delete() "); 4510 //qDebug("undo_delete() ");
4511 Incidence* undo = mCalendar->undoIncidence(); 4511 Incidence* undo = mCalendar->undoIncidence();
4512 if ( !undo ) { 4512 if ( !undo ) {
4513 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 4513 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
4514 i18n("KO/Pi")); 4514 i18n("KO/Pi"));
4515 return; 4515 return;
4516 } 4516 }
4517 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + 4517 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
4518 i18n("\nAre you sure you want\nto restore this?"), 4518 i18n("\nAre you sure you want\nto restore this?"),
4519 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 4519 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
4520 mCalendar->undoDeleteIncidence(); 4520 mCalendar->undoDeleteIncidence();
4521 updateView(); 4521 updateView();
4522 } 4522 }
4523} 4523}
4524 4524
4525void CalendarView::slotViewerClosed() 4525void CalendarView::slotViewerClosed()
4526{ 4526{
4527 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4527 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4528} 4528}
4529 4529
4530void CalendarView::resetFocus() 4530void CalendarView::resetFocus()
4531{ 4531{
4532 if ( mViewerCallerIsSearchDialog ) { 4532 if ( mViewerCallerIsSearchDialog ) {
4533 if ( mDialogManager->getSearchDialog()->isVisible() ){ 4533 if ( mDialogManager->getSearchDialog()->isVisible() ){
4534 mDialogManager->getSearchDialog()->raise(); 4534 mDialogManager->getSearchDialog()->raise();
4535 mDialogManager->getSearchDialog()->setActiveWindow(); 4535 mDialogManager->getSearchDialog()->setActiveWindow();
4536 mDialogManager->getSearchDialog()->listview()->resetFocus(); 4536 mDialogManager->getSearchDialog()->listview()->resetFocus();
4537 } else 4537 } else
4538 mViewerCallerIsSearchDialog = false; 4538 mViewerCallerIsSearchDialog = false;
4539 } 4539 }
4540 if ( !mViewerCallerIsSearchDialog ) { 4540 if ( !mViewerCallerIsSearchDialog ) {
4541 //mViewManager->currentView()->setFocus(); 4541 //mViewManager->currentView()->setFocus();
4542 //qDebug("sssssssssssssssset focus "); 4542 //qDebug("sssssssssssssssset focus ");
4543 topLevelWidget()->raise(); 4543 topLevelWidget()->raise();
4544 setActiveWindow(); 4544 setActiveWindow();
4545 //setFocus(); 4545 //setFocus();
4546 } 4546 }
4547 mViewerCallerIsSearchDialog = false; 4547 mViewerCallerIsSearchDialog = false;
4548} 4548}
4549 4549
4550void CalendarView::showNextAlarms() 4550void CalendarView::showNextAlarms()
4551{ 4551{
4552 QString message; 4552 QString message;
4553 QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); 4553 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
4554 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { 4554 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) {
4555 QString sum = mCalendar->nextSummary(); 4555 QString sum = mCalendar->nextSummary();
4556 QDateTime nextA = mNextAlarmDateTime; 4556 QDateTime nextA = mNextAlarmDateTime;
4557 QDateTime cur = QDateTime::currentDateTime(); 4557 QDateTime cur = QDateTime::currentDateTime();
4558 int secs = cur.secsTo( nextA ); 4558 int secs = cur.secsTo( nextA );
4559 int min = secs /60; 4559 int min = secs /60;
4560 int hours = min /60; 4560 int hours = min /60;
4561 min = min % 60; 4561 min = min % 60;
4562 int days = hours /24; 4562 int days = hours /24;
4563 hours = hours % 24; 4563 hours = hours % 24;
4564 4564
4565 //message = i18n("The next alarm is in:\n"); 4565 //message = i18n("The next alarm is in:\n");
4566 if ( days > 1 ) 4566 if ( days > 1 )
4567 message += i18n("%1 days\n").arg( days ); 4567 message += i18n("%1 days\n").arg( days );
4568 else if ( days == 1 ) 4568 else if ( days == 1 )
4569 message += i18n("1 day\n"); 4569 message += i18n("1 day\n");
4570 if ( hours > 1 ) 4570 if ( hours > 1 )
4571 message += i18n("%1 hours\n").arg( hours ); 4571 message += i18n("%1 hours\n").arg( hours );
4572 else if ( hours == 1 ) 4572 else if ( hours == 1 )
4573 message += i18n("1 hour\n"); 4573 message += i18n("1 hour\n");
4574 if ( min > 1 ) 4574 if ( min > 1 )
4575 message += i18n("%1 minutes\n").arg( min ); 4575 message += i18n("%1 minutes\n").arg( min );
4576 else if ( min == 1 ) 4576 else if ( min == 1 )
4577 message += i18n("1 minute\n"); 4577 message += i18n("1 minute\n");
4578 if ( message.isEmpty() ) 4578 if ( message.isEmpty() )
4579 message = i18n("The next alarm is in\nless than one minute!"); 4579 message = i18n("The next alarm is in\nless than one minute!");
4580 else 4580 else
4581 message = i18n("The next alarm is in:\n") + message; 4581 message = i18n("The next alarm is in:\n") + message;
4582 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 4582 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
4583 } else { 4583 } else {
4584 message = i18n("There is no next alarm."); 4584 message = i18n("There is no next alarm.");
4585 4585
4586 } 4586 }
4587#ifdef DESKTOP_VERSION 4587#ifdef DESKTOP_VERSION
4588 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 4588 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
4589 message += i18n("\nThe internal alarm notification is disabled!\n"); 4589 message += i18n("\nThe internal alarm notification is disabled!\n");
4590 message += i18n("Enable it in the settings menu, TAB alarm."); 4590 message += i18n("Enable it in the settings menu, TAB alarm.");
4591 } 4591 }
4592 4592
4593#endif 4593#endif
4594 KMessageBox::information( this, message); 4594 KMessageBox::information( this, message);
4595} 4595}
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index 874fc6a..4322299 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -1,254 +1,255 @@
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 <qapplication.h>
28#include <qradiobutton.h> 29#include <qradiobutton.h>
29#include <qlayout.h> 30#include <qlayout.h>
30#include <qlabel.h> 31#include <qlabel.h>
31#include <qdialog.h> 32#include <qdialog.h>
32#include <qscrollview.h> 33#include <qscrollview.h>
33#include <qpushbutton.h> 34#include <qpushbutton.h>
34#include <kconfig.h> 35#include <kconfig.h>
35#include "kofilterview_base.h" 36#include "kofilterview_base.h"
36 37
37#include <libkcal/calfilter.h> 38#include <libkcal/calfilter.h>
38 39
39#include <kurlrequester.h> 40#include <kurlrequester.h>
40#include <klineedit.h> 41#include <klineedit.h>
41#include <kglobal.h> 42#include <kglobal.h>
42#include <kmessagebox.h> 43#include <kmessagebox.h>
43 44
44class QGridLayout; 45class QGridLayout;
45 46
46using namespace KCal; 47using namespace KCal;
47 48
48class KONewCalPrefs : public QDialog 49class KONewCalPrefs : public QDialog
49{ 50{
50 Q_OBJECT 51 Q_OBJECT
51 public: 52 public:
52 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : 53 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) :
53 QDialog( parent, name, true ) 54 QDialog( parent, name, true )
54 { 55 {
55 setCaption( i18n("Add new Calendar") ); 56 setCaption( i18n("Add new Calendar") );
56 QVBoxLayout* lay = new QVBoxLayout( this ); 57 QVBoxLayout* lay = new QVBoxLayout( this );
57 lay->setSpacing( 3 ); 58 lay->setSpacing( 3 );
58 lay->setMargin( 3 ); 59 lay->setMargin( 3 );
59 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); 60 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this );
60 lay->addWidget( lab ); 61 lay->addWidget( lab );
61 nameE = new KLineEdit( this ); 62 nameE = new KLineEdit( this );
62 lay->addWidget( nameE ); 63 lay->addWidget( nameE );
63 lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this ); 64 lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this );
64 lay->addWidget( lab ); 65 lay->addWidget( lab );
65 url = new KURLRequester ( this ); 66 url = new KURLRequester ( this );
66 lay->addWidget( url ); 67 lay->addWidget( url );
67 QPushButton * ok = new QPushButton( i18n("OK"), this ); 68 QPushButton * ok = new QPushButton( i18n("OK"), this );
68 lay->addWidget( ok ); 69 lay->addWidget( ok );
69 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 70 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
70 lay->addWidget( cancel ); 71 lay->addWidget( cancel );
71 connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); 72 connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) );
72 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 73 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
73 int minwid = 220; 74 int minwid = 220;
74 if ( QApplication::desktop()->width() >= 320 ) minwid = 300; 75 if ( QApplication::desktop()->width() >= 320 ) minwid = 300;
75 setMinimumWidth( minwid ); 76 setMinimumWidth( minwid );
76 resize(sizeHint() ); 77 resize(sizeHint() );
77 } 78 }
78 79
79 QString calName() { return nameE->text(); } 80 QString calName() { return nameE->text(); }
80 QString calFileName() { return url->url(); } 81 QString calFileName() { return url->url(); }
81 82
82public slots: 83public slots:
83void checkValid() { 84void checkValid() {
84 if ( nameE->text().isEmpty() ) { 85 if ( nameE->text().isEmpty() ) {
85 KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") ); 86 KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") );
86 nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () )); 87 nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () ));
87 return; 88 return;
88 } 89 }
89 if ( url->url().isEmpty() ) { 90 if ( url->url().isEmpty() ) {
90 KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); 91 KMessageBox::information( this, i18n("Sorry, the file name is empty!") );
91 return; 92 return;
92 } 93 }
93 accept(); 94 accept();
94} 95}
95 96
96public: 97public:
97 KLineEdit* nameE; 98 KLineEdit* nameE;
98 KURLRequester *url; 99 KURLRequester *url;
99}; 100};
100 101
101class KOCalButton : public QPushButton 102class KOCalButton : public QPushButton
102{ 103{
103 Q_OBJECT 104 Q_OBJECT
104 public: 105 public:
105 KOCalButton( QWidget *parent=0, const char *name=0 ) : 106 KOCalButton( QWidget *parent=0, const char *name=0 ) :
106 QPushButton( parent, name) 107 QPushButton( parent, name)
107 { 108 {
108 connect( this, SIGNAL( clicked() ), 109 connect( this, SIGNAL( clicked() ),
109 SLOT( bottonClicked() )); 110 SLOT( bottonClicked() ));
110 mNumber = -1; 111 mNumber = -1;
111 setFocusPolicy(NoFocus); 112 setFocusPolicy(NoFocus);
112 } 113 }
113 void setNum ( int num ) {mNumber = num; } 114 void setNum ( int num ) {mNumber = num; }
114 signals: 115 signals:
115 void selectNum ( int ); 116 void selectNum ( int );
116private: 117private:
117 int mNumber; 118 int mNumber;
118 void keyPressEvent ( QKeyEvent * e ) 119 void keyPressEvent ( QKeyEvent * e )
119 { 120 {
120 e->ignore(); 121 e->ignore();
121 } 122 }
122 123
123private slots : 124private slots :
124 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } 125 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
125}; 126};
126class KOCalCheckButton : public QCheckBox 127class KOCalCheckButton : public QCheckBox
127{ 128{
128 Q_OBJECT 129 Q_OBJECT
129 public: 130 public:
130 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : 131 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
131 QCheckBox( parent, name) 132 QCheckBox( parent, name)
132 { 133 {
133 connect( this, SIGNAL( toggled ( bool ) ), 134 connect( this, SIGNAL( toggled ( bool ) ),
134 SLOT( bottonClicked( bool ) )); 135 SLOT( bottonClicked( bool ) ));
135 mNumber = -1; 136 mNumber = -1;
136 setFocusPolicy(NoFocus); 137 setFocusPolicy(NoFocus);
137 //setMaximumWidth( 10 ); 138 //setMaximumWidth( 10 );
138 139
139 } 140 }
140 void setNum ( int num ) {mNumber = num; } 141 void setNum ( int num ) {mNumber = num; }
141 signals: 142 signals:
142 void selectNum ( int, bool ); 143 void selectNum ( int, bool );
143private: 144private:
144 int mNumber; 145 int mNumber;
145 void keyPressEvent ( QKeyEvent * e ) 146 void keyPressEvent ( QKeyEvent * e )
146 { 147 {
147 e->ignore(); 148 e->ignore();
148 } 149 }
149 150
150private slots : 151private slots :
151 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } 152 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
152}; 153};
153 154
154class KOCalRadioButton : public QRadioButton 155class KOCalRadioButton : public QRadioButton
155{ 156{
156 Q_OBJECT 157 Q_OBJECT
157 public: 158 public:
158 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : 159 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) :
159 QRadioButton( parent, name) 160 QRadioButton( parent, name)
160 { 161 {
161 connect( this, SIGNAL( toggled ( bool ) ), 162 connect( this, SIGNAL( toggled ( bool ) ),
162 SLOT( bottonClicked( bool ) )); 163 SLOT( bottonClicked( bool ) ));
163 mNumber = -1; 164 mNumber = -1;
164 setFocusPolicy(NoFocus); 165 setFocusPolicy(NoFocus);
165 //setMaximumWidth( 10 ); 166 //setMaximumWidth( 10 );
166 167
167 } 168 }
168 int num() { return mNumber;} 169 int num() { return mNumber;}
169 void setNum ( int num ) {mNumber = num; } 170 void setNum ( int num ) {mNumber = num; }
170 signals: 171 signals:
171 void selectNum ( int ); 172 void selectNum ( int );
172private: 173private:
173 int mNumber; 174 int mNumber;
174 void keyPressEvent ( QKeyEvent * e ) 175 void keyPressEvent ( QKeyEvent * e )
175 { 176 {
176 e->ignore(); 177 e->ignore();
177 } 178 }
178 179
179private slots : 180private slots :
180 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); } 181 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); }
181}; 182};
182 183
183 184
184 185
185class KOFilterView : public KOFilterView_base 186class KOFilterView : public KOFilterView_base
186{ 187{
187 Q_OBJECT 188 Q_OBJECT
188 public: 189 public:
189 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 190 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
190 ~KOFilterView(); 191 ~KOFilterView();
191 192
192 void updateFilters(); 193 void updateFilters();
193 194
194 bool filtersEnabled(); 195 bool filtersEnabled();
195 void setFiltersEnabled(bool); 196 void setFiltersEnabled(bool);
196 CalFilter *selectedFilter(); 197 CalFilter *selectedFilter();
197 void setSelectedFilter(QString); 198 void setSelectedFilter(QString);
198 void setSelectedFilter( int ); 199 void setSelectedFilter( int );
199 200
200 signals: 201 signals:
201 void filterChanged(); 202 void filterChanged();
202 void editFilters(); 203 void editFilters();
203 204
204 private: 205 private:
205 QPtrList<CalFilter> *mFilters; 206 QPtrList<CalFilter> *mFilters;
206}; 207};
207 208
208class KOCalEditView : public QScrollView 209class KOCalEditView : public QScrollView
209{ 210{
210 Q_OBJECT 211 Q_OBJECT
211 public: 212 public:
212 KOCalEditView( QWidget* parent=0,const char* name=0); 213 KOCalEditView( QWidget* parent=0,const char* name=0);
213 ~KOCalEditView(); 214 ~KOCalEditView();
214 int addCalendar( QString calName, QString fileName, bool ask = true ); 215 int addCalendar( QString calName, QString fileName, bool ask = true );
215 int getBirtdayID(); 216 int getBirtdayID();
216 public slots: 217 public slots:
217 void addCal(); 218 void addCal();
218 void enableAll(); 219 void enableAll();
219 void enableAlarm(); 220 void enableAlarm();
220 void disableRO(); 221 void disableRO();
221 void deleteAll(); 222 void deleteAll();
222 void selectStdCal(int); 223 void selectStdCal(int);
223 void selectCal(int,bool ); 224 void selectCal(int,bool );
224 void selectCalAlarm(int,bool ); 225 void selectCalAlarm(int,bool );
225 void selectReadOnly(int,bool ); 226 void selectReadOnly(int,bool );
226 void setColor(const QColor &,int) ; 227 void setColor(const QColor &,int) ;
227 void deleteCal(int) ; 228 void deleteCal(int) ;
228 void infoCal(int) ; 229 void infoCal(int) ;
229 void readConfig(); 230 void readConfig();
230 void defaultInfo(); 231 void defaultInfo();
231 void findNewStandard(); 232 void findNewStandard();
232 signals: 233 signals:
233 void alarmEnabled ( int cal, bool enable ); 234 void alarmEnabled ( int cal, bool enable );
234 void calendarEnabled ( int cal, bool enable ); 235 void calendarEnabled ( int cal, bool enable );
235 void calendarReadonly ( int cal, bool readonly ); 236 void calendarReadonly ( int cal, bool readonly );
236 void setCalendarDefault ( int cal ); 237 void setCalendarDefault ( int cal );
237 void removeCalendar ( int cal ); 238 void removeCalendar ( int cal );
238 void calendarAdded( int ); 239 void calendarAdded( int );
239 void needsUpdate(); 240 void needsUpdate();
240 void checkCalendar(); 241 void checkCalendar();
241 242
242 private: 243 private:
243 QWidget *mw; 244 QWidget *mw;
244 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); 245 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true );
245 QPtrList<KOCalRadioButton> mStdandardB; 246 QPtrList<KOCalRadioButton> mStdandardB;
246 QPtrList<KOCalCheckButton> mEnabledB; 247 QPtrList<KOCalCheckButton> mEnabledB;
247 QPtrList<KOCalCheckButton> mAlarmB; 248 QPtrList<KOCalCheckButton> mAlarmB;
248 QPtrList<KOCalCheckButton> mROB; 249 QPtrList<KOCalCheckButton> mROB;
249 QGridLayout* mainLayout; 250 QGridLayout* mainLayout;
250}; 251};
251 252
252 253
253 254
254#endif // KOFILTERVIEW_H 255#endif // KOFILTERVIEW_H
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 264cf28..4fc447e 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1,2248 +1,2250 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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 19
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21#include <qfont.h> 21#include <qfont.h>
22#include <qfontmetrics.h> 22#include <qfontmetrics.h>
23#include <qkeycode.h> 23#include <qkeycode.h>
24#include <qhbox.h> 24#include <qhbox.h>
25#include <qvbox.h> 25#include <qvbox.h>
26#include <qwidgetstack.h> 26#include <qwidgetstack.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qtooltip.h> 28#include <qtooltip.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qwhatsthis.h> 31#include <qwhatsthis.h>
32#ifndef DESKTOP_VERSION 32#ifndef DESKTOP_VERSION
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#else 34#else
35#include <qapplication.h> 35#include <qapplication.h>
36#endif 36#endif
37 37
38#include <kdebug.h> 38#include <kdebug.h>
39#include <klocale.h> 39#include <klocale.h>
40#include <kglobal.h> 40#include <kglobal.h>
41#include <kconfig.h> 41#include <kconfig.h>
42#include <kiconloader.h> 42#include <kiconloader.h>
43 43
44#include <kcalendarsystem.h> 44#include <kcalendarsystem.h>
45 45
46#ifndef KORG_NOPRINTER 46#ifndef KORG_NOPRINTER
47#include "calprinter.h" 47#include "calprinter.h"
48#endif 48#endif
49#include "koprefs.h" 49#include "koprefs.h"
50#ifndef KORG_NOPLUGINS 50#ifndef KORG_NOPLUGINS
51#include "kocore.h" 51#include "kocore.h"
52#endif 52#endif
53#include "koglobals.h" 53#include "koglobals.h"
54#include <libkcal/kincidenceformatter.h> 54#include <libkcal/kincidenceformatter.h>
55 55
56#include "komonthview.h" 56#include "komonthview.h"
57 57
58#define PIXMAP_SIZE 5 58#define PIXMAP_SIZE 5
59#ifdef DESKTOP_VERSION 59#ifdef DESKTOP_VERSION
60QToolTipGroup *MonthViewCell::mToolTipGroup = 0; 60QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
61#endif 61#endif
62class KNOWhatsThis :public QWhatsThis 62class KNOWhatsThis :public QWhatsThis
63{ 63{
64public: 64public:
65 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; 65 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
66 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; 66 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
67 67
68protected: 68protected:
69 virtual QString text( const QPoint& p) 69 virtual QString text( const QPoint& p)
70 { 70 {
71 return _wid->getWhatsThisText(p) ; 71 return _wid->getWhatsThisText(p) ;
72 }; 72 };
73private: 73private:
74 KNoScrollListBox* _wid; 74 KNoScrollListBox* _wid;
75 75
76}; 76};
77 77
78 78
79KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 79KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
80 : QListBox(parent, name, WRepaintNoErase) 80 : QListBox(parent, name, WRepaintNoErase)
81{ 81{
82#ifndef DESKTOP_VERSION 82#ifndef DESKTOP_VERSION
83 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 83 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
84#endif 84#endif
85 mWT = new KNOWhatsThis(this); 85 mWT = new KNOWhatsThis(this);
86 resetOnFocusIn = true; 86 resetOnFocusIn = true;
87 setVScrollBarMode(QScrollView::AlwaysOff); 87 setVScrollBarMode(QScrollView::AlwaysOff);
88 setHScrollBarMode(QScrollView::AlwaysOff); 88 setHScrollBarMode(QScrollView::AlwaysOff);
89} 89}
90KNoScrollListBox::~KNoScrollListBox() 90KNoScrollListBox::~KNoScrollListBox()
91{ 91{
92#if QT_VERSION >= 0x030000 92#if QT_VERSION >= 0x030000
93 93
94#else 94#else
95 delete mWT; 95 delete mWT;
96#endif 96#endif
97} 97}
98 98
99 99
100void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) 100void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
101{ 101{
102 QListBox::focusInEvent ( e ); 102 QListBox::focusInEvent ( e );
103 if ( count() ){ 103 if ( count() ){
104 int ci = currentItem(); 104 int ci = currentItem();
105 if ( ci < 0 ) ci = 0; 105 if ( ci < 0 ) ci = 0;
106 106
107 setCurrentItem( ci ); 107 setCurrentItem( ci );
108 setSelected ( ci, true ); 108 setSelected ( ci, true );
109 emit highlighted( item ( ci ) ); 109 emit highlighted( item ( ci ) );
110 110
111 resetOnFocusIn = true; 111 resetOnFocusIn = true;
112 112
113 if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { 113 if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) {
114 QListBoxItem *fi = firstItem (); 114 QListBoxItem *fi = firstItem ();
115 if (fi ) { 115 if (fi ) {
116 int ihei = fi->height( this ); 116 int ihei = fi->height( this );
117 int hei = numRows () * ihei; 117 int hei = numRows () * ihei;
118 if ( hei < height() - horizontalScrollBar()->height () ) { 118 if ( hei < height() - horizontalScrollBar()->height () ) {
119 setVScrollBarMode(QScrollView::AlwaysOff); 119 setVScrollBarMode(QScrollView::AlwaysOff);
120 } 120 }
121 else 121 else
122 setVScrollBarMode(QScrollView::Auto); 122 setVScrollBarMode(QScrollView::Auto);
123 if ( ihei *3 > height() ) { 123 if ( ihei *3 > height() ) {
124 setHScrollBarMode(QScrollView::AlwaysOff); 124 setHScrollBarMode(QScrollView::AlwaysOff);
125 } 125 }
126 else { 126 else {
127 setHScrollBarMode(QScrollView::Auto); 127 setHScrollBarMode(QScrollView::Auto);
128 } 128 }
129 } else { 129 } else {
130 setVScrollBarMode(QScrollView::Auto); 130 setVScrollBarMode(QScrollView::Auto);
131 setHScrollBarMode(QScrollView::Auto); 131 setHScrollBarMode(QScrollView::Auto);
132 } 132 }
133 } 133 }
134 } 134 }
135} 135}
136void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) 136void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
137{ 137{
138 int i = currentItem (); 138 int i = currentItem ();
139 if ( i >= 0 ) { 139 if ( i >= 0 ) {
140 setSelected ( i, false ); 140 setSelected ( i, false );
141 } 141 }
142 QListBox::focusOutEvent ( e ); 142 QListBox::focusOutEvent ( e );
143 setVScrollBarMode(QScrollView::AlwaysOff); 143 setVScrollBarMode(QScrollView::AlwaysOff);
144 setHScrollBarMode(QScrollView::AlwaysOff); 144 setHScrollBarMode(QScrollView::AlwaysOff);
145 emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); 145 emit highlightIncidence( 0, (MonthViewCell*)this, 0 );
146} 146}
147 147
148QString KNoScrollListBox::getWhatsThisText(QPoint p) 148QString KNoScrollListBox::getWhatsThisText(QPoint p)
149{ 149{
150 QListBoxItem* item = itemAt ( p ); 150 QListBoxItem* item = itemAt ( p );
151 if ( ! item ) { 151 if ( ! item ) {
152 return i18n("Click in the cell\nto add an event!"); 152 return i18n("Click in the cell\nto add an event!");
153 } 153 }
154 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), 154 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(),
155 KOPrefs::instance()->mWTshowDetails, 155 KOPrefs::instance()->mWTshowDetails,
156 KOPrefs::instance()->mWTshowCreated, 156 KOPrefs::instance()->mWTshowCreated,
157 KOPrefs::instance()->mWTshowChanged); 157 KOPrefs::instance()->mWTshowChanged);
158} 158}
159void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 159void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
160{ 160{
161 //qDebug("KNoScrollListBox::keyPressEvent "); 161 //qDebug("KNoScrollListBox::keyPressEvent ");
162 switch(e->key()) { 162 switch(e->key()) {
163 case Key_Right: 163 case Key_Right:
164 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 164 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
165 { 165 {
166 e->ignore(); 166 e->ignore();
167 return; 167 return;
168 } 168 }
169 scrollBy(10,0); 169 scrollBy(10,0);
170 break; 170 break;
171 case Key_Left: 171 case Key_Left:
172 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 172 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
173 { 173 {
174 e->ignore(); 174 e->ignore();
175 return; 175 return;
176 } 176 }
177 scrollBy(-10,0); 177 scrollBy(-10,0);
178 break; 178 break;
179 case Key_Up: 179 case Key_Up:
180 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 180 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
181 e->ignore(); 181 e->ignore();
182 break; 182 break;
183 } 183 }
184 if ( count() ) { 184 if ( count() ) {
185 if ( currentItem() == 0 ) { 185 if ( currentItem() == 0 ) {
186 emit prevCell(); 186 emit prevCell();
187 } else { 187 } else {
188 setCurrentItem((currentItem()+count()-1)%count()); 188 setCurrentItem((currentItem()+count()-1)%count());
189 if(!itemVisible(currentItem())) { 189 if(!itemVisible(currentItem())) {
190 if((unsigned int) currentItem() == (count()-1)) { 190 if((unsigned int) currentItem() == (count()-1)) {
191 setTopItem(currentItem()-numItemsVisible()+1); 191 setTopItem(currentItem()-numItemsVisible()+1);
192 } else { 192 } else {
193 setTopItem(topItem()-1); 193 setTopItem(topItem()-1);
194 } 194 }
195 } 195 }
196 } 196 }
197 } 197 }
198 break; 198 break;
199 case Key_Down: 199 case Key_Down:
200 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 200 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
201 e->ignore(); 201 e->ignore();
202 break; 202 break;
203 } 203 }
204 if ( count () ) { 204 if ( count () ) {
205 if ( currentItem()+1 == count () ) { 205 if ( currentItem()+1 == count () ) {
206 emit nextCell(); 206 emit nextCell();
207 } else { 207 } else {
208 setCurrentItem((currentItem()+1)%count()); 208 setCurrentItem((currentItem()+1)%count());
209 if(!itemVisible(currentItem())) { 209 if(!itemVisible(currentItem())) {
210 if(currentItem() == 0) { 210 if(currentItem() == 0) {
211 setTopItem(0); 211 setTopItem(0);
212 } else { 212 } else {
213 setTopItem(topItem()+1); 213 setTopItem(topItem()+1);
214 } 214 }
215 } 215 }
216 } 216 }
217 } 217 }
218 break; 218 break;
219 case Key_I: 219 case Key_I:
220 QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); 220 QTimer::singleShot( 1, this, SLOT ( oneDown() ) );
221 e->ignore(); 221 e->ignore();
222 break; 222 break;
223 case Key_Return: 223 case Key_Return:
224 case Key_Enter: 224 case Key_Enter:
225 { 225 {
226 if ( currentItem() >= 0 ) { 226 if ( currentItem() >= 0 ) {
227 emit doubleClicked( item( currentItem() ) ); 227 emit doubleClicked( item( currentItem() ) );
228 e->accept(); 228 e->accept();
229 } else { 229 } else {
230 e->ignore(); 230 e->ignore();
231 } 231 }
232 } 232 }
233 break; 233 break;
234 case Key_Shift: 234 case Key_Shift:
235 emit shiftDown(); 235 emit shiftDown();
236 break; 236 break;
237 default: 237 default:
238 e->ignore(); 238 e->ignore();
239 break; 239 break;
240 } 240 }
241} 241}
242 242
243void KNoScrollListBox::oneDown() 243void KNoScrollListBox::oneDown()
244{ 244{
245 if ( count () ) { 245 if ( count () ) {
246 if ( currentItem()+1 == count () ) { 246 if ( currentItem()+1 == count () ) {
247 emit nextCell(); 247 emit nextCell();
248 } else { 248 } else {
249 resetOnFocusIn = false; 249 resetOnFocusIn = false;
250 setCurrentItem((currentItem()+1)%count()); 250 setCurrentItem((currentItem()+1)%count());
251 if(!itemVisible(currentItem())) { 251 if(!itemVisible(currentItem())) {
252 if(currentItem() == 0) { 252 if(currentItem() == 0) {
253 setTopItem(0); 253 setTopItem(0);
254 } else { 254 } else {
255 setTopItem(topItem()+1); 255 setTopItem(topItem()+1);
256 } 256 }
257 } 257 }
258 } 258 }
259 } 259 }
260} 260}
261void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 261void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
262{ 262{
263 switch(e->key()) { 263 switch(e->key()) {
264 case Key_Shift: 264 case Key_Shift:
265 emit shiftUp(); 265 emit shiftUp();
266 break; 266 break;
267 default: 267 default:
268 break; 268 break;
269 } 269 }
270} 270}
271 271
272void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 272void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
273{ 273{
274 QListBox::mousePressEvent(e); 274 QListBox::mousePressEvent(e);
275 275
276 if(e->button() == RightButton) { 276 if(e->button() == RightButton) {
277 emit rightClick(); 277 emit rightClick();
278 } 278 }
279} 279}
280 280
281MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) 281MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s)
282 : QListBoxItem() 282 : QListBoxItem()
283{ 283{
284 mblockRepaint = true; 284 mblockRepaint = true;
285 isWeekItem = KOPrefs::instance()->mMonthViewWeek; 285 isWeekItem = KOPrefs::instance()->mMonthViewWeek;
286 recycle( incidence, s ); 286 recycle( incidence, s );
287} 287}
288void MonthViewItem::recycle( Incidence *incidence, const QString & s) 288void MonthViewItem::recycle( Incidence *incidence, const QString & s)
289{ 289{
290 mDisplayHighlighted = false; 290 mDisplayHighlighted = false;
291 setText( s ); 291 setText( s );
292 mMultiday = 0; 292 mMultiday = 0;
293 mIncidence = incidence; 293 mIncidence = incidence;
294 mRecur = false; 294 mRecur = false;
295 mAlarm = false; 295 mAlarm = false;
296 mReply = false; 296 mReply = false;
297 mInfo = false; 297 mInfo = false;
298 mdayPos = 0; 298 mdayPos = 0;
299} 299}
300 300
301bool MonthViewItem::setHighlightedFalse() 301bool MonthViewItem::setHighlightedFalse()
302{ 302{
303 if ( !mDisplayHighlighted ) 303 if ( !mDisplayHighlighted )
304 return false; 304 return false;
305 mDisplayHighlighted = false; 305 mDisplayHighlighted = false;
306 return true; 306 return true;
307} 307}
308 308
309bool MonthViewItem::setHighlighted( Incidence * inc ) 309bool MonthViewItem::setHighlighted( Incidence * inc )
310{ 310{
311 if ( inc == mIncidence ) { 311 if ( inc == mIncidence ) {
312 if ( mDisplayHighlighted ) 312 if ( mDisplayHighlighted )
313 return false; 313 return false;
314 mDisplayHighlighted = true; 314 mDisplayHighlighted = true;
315 return true; 315 return true;
316 } else { 316 } else {
317 if ( !mDisplayHighlighted ) 317 if ( !mDisplayHighlighted )
318 return false; 318 return false;
319 mDisplayHighlighted = false; 319 mDisplayHighlighted = false;
320 return true; 320 return true;
321 } 321 }
322 return false; 322 return false;
323} 323}
324void MonthViewItem::paint(QPainter *p) 324void MonthViewItem::paint(QPainter *p)
325{ 325{
326 if ( mblockRepaint || !mIncidence ) { 326 if ( mblockRepaint || !mIncidence ) {
327 return; 327 return;
328 } 328 }
329#if QT_VERSION >= 0x030000 329#if QT_VERSION >= 0x030000
330 bool sel = isSelected(); 330 bool sel = isSelected();
331#else 331#else
332 bool sel = selected(); 332 bool sel = selected();
333#endif 333#endif
334 int heihei = height( listBox () ); 334 int heihei = height( listBox () );
335 int x = 1; 335 int x = 1;
336 if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHighlighted || sel ) 336 if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHighlighted || sel )
337 { 337 {
338 338
339 p->setBackgroundColor( palette().color( QPalette::Normal, \ 339 p->setBackgroundColor( palette().color( QPalette::Normal, \
340 sel ||mDisplayHighlighted ? QColorGroup::Highlight : QColorGroup::Background ) ); 340 sel ||mDisplayHighlighted ? QColorGroup::Highlight : QColorGroup::Background ) );
341 p->eraseRect( 0, 0, listBox()->maxItemWidth(), heihei ); 341 p->eraseRect( 0, 0, listBox()->maxItemWidth(), heihei );
342 } 342 }
343 343
344 //int y = 3;//(height() - mRecurPixmap.height()) /2; 344 //int y = 3;//(height() - mRecurPixmap.height()) /2;
345 int size = PIXMAP_SIZE; 345 int size = PIXMAP_SIZE;
346 if ( QApplication::desktop()->width() < 300 ) 346 if ( QApplication::desktop()->width() < 300 )
347 size = 3; 347 size = 3;
348 int y = (heihei - size -1 ) /2; 348 int y = (heihei - size -1 ) /2;
349 349
350 if ( mIncidence->calID() > 1 ) { 350 if ( mIncidence->calID() > 1 ) {
351 p->fillRect ( x, y-2,size,size+4, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); 351 p->fillRect ( x, y-2,size,size+4, KOPrefs::instance()->defaultColor( mIncidence->calID() ) );
352 p->drawRect ( x, y-2,size,size+4); 352 p->drawRect ( x, y-2,size,size+4);
353 x += size + 1; 353 x += size + 1;
354 } 354 }
355 if ( KOPrefs::instance()->mMonthShowIcons ) { 355 if ( KOPrefs::instance()->mMonthShowIcons ) {
356 if ( mInfo ) { 356 if ( mInfo ) {
357 p->fillRect ( x, y,size,size, Qt::darkGreen ); 357 p->fillRect ( x, y,size,size, Qt::darkGreen );
358 x += size + 1; 358 x += size + 1;
359 } 359 }
360 if ( mRecur ) { 360 if ( mRecur ) {
361 p->fillRect ( x, y,size,size, Qt::blue ); 361 p->fillRect ( x, y,size,size, Qt::blue );
362 x += size + 1; 362 x += size + 1;
363 } 363 }
364 if ( mAlarm ) { 364 if ( mAlarm ) {
365 p->fillRect ( x, y,size,size, Qt::red ); 365 p->fillRect ( x, y,size,size, Qt::red );
366 x += size + 1; 366 x += size + 1;
367 } 367 }
368 if ( mReply ) { 368 if ( mReply ) {
369 p->fillRect ( x, y,size,size, Qt::yellow ); 369 p->fillRect ( x, y,size,size, Qt::yellow );
370 x += size + 1; 370 x += size + 1;
371 } 371 }
372 } 372 }
373 373
374 374
375 375
376 376
377 if ( sel ) p->setPen( Qt::white ); 377 if ( sel ) p->setPen( Qt::white );
378 else p->setPen( palette().color( QPalette::Normal,QColorGroup::Foreground ) ); 378 else p->setPen( palette().color( QPalette::Normal,QColorGroup::Foreground ) );
379 379
380#if 0 380#if 0
381 p->setPen( palette().color( QPalette::Normal, sel ? \ 381 p->setPen( palette().color( QPalette::Normal, sel ? \
382 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 382 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
383#endif 383#endif
384 QColor textColor = p->pen().color(); 384 QColor textColor = p->pen().color();
385 385
386 386
387 if ( mMultiday ) { 387 if ( mMultiday ) {
388 int yyy = y+(size/2); 388 int yyy = y+(size/2);
389 int sizeM = size+2; 389 int sizeM = size+2;
390 p->setBrush( QBrush( textColor ) ); 390 p->setBrush( QBrush( textColor ) );
391 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; 391 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
392 if ( mMultiday == 2 || mMultiday == 3 ) { 392 if ( mMultiday == 2 || mMultiday == 3 ) {
393 QPointArray pa ( 3 ); 393 QPointArray pa ( 3 );
394 pa.setPoint (0, x, yyy ); 394 pa.setPoint (0, x, yyy );
395 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); 395 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 );
396 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); 396 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
397 p->drawPolygon( pa ); 397 p->drawPolygon( pa );
398 } 398 }
399 if ( mMultiday == 2 || mMultiday == 1 ) { 399 if ( mMultiday == 2 || mMultiday == 1 ) {
400 QPointArray pa ( 3 ); 400 QPointArray pa ( 3 );
401 pa.setPoint (0, x+sizeM +sizeM/2, yyy ); 401 pa.setPoint (0, x+sizeM +sizeM/2, yyy );
402 pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); 402 pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
403 pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); 403 pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
404 p->drawPolygon( pa ); 404 p->drawPolygon( pa );
405 } 405 }
406 if ( mMultiday == 1 ) { 406 if ( mMultiday == 1 ) {
407 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 407 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
408 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); 408 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
409 } 409 }
410 if ( mMultiday == 3 ) { 410 if ( mMultiday == 3 ) {
411 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 411 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
412 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); 412 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
413 413
414 } 414 }
415 x += sizeM/2 + 1; 415 x += sizeM/2 + 1;
416 x += sizeM + 1; 416 x += sizeM + 1;
417 } 417 }
418 418
419 if ( mIncidence->typeID() == todoID ){ 419 if ( mIncidence->typeID() == todoID ){
420 Todo* td = ( Todo* ) mIncidence; 420 Todo* td = ( Todo* ) mIncidence;
421 if ( td->isCompleted() ) { 421 if ( td->isCompleted() ) {
422 int half = size/2; 422 int half = size/2;
423 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; 423 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
424 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; 424 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
425 x += half+half + 4; 425 x += half+half + 4;
426 426
427 } else { 427 } else {
428 int val = td->percentComplete()/20; 428 int val = td->percentComplete()/20;
429 p->fillRect ( x+1, y-2, val ,size+4,textColor ); 429 p->fillRect ( x+1, y-2, val ,size+4,textColor );
430 p->drawRect ( x, y-2,7,size+4); 430 p->drawRect ( x, y-2,7,size+4);
431 x += size + 3; 431 x += size + 3;
432 } 432 }
433 } 433 }
434 QFontMetrics fm = p->fontMetrics(); 434 QFontMetrics fm = p->fontMetrics();
435 int yPos; 435 int yPos;
436 int pmheight = size; 436 int pmheight = size;
437 if( pmheight < fm.height() ) 437 if( pmheight < fm.height() )
438 yPos = fm.ascent() + fm.leading()/2; 438 yPos = fm.ascent() + fm.leading()/2;
439 else 439 else
440 yPos = pmheight/2 - fm.height()/2 + fm.ascent(); 440 yPos = pmheight/2 - fm.height()/2 + fm.ascent();
441 441
442 if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) { 442 if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
443 p->drawText( x, yPos, text() ); 443 p->drawText( x, yPos, text() );
444 if ( mIncidence->cancelled() ) { 444 if ( mIncidence->cancelled() ) {
445 int wid = fm.width( text() ); 445 int wid = fm.width( text() );
446 p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); 446 p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
447 } 447 }
448 } else { 448 } else {
449 QString pText = text(); 449 QString pText = text();
450 if( pText.mid(2,1) == ":" ) 450 if( pText.mid(2,1) == ":" )
451 pText = pText.mid( 6 ); 451 pText = pText.mid( 6 );
452 p->drawText( x, yPos, pText ); 452 p->drawText( x, yPos, pText );
453 if ( mIncidence->cancelled() ) { 453 if ( mIncidence->cancelled() ) {
454 int wid = fm.width( pText ); 454 int wid = fm.width( pText );
455 p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); 455 p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
456 } 456 }
457 } 457 }
458} 458}
459 459
460int MonthViewItem::height(const QListBox *lb) const 460int MonthViewItem::height(const QListBox *lb) const
461{ 461{
462 int ret = 10; 462 int ret = 10;
463 if ( lb ) 463 if ( lb )
464 ret = lb->fontMetrics().lineSpacing()+1; 464 ret = lb->fontMetrics().lineSpacing()+1;
465 return ret; 465 return ret;
466} 466}
467 467
468int MonthViewItem::width(const QListBox *lb) const 468int MonthViewItem::width(const QListBox *lb) const
469{ 469{
470 if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { 470 if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) {
471 int size = PIXMAP_SIZE; 471 int size = PIXMAP_SIZE;
472 if ( QApplication::desktop()->width() < 300 ) 472 if ( QApplication::desktop()->width() < 300 )
473 size = 3; 473 size = 3;
474 int x = 1; 474 int x = 1;
475 if ( KOPrefs::instance()->mMonthShowIcons ) { 475 if ( KOPrefs::instance()->mMonthShowIcons ) {
476 if ( mInfo ) { 476 if ( mInfo ) {
477 x += size + 1; 477 x += size + 1;
478 } 478 }
479 if( mRecur ) { 479 if( mRecur ) {
480 x += size+1; 480 x += size+1;
481 } 481 }
482 if( mAlarm ) { 482 if( mAlarm ) {
483 x += size+1; 483 x += size+1;
484 } 484 }
485 if( mReply ) { 485 if( mReply ) {
486 x += size+1; 486 x += size+1;
487 } 487 }
488 } 488 }
489 if( mMultiday ) { 489 if( mMultiday ) {
490 x += size+1+2+size/2; 490 x += size+1+2+size/2;
491 } 491 }
492 return( x + lb->fontMetrics().width( text() ) + 1 ); 492 return( x + lb->fontMetrics().width( text() ) + 1 );
493 } 493 }
494 if ( ! lb ) 494 if ( ! lb )
495 return 10; 495 return 10;
496 return lb->width(); 496 return lb->width();
497} 497}
498 498
499 499
500MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) 500MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
501 : KNoScrollListBox( par ), 501 : KNoScrollListBox( par ),
502 mMonthView( parent ) 502 mMonthView( parent )
503{ 503{
504 //QVBoxLayout *topLayout = new QVBoxLayout( this ); 504 //QVBoxLayout *topLayout = new QVBoxLayout( this );
505 currentPalette = 0; 505 currentPalette = 0;
506 // mLabel = new QLabel( this );QPushButton 506 // mLabel = new QLabel( this );QPushButton
507 mLabel = new QPushButton( this ); 507 mLabel = new QPushButton( this );
508 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); 508 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
509 //mLabel->setLineWidth( 1 ); 509 //mLabel->setLineWidth( 1 );
510 //mLabel->setAlignment( AlignCenter ); 510 //mLabel->setAlignment( AlignCenter );
511 mLabel->setFlat( true ); 511 mLabel->setFlat( true );
512 mLabel->setFocusPolicy(NoFocus); 512 mLabel->setFocusPolicy(NoFocus);
513 //mItemList = new KNoScrollListBox( this ); 513 //mItemList = new KNoScrollListBox( this );
514 setMinimumSize( 10, 10 ); 514 setMinimumSize( 10, 10 );
515 setFrameStyle( QFrame::Panel | QFrame::Plain ); 515 setFrameStyle( QFrame::Panel | QFrame::Plain );
516 setLineWidth( 1 ); 516 setLineWidth( 1 );
517 //topLayout->addWidget( mItemList ); 517 //topLayout->addWidget( mItemList );
518 mLabel->raise(); 518 mLabel->raise();
519 // QColor( 0,0,255 ) QColor( 160,1600,255 ) 519 // QColor( 0,0,255 ) QColor( 160,1600,255 )
520 mStandardPalette = palette(); 520 mStandardPalette = palette();
521 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); 521 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) );
522 522
523 enableScrollBars( false ); 523 enableScrollBars( false );
524 updateConfig(); 524 updateConfig();
525 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); 525 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
526 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); 526 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
527 connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), 527 connect( this , SIGNAL( doubleClicked( QListBoxItem *) ),
528 SLOT( defaultAction( QListBoxItem * ) ) ); 528 SLOT( defaultAction( QListBoxItem * ) ) );
529 connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, 529 connect( this, SIGNAL( rightButtonPressed( QListBoxItem *,
530 const QPoint &) ), 530 const QPoint &) ),
531 SLOT( contextMenu( QListBoxItem * ) ) ); 531 SLOT( contextMenu( QListBoxItem * ) ) );
532 connect( this, SIGNAL( highlighted( QListBoxItem *) ), 532 connect( this, SIGNAL( highlighted( QListBoxItem *) ),
533 SLOT( selection( QListBoxItem * ) ) ); 533 SLOT( selection( QListBoxItem * ) ) );
534 534
535 /* 535 /*
536 connect( this, SIGNAL( clicked( QListBoxItem * ) ), 536 connect( this, SIGNAL( clicked( QListBoxItem * ) ),
537 SLOT( selection( QListBoxItem * ) ) ); 537 SLOT( selection( QListBoxItem * ) ) );
538 */ 538 */
539} 539}
540#ifdef DESKTOP_VERSION 540#ifdef DESKTOP_VERSION
541QToolTipGroup *MonthViewCell::toolTipGroup() 541QToolTipGroup *MonthViewCell::toolTipGroup()
542{ 542{
543 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); 543 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
544 return mToolTipGroup; 544 return mToolTipGroup;
545} 545}
546#endif 546#endif
547 547
548void MonthViewCell::setDate( const QDate &date ) 548void MonthViewCell::setDate( const QDate &date )
549{ 549{
550 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; 550 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
551 mDate = date; 551 mDate = date;
552 552
553 553
554 554
555 //resizeEvent( 0 ); 555 //resizeEvent( 0 );
556} 556}
557 557
558QDate MonthViewCell::date() const 558QDate MonthViewCell::date() const
559{ 559{
560 return mDate; 560 return mDate;
561} 561}
562 562
563void MonthViewCell::setPrimary( bool primary ) 563void MonthViewCell::setPrimary( bool primary )
564{ 564{
565 mPrimary = primary; 565 mPrimary = primary;
566 //setMyPalette(); 566 //setMyPalette();
567} 567}
568void MonthViewCell::setMyPalette() 568void MonthViewCell::setMyPalette()
569{ 569{
570 570
571 if ( mHoliday) { 571 if ( mHoliday) {
572 if ( currentPalette == 1 ) return; 572 if ( currentPalette == 1 ) return;
573 mLabel->setPalette( QPalette ( mHolidayPalette.color( QPalette::Normal,QColorGroup::Base),mHolidayPalette.color(QPalette::Normal,QColorGroup::Base ) )); 573 mLabel->setPalette( QPalette ( mHolidayPalette.color( QPalette::Normal,QColorGroup::Base),mHolidayPalette.color(QPalette::Normal,QColorGroup::Base ) ));
574 setPalette( mHolidayPalette ); 574 setPalette( mHolidayPalette );
575 //mLabel->setPalette( mHolidayPalette ); 575 //mLabel->setPalette( mHolidayPalette );
576 currentPalette = 1; 576 currentPalette = 1;
577 577
578 } else { 578 } else {
579 if ( mPrimary ) { 579 if ( mPrimary ) {
580 if ( currentPalette == 2 ) return; 580 if ( currentPalette == 2 ) return;
581 mLabel->setPalette( QPalette ( mPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); 581 mLabel->setPalette( QPalette ( mPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) ));
582 //mLabel->setPalette( mPrimaryPalette ); 582 //mLabel->setPalette( mPrimaryPalette );
583 setPalette( mPrimaryPalette ); 583 setPalette( mPrimaryPalette );
584 currentPalette = 2; 584 currentPalette = 2;
585 585
586 } else { 586 } else {
587 if ( currentPalette == 3 ) return; 587 if ( currentPalette == 3 ) return;
588 setPalette( mNonPrimaryPalette ); 588 setPalette( mNonPrimaryPalette );
589 mLabel->setPalette( QPalette ( mNonPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mNonPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); 589 mLabel->setPalette( QPalette ( mNonPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mNonPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) ));
590 //mLabel->setPalette( mNonPrimaryPalette );; 590 //mLabel->setPalette( mNonPrimaryPalette );;
591 currentPalette = 3; 591 currentPalette = 3;
592 } 592 }
593 } 593 }
594 //QPalette pal = palette(); 594 //QPalette pal = palette();
595 595
596 //mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); 596 //mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) ));
597} 597}
598QPalette MonthViewCell::getPalette () 598QPalette MonthViewCell::getPalette ()
599{ 599{
600 if ( !KOPrefs::instance()->mMonthViewUsesDayColors ) 600 if ( !KOPrefs::instance()->mMonthViewUsesDayColors )
601 return mStandardPalette; 601 return mStandardPalette;
602 if ( mHoliday) { 602 if ( mHoliday) {
603 return mHolidayPalette ; 603 return mHolidayPalette ;
604 } else { 604 } else {
605 if ( mPrimary ) { 605 if ( mPrimary ) {
606 return mPrimaryPalette ; 606 return mPrimaryPalette ;
607 } 607 }
608 } 608 }
609 return mNonPrimaryPalette; 609 return mNonPrimaryPalette;
610} 610}
611bool MonthViewCell::isPrimary() const 611bool MonthViewCell::isPrimary() const
612{ 612{
613 return mPrimary; 613 return mPrimary;
614} 614}
615 615
616void MonthViewCell::setHoliday( bool holiday ) 616void MonthViewCell::setHoliday( bool holiday )
617{ 617{
618 mHoliday = holiday; 618 mHoliday = holiday;
619 //setMyPalette(); 619 //setMyPalette();
620} 620}
621 621
622void MonthViewCell::setHoliday( const QString &holiday ) 622void MonthViewCell::setHoliday( const QString &holiday )
623{ 623{
624 mHolidayString = holiday; 624 mHolidayString = holiday;
625 625
626 if ( !holiday.isEmpty() ) { 626 if ( !holiday.isEmpty() ) {
627 setHoliday( true ); 627 setHoliday( true );
628 } 628 }
629} 629}
630 630
631void MonthViewCell::startUpdateCell() 631void MonthViewCell::startUpdateCell()
632{ 632{
633 blockSignals( true ); 633 blockSignals( true );
634 mdayCount = 0; 634 mdayCount = 0;
635 setFocusPolicy(NoFocus); 635 setFocusPolicy(NoFocus);
636 if ( !mMonthView->isUpdatePossible() ) 636 if ( !mMonthView->isUpdatePossible() )
637 return; 637 return;
638 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 638 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
639 while ( mitem ) { 639 while ( mitem ) {
640 mitem->setBlockRepaint( true ); 640 mitem->setBlockRepaint( true );
641 mitem = (MonthViewItem *)mitem->next(); 641 mitem = (MonthViewItem *)mitem->next();
642 } 642 }
643 if ( mAvailItemList.count() > 20 ) { 643 if ( mAvailItemList.count() > 20 ) {
644 mAvailItemList.setAutoDelete( true ); 644 mAvailItemList.setAutoDelete( true );
645 mAvailItemList.clear(); 645 mAvailItemList.clear();
646 mAvailItemList.setAutoDelete( false ); 646 mAvailItemList.setAutoDelete( false );
647 clear(); 647 clear();
648 } 648 }
649 649
650 setPrimary( mDate.month()%2 ); 650 setPrimary( mDate.month()%2 );
651 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); 651 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
652 if ( mDate == QDate::currentDate() ) { 652 if ( mDate == QDate::currentDate() ) {
653 setLineWidth( 3 ); 653 setLineWidth( 3 );
654 } else { 654 } else {
655 setLineWidth( 1 ); 655 setLineWidth( 1 );
656 } 656 }
657 MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); 657 MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem ();
658 //clear(); 658 //clear();
659 while ( CurrentAvailItem ) { 659 while ( CurrentAvailItem ) {
660 MonthViewItem *item = CurrentAvailItem; 660 MonthViewItem *item = CurrentAvailItem;
661 //item->setHighlightedFalse(); 661 //item->setHighlightedFalse();
662 item->recycle( 0, ""); 662 item->recycle( 0, "");
663 CurrentAvailItem = (MonthViewItem *)item->next(); 663 CurrentAvailItem = (MonthViewItem *)item->next();
664 mAvailItemList.append( item ); 664 mAvailItemList.append( item );
665 takeItem ( item ); 665 takeItem ( item );
666 } 666 }
667 667
668#ifdef DESKTOP_VERSION 668#ifdef DESKTOP_VERSION
669 QToolTip::remove(this); 669 QToolTip::remove(this);
670#endif 670#endif
671 mToolTip.clear(); 671 mToolTip.clear();
672 //qApp->processEvents(); 672 //qApp->processEvents();
673#if 0 673#if 0
674 if ( !mHolidayString.isEmpty() ) { 674 if ( !mHolidayString.isEmpty() ) {
675 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); 675 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
676 item->setPalette( mHolidayPalette ); 676 item->setPalette( mHolidayPalette );
677 insertItem( item ); 677 insertItem( item );
678 mToolTip.append ( mHolidayString ); 678 mToolTip.append ( mHolidayString );
679 } 679 }
680#endif 680#endif
681} 681}
682 682
683int MonthViewCell::insertEvent(Event *event) 683int MonthViewCell::insertEvent(Event *event)
684{ 684{
685 bool useToolTips = true; 685 bool useToolTips = true;
686#ifndef DESKTOP_VERSION 686#ifndef DESKTOP_VERSION
687 useToolTips = false; 687 useToolTips = false;
688#endif 688#endif
689 QString mToolTipText; 689 QString mToolTipText;
690 setFocusPolicy(WheelFocus); 690 setFocusPolicy(WheelFocus);
691 if ( !(event->doesRecur() == Recurrence::rNone) ) { 691 if ( !(event->doesRecur() == Recurrence::rNone) ) {
692 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 692 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
693 return mdayCount; 693 return mdayCount;
694 else 694 else
695 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) 695 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
696 return mdayCount; 696 return mdayCount;
697 } 697 }
698 698
699 if ( event->isHoliday()) { 699 if ( event->isHoliday()) {
700 setHoliday( true ); 700 setHoliday( true );
701 if ( mDate.dayOfWeek() == 7 ) 701 if ( mDate.dayOfWeek() == 7 )
702 setLineWidth( 3 ); 702 setLineWidth( 3 );
703 } 703 }
704 QString text; 704 QString text;
705 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day 705 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
706 if (event->isMultiDay()) { 706 if (event->isMultiDay()) {
707 QString prefix = "<->";multiday = 2; 707 QString prefix = "<->";multiday = 2;
708 QString time; 708 QString time;
709 if ( event->doesRecur() ) { 709 if ( event->doesRecur() ) {
710 if ( event->recursOn( mDate) ) { 710 if ( event->recursOn( mDate) ) {
711 prefix ="->" ;multiday = 1; 711 prefix ="->" ;multiday = 1;
712 } 712 }
713 else { 713 else {
714 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 714 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
715 if ( event->recursOn( mDate.addDays( -days)) ) { 715 if ( event->recursOn( mDate.addDays( -days)) ) {
716 prefix ="<-" ;multiday = 3; 716 prefix ="<-" ;multiday = 3;
717 } 717 }
718 } 718 }
719 719
720 } else { 720 } else {
721 if (mDate == event->dtStart().date()) { 721 if (mDate == event->dtStart().date()) {
722 prefix ="->" ;multiday = 1; 722 prefix ="->" ;multiday = 1;
723 } else if (mDate == event->dtEnd().date()) { 723 } else if (mDate == event->dtEnd().date()) {
724 prefix ="<-" ;multiday = 3; 724 prefix ="<-" ;multiday = 3;
725 } 725 }
726 } 726 }
727 if ( !event->doesFloat() ) { 727 if ( !event->doesFloat() ) {
728 if ( mDate == event->dtStart().date () ) 728 if ( mDate == event->dtStart().date () )
729 time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; 729 time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
730 else if ( mDate == event->dtEnd().date () ) 730 else if ( mDate == event->dtEnd().date () )
731 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; 731 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
732 732
733 } 733 }
734 text = time + event->summary(); 734 text = time + event->summary();
735 if ( useToolTips ) 735 if ( useToolTips )
736 mToolTipText += prefix + text; 736 mToolTipText += prefix + text;
737 } else { 737 } else {
738 if (event->doesFloat()) { 738 if (event->doesFloat()) {
739 text = event->summary(); 739 text = event->summary();
740 if ( useToolTips ) 740 if ( useToolTips )
741 mToolTipText += text; 741 mToolTipText += text;
742 } 742 }
743 else { 743 else {
744 text = KGlobal::locale()->formatTime(event->dtStart().time()); 744 text = KGlobal::locale()->formatTime(event->dtStart().time());
745 text += " " + event->summary(); 745 text += " " + event->summary();
746 if ( useToolTips ) 746 if ( useToolTips )
747 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 747 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
748 } 748 }
749 } 749 }
750 if ( useToolTips && ! event->location().isEmpty() ) { 750 if ( useToolTips && ! event->location().isEmpty() ) {
751 mToolTipText += " (" + event->location() +")"; 751 mToolTipText += " (" + event->location() +")";
752 } 752 }
753 MonthViewItem *item ; 753 MonthViewItem *item ;
754 754
755 if ( mAvailItemList.count() ) { 755 if ( mAvailItemList.count() ) {
756 item = mAvailItemList.first(); 756 item = mAvailItemList.first();
757 mAvailItemList.remove( item ); 757 mAvailItemList.remove( item );
758 item->recycle( event, text ); 758 item->recycle( event, text );
759 } else { 759 } else {
760 item = new MonthViewItem( event, text ); 760 item = new MonthViewItem( event, text );
761 } 761 }
762 762
763 QPalette pal; 763 QPalette pal;
764 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 764 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
765 QStringList categories = event->categories(); 765 QStringList categories = event->categories();
766 QString cat = categories.first(); 766 QString cat = categories.first();
767 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 767 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
768 pal = getPalette(); 768 pal = getPalette();
769 if (cat.isEmpty()) { 769 if (cat.isEmpty()) {
770 //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 770 //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
771 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); 771 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() ));
772 } else { 772 } else {
773 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 773 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
774 } 774 }
775 775
776 } else { 776 } else {
777 if (cat.isEmpty()) { 777 if (cat.isEmpty()) {
778 //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 778 //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
779 pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); 779 pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() ));
780 } else { 780 } else {
781 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 781 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
782 } 782 }
783 } 783 }
784 784
785 } else { 785 } else {
786 pal = mStandardPalette ; 786 pal = mStandardPalette ;
787 } 787 }
788 pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); 788 pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
789 item->setPalette( pal ); 789 item->setPalette( pal );
790 item->setRecur( event->recurrence()->doesRecur() ); 790 item->setRecur( event->recurrence()->doesRecur() );
791 item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); 791 item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() );
792 item->setMoreInfo( event->description().length() > 0 ); 792 item->setMoreInfo( event->description().length() > 0 );
793#ifdef DESKTOP_VERSION 793#ifdef DESKTOP_VERSION
794 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, 794 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
795 KOPrefs::instance()->email()); 795 KOPrefs::instance()->email());
796 if ( me != 0 ) { 796 if ( me != 0 ) {
797 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 797 if ( me->status() == Attendee::NeedsAction && me->RSVP())
798 item->setReply(true && multiday < 2); 798 item->setReply(true && multiday < 2);
799 else 799 else
800 item->setReply(false); 800 item->setReply(false);
801 } else 801 } else
802 item->setReply(false); 802 item->setReply(false);
803#endif 803#endif
804 804
805 item->setMultiDay( multiday ); 805 item->setMultiDay( multiday );
806 if ( multiday ) { 806 if ( multiday ) {
807 insertItem( item ,mdayCount); 807 insertItem( item ,mdayCount);
808 ++mdayCount; 808 ++mdayCount;
809 } else { 809 } else {
810 uint i = mdayCount; 810 uint i = mdayCount;
811 uint pos = mdayCount; 811 uint pos = mdayCount;
812 uint itcount = count(); 812 uint itcount = count();
813 if ( itcount > 1000 ) { 813 if ( itcount > 1000 ) {
814 qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); 814 qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount);
815 itcount = 0; 815 itcount = 0;
816 } 816 }
817 for ( i = pos; i < itcount;++i ) { 817 for ( i = pos; i < itcount;++i ) {
818 // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); 818 // qDebug("i %d mday %u count %d ",i,itcount,mdayCount );
819 QListBoxItem* it = this->item ( i ); 819 QListBoxItem* it = this->item ( i );
820 if ( it && text < it->text() ) { 820 if ( it && text < it->text() ) {
821 pos = i; 821 pos = i;
822 break; 822 break;
823 } 823 }
824 ++pos; 824 ++pos;
825 } 825 }
826 insertItem( item ,pos); 826 insertItem( item ,pos);
827 } 827 }
828 if ( useToolTips ) { 828 if ( useToolTips ) {
829 mToolTip.append( mToolTipText ); 829 mToolTip.append( mToolTipText );
830 } 830 }
831 return mdayCount; 831 return mdayCount;
832} 832}
833void MonthViewCell::insertTodo(Todo *todo) 833void MonthViewCell::insertTodo(Todo *todo)
834{ 834{
835 setFocusPolicy(WheelFocus); 835 setFocusPolicy(WheelFocus);
836 QString text; 836 QString text;
837 if (todo->hasDueDate()) { 837 if (todo->hasDueDate()) {
838 if (!todo->doesFloat()) { 838 if (!todo->doesFloat()) {
839 text += KGlobal::locale()->formatTime(todo->dtDue().time()); 839 text += KGlobal::locale()->formatTime(todo->dtDue().time());
840 text += " "; 840 text += " ";
841 } 841 }
842 } 842 }
843 text += todo->summary(); 843 text += todo->summary();
844 MonthViewItem *item ; 844 MonthViewItem *item ;
845 if ( mAvailItemList.count() ) { 845 if ( mAvailItemList.count() ) {
846 item = mAvailItemList.first(); 846 item = mAvailItemList.first();
847 mAvailItemList.remove( item ); 847 mAvailItemList.remove( item );
848 item->recycle( todo, text ); 848 item->recycle( todo, text );
849 } else { 849 } else {
850 item = new MonthViewItem( todo, text ); 850 item = new MonthViewItem( todo, text );
851 } 851 }
852 //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); 852 //MonthViewItem *item = new MonthViewItem( todo, mDate, text );
853 //item->setPalette( mStandardPalette ); 853 //item->setPalette( mStandardPalette );
854 QPalette pal; 854 QPalette pal;
855 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 855 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
856 QStringList categories = todo->categories(); 856 QStringList categories = todo->categories();
857 QString cat = categories.first(); 857 QString cat = categories.first();
858 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 858 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
859 pal = getPalette(); 859 pal = getPalette();
860 if (cat.isEmpty()) { 860 if (cat.isEmpty()) {
861 //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 861 //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
862 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); 862 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() ));
863 } else { 863 } else {
864 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 864 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
865 } 865 }
866 866
867 } else { 867 } else {
868 if (cat.isEmpty()) { 868 if (cat.isEmpty()) {
869 //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 869 //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
870 pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); 870 pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() ));
871 } else { 871 } else {
872 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 872 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
873 } 873 }
874 } 874 }
875 875
876 } else { 876 } else {
877 pal = mStandardPalette ; 877 pal = mStandardPalette ;
878 } 878 }
879 pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); 879 pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
880 item->setPalette( pal ); 880 item->setPalette( pal );
881 item->setRecur( todo->recurrence()->doesRecur() ); 881 item->setRecur( todo->recurrence()->doesRecur() );
882 item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); 882 item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() );
883 item->setMoreInfo( todo->description().length() > 0 ); 883 item->setMoreInfo( todo->description().length() > 0 );
884 insertItem( item , count()); 884 insertItem( item , count());
885#ifdef DESKTOP_VERSION 885#ifdef DESKTOP_VERSION
886 mToolTip.append( text ); 886 mToolTip.append( text );
887#endif 887#endif
888} 888}
889void MonthViewCell::repaintfinishUpdateCell() 889void MonthViewCell::repaintfinishUpdateCell()
890{ 890{
891 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 891 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
892 while ( mitem ) { 892 while ( mitem ) {
893 mitem->setBlockRepaint( false ); 893 mitem->setBlockRepaint( false );
894 updateItem ( mitem ); 894 updateItem ( mitem );
895 mitem = (MonthViewItem *)mitem->next(); 895 mitem = (MonthViewItem *)mitem->next();
896 } 896 }
897 blockSignals( false ); 897 blockSignals( false );
898} 898}
899void MonthViewCell::finishUpdateCell() 899void MonthViewCell::finishUpdateCell()
900{ 900{
901 901
902 902
903 903
904#ifdef DESKTOP_VERSION 904#ifdef DESKTOP_VERSION
905 if (mToolTip.count() > 0 ) { 905 if (mToolTip.count() > 0 ) {
906 mToolTip.sort(); 906 mToolTip.sort();
907 QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); 907 QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
908 } 908 }
909#endif 909#endif
910 //sort(); 910 //sort();
911 //setMyPalette(); 911 //setMyPalette();
912 setMyPalette(); 912 setMyPalette();
913 913
914 resizeEvent( 0 ); 914 resizeEvent( 0 );
915 915
916} 916}
917void MonthViewCell::updateCell() 917void MonthViewCell::updateCell()
918{ 918{
919 if ( !mMonthView->isUpdatePossible() ) 919 if ( !mMonthView->isUpdatePossible() )
920 return; 920 return;
921 startUpdateCell(); 921 startUpdateCell();
922 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 922 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
923 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 923 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
924 Event *event; 924 Event *event;
925 for( event = events.first(); event; event = events.next() ) { // for event 925 for( event = events.first(); event; event = events.next() ) { // for event
926 insertEvent(event); 926 insertEvent(event);
927 } 927 }
928 // insert due todos 928 // insert due todos
929 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 929 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
930 Todo *todo; 930 Todo *todo;
931 for(todo = todos.first(); todo; todo = todos.next()) { 931 for(todo = todos.first(); todo; todo = todos.next()) {
932 insertTodo( todo ); 932 insertTodo( todo );
933 } 933 }
934 finishUpdateCell(); 934 finishUpdateCell();
935 // if ( isVisible()) 935 // if ( isVisible())
936 //qApp->processEvents(); 936 //qApp->processEvents();
937} 937}
938 938
939void MonthViewCell::updateConfig( bool bigFont ) // = false 939void MonthViewCell::updateConfig( bool bigFont ) // = false
940{ 940{
941 941
942 if ( bigFont ) { 942 if ( bigFont ) {
943 QFont fo = KOPrefs::instance()->mMonthViewFont; 943 QFont fo = KOPrefs::instance()->mMonthViewFont;
944 int ps = fo.pointSize() + 2; 944 int ps = fo.pointSize() + 2;
945 if ( ps < 18 ) 945 if ( ps < 18 )
946 ps += 2; 946 ps += 2;
947 fo.setPointSize( ps ); 947 fo.setPointSize( ps );
948 setFont( fo ); 948 setFont( fo );
949 } else 949 } else
950 setFont( KOPrefs::instance()->mMonthViewFont ); 950 setFont( KOPrefs::instance()->mMonthViewFont );
951 951
952 QFontMetrics fm( font() ); 952 QFontMetrics fm( font() );
953 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 953 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
954 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 954 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
955 mHolidayPalette = mStandardPalette; 955 mHolidayPalette = mStandardPalette;
956 mPrimaryPalette = mStandardPalette; 956 mPrimaryPalette = mStandardPalette;
957 mNonPrimaryPalette = mStandardPalette; 957 mNonPrimaryPalette = mStandardPalette;
958 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 958 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
959 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 959 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
960 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 960 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
961 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 961 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
962 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 962 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
963 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 963 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
964 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 964 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
965 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 965 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
966 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 966 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
967 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 967 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
968 } 968 }
969 //updateCell(); 969 //updateCell();
970} 970}
971 971
972void MonthViewCell::enableScrollBars( bool enabled ) 972void MonthViewCell::enableScrollBars( bool enabled )
973{ 973{
974 974
975 return; 975 return;
976 if ( enabled ) { 976 if ( enabled ) {
977 QListBoxItem *fi = firstItem (); 977 QListBoxItem *fi = firstItem ();
978 if (fi ) { 978 if (fi ) {
979 int ihei = fi->height( this ); 979 int ihei = fi->height( this );
980 int hei = numRows () * ihei; 980 int hei = numRows () * ihei;
981 if ( hei < height() - horizontalScrollBar()->height () ) { 981 if ( hei < height() - horizontalScrollBar()->height () ) {
982 setVScrollBarMode(QScrollView::AlwaysOff); 982 setVScrollBarMode(QScrollView::AlwaysOff);
983 } 983 }
984 else 984 else
985 setVScrollBarMode(QScrollView::Auto); 985 setVScrollBarMode(QScrollView::Auto);
986 if ( ihei *3 > height() ) { 986 if ( ihei *3 > height() ) {
987 setHScrollBarMode(QScrollView::AlwaysOff); 987 setHScrollBarMode(QScrollView::AlwaysOff);
988 } 988 }
989 else { 989 else {
990 setHScrollBarMode(QScrollView::Auto); 990 setHScrollBarMode(QScrollView::Auto);
991 } 991 }
992 } else { 992 } else {
993 setVScrollBarMode(QScrollView::Auto); 993 setVScrollBarMode(QScrollView::Auto);
994 setHScrollBarMode(QScrollView::Auto); 994 setHScrollBarMode(QScrollView::Auto);
995 } 995 }
996 } else { 996 } else {
997 setVScrollBarMode(QScrollView::AlwaysOff); 997 setVScrollBarMode(QScrollView::AlwaysOff);
998 setHScrollBarMode(QScrollView::AlwaysOff); 998 setHScrollBarMode(QScrollView::AlwaysOff);
999 } 999 }
1000} 1000}
1001 1001
1002Incidence *MonthViewCell::selectedIncidence() 1002Incidence *MonthViewCell::selectedIncidence()
1003{ 1003{
1004 int index = currentItem(); 1004 int index = currentItem();
1005 if ( index < 0 ) return 0; 1005 if ( index < 0 ) return 0;
1006 1006
1007 MonthViewItem *mitem = 1007 MonthViewItem *mitem =
1008 static_cast<MonthViewItem *>( item( index ) ); 1008 static_cast<MonthViewItem *>( item( index ) );
1009 1009
1010 if ( !mitem ) return 0; 1010 if ( !mitem ) return 0;
1011 1011
1012 return mitem->incidence(); 1012 return mitem->incidence();
1013} 1013}
1014 1014
1015QDate MonthViewCell::selectedIncidenceDate() 1015QDate MonthViewCell::selectedIncidenceDate()
1016{ 1016{
1017 QDate qd; 1017 QDate qd;
1018 int index = currentItem(); 1018 int index = currentItem();
1019 if ( index < 0 ) return qd; 1019 if ( index < 0 ) return qd;
1020 return mDate; 1020 return mDate;
1021} 1021}
1022 1022
1023void MonthViewCell::deselect() 1023void MonthViewCell::deselect()
1024{ 1024{
1025 clearSelection(); 1025 clearSelection();
1026 enableScrollBars( false ); 1026 enableScrollBars( false );
1027 // updateCell(); 1027 // updateCell();
1028} 1028}
1029void MonthViewCell::select() 1029void MonthViewCell::select()
1030{ 1030{
1031 ;// updateCell(); 1031 ;// updateCell();
1032} 1032}
1033 1033
1034void MonthViewCell::resizeEvent ( QResizeEvent * e ) 1034void MonthViewCell::resizeEvent ( QResizeEvent * e )
1035{ 1035{
1036 if ( !mMonthView->isUpdatePossible() ) 1036 if ( !mMonthView->isUpdatePossible() )
1037 return; 1037 return;
1038 //qDebug("++++++++++++++MonthViewCell::resizeEvent %d %d ", width(), height()); 1038 //qDebug("++++++++++++++MonthViewCell::resizeEvent %d %d ", width(), height());
1039 deselect(); 1039 deselect();
1040 mLabel->setMaximumHeight( height() - lineWidth()*2 ); 1040 mLabel->setMaximumHeight( height() - lineWidth()*2 );
1041 1041
1042 QString text; 1042 QString text;
1043 //mLabel->setText( text ); 1043 //mLabel->setText( text );
1044 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 1044 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
1045 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 1045 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
1046 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " " + QString::number( mDate.day() ); 1046 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " " + QString::number( mDate.day() );
1047 mLabel->resize( mLabelBigSize ); 1047 mLabel->resize( mLabelBigSize );
1048 } else { 1048 } else {
1049 mLabel->resize( mLabelSize ); 1049 mLabel->resize( mLabelSize );
1050 text = QString::number( mDate.day() ); 1050 text = QString::number( mDate.day() );
1051 } 1051 }
1052 mLabel->setText( text ); 1052 mLabel->setText( text );
1053 1053
1054 int size = height() - mLabel->height() - lineWidth()-1; 1054 int size = height() - mLabel->height() - lineWidth()-1;
1055 //qDebug("LW %d ", lineWidth()); 1055 //qDebug("LW %d ", lineWidth());
1056 if ( size > 0 ) 1056 if ( size > 0 )
1057 verticalScrollBar()->setMaximumHeight( size ); 1057 verticalScrollBar()->setMaximumHeight( size );
1058 size = width() - mLabel->width() -lineWidth()-1; 1058 size = width() - mLabel->width() -lineWidth()-1;
1059 if ( size > 0 ) 1059 if ( size > 0 )
1060 horizontalScrollBar()->setMaximumWidth( size ); 1060 horizontalScrollBar()->setMaximumWidth( size );
1061 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() ); 1061 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() );
1062 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 1062 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
1063 // mItemList->resize ( width(), height () ); 1063 // mItemList->resize ( width(), height () );
1064 if ( e ) 1064 if ( e )
1065 KNoScrollListBox::resizeEvent ( e ); 1065 KNoScrollListBox::resizeEvent ( e );
1066} 1066}
1067 1067
1068void MonthViewCell::defaultAction( QListBoxItem *item ) 1068void MonthViewCell::defaultAction( QListBoxItem *item )
1069{ 1069{
1070 1070
1071 if ( !item ) { 1071 if ( !item ) {
1072 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1072 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1073 emit newEventSignal( dt ); 1073 emit newEventSignal( dt );
1074 return; 1074 return;
1075 } 1075 }
1076 1076
1077 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1077 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
1078 Incidence *incidence = eventItem->incidence(); 1078 Incidence *incidence = eventItem->incidence();
1079 if ( incidence ) mMonthView->defaultAction( incidence ); 1079 if ( incidence ) mMonthView->defaultAction( incidence );
1080} 1080}
1081void MonthViewCell::showDay() 1081void MonthViewCell::showDay()
1082{ 1082{
1083 emit showDaySignal( date() ); 1083 emit showDaySignal( date() );
1084} 1084}
1085void MonthViewCell::newEvent() 1085void MonthViewCell::newEvent()
1086{ 1086{
1087 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1087 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1088 emit newEventSignal( dt ); 1088 emit newEventSignal( dt );
1089} 1089}
1090void MonthViewCell::cellClicked( QListBoxItem *item ) 1090void MonthViewCell::cellClicked( QListBoxItem *item )
1091{ 1091{
1092 mMonthView->setSelectedCell( this ); 1092 mMonthView->setSelectedCell( this );
1093 if ( item == 0 ) { 1093 if ( item == 0 ) {
1094 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1094 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1095 emit newEventSignal( dt ); 1095 emit newEventSignal( dt );
1096 return; 1096 return;
1097 } 1097 }
1098 1098
1099} 1099}
1100 1100
1101void MonthViewCell::contextMenu( QListBoxItem *item ) 1101void MonthViewCell::contextMenu( QListBoxItem *item )
1102{ 1102{
1103 mMonthView->setPopupCell( this ); 1103 mMonthView->setPopupCell( this );
1104 if ( !item ) { 1104 if ( !item ) {
1105 mMonthView->showContextMenu( 0 ); 1105 mMonthView->showContextMenu( 0 );
1106 return; 1106 return;
1107 } 1107 }
1108 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1108 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
1109 Incidence *incidence = eventItem->incidence(); 1109 Incidence *incidence = eventItem->incidence();
1110 if ( incidence ) mMonthView->showContextMenu( incidence ); 1110 if ( incidence ) mMonthView->showContextMenu( incidence );
1111} 1111}
1112 1112
1113void MonthViewCell::selection( QListBoxItem *item ) 1113void MonthViewCell::selection( QListBoxItem *item )
1114{ 1114{
1115 if ( !item ) { 1115 if ( !item ) {
1116 emit highlightIncidence( 0 , this, 0 ); 1116 emit highlightIncidence( 0 , this, 0 );
1117 return; 1117 return;
1118 } 1118 }
1119 MonthViewItem * it = (static_cast<MonthViewItem *>( item )); 1119 MonthViewItem * it = (static_cast<MonthViewItem *>( item ));
1120 emit highlightIncidence( it->incidence(), this, it->multiDay() ); 1120 emit highlightIncidence( it->incidence(), this, it->multiDay() );
1121 mMonthView->setSelectedCell( this ); 1121 mMonthView->setSelectedCell( this );
1122} 1122}
1123 1123
1124void MonthViewCell::deHighLight() 1124void MonthViewCell::deHighLight()
1125{ 1125{
1126 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 1126 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
1127 while ( mitem ) { 1127 while ( mitem ) {
1128 if ( mitem->setHighlightedFalse() ) 1128 if ( mitem->setHighlightedFalse() )
1129 updateItem ( mitem ); 1129 updateItem ( mitem );
1130 mitem = (MonthViewItem *)mitem->next(); 1130 mitem = (MonthViewItem *)mitem->next();
1131 } 1131 }
1132} 1132}
1133// returns true if no inc found 1133// returns true if no inc found
1134bool MonthViewCell::doHighLight( Incidence * inc ) 1134bool MonthViewCell::doHighLight( Incidence * inc )
1135{ 1135{
1136 1136
1137 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 1137 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
1138 while ( mitem ) { 1138 while ( mitem ) {
1139 if ( mitem->incidence() == inc ) { 1139 if ( mitem->incidence() == inc ) {
1140 if ( mitem->setHighlighted( inc ) ) 1140 if ( mitem->setHighlighted( inc ) )
1141 updateItem ( mitem ); 1141 updateItem ( mitem );
1142 return false; 1142 return false;
1143 } 1143 }
1144 mitem = (MonthViewItem *)mitem->next(); 1144 mitem = (MonthViewItem *)mitem->next();
1145 } 1145 }
1146 return true; 1146 return true;
1147} 1147}
1148// ******************************************************************************* 1148// *******************************************************************************
1149// ******************************************************************************* 1149// *******************************************************************************
1150// ******************************************************************************* 1150// *******************************************************************************
1151 1151
1152 1152
1153KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 1153KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1154 : KOEventView( calendar, parent, name ), 1154 : KOEventView( calendar, parent, name ),
1155 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 1155 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
1156 mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 1156 mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
1157{ 1157{
1158 mFlagKeyPressed = false; 1158 mFlagKeyPressed = false;
1159 mShortDayLabelsM = false; 1159 mShortDayLabelsM = false;
1160 mShortDayLabelsW = false; 1160 mShortDayLabelsW = false;
1161 skipResize = false; 1161 skipResize = false;
1162 clPending = true; 1162 clPending = true;
1163 mPopupCell = 0; 1163 mPopupCell = 0;
1164 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); 1164 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
1165 mWidStack = new QWidgetStack( this ); 1165 mWidStack = new QWidgetStack( this );
1166 QVBoxLayout* hb = new QVBoxLayout( this ); 1166 QVBoxLayout* hb = new QVBoxLayout( this );
1167 mMonthView = new QWidget( mWidStack ); 1167 mMonthView = new QWidget( mWidStack );
1168 mWeekView = new QWidget( mWidStack ); 1168 mWeekView = new QWidget( mWidStack );
1169#if QT_VERSION >= 0x030000 1169#if QT_VERSION >= 0x030000
1170 mWidStack->addWidget(mMonthView ); 1170 mWidStack->addWidget(mMonthView );
1171 mWidStack->addWidget(mWeekView ); 1171 mWidStack->addWidget(mWeekView );
1172#else 1172#else
1173 mWidStack->addWidget( mMonthView, 1 ); 1173 mWidStack->addWidget( mMonthView, 1 );
1174 mWidStack->addWidget( mWeekView , 1 ); 1174 mWidStack->addWidget( mWeekView , 1 );
1175#endif 1175#endif
1176 hb->addWidget( mNavigatorBar ); 1176 hb->addWidget( mNavigatorBar );
1177 hb->addWidget( mWidStack ); 1177 hb->addWidget( mWidStack );
1178 mShowWeekView = KOPrefs::instance()->mMonthViewWeek; 1178 mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
1179 updatePossible = false; 1179 updatePossible = false;
1180 //updatePossible = true; 1180 //updatePossible = true;
1181 mCells.setAutoDelete( true ); 1181 mCells.setAutoDelete( true );
1182 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 1182 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
1183 mDayLabels.resize( mDaysPerWeek ); 1183 mDayLabels.resize( mDaysPerWeek );
1184 mDayLabelsW.resize( mDaysPerWeek ); 1184 mDayLabelsW.resize( mDaysPerWeek );
1185 QFont bfont = font(); 1185 QFont bfont = font();
1186 if ( QApplication::desktop()->width() < 650 ) { 1186 if ( QApplication::desktop()->width() < 650 ) {
1187 bfont.setPointSize( bfont.pointSize() - 2 ); 1187 bfont.setPointSize( bfont.pointSize() - 2 );
1188 } 1188 }
1189 bfont.setBold( true ); 1189 bfont.setBold( true );
1190 int i; 1190 int i;
1191 1191
1192 for( i = 0; i < mDaysPerWeek; i++ ) { 1192 for( i = 0; i < mDaysPerWeek; i++ ) {
1193 QLabel *label = new QLabel( mMonthView ); 1193 QLabel *label = new QLabel( mMonthView );
1194 label->setFont(bfont); 1194 label->setFont(bfont);
1195 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1195 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1196 label->setLineWidth(1); 1196 label->setLineWidth(1);
1197 label->setAlignment(AlignCenter); 1197 label->setAlignment(AlignCenter);
1198 mDayLabels.insert( i, label ); 1198 mDayLabels.insert( i, label );
1199 label = new QLabel( mWeekView ); 1199 label = new QLabel( mWeekView );
1200 label->setFont(bfont); 1200 label->setFont(bfont);
1201 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1201 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1202 label->setLineWidth(1); 1202 label->setLineWidth(1);
1203 label->setAlignment(AlignCenter); 1203 label->setAlignment(AlignCenter);
1204 mDayLabelsW.insert( i, label ); 1204 mDayLabelsW.insert( i, label );
1205 } 1205 }
1206 1206
1207 bfont.setBold( false ); 1207 bfont.setBold( false );
1208 mWeekLabels.resize( mNumWeeks+1 ); 1208 mWeekLabels.resize( mNumWeeks+1 );
1209 mWeekLabelsW.resize( 2 ); 1209 mWeekLabelsW.resize( 2 );
1210 for( i = 0; i < mNumWeeks+1; i++ ) { 1210 for( i = 0; i < mNumWeeks+1; i++ ) {
1211 KOWeekButton *label = new KOWeekButton( mMonthView ); 1211 KOWeekButton *label = new KOWeekButton( mMonthView );
1212 label->setFocusPolicy(NoFocus); 1212 label->setFocusPolicy(NoFocus);
1213 label->setFont(bfont); 1213 label->setFont(bfont);
1214 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 1214 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
1215 label->setFlat(true); 1215 label->setFlat(true);
1216 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 1216 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
1217 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1217 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1218 //label->setLineWidth(1); 1218 //label->setLineWidth(1);
1219 //label->setAlignment(AlignCenter); 1219 //label->setAlignment(AlignCenter);
1220 mWeekLabels.insert( i, label ); 1220 mWeekLabels.insert( i, label );
1221 } 1221 }
1222 mWeekLabels[mNumWeeks]->setText( i18n("W")); 1222 mWeekLabels[mNumWeeks]->setText( i18n("W"));
1223 mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); 1223 mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus);
1224 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 1224 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
1225 1225
1226 for( i = 0; i < 1+1; i++ ) { 1226 for( i = 0; i < 1+1; i++ ) {
1227 KOWeekButton *label = new KOWeekButton( mWeekView ); 1227 KOWeekButton *label = new KOWeekButton( mWeekView );
1228 label->setFocusPolicy(NoFocus); 1228 label->setFocusPolicy(NoFocus);
1229 label->setFont(bfont); 1229 label->setFont(bfont);
1230 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 1230 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
1231 label->setFlat(true); 1231 label->setFlat(true);
1232 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 1232 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
1233 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1233 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1234 //label->setLineWidth(1); 1234 //label->setLineWidth(1);
1235 //label->setAlignment(AlignCenter); 1235 //label->setAlignment(AlignCenter);
1236 mWeekLabelsW.insert( i, label ); 1236 mWeekLabelsW.insert( i, label );
1237 } 1237 }
1238 mWeekLabelsW[1]->setText( i18n("W")); 1238 mWeekLabelsW[1]->setText( i18n("W"));
1239 mWeekLabelsW[1]->setFocusPolicy(WheelFocus); 1239 mWeekLabelsW[1]->setFocusPolicy(WheelFocus);
1240 1240
1241 1241
1242 int row, col; 1242 int row, col;
1243 mCells.resize( mNumCells ); 1243 mCells.resize( mNumCells );
1244 for( row = 0; row < mNumWeeks; ++row ) { 1244 for( row = 0; row < mNumWeeks; ++row ) {
1245 for( col = 0; col < mDaysPerWeek; ++col ) { 1245 for( col = 0; col < mDaysPerWeek; ++col ) {
1246 MonthViewCell *cell = new MonthViewCell( this, mMonthView ); 1246 MonthViewCell *cell = new MonthViewCell( this, mMonthView );
1247 mCells.insert( row * mDaysPerWeek + col, cell ); 1247 mCells.insert( row * mDaysPerWeek + col, cell );
1248 1248
1249 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 1249 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
1250 SLOT( defaultAction( Incidence * ) ) ); 1250 SLOT( defaultAction( Incidence * ) ) );
1251 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 1251 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
1252 SIGNAL( newEventSignal( QDateTime ) ) ); 1252 SIGNAL( newEventSignal( QDateTime ) ) );
1253 connect( cell, SIGNAL( showDaySignal( QDate ) ), 1253 connect( cell, SIGNAL( showDaySignal( QDate ) ),
1254 SIGNAL( showDaySignal( QDate ) ) ); 1254 SIGNAL( showDaySignal( QDate ) ) );
1255 connect( cell, SIGNAL( nextCell() ), 1255 connect( cell, SIGNAL( nextCell() ),
1256 SLOT( nextCell() ) ); 1256 SLOT( nextCell() ) );
1257 connect( cell, SIGNAL( prevCell() ), 1257 connect( cell, SIGNAL( prevCell() ),
1258 SLOT( prevCell() ) ); 1258 SLOT( prevCell() ) );
1259 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ), 1259 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ),
1260 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) )); 1260 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) ));
1261 } 1261 }
1262 } 1262 }
1263 mCellsW.resize( mDaysPerWeek ); 1263 mCellsW.resize( mDaysPerWeek );
1264 for( col = 0; col < mDaysPerWeek; ++col ) { 1264 for( col = 0; col < mDaysPerWeek; ++col ) {
1265 MonthViewCell *cell = new MonthViewCell( this, mWeekView ); 1265 MonthViewCell *cell = new MonthViewCell( this, mWeekView );
1266 mCellsW.insert( col, cell ); 1266 mCellsW.insert( col, cell );
1267 1267
1268 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 1268 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
1269 SLOT( defaultAction( Incidence * ) ) ); 1269 SLOT( defaultAction( Incidence * ) ) );
1270 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 1270 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
1271 SIGNAL( newEventSignal( QDateTime ) ) ); 1271 SIGNAL( newEventSignal( QDateTime ) ) );
1272 connect( cell, SIGNAL( showDaySignal( QDate ) ), 1272 connect( cell, SIGNAL( showDaySignal( QDate ) ),
1273 SIGNAL( showDaySignal( QDate ) ) ); 1273 SIGNAL( showDaySignal( QDate ) ) );
1274 connect( cell, SIGNAL( nextCell() ), 1274 connect( cell, SIGNAL( nextCell() ),
1275 SLOT( nextCell() ) ); 1275 SLOT( nextCell() ) );
1276 connect( cell, SIGNAL( prevCell() ), 1276 connect( cell, SIGNAL( prevCell() ),
1277 SLOT( prevCell() ) ); 1277 SLOT( prevCell() ) );
1278 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ), 1278 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ),
1279 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) )); 1279 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) ));
1280 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); 1280 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont );
1281 } 1281 }
1282 1282
1283 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 1283 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
1284 mContextMenu = eventPopup(); 1284 mContextMenu = eventPopup();
1285 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1285 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1286 i18n("New Event..."),this, 1286 i18n("New Event..."),this,
1287 SLOT(slotNewEvent()),false); 1287 SLOT(slotNewEvent()),false);
1288 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1288 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1289 i18n("New Todo..."),this, 1289 i18n("New Todo..."),this,
1290 SLOT(slotNewTodo()),false); 1290 SLOT(slotNewTodo()),false);
1291 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1291 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1292 i18n("Journal"),this, 1292 i18n("Journal"),this,
1293 SLOT(slotEditJournal()),false); 1293 SLOT(slotEditJournal()),false);
1294 1294
1295 1295
1296 1296
1297 QString pathString = ""; 1297 QString pathString = "";
1298 if ( !KOPrefs::instance()->mToolBarMiniIcons ) { 1298 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
1299 if ( QApplication::desktop()->width() < 480 ) 1299 if ( QApplication::desktop()->width() < 480 )
1300 pathString += "icons16/"; 1300 pathString += "icons16/";
1301 } else 1301 } else
1302 pathString += "iconsmini/"; 1302 pathString += "iconsmini/";
1303 mNewItemMenu = new QPopupMenu( this ); 1303 mNewItemMenu = new QPopupMenu( this );
1304 mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); 1304 mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
1305 mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); 1305 mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
1306 mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); 1306 mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
1307 1307
1308 // updateConfig(); //useless here... 1308 // updateConfig(); //useless here...
1309 // ... but we need mWidthLongDayLabel computed 1309 // ... but we need mWidthLongDayLabel computed
1310 QFontMetrics fontmetric(mDayLabels[0]->font()); 1310 QFontMetrics fontmetric(mDayLabels[0]->font());
1311 mWidthLongDayLabel = 0; 1311 mWidthLongDayLabel = 0;
1312 for (int i = 0; i < 7; i++) { 1312 for (int i = 0; i < 7; i++) {
1313 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 1313 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
1314 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 1314 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
1315 } 1315 }
1316 1316
1317 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 1317 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
1318 1318
1319#if 0 1319#if 0
1320 if ( mShowWeekView ) 1320 if ( mShowWeekView )
1321 mWidStack->raiseWidget( mWeekView ); 1321 mWidStack->raiseWidget( mWeekView );
1322 else 1322 else
1323 mWidStack->raiseWidget( mMonthView ); 1323 mWidStack->raiseWidget( mMonthView );
1324#endif 1324#endif
1325 1325
1326 emit incidenceSelected( 0 ); 1326 emit incidenceSelected( 0 );
1327 1327
1328 mComputeLayoutTimer = new QTimer( this ); 1328 mComputeLayoutTimer = new QTimer( this );
1329 connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout())); 1329 connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout()));
1330 1330
1331 1331
1332#ifndef DESKTOP_VERSION 1332#ifndef DESKTOP_VERSION
1333 resize( QApplication::desktop()->size() ); 1333 resize( QApplication::desktop()->size() );
1334#else 1334#else
1335 resize(640, 480 ); 1335 resize(640, 480 );
1336 updatePossible = true; 1336 updatePossible = true;
1337#endif 1337#endif
1338 computeLayout(); 1338 computeLayout();
1339 1339
1340 if ( mShowWeekView ) 1340 if ( mShowWeekView )
1341 mWidStack->raiseWidget( mWeekView ); 1341 mWidStack->raiseWidget( mWeekView );
1342 else 1342 else
1343 mWidStack->raiseWidget( mMonthView ); 1343 mWidStack->raiseWidget( mMonthView );
1344} 1344}
1345 1345
1346KOMonthView::~KOMonthView() 1346KOMonthView::~KOMonthView()
1347{ 1347{
1348 delete mContextMenu; 1348 delete mContextMenu;
1349} 1349}
1350 1350
1351void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday ) 1351void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday )
1352{ 1352{
1353 static Incidence * lastInc = 0; 1353 static Incidence * lastInc = 0;
1354 static MonthViewCell * lastCell = 0; 1354 static MonthViewCell * lastCell = 0;
1355 1355
1356 if ( lastInc == inc && lastCell == mc ) 1356 if ( lastInc == inc && lastCell == mc )
1357 return; 1357 return;
1358 lastInc = inc; 1358 lastInc = inc;
1359 lastCell = mc; 1359 lastCell = mc;
1360 //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday ); 1360 //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
1361 1361
1362 bool weekview = false; 1362 bool weekview = false;
1363 int index = 0; 1363 int index = 0;
1364 for (uint i = 0; i < mCellsW.count(); ++i) { 1364 for (uint i = 0; i < mCellsW.count(); ++i) {
1365 if ( mCellsW[i] == mc ) { 1365 if ( mCellsW[i] == mc ) {
1366 weekview = true; 1366 weekview = true;
1367 index = i; 1367 index = i;
1368 break; 1368 break;
1369 } 1369 }
1370 } 1370 }
1371 QPtrVector<MonthViewCell> *cells; 1371 QPtrVector<MonthViewCell> *cells;
1372 if ( weekview ) 1372 if ( weekview )
1373 cells = &mCellsW; 1373 cells = &mCellsW;
1374 else { 1374 else {
1375 for (uint i = 0; i < mCells.count(); ++i) { 1375 for (uint i = 0; i < mCells.count(); ++i) {
1376 if ( mCells[i] == mc ) { 1376 if ( mCells[i] == mc ) {
1377 index = i; 1377 index = i;
1378 break; 1378 break;
1379 } 1379 }
1380 } 1380 }
1381 cells = &mCells; 1381 cells = &mCells;
1382 } 1382 }
1383 for (uint i = 0; i < (*cells).count(); ++i) { 1383 for (uint i = 0; i < (*cells).count(); ++i) {
1384 (*cells)[i]->deHighLight(); 1384 (*cells)[i]->deHighLight();
1385 } 1385 }
1386 if ( ! inc ) 1386 if ( ! inc )
1387 return; 1387 return;
1388 1388
1389 int count = (*cells).count(); 1389 int count = (*cells).count();
1390 bool goLeft = (mday > 1 && index > 0); 1390 bool goLeft = (mday > 1 && index > 0);
1391 bool goRight = (mday < 3 && mday > 0 && index < count -1); 1391 bool goRight = (mday < 3 && mday > 0 && index < count -1);
1392 for (uint iii = 1; iii < count; ++iii) { 1392 for (uint iii = 1; iii < count; ++iii) {
1393 if ( goLeft ) { 1393 if ( goLeft ) {
1394 int left = index - iii; 1394 int left = index - iii;
1395 if ( left >= 0 ) { 1395 if ( left >= 0 ) {
1396 if ( (*cells)[(uint)left]->doHighLight(inc) ) 1396 if ( (*cells)[(uint)left]->doHighLight(inc) )
1397 goLeft = false; 1397 goLeft = false;
1398 } else 1398 } else
1399 goLeft = false; 1399 goLeft = false;
1400 } 1400 }
1401 if ( goRight ) { 1401 if ( goRight ) {
1402 int right = index + iii; 1402 int right = index + iii;
1403 if ( right < count ) { 1403 if ( right < count ) {
1404 if ( (*cells)[right]->doHighLight(inc) ) 1404 if ( (*cells)[right]->doHighLight(inc) )
1405 goRight = false; 1405 goRight = false;
1406 1406
1407 } else 1407 } else
1408 goRight = false; 1408 goRight = false;
1409 } 1409 }
1410 1410
1411 } 1411 }
1412#if 0 1412#if 0
1413 if ( mday > 1 && index > 0 ) 1413 if ( mday > 1 && index > 0 )
1414 for (int i = index-1; i >= 0; --i) { 1414 for (int i = index-1; i >= 0; --i) {
1415 //qDebug("index %d iii %d ", index, i); 1415 //qDebug("index %d iii %d ", index, i);
1416 if ( (*cells)[(uint)i]->doHighLight(inc) ) 1416 if ( (*cells)[(uint)i]->doHighLight(inc) )
1417 break; 1417 break;
1418 } 1418 }
1419 if ( mday < 3 && mday > 0 && index < (*cells).count()-1) 1419 if ( mday < 3 && mday > 0 && index < (*cells).count()-1)
1420 for (uint i = index+1; i < (*cells).count(); ++i) { 1420 for (uint i = index+1; i < (*cells).count(); ++i) {
1421 if ( (*cells)[i]->doHighLight(inc) ) 1421 if ( (*cells)[i]->doHighLight(inc) )
1422 break; 1422 break;
1423 } 1423 }
1424#endif 1424#endif
1425 1425
1426} 1426}
1427void KOMonthView::selectInternalWeekNum ( int n ) 1427void KOMonthView::selectInternalWeekNum ( int n )
1428{ 1428{
1429 switchView(); 1429 switchView();
1430 if ( !KOPrefs::instance()->mMonthViewWeek ) 1430 if ( !KOPrefs::instance()->mMonthViewWeek )
1431 emit selectMonth (); 1431 emit selectMonth ();
1432 else 1432 else
1433 emit selectWeekNum ( n ); 1433 emit selectWeekNum ( n );
1434} 1434}
1435 1435
1436int KOMonthView::currentWeek() 1436int KOMonthView::currentWeek()
1437{ 1437{
1438 if ( mShowWeekView ) 1438 if ( mShowWeekView )
1439 return mWeekLabelsW[0]->getWeekNum(); 1439 return mWeekLabelsW[0]->getWeekNum();
1440 return mWeekLabels[0]->getWeekNum(); 1440 return mWeekLabels[0]->getWeekNum();
1441} 1441}
1442void KOMonthView::switchView() 1442void KOMonthView::switchView()
1443{ 1443{
1444 if ( selectedCell( ) ) 1444 if ( selectedCell( ) )
1445 selectedCell()->deselect(); 1445 selectedCell()->deselect();
1446 mShowWeekView = !mShowWeekView; 1446 mShowWeekView = !mShowWeekView;
1447 KOPrefs::instance()->mMonthViewWeek = mShowWeekView; 1447 KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
1448 if ( clPending ) { 1448 if ( clPending ) {
1449 computeLayout(); 1449 computeLayout();
1450 updateConfig(); 1450 updateConfig();
1451 } 1451 }
1452 if ( mShowWeekView ) 1452 if ( mShowWeekView )
1453 mWidStack->raiseWidget( mWeekView ); 1453 mWidStack->raiseWidget( mWeekView );
1454 else 1454 else
1455 mWidStack->raiseWidget( mMonthView ); 1455 mWidStack->raiseWidget( mMonthView );
1456 clPending = false; 1456 clPending = false;
1457} 1457}
1458 1458
1459int KOMonthView::maxDatesHint() 1459int KOMonthView::maxDatesHint()
1460{ 1460{
1461 return mNumCells; 1461 return mNumCells;
1462} 1462}
1463 1463
1464int KOMonthView::currentDateCount() 1464int KOMonthView::currentDateCount()
1465{ 1465{
1466 return mNumCells; 1466 return mNumCells;
1467} 1467}
1468 1468
1469QPtrList<Incidence> KOMonthView::selectedIncidences() 1469QPtrList<Incidence> KOMonthView::selectedIncidences()
1470{ 1470{
1471 QPtrList<Incidence> selected; 1471 QPtrList<Incidence> selected;
1472 1472
1473 if ( mSelectedCell ) { 1473 if ( mSelectedCell ) {
1474 Incidence *incidence = mSelectedCell->selectedIncidence(); 1474 Incidence *incidence = mSelectedCell->selectedIncidence();
1475 if ( incidence ) selected.append( incidence ); 1475 if ( incidence ) selected.append( incidence );
1476 } 1476 }
1477 1477
1478 return selected; 1478 return selected;
1479} 1479}
1480 1480
1481DateList KOMonthView::selectedDates() 1481DateList KOMonthView::selectedDates()
1482{ 1482{
1483 DateList selected; 1483 DateList selected;
1484 1484
1485 if ( mSelectedCell ) { 1485 if ( mSelectedCell ) {
1486 QDate qd = mSelectedCell->selectedIncidenceDate(); 1486 QDate qd = mSelectedCell->selectedIncidenceDate();
1487 if ( qd.isValid() ) selected.append( qd ); 1487 if ( qd.isValid() ) selected.append( qd );
1488 } 1488 }
1489 1489
1490 return selected; 1490 return selected;
1491} 1491}
1492 1492
1493void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1493void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1494 const QDate &td) 1494 const QDate &td)
1495{ 1495{
1496#ifndef KORG_NOPRINTER 1496#ifndef KORG_NOPRINTER
1497 calPrinter->preview(CalPrinter::Month, fd, td); 1497 calPrinter->preview(CalPrinter::Month, fd, td);
1498#endif 1498#endif
1499} 1499}
1500 1500
1501void KOMonthView::updateConfig() 1501void KOMonthView::updateConfig()
1502{ 1502{
1503 1503
1504 int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 1504 int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
1505 1505
1506 if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) { 1506 if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
1507 mWeekStartsMonday = true; 1507 mWeekStartsMonday = true;
1508 } 1508 }
1509 QFontMetrics fontmetric(mDayLabels[0]->font()); 1509 QFontMetrics fontmetric(mDayLabels[0]->font());
1510 mWidthLongDayLabel = 0; 1510 mWidthLongDayLabel = 0;
1511 1511
1512 for (int i = 0; i < 7; i++) { 1512 for (int i = 0; i < 7; i++) {
1513 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 1513 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
1514 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 1514 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
1515 } 1515 }
1516 bool temp = mShowSatSunComp ; 1516 bool temp = mShowSatSunComp ;
1517 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 1517 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
1518 if ( ! mShowWeekView ) { 1518 if ( ! mShowWeekView ) {
1519 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) 1519 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
1520 computeLayout(); 1520 computeLayout();
1521 } 1521 }
1522 updateDayLabels(); 1522 updateDayLabels();
1523 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 1523 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
1524 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 1524 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
1525 //resizeEvent( 0 ); 1525 //resizeEvent( 0 );
1526 for (uint i = 0; i < mCells.count(); ++i) { 1526 for (uint i = 0; i < mCells.count(); ++i) {
1527 mCells[i]->updateConfig(); 1527 mCells[i]->updateConfig();
1528 } 1528 }
1529 1529
1530 for (uint i = 0; i < mCellsW.count(); ++i) { 1530 for (uint i = 0; i < mCellsW.count(); ++i) {
1531 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); 1531 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont);
1532 } 1532 }
1533#ifdef DESKTOP_VERSION 1533#ifdef DESKTOP_VERSION
1534 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 1534 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
1535#endif 1535#endif
1536 updateView(); 1536 updateView();
1537} 1537}
1538 1538
1539void KOMonthView::updateDayLabels() 1539void KOMonthView::updateDayLabels()
1540{ 1540{
1541 1541
1542 QPtrVector<QLabel> *mDayLabelsT; 1542 QPtrVector<QLabel> *mDayLabelsT;
1543 1543
1544 mDayLabelsT = &mDayLabelsW; 1544 mDayLabelsT = &mDayLabelsW;
1545 for (int i = 0; i < 7; i++) { 1545 for (int i = 0; i < 7; i++) {
1546 { 1546 {
1547 bool show = mShortDayLabelsW; 1547 bool show = mShortDayLabelsW;
1548 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) 1548 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
1549 show = true; 1549 show = true;
1550 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 1550 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
1551 } 1551 }
1552 } 1552 }
1553 mDayLabelsT = &mDayLabels; 1553 mDayLabelsT = &mDayLabels;
1554 for (int i = 0; i < 7; i++) { 1554 for (int i = 0; i < 7; i++) {
1555 if (KGlobal::locale()->weekStartsMonday() || KOPrefs::instance()->mMonthViewSatSunTog ) { 1555 if (KGlobal::locale()->weekStartsMonday() || KOPrefs::instance()->mMonthViewSatSunTog ) {
1556 bool show = mShortDayLabelsM; 1556 bool show = mShortDayLabelsM;
1557 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) 1557 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
1558 show = true; 1558 show = true;
1559 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 1559 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
1560 } else { 1560 } else {
1561 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM)); 1561 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM));
1562 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM)); 1562 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM));
1563 1563
1564 } 1564 }
1565 } 1565 }
1566 1566
1567} 1567}
1568 1568
1569void KOMonthView::clearList() 1569void KOMonthView::clearList()
1570{ 1570{
1571 unsigned int i; 1571 unsigned int i;
1572 for( i = 0; i < mCells.size(); ++i ) { 1572 for( i = 0; i < mCells.size(); ++i ) {
1573 mCells[i]->clear(); 1573 mCells[i]->clear();
1574 } 1574 }
1575 for( i = 0; i < mCellsW.size(); ++i ) { 1575 for( i = 0; i < mCellsW.size(); ++i ) {
1576 mCellsW[i]->clear(); 1576 mCellsW[i]->clear();
1577 } 1577 }
1578} 1578}
1579void KOMonthView::showDates(const QDate &start, const QDate &) 1579void KOMonthView::showDates(const QDate &start, const QDate &)
1580{ 1580{
1581 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; 1581 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
1582 1582
1583 QPtrVector<MonthViewCell> *cells; 1583 QPtrVector<MonthViewCell> *cells;
1584 QPtrVector<QLabel> *dayLabels; 1584 QPtrVector<QLabel> *dayLabels;
1585 QPtrVector<KOWeekButton> *weekLabels; 1585 QPtrVector<KOWeekButton> *weekLabels;
1586 int weekNum = 6; 1586 int weekNum = 6;
1587 mStartDate = start; 1587 mStartDate = start;
1588 if ( mShowWeekView ) { 1588 if ( mShowWeekView ) {
1589 weekNum = 1; 1589 weekNum = 1;
1590 cells = &mCellsW; 1590 cells = &mCellsW;
1591 dayLabels = &mDayLabelsW; 1591 dayLabels = &mDayLabelsW;
1592 weekLabels = &mWeekLabelsW; 1592 weekLabels = &mWeekLabelsW;
1593 if ( !KGlobal::locale()->weekStartsMonday() ) { 1593 if ( !KGlobal::locale()->weekStartsMonday() ) {
1594 mStartDate = mStartDate.addDays( 1 ); 1594 mStartDate = mStartDate.addDays( 1 );
1595 } 1595 }
1596 } else { 1596 } else {
1597 cells = &mCells; 1597 cells = &mCells;
1598 dayLabels = &mDayLabels; 1598 dayLabels = &mDayLabels;
1599 weekLabels = &mWeekLabels; 1599 weekLabels = &mWeekLabels;
1600 } 1600 }
1601 1601
1602 int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 1602 int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
1603 1603
1604 if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) { 1604 if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
1605 mWeekStartsMonday = true; 1605 mWeekStartsMonday = true;
1606 } 1606 }
1607 int startWeekDay = mWeekStartsMonday ? 1 : 7; 1607 int startWeekDay = mWeekStartsMonday ? 1 : 7;
1608 1608
1609 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { 1609 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
1610 mStartDate = mStartDate.addDays( -1 ); 1610 mStartDate = mStartDate.addDays( -1 );
1611 } 1611 }
1612 bool primary = false; 1612 bool primary = false;
1613 uint i; 1613 uint i;
1614 for( i = 0; i < (*cells).size(); ++i ) { 1614 for( i = 0; i < (*cells).size(); ++i ) {
1615 QDate date = mStartDate.addDays( i ); 1615 QDate date = mStartDate.addDays( i );
1616 (*cells)[i]->setDate( date ); 1616 (*cells)[i]->setDate( date );
1617 1617
1618#ifndef KORG_NOPLUGINS 1618#ifndef KORG_NOPLUGINS
1619 // add holiday, if present 1619 // add holiday, if present
1620 QString hstring(KOCore::self()->holiday(date)); 1620 QString hstring(KOCore::self()->holiday(date));
1621 (*cells)[i]->setHoliday( hstring ); 1621 (*cells)[i]->setHoliday( hstring );
1622#endif 1622#endif
1623 1623
1624 } 1624 }
1625 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); 1625 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 );
1626 for( i = 0; i < weekNum; ++i ) { 1626 for( i = 0; i < weekNum; ++i ) {
1627 int wno; 1627 int wno;
1628 // remember, according to ISO 8601, the first week of the year is the 1628 // remember, according to ISO 8601, the first week of the year is the
1629 // first week that contains a thursday. Thus we must subtract off 4, 1629 // first week that contains a thursday. Thus we must subtract off 4,
1630 // not just 1. 1630 // not just 1.
1631 int dayOfYear = date.dayOfYear(); 1631 int dayOfYear = date.dayOfYear();
1632 if (dayOfYear % 7 != 0) 1632 if (dayOfYear % 7 != 0)
1633 wno = dayOfYear / 7 + 1; 1633 wno = dayOfYear / 7 + 1;
1634 else 1634 else
1635 wno =dayOfYear / 7; 1635 wno =dayOfYear / 7;
1636 (*weekLabels)[i]->setWeekNum( wno ); 1636 (*weekLabels)[i]->setWeekNum( wno );
1637 date = date.addDays( 7 ); 1637 date = date.addDays( 7 );
1638 } 1638 }
1639 updateView(); 1639 updateView();
1640} 1640}
1641 1641
1642void KOMonthView::showEvents(QPtrList<Event>) 1642void KOMonthView::showEvents(QPtrList<Event>)
1643{ 1643{
1644 qDebug("KOMonthView::selectEvents is not implemented yet. "); 1644 qDebug("KOMonthView::selectEvents is not implemented yet. ");
1645} 1645}
1646 1646
1647void KOMonthView::changeEventDisplay(Event *, int) 1647void KOMonthView::changeEventDisplay(Event *, int)
1648{ 1648{
1649 // this should be re-written to be much more efficient, but this 1649 // this should be re-written to be much more efficient, but this
1650 // quick-and-dirty-hack gets the job done for right now. 1650 // quick-and-dirty-hack gets the job done for right now.
1651 //qDebug("KOMonthView::changeEventDisplay "); 1651 //qDebug("KOMonthView::changeEventDisplay ");
1652 updateView(); 1652 updateView();
1653} 1653}
1654 1654
1655void KOMonthView::updateView() 1655void KOMonthView::updateView()
1656{ 1656{
1657 1657
1658 if ( !updatePossible ) 1658 if ( !updatePossible )
1659 return; 1659 return;
1660 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); 1660 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU ");
1661 //QTime ti; 1661 //QTime ti;
1662 //ti.start(); 1662 //ti.start();
1663 clearSelection(); 1663 clearSelection();
1664 QPtrVector<MonthViewCell> *cells; 1664 QPtrVector<MonthViewCell> *cells;
1665 if ( mShowWeekView ) { 1665 if ( mShowWeekView ) {
1666 cells = &mCellsW; 1666 cells = &mCellsW;
1667 } else { 1667 } else {
1668 cells = &mCells; 1668 cells = &mCells;
1669 } 1669 }
1670#if 1 1670#if 1
1671 int i; 1671 int i;
1672 int timeSpan = (*cells).size()-1; 1672 int timeSpan = (*cells).size()-1;
1673 if ( KOPrefs::instance()->mMonthViewWeek ) 1673 if ( KOPrefs::instance()->mMonthViewWeek )
1674 timeSpan = 6; 1674 timeSpan = 6;
1675 for( i = 0; i < timeSpan + 1; ++i ) { 1675 for( i = 0; i < timeSpan + 1; ++i ) {
1676 (*cells)[i]->startUpdateCell(); 1676 (*cells)[i]->startUpdateCell();
1677 } 1677 }
1678 1678
1679 QPtrList<Event> events = calendar()->events(); 1679 QPtrList<Event> events = calendar()->events();
1680 Event *event; 1680 Event *event;
1681 QDateTime dt; 1681 QDateTime dt;
1682 bool ok; 1682 bool ok;
1683 QDate endDate = mStartDate.addDays( timeSpan ); 1683 QDate endDate = mStartDate.addDays( timeSpan );
1684 for( event = events.first(); event; event = events.next() ) { // for event 1684 for( event = events.first(); event; event = events.next() ) { // for event
1685 if ( event->doesRecur() ) { 1685 if ( event->doesRecur() ) {
1686 bool last; 1686 bool last;
1687 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); 1687 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
1688 QDateTime incidenceEnd; 1688 QDateTime incidenceEnd;
1689 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); 1689 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
1690 bool invalid = false; 1690 bool invalid = false;
1691 while( true ) { 1691 while( true ) {
1692 if ( incidenceStart.isValid() ) { 1692 if ( incidenceStart.isValid() ) {
1693 incidenceEnd = incidenceStart.addDays( eventlen ); 1693 incidenceEnd = incidenceStart.addDays( eventlen );
1694 int st = incidenceStart.date().daysTo( endDate ); 1694 int st = incidenceStart.date().daysTo( endDate );
1695 if ( st >= 0 ) { // start before timeend 1695 if ( st >= 0 ) { // start before timeend
1696 int end = mStartDate.daysTo( incidenceEnd.date() ); 1696 int end = mStartDate.daysTo( incidenceEnd.date() );
1697 if ( end >= 0 ) { // end after timestart --- got one! 1697 if ( end >= 0 ) { // end after timestart --- got one!
1698 //normalize 1698 //normalize
1699 st = timeSpan - st; 1699 st = timeSpan - st;
1700 if ( st < 0 ) st = 0; 1700 if ( st < 0 ) st = 0;
1701 if ( end > timeSpan ) end = timeSpan; 1701 if ( end > timeSpan ) end = timeSpan;
1702 int iii; 1702 int iii;
1703 //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); 1703 //qDebug("found %s %d %d ",event->summary().latin1(), st, end );
1704 for ( iii = st;iii<= end;++iii) 1704 for ( iii = st;iii<= end;++iii)
1705 (*cells)[iii]->insertEvent( event ); 1705 (*cells)[iii]->insertEvent( event );
1706 } 1706 }
1707 } 1707 }
1708 } else { 1708 } else {
1709 if ( invalid ) 1709 if ( invalid )
1710 break; 1710 break;
1711 invalid = true; 1711 invalid = true;
1712 //qDebug("invalid %s", event->summary().latin1()); 1712 //qDebug("invalid %s", event->summary().latin1());
1713 incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; 1713 incidenceStart = QDateTime( mStartDate ).addSecs( -2 );;
1714 } 1714 }
1715 if ( last ) 1715 if ( last )
1716 break; 1716 break;
1717 bool ok; 1717 bool ok;
1718 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); 1718 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok );
1719 if ( ! ok ) 1719 if ( ! ok )
1720 break; 1720 break;
1721 if ( incidenceStart.date() > endDate ) 1721 if ( incidenceStart.date() > endDate )
1722 break; 1722 break;
1723 } 1723 }
1724 } else { // no recur 1724 } else { // no recur
1725 if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) 1725 if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
1726 if ( event->uid().left(15) == QString("last-syncEvent-") ) 1726 if ( event->uid().left(15) == QString("last-syncEvent-") )
1727 continue; 1727 continue;
1728 int st = event->dtStart().date().daysTo( endDate ); 1728 int st = event->dtStart().date().daysTo( endDate );
1729 if ( st >= 0 ) { // start before timeend 1729 if ( st >= 0 ) { // start before timeend
1730 int end = mStartDate.daysTo( event->dtEnd().date() ); 1730 int end = mStartDate.daysTo( event->dtEnd().date() );
1731 if ( end >= 0 ) { // end after timestart --- got one! 1731 if ( end >= 0 ) { // end after timestart --- got one!
1732 //normalize 1732 //normalize
1733 st = timeSpan - st; 1733 st = timeSpan - st;
1734 if ( st < 0 ) st = 0; 1734 if ( st < 0 ) st = 0;
1735 if ( end > timeSpan ) end = timeSpan; 1735 if ( end > timeSpan ) end = timeSpan;
1736 int iii; 1736 int iii;
1737 for ( iii = st;iii<= end;++iii) 1737 for ( iii = st;iii<= end;++iii)
1738 (*cells)[iii]->insertEvent( event ); 1738 (*cells)[iii]->insertEvent( event );
1739 } 1739 }
1740 } 1740 }
1741 } 1741 }
1742 } 1742 }
1743 // insert due todos 1743 // insert due todos
1744 QPtrList<Todo> todos = calendar()->todos( ); 1744 QPtrList<Todo> todos = calendar()->todos( );
1745 Todo *todo; 1745 Todo *todo;
1746 for(todo = todos.first(); todo; todo = todos.next()) { 1746 for(todo = todos.first(); todo; todo = todos.next()) {
1747 //insertTodo( todo ); 1747 //insertTodo( todo );
1748 if ( todo->hasDueDate() ) { 1748 if ( todo->hasDueDate() ) {
1749 int day = mStartDate.daysTo( todo->dtDue().date() ); 1749 int day = mStartDate.daysTo( todo->dtDue().date() );
1750 if ( day >= 0 && day < timeSpan + 1) { 1750 if ( day >= 0 && day < timeSpan + 1) {
1751 (*cells)[day]->insertTodo( todo ); 1751 (*cells)[day]->insertTodo( todo );
1752 } 1752 }
1753 } 1753 }
1754 } 1754 }
1755 1755
1756 for( i = 0; i < timeSpan+1; ++i ) { 1756 for( i = 0; i < timeSpan+1; ++i ) {
1757 (*cells)[i]->finishUpdateCell(); 1757 (*cells)[i]->finishUpdateCell();
1758 } 1758 }
1759 processSelectionChange(); 1759 processSelectionChange();
1760 //qApp->processEvents(); 1760 //qApp->processEvents();
1761 for( i = 0; i < timeSpan+1; ++i ) { 1761 for( i = 0; i < timeSpan+1; ++i ) {
1762 //(*cells)[i]->repaintfinishUpdateCell(); 1762 //(*cells)[i]->repaintfinishUpdateCell();
1763 QTimer::singleShot( 0, (*cells)[i], SLOT ( repaintfinishUpdateCell() ) ); 1763 QTimer::singleShot( 0, (*cells)[i], SLOT ( repaintfinishUpdateCell() ) );
1764 } 1764 }
1765 setKeyBFocus(); 1765 setKeyBFocus();
1766#else 1766#else
1767 // old code 1767 // old code
1768 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); 1768 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
1769 int i; 1769 int i;
1770 for( i = 0; i < (*cells).count(); ++i ) { 1770 for( i = 0; i < (*cells).count(); ++i ) {
1771 (*cells)[i]->updateCell(); 1771 (*cells)[i]->updateCell();
1772 } 1772 }
1773 1773
1774 //qDebug("KOMonthView::updateView() "); 1774 //qDebug("KOMonthView::updateView() ");
1775 processSelectionChange(); 1775 processSelectionChange();
1776 // qDebug("---------------------------------------------------------------------+ "); 1776 // qDebug("---------------------------------------------------------------------+ ");
1777 (*cells)[0]->setFocus(); 1777 (*cells)[0]->setFocus();
1778#endif 1778#endif
1779 1779
1780 //qDebug("update time %d ", ti.elapsed()); 1780 //qDebug("update time %d ", ti.elapsed());
1781} 1781}
1782 1782
1783void KOMonthView::setKeyBoardFocus() 1783void KOMonthView::setKeyBoardFocus()
1784{ 1784{
1785 //qDebug("KOMonthView::setKeyBoardFocus() "); 1785 //qDebug("KOMonthView::setKeyBoardFocus() ");
1786 bool shootAgain = false; 1786 bool shootAgain = false;
1787 if ( mShowWeekView ) { 1787 if ( mShowWeekView ) {
1788 shootAgain = !mWeekLabelsW[1]->hasFocus(); 1788 shootAgain = !mWeekLabelsW[1]->hasFocus();
1789 mWeekLabelsW[1]->setFocus(); 1789 mWeekLabelsW[1]->setFocus();
1790 } 1790 }
1791 else { 1791 else {
1792 shootAgain = !mWeekLabels[mNumWeeks]->hasFocus(); 1792 shootAgain = !mWeekLabels[mNumWeeks]->hasFocus();
1793 mWeekLabels[mNumWeeks]->setFocus(); 1793 mWeekLabels[mNumWeeks]->setFocus();
1794 } 1794 }
1795 if ( shootAgain ) { 1795 --mKBFcounter;
1796 QTimer::singleShot( 0, this, SLOT ( setKeyBFocus() ) ); 1796 if ( shootAgain && mKBFcounter > 0 ) {
1797 QTimer::singleShot( 50, this, SLOT ( setKeyBoardFocus() ) );
1797 } 1798 }
1798} 1799}
1799void KOMonthView::setKeyBFocus() 1800void KOMonthView::setKeyBFocus()
1800{ 1801{
1801 //qDebug("KOMonthView::setKeyBFocus() "); 1802 //qDebug("KOMonthView::setKeyBFocus() ");
1803 mKBFcounter = 10;
1802 QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) ); 1804 QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) );
1803} 1805}
1804void KOMonthView::resizeEvent(QResizeEvent * e) 1806void KOMonthView::resizeEvent(QResizeEvent * e)
1805{ 1807{
1806 //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); 1808 //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
1807 if ( isVisible() ) { 1809 if ( isVisible() ) {
1808 //qDebug("KOMonthView::isVisible "); 1810 //qDebug("KOMonthView::isVisible ");
1809 slotComputeLayout(); 1811 slotComputeLayout();
1810 } else 1812 } else
1811 mComputeLayoutTimer->start( 100 ); 1813 mComputeLayoutTimer->start( 100 );
1812} 1814}
1813 1815
1814void KOMonthView::slotComputeLayout() 1816void KOMonthView::slotComputeLayout()
1815{ 1817{
1816 mComputeLayoutTimer->stop(); 1818 mComputeLayoutTimer->stop();
1817 //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); 1819 //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() );
1818 computeLayout(); 1820 computeLayout();
1819 clPending = true; 1821 clPending = true;
1820 setKeyBFocus(); 1822 setKeyBFocus();
1821} 1823}
1822void KOMonthView::computeLayoutWeek() 1824void KOMonthView::computeLayoutWeek()
1823{ 1825{
1824 static int lastWid = 0; 1826 static int lastWid = 0;
1825 static int lastHei = 0; 1827 static int lastHei = 0;
1826 int daysToShow; 1828 int daysToShow;
1827 bool combinedSatSun = false; 1829 bool combinedSatSun = false;
1828 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { 1830 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
1829 daysToShow = 6; 1831 daysToShow = 6;
1830 combinedSatSun = true; 1832 combinedSatSun = true;
1831 } 1833 }
1832 int tWid = topLevelWidget()->size().width(); 1834 int tWid = topLevelWidget()->size().width();
1833 int tHei = topLevelWidget()->size().height(); 1835 int tHei = topLevelWidget()->size().height();
1834 1836
1835 int wid = width();//e 1837 int wid = width();//e
1836 int hei = height()-1-mNavigatorBar->height(); 1838 int hei = height()-1-mNavigatorBar->height();
1837 1839
1838 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 1840 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1839 return; 1841 return;
1840 1842
1841 if ( lastWid == width() && lastHei == height() ) { 1843 if ( lastWid == width() && lastHei == height() ) {
1842 //qDebug("KOListWeekView::No compute layout needed "); 1844 //qDebug("KOListWeekView::No compute layout needed ");
1843 return; 1845 return;
1844 } 1846 }
1845 lastWid = width(); 1847 lastWid = width();
1846 lastHei = height(); 1848 lastHei = height();
1847 1849
1848 1850
1849 if ( wid < hei ) 1851 if ( wid < hei )
1850 daysToShow = 2; 1852 daysToShow = 2;
1851 else 1853 else
1852 daysToShow = 3; 1854 daysToShow = 3;
1853 mShowSatSunComp = true; 1855 mShowSatSunComp = true;
1854 combinedSatSun = true; 1856 combinedSatSun = true;
1855 1857
1856 //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); 1858 //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ ");
1857 QFontMetrics fm ( mWeekLabels[0]->font() ); 1859 QFontMetrics fm ( mWeekLabels[0]->font() );
1858 int weeklabelwid = fm.width( "888" ); 1860 int weeklabelwid = fm.width( "888" );
1859 wid -= weeklabelwid; 1861 wid -= weeklabelwid;
1860 1862
1861 int colWid = wid / daysToShow; 1863 int colWid = wid / daysToShow;
1862 int lastCol = wid - ( colWid*6 ); 1864 int lastCol = wid - ( colWid*6 );
1863 int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); 1865 int dayLabelHei = mDayLabelsW[0]->sizeHint().height();
1864 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); 1866 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow );
1865 int colModulo = wid % daysToShow; 1867 int colModulo = wid % daysToShow;
1866 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; 1868 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1;
1867 //qDebug("rowmod %d ", rowModulo); 1869 //qDebug("rowmod %d ", rowModulo);
1868 int i; 1870 int i;
1869 int x,y,w,h; 1871 int x,y,w,h;
1870 x= 0; 1872 x= 0;
1871 y= 0; 1873 y= 0;
1872 w = colWid; 1874 w = colWid;
1873 h = dayLabelHei ; 1875 h = dayLabelHei ;
1874 for ( i = 0; i < 7; i++) { 1876 for ( i = 0; i < 7; i++) {
1875 if ( i && !( i % daysToShow) && i < 6) { 1877 if ( i && !( i % daysToShow) && i < 6) {
1876 y += hei/(5-daysToShow); 1878 y += hei/(5-daysToShow);
1877 x = 0; 1879 x = 0;
1878 w = colWid; 1880 w = colWid;
1879 } 1881 }
1880 if ( ((i) % daysToShow) >= daysToShow-colModulo ) { 1882 if ( ((i) % daysToShow) >= daysToShow-colModulo ) {
1881 ++w; 1883 ++w;
1882 } 1884 }
1883 if ( i >= 5 ) { 1885 if ( i >= 5 ) {
1884 int wi = width() - x - weeklabelwid; 1886 int wi = width() - x - weeklabelwid;
1885 if ( i == 5 ) { 1887 if ( i == 5 ) {
1886 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi/2+wi%2,h); 1888 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi/2+wi%2,h);
1887 } else { 1889 } else {
1888 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h); 1890 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h);
1889 } 1891 }
1890 x = x - w + wi - (wi/2 ); 1892 x = x - w + wi - (wi/2 );
1891 } 1893 }
1892 else { 1894 else {
1893 int wi = w; 1895 int wi = w;
1894 if ( !(( i+1) % daysToShow)) { 1896 if ( !(( i+1) % daysToShow)) {
1895 wi = width() - x - weeklabelwid; 1897 wi = width() - x - weeklabelwid;
1896 } 1898 }
1897 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h); 1899 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h);
1898 } 1900 }
1899 x += w; 1901 x += w;
1900 } 1902 }
1901 x= 0; 1903 x= 0;
1902 y= dayLabelHei; 1904 y= dayLabelHei;
1903 w = colWid; 1905 w = colWid;
1904 h = cellHei; 1906 h = cellHei;
1905 int max = 0; 1907 int max = 0;
1906 for ( i = 0; i < mCellsW.count(); ++i) { 1908 for ( i = 0; i < mCellsW.count(); ++i) {
1907 if ( i > 6 ) { 1909 if ( i > 6 ) {
1908 mCellsW[i]->hide(); 1910 mCellsW[i]->hide();
1909 continue; 1911 continue;
1910 } 1912 }
1911 1913
1912 w = colWid; 1914 w = colWid;
1913 if ( ((i) % daysToShow) >= daysToShow-colModulo ) { 1915 if ( ((i) % daysToShow) >= daysToShow-colModulo ) {
1914 ++w; 1916 ++w;
1915 } 1917 }
1916 if ( i == (daysToShow-1-rowModulo)*7) 1918 if ( i == (daysToShow-1-rowModulo)*7)
1917 ++h; 1919 ++h;
1918 1920
1919 if ( i >= 5 ) { 1921 if ( i >= 5 ) {
1920 if ( i ==5 ) { 1922 if ( i ==5 ) {
1921 max = h/2; 1923 max = h/2;
1922 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max ); 1924 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max );
1923 x -= w ;y += h/2; 1925 x -= w ;y += h/2;
1924 } else { 1926 } else {
1925 if ( ((i-1) % daysToShow) >= daysToShow-colModulo ) { 1927 if ( ((i-1) % daysToShow) >= daysToShow-colModulo ) {
1926 ++w; 1928 ++w;
1927 } 1929 }
1928 max = h-h/2; 1930 max = h-h/2;
1929 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max ); 1931 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max );
1930 y -= h/2; 1932 y -= h/2;
1931 } 1933 }
1932 } else { 1934 } else {
1933 max = h; 1935 max = h;
1934 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h ); 1936 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h );
1935 } 1937 }
1936 1938
1937 1939
1938 x += w; 1940 x += w;
1939 if ( x + w/2 > wid ) { 1941 if ( x + w/2 > wid ) {
1940 x = 0; 1942 x = 0;
1941 y += h+dayLabelHei ; 1943 y += h+dayLabelHei ;
1942 } 1944 }
1943 //mCellsW[i]->dateLabel()->setMaximumHeight( max - mCellsW[i]->lineWidth()*2 ); 1945 //mCellsW[i]->dateLabel()->setMaximumHeight( max - mCellsW[i]->lineWidth()*2 );
1944 } 1946 }
1945 y= dayLabelHei; 1947 y= dayLabelHei;
1946 h = cellHei ; 1948 h = cellHei ;
1947 mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); 1949 mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei);
1948 mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1950 mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1949 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1951 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1950 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 1952 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1951 mShortDayLabelsW = mDayLabelsW[0]->width()-2 < mWidthLongDayLabel ; 1953 mShortDayLabelsW = mDayLabelsW[0]->width()-2 < mWidthLongDayLabel ;
1952 updateDayLabels(); 1954 updateDayLabels();
1953 //bool forceUpdate = !updatePossible; 1955 //bool forceUpdate = !updatePossible;
1954 updatePossible = true; 1956 updatePossible = true;
1955 //mWeekLabels[mNumWeeks]->setText( i18n("M")); 1957 //mWeekLabels[mNumWeeks]->setText( i18n("M"));
1956 //if ( forceUpdate ) 1958 //if ( forceUpdate )
1957 // updateView(); 1959 // updateView();
1958} 1960}
1959void KOMonthView::computeLayout() 1961void KOMonthView::computeLayout()
1960{ 1962{
1961 1963
1962 1964
1963 static int lastWid = 0; 1965 static int lastWid = 0;
1964 static int lastHei = 0; 1966 static int lastHei = 0;
1965 1967
1966 if ( mShowWeekView ){ 1968 if ( mShowWeekView ){
1967 computeLayoutWeek(); 1969 computeLayoutWeek();
1968 return; 1970 return;
1969 } 1971 }
1970 int daysToShow = 7; 1972 int daysToShow = 7;
1971 bool combinedSatSun = false; 1973 bool combinedSatSun = false;
1972 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { 1974 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
1973 daysToShow = 6; 1975 daysToShow = 6;
1974 combinedSatSun = true; 1976 combinedSatSun = true;
1975 } 1977 }
1976 int tWid = topLevelWidget()->size().width(); 1978 int tWid = topLevelWidget()->size().width();
1977 int tHei = topLevelWidget()->size().height(); 1979 int tHei = topLevelWidget()->size().height();
1978 1980
1979 int wid = width();//e 1981 int wid = width();//e
1980 int hei = height()-1-mNavigatorBar->height(); 1982 int hei = height()-1-mNavigatorBar->height();
1981 1983
1982 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { 1984 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) {
1983 return; 1985 return;
1984 } 1986 }
1985 if ( lastWid == width() && lastHei == height() ){ 1987 if ( lastWid == width() && lastHei == height() ){
1986 //qDebug("KOMonthview::No compute layout needed "); 1988 //qDebug("KOMonthview::No compute layout needed ");
1987 return; 1989 return;
1988 } 1990 }
1989 1991
1990 lastWid = width(); 1992 lastWid = width();
1991 lastHei = height(); 1993 lastHei = height();
1992 //qDebug("KOMonthView::computeLayout() MMM ------------------- "); 1994 //qDebug("KOMonthView::computeLayout() MMM ------------------- ");
1993 QFontMetrics fm ( mWeekLabels[0]->font() ); 1995 QFontMetrics fm ( mWeekLabels[0]->font() );
1994 int weeklabelwid = fm.width( "888" ); 1996 int weeklabelwid = fm.width( "888" );
1995 wid -= weeklabelwid; 1997 wid -= weeklabelwid;
1996 1998
1997 int colWid = wid / daysToShow; 1999 int colWid = wid / daysToShow;
1998 int lastCol = wid - ( colWid*6 ); 2000 int lastCol = wid - ( colWid*6 );
1999 int dayLabelHei = mDayLabels[0]->sizeHint().height(); 2001 int dayLabelHei = mDayLabels[0]->sizeHint().height();
2000 int cellHei = (hei - dayLabelHei) /6; 2002 int cellHei = (hei - dayLabelHei) /6;
2001 int colModulo = wid % daysToShow; 2003 int colModulo = wid % daysToShow;
2002 int rowModulo = (hei- dayLabelHei) % 6; 2004 int rowModulo = (hei- dayLabelHei) % 6;
2003 //qDebug("rowmod %d ", rowModulo); 2005 //qDebug("rowmod %d ", rowModulo);
2004 int i; 2006 int i;
2005 int x,y,w,h; 2007 int x,y,w,h;
2006 x= 0; 2008 x= 0;
2007 y= 0; 2009 y= 0;
2008 w = colWid; 2010 w = colWid;
2009 h = dayLabelHei ; 2011 h = dayLabelHei ;
2010 for ( i = 0; i < 7; i++) { 2012 for ( i = 0; i < 7; i++) {
2011 if ( i == daysToShow-colModulo ) 2013 if ( i == daysToShow-colModulo )
2012 ++w; 2014 ++w;
2013 if ( combinedSatSun ) { 2015 if ( combinedSatSun ) {
2014 if ( i >= daysToShow-1 ) { 2016 if ( i >= daysToShow-1 ) {
2015 2017
2016 if ( i == 6 ) 2018 if ( i == 6 )
2017 mDayLabels[i]->setGeometry( x+weeklabelwid,y,width()-x-weeklabelwid,h); 2019 mDayLabels[i]->setGeometry( x+weeklabelwid,y,width()-x-weeklabelwid,h);
2018 else 2020 else
2019 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); 2021 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h);
2020 x -= w/2 ; 2022 x -= w/2 ;
2021 } 2023 }
2022 else 2024 else
2023 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); 2025 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h);
2024 } else 2026 } else
2025 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); 2027 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h);
2026 x += w; 2028 x += w;
2027 } 2029 }
2028 x= 0; 2030 x= 0;
2029 y= dayLabelHei; 2031 y= dayLabelHei;
2030 w = colWid; 2032 w = colWid;
2031 h = cellHei ; 2033 h = cellHei ;
2032 int max = 0; 2034 int max = 0;
2033 for ( i = 0; i < mCells.count(); ++i) { 2035 for ( i = 0; i < mCells.count(); ++i) {
2034 //qDebug("iii %d ", i); 2036 //qDebug("iii %d ", i);
2035 w = colWid; 2037 w = colWid;
2036 if ( ((i) % 7) >= 7-colModulo ) { 2038 if ( ((i) % 7) >= 7-colModulo ) {
2037 ++w; 2039 ++w;
2038 } 2040 }
2039 if ( i == (6-rowModulo)*7) 2041 if ( i == (6-rowModulo)*7)
2040 ++h; 2042 ++h;
2041 if ( combinedSatSun ) { 2043 if ( combinedSatSun ) {
2042 if ( (i)%7 >= daysToShow-1 ) { 2044 if ( (i)%7 >= daysToShow-1 ) {
2043 if ( (i)%7 == daysToShow-1 ) { 2045 if ( (i)%7 == daysToShow-1 ) {
2044 w = width()-x-weeklabelwid; 2046 w = width()-x-weeklabelwid;
2045 max = h/2; 2047 max = h/2;
2046 mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); 2048 mCells[i]->setGeometry ( x+weeklabelwid,y,w,max );
2047 x -= w ;y += h/2; 2049 x -= w ;y += h/2;
2048 } else { 2050 } else {
2049 w = width()-x-weeklabelwid; 2051 w = width()-x-weeklabelwid;
2050 max = h-h/2; 2052 max = h-h/2;
2051 mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); 2053 mCells[i]->setGeometry ( x+weeklabelwid,y,w,max );
2052 y -= h/2; 2054 y -= h/2;
2053 } 2055 }
2054 } else { 2056 } else {
2055 max = h; 2057 max = h;
2056 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); 2058 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h );
2057 } 2059 }
2058 2060
2059 } 2061 }
2060 else { 2062 else {
2061 max = h; 2063 max = h;
2062 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); 2064 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h );
2063 } 2065 }
2064 x += w; 2066 x += w;
2065 if ( x + w/2 > wid ) { 2067 if ( x + w/2 > wid ) {
2066 x = 0; 2068 x = 0;
2067 y += h; 2069 y += h;
2068 } 2070 }
2069 //mCells[i]->dateLabel()->setMaximumHeight( max- mCells[i]->lineWidth()*2 ); 2071 //mCells[i]->dateLabel()->setMaximumHeight( max- mCells[i]->lineWidth()*2 );
2070 } 2072 }
2071 y= dayLabelHei; 2073 y= dayLabelHei;
2072 h = cellHei ; 2074 h = cellHei ;
2073 for ( i = 0; i < 6; i++) { 2075 for ( i = 0; i < 6; i++) {
2074 if ( i == (6-rowModulo)) 2076 if ( i == (6-rowModulo))
2075 ++h; 2077 ++h;
2076 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); 2078 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h);
2077 y += h; 2079 y += h;
2078 } 2080 }
2079 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 2081 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
2080 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 2082 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
2081 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 2083 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
2082 mShortDayLabelsM = mDayLabels[0]->width()-2 < mWidthLongDayLabel ; 2084 mShortDayLabelsM = mDayLabels[0]->width()-2 < mWidthLongDayLabel ;
2083 updateDayLabels(); 2085 updateDayLabels();
2084 //bool forceUpdate = !updatePossible; 2086 //bool forceUpdate = !updatePossible;
2085 updatePossible = true; 2087 updatePossible = true;
2086 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 2088 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
2087} 2089}
2088 2090
2089void KOMonthView::showContextMenu( Incidence *incidence ) 2091void KOMonthView::showContextMenu( Incidence *incidence )
2090{ 2092{
2091 if( incidence ) 2093 if( incidence )
2092 mContextMenu->showIncidencePopup(incidence); 2094 mContextMenu->showIncidencePopup(incidence);
2093 else { 2095 else {
2094 //qDebug("KOMonthView::showContextMenu "); 2096 //qDebug("KOMonthView::showContextMenu ");
2095 mNewItemMenu->popup(QCursor::pos()); 2097 mNewItemMenu->popup(QCursor::pos());
2096 } 2098 }
2097 /* 2099 /*
2098 if( incidence && incidence->typeID() == eventID ) { 2100 if( incidence && incidence->typeID() == eventID ) {
2099 Event *event = static_cast<Event *>(incidence); 2101 Event *event = static_cast<Event *>(incidence);
2100 mContextMenu->showEventPopup(event); 2102 mContextMenu->showEventPopup(event);
2101 } else { 2103 } else {
2102 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; 2104 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
2103 } 2105 }
2104 */ 2106 */
2105} 2107}
2106MonthViewCell * KOMonthView::selectedCell( ) 2108MonthViewCell * KOMonthView::selectedCell( )
2107{ 2109{
2108 return mSelectedCell; 2110 return mSelectedCell;
2109} 2111}
2110void KOMonthView::setSelectedCell( MonthViewCell *cell ) 2112void KOMonthView::setSelectedCell( MonthViewCell *cell )
2111{ 2113{
2112 //qDebug("KOMonthView::setSelectedCell %d", cell); 2114 //qDebug("KOMonthView::setSelectedCell %d", cell);
2113 if ( mSelectedCell && mSelectedCell != cell ) { 2115 if ( mSelectedCell && mSelectedCell != cell ) {
2114 MonthViewCell * mvc = mSelectedCell; 2116 MonthViewCell * mvc = mSelectedCell;
2115 mSelectedCell = cell; 2117 mSelectedCell = cell;
2116 mvc->deselect(); 2118 mvc->deselect();
2117 } else 2119 } else
2118 mSelectedCell = cell; 2120 mSelectedCell = cell;
2119 // if ( mSelectedCell ) 2121 // if ( mSelectedCell )
2120 // mSelectedCell->select(); 2122 // mSelectedCell->select();
2121 if ( !mSelectedCell ) 2123 if ( !mSelectedCell )
2122 emit incidenceSelected( 0 ); 2124 emit incidenceSelected( 0 );
2123 else 2125 else
2124 emit incidenceSelected( mSelectedCell->selectedIncidence() ); 2126 emit incidenceSelected( mSelectedCell->selectedIncidence() );
2125} 2127}
2126 2128
2127void KOMonthView::processSelectionChange() 2129void KOMonthView::processSelectionChange()
2128{ 2130{
2129 QPtrList<Incidence> incidences = selectedIncidences(); 2131 QPtrList<Incidence> incidences = selectedIncidences();
2130 if (incidences.count() > 0) { 2132 if (incidences.count() > 0) {
2131 emit incidenceSelected( incidences.first() ); 2133 emit incidenceSelected( incidences.first() );
2132 } else { 2134 } else {
2133 emit incidenceSelected( 0 ); 2135 emit incidenceSelected( 0 );
2134 clearSelection(); 2136 clearSelection();
2135 } 2137 }
2136} 2138}
2137 2139
2138void KOMonthView::clearSelection() 2140void KOMonthView::clearSelection()
2139{ 2141{
2140 if ( mSelectedCell ) { 2142 if ( mSelectedCell ) {
2141 mSelectedCell->deselect(); 2143 mSelectedCell->deselect();
2142 mSelectedCell = 0; 2144 mSelectedCell = 0;
2143 } 2145 }
2144} 2146}
2145 2147
2146void KOMonthView::keyReleaseEvent ( QKeyEvent * e) 2148void KOMonthView::keyReleaseEvent ( QKeyEvent * e)
2147{ 2149{
2148 if ( !e->isAutoRepeat() ) { 2150 if ( !e->isAutoRepeat() ) {
2149 mFlagKeyPressed = false; 2151 mFlagKeyPressed = false;
2150 } 2152 }
2151} 2153}
2152 2154
2153void KOMonthView::keyPressEvent ( QKeyEvent * e ) 2155void KOMonthView::keyPressEvent ( QKeyEvent * e )
2154{ 2156{
2155 2157
2156 qApp->processEvents(); 2158 qApp->processEvents();
2157 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 2159 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
2158 //e->ignore(); 2160 //e->ignore();
2159 e->accept(); 2161 e->accept();
2160 return; 2162 return;
2161 } 2163 }
2162 if (! e->isAutoRepeat() ) 2164 if (! e->isAutoRepeat() )
2163 mFlagKeyPressed = true; 2165 mFlagKeyPressed = true;
2164 switch(e->key()) { 2166 switch(e->key()) {
2165 case Key_Up: 2167 case Key_Up:
2166 { 2168 {
2167 if ( mShowWeekView ) { 2169 if ( mShowWeekView ) {
2168 emit selectWeekNum ( currentWeek() - 1 ); 2170 emit selectWeekNum ( currentWeek() - 1 );
2169 } 2171 }
2170 else { 2172 else {
2171 emit prevMonth(); 2173 emit prevMonth();
2172 } 2174 }
2173 } 2175 }
2174 e->accept(); 2176 e->accept();
2175 break; 2177 break;
2176 case Key_Down: 2178 case Key_Down:
2177 { 2179 {
2178 if ( mShowWeekView ) { 2180 if ( mShowWeekView ) {
2179 emit selectWeekNum ( currentWeek() +1); 2181 emit selectWeekNum ( currentWeek() +1);
2180 } 2182 }
2181 else { 2183 else {
2182 emit nextMonth(); 2184 emit nextMonth();
2183 } 2185 }
2184 2186
2185 } 2187 }
2186 e->accept(); 2188 e->accept();
2187 break; 2189 break;
2188 case Key_Return: 2190 case Key_Return:
2189 case Key_Enter: 2191 case Key_Enter:
2190 { 2192 {
2191 selectInternalWeekNum ( currentWeek() ); 2193 selectInternalWeekNum ( currentWeek() );
2192 } 2194 }
2193 e->accept(); 2195 e->accept();
2194 break; 2196 break;
2195 case Key_D: 2197 case Key_D:
2196 if ( mSelectedCell ) { 2198 if ( mSelectedCell ) {
2197 mSelectedCell->showDay(); 2199 mSelectedCell->showDay();
2198 e->accept(); 2200 e->accept();
2199 } else { 2201 } else {
2200 e->ignore(); 2202 e->ignore();
2201 } 2203 }
2202 break; 2204 break;
2203 default: 2205 default:
2204 e->ignore(); 2206 e->ignore();
2205 break; 2207 break;
2206 } 2208 }
2207} 2209}
2208 2210
2209void KOMonthView::nextCell() 2211void KOMonthView::nextCell()
2210{ 2212{
2211 bool res = focusNextPrevChild ( true ); 2213 bool res = focusNextPrevChild ( true );
2212} 2214}
2213void KOMonthView::prevCell() 2215void KOMonthView::prevCell()
2214{ 2216{
2215 focusNextPrevChild ( false ); 2217 focusNextPrevChild ( false );
2216} 2218}
2217 2219
2218void KOMonthView::slotNewTodo() 2220void KOMonthView::slotNewTodo()
2219{ 2221{
2220 //qDebug("KOMonthView::slotNewTodo() "); 2222 //qDebug("KOMonthView::slotNewTodo() ");
2221 if ( mPopupCell ){ 2223 if ( mPopupCell ){
2222 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 2224 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
2223 emit newTodoSignal(dt,true); 2225 emit newTodoSignal(dt,true);
2224 } 2226 }
2225 mPopupCell = 0; 2227 mPopupCell = 0;
2226} 2228}
2227void KOMonthView::slotNewEvent() 2229void KOMonthView::slotNewEvent()
2228{ 2230{
2229 if ( mPopupCell ) { 2231 if ( mPopupCell ) {
2230 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 2232 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
2231 emit newEventSignal( dt ); 2233 emit newEventSignal( dt );
2232 } 2234 }
2233 //qDebug("KOMonthView::slotNewEvent() "); 2235 //qDebug("KOMonthView::slotNewEvent() ");
2234 mPopupCell = 0; 2236 mPopupCell = 0;
2235} 2237}
2236 2238
2237void KOMonthView::slotEditJournal() 2239void KOMonthView::slotEditJournal()
2238{ 2240{
2239 if ( mPopupCell ) 2241 if ( mPopupCell )
2240 emit showJournalSignal( 7, mPopupCell->date() ); 2242 emit showJournalSignal( 7, mPopupCell->date() );
2241 //qDebug("KOMonthView::slotEditJournal() "); 2243 //qDebug("KOMonthView::slotEditJournal() ");
2242 mPopupCell = 0; 2244 mPopupCell = 0;
2243} 2245}
2244 2246
2245void KOMonthView::setPopupCell( MonthViewCell * c) 2247void KOMonthView::setPopupCell( MonthViewCell * c)
2246{ 2248{
2247 mPopupCell = c; 2249 mPopupCell = c;
2248} 2250}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 0bd6b1c..a41eb54 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -1,345 +1,346 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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 19
20#ifndef _KOMONTHVIEW_H 20#ifndef _KOMONTHVIEW_H
21#define _KOMONTHVIEW_H 21#define _KOMONTHVIEW_H
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qframe.h> 24#include <qframe.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <qlistbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h> 28#include <qwidgetstack.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qintdict.h> 31#include <qintdict.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qvaluelist.h> 33#include <qvaluelist.h>
34#include <qptrvector.h> 34#include <qptrvector.h>
35 35
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37#include <libkcal/event.h> 37#include <libkcal/event.h>
38 38
39#include "koeventview.h" 39#include "koeventview.h"
40#include "navigatorbar.h" 40#include "navigatorbar.h"
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43class QToolTipGroup; 43class QToolTipGroup;
44#endif 44#endif
45 45
46class KNOWhatsThis; 46class KNOWhatsThis;
47class MonthViewCell; 47class MonthViewCell;
48class KOWeekButton : public QPushButton 48class KOWeekButton : public QPushButton
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 public: 51 public:
52 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 52 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
53 QPushButton( parent, name) 53 QPushButton( parent, name)
54 { 54 {
55 connect( this, SIGNAL( clicked() ), 55 connect( this, SIGNAL( clicked() ),
56 SLOT( bottonClicked() )); 56 SLOT( bottonClicked() ));
57 mNumber = -1; 57 mNumber = -1;
58 } 58 }
59 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 59 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
60 int getWeekNum() { return mNumber;} 60 int getWeekNum() { return mNumber;}
61 signals: 61 signals:
62 void selectWeekNum ( int ); 62 void selectWeekNum ( int );
63private: 63private:
64 void focusInEvent ( QFocusEvent * ){;} 64 void focusInEvent ( QFocusEvent * ){;}
65 int mNumber; 65 int mNumber;
66 void keyPressEvent ( QKeyEvent * e ) 66 void keyPressEvent ( QKeyEvent * e )
67 { 67 {
68 e->ignore(); 68 e->ignore();
69 } 69 }
70 70
71private slots : 71private slots :
72 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 72 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
73}; 73};
74 74
75class KNoScrollListBox: public QListBox 75class KNoScrollListBox: public QListBox
76{ 76{
77 Q_OBJECT 77 Q_OBJECT
78 public: 78 public:
79 KNoScrollListBox(QWidget *parent=0, const char *name=0); 79 KNoScrollListBox(QWidget *parent=0, const char *name=0);
80 ~KNoScrollListBox(); 80 ~KNoScrollListBox();
81 QString getWhatsThisText(QPoint p) ; 81 QString getWhatsThisText(QPoint p) ;
82 82
83 signals: 83 signals:
84 void shiftDown(); 84 void shiftDown();
85 void shiftUp(); 85 void shiftUp();
86 void rightClick(); 86 void rightClick();
87 void nextCell(); 87 void nextCell();
88 void prevCell(); 88 void prevCell();
89 void highlightIncidence( Incidence * , MonthViewCell*, int ); 89 void highlightIncidence( Incidence * , MonthViewCell*, int );
90 90
91 protected slots: 91 protected slots:
92 void oneDown(); 92 void oneDown();
93 void keyPressEvent(QKeyEvent *); 93 void keyPressEvent(QKeyEvent *);
94 void keyReleaseEvent(QKeyEvent *); 94 void keyReleaseEvent(QKeyEvent *);
95 void mousePressEvent(QMouseEvent *); 95 void mousePressEvent(QMouseEvent *);
96 void focusInEvent ( QFocusEvent * ); 96 void focusInEvent ( QFocusEvent * );
97 void focusOutEvent ( QFocusEvent * ); 97 void focusOutEvent ( QFocusEvent * );
98 98
99 private: 99 private:
100 bool resetOnFocusIn; 100 bool resetOnFocusIn;
101 KNOWhatsThis * mWT; 101 KNOWhatsThis * mWT;
102}; 102};
103 103
104 104
105class MonthViewItem: public QListBoxItem 105class MonthViewItem: public QListBoxItem
106{ 106{
107 public: 107 public:
108 MonthViewItem( Incidence *,const QString & title ); 108 MonthViewItem( Incidence *,const QString & title );
109 void recycle( Incidence *incidence, const QString & s); 109 void recycle( Incidence *incidence, const QString & s);
110 void setRecur(bool on) { mRecur = on; } 110 void setRecur(bool on) { mRecur = on; }
111 void setAlarm(bool on) { mAlarm = on; } 111 void setAlarm(bool on) { mAlarm = on; }
112 void setReply(bool on) { mReply = on; } 112 void setReply(bool on) { mReply = on; }
113 void setMoreInfo(bool on) { mInfo = on; } 113 void setMoreInfo(bool on) { mInfo = on; }
114 void setMultiDay(int type) { mMultiday = type; } 114 void setMultiDay(int type) { mMultiday = type; }
115 int multiDay() { return mMultiday; } 115 int multiDay() { return mMultiday; }
116 void setMultiDayPos(int type) { mdayPos = type; } 116 void setMultiDayPos(int type) { mdayPos = type; }
117 int gettMultiDayPos() { return mdayPos; } 117 int gettMultiDayPos() { return mdayPos; }
118 void setBlockRepaint(bool on) { mblockRepaint = on; } 118 void setBlockRepaint(bool on) { mblockRepaint = on; }
119 bool setHighlighted( Incidence * ); 119 bool setHighlighted( Incidence * );
120 120
121 void setPalette(const QPalette &p) { mPalette = p; } 121 void setPalette(const QPalette &p) { mPalette = p; }
122 QPalette palette() const { return mPalette; } 122 QPalette palette() const { return mPalette; }
123 bool setHighlightedFalse(); 123 bool setHighlightedFalse();
124 Incidence *incidence() const { return mIncidence; } 124 Incidence *incidence() const { return mIncidence; }
125 125
126 protected: 126 protected:
127 virtual void paint(QPainter *); 127 virtual void paint(QPainter *);
128 virtual int height(const QListBox *) const; 128 virtual int height(const QListBox *) const;
129 virtual int width(const QListBox *) const; 129 virtual int width(const QListBox *) const;
130 130
131 private: 131 private:
132 int mdayPos; 132 int mdayPos;
133 bool isWeekItem; 133 bool isWeekItem;
134 bool mblockRepaint; 134 bool mblockRepaint;
135 int mMultiday; 135 int mMultiday;
136 bool mRecur; 136 bool mRecur;
137 bool mAlarm; 137 bool mAlarm;
138 bool mReply; 138 bool mReply;
139 bool mInfo; 139 bool mInfo;
140 bool mDisplayHighlighted; 140 bool mDisplayHighlighted;
141 141
142 QPalette mPalette; 142 QPalette mPalette;
143 QDate mDate; 143 QDate mDate;
144 144
145 Incidence *mIncidence; 145 Incidence *mIncidence;
146}; 146};
147 147
148 148
149class KOMonthView; 149class KOMonthView;
150 150
151class MonthViewCell : public KNoScrollListBox 151class MonthViewCell : public KNoScrollListBox
152{ 152{
153 Q_OBJECT 153 Q_OBJECT
154 public: 154 public:
155 MonthViewCell(KOMonthView *,QWidget* ); 155 MonthViewCell(KOMonthView *,QWidget* );
156 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );} 156 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );}
157 157
158 void setDate( const QDate & ); 158 void setDate( const QDate & );
159 QDate date() const; 159 QDate date() const;
160 160
161 void setPrimary( bool ); 161 void setPrimary( bool );
162 bool isPrimary() const; 162 bool isPrimary() const;
163 163
164 void setHoliday( bool ); 164 void setHoliday( bool );
165 void setHoliday( const QString & ); 165 void setHoliday( const QString & );
166 166
167 void updateCell(); 167 void updateCell();
168 void startUpdateCell(); 168 void startUpdateCell();
169 void finishUpdateCell(); 169 void finishUpdateCell();
170 int insertEvent(Event *); 170 int insertEvent(Event *);
171 void insertTodo(Todo *); 171 void insertTodo(Todo *);
172 172
173 void updateConfig( bool bigFont = false ); 173 void updateConfig( bool bigFont = false );
174 174
175 void enableScrollBars( bool ); 175 void enableScrollBars( bool );
176 176
177 Incidence *selectedIncidence(); 177 Incidence *selectedIncidence();
178 QDate selectedIncidenceDate(); 178 QDate selectedIncidenceDate();
179 QPushButton * dateLabel() { return mLabel; } 179 QPushButton * dateLabel() { return mLabel; }
180 bool doHighLight( Incidence *); 180 bool doHighLight( Incidence *);
181 void deselect(); 181 void deselect();
182 void select(); 182 void select();
183#ifdef DESKTOP_VERSION 183#ifdef DESKTOP_VERSION
184 static QToolTipGroup *toolTipGroup(); 184 static QToolTipGroup *toolTipGroup();
185#endif 185#endif
186 signals: 186 signals:
187 void defaultAction( Incidence * ); 187 void defaultAction( Incidence * );
188 void newEventSignal( QDateTime ); 188 void newEventSignal( QDateTime );
189 void showDaySignal( QDate ); 189 void showDaySignal( QDate );
190 190
191 protected: 191 protected:
192 QStringList mToolTip; 192 QStringList mToolTip;
193 void resizeEvent( QResizeEvent * ); 193 void resizeEvent( QResizeEvent * );
194 194
195public slots: 195public slots:
196 void showDay(); 196 void showDay();
197 void deHighLight(); 197 void deHighLight();
198 void repaintfinishUpdateCell(); 198 void repaintfinishUpdateCell();
199 protected slots: 199 protected slots:
200 void defaultAction( QListBoxItem * ); 200 void defaultAction( QListBoxItem * );
201 void contextMenu( QListBoxItem * ); 201 void contextMenu( QListBoxItem * );
202 void selection( QListBoxItem * ); 202 void selection( QListBoxItem * );
203 void cellClicked( QListBoxItem * ); 203 void cellClicked( QListBoxItem * );
204 void newEvent(); 204 void newEvent();
205 205
206 private: 206 private:
207 int mdayCount; 207 int mdayCount;
208 QPtrList <MonthViewItem> mAvailItemList; 208 QPtrList <MonthViewItem> mAvailItemList;
209 KOMonthView *mMonthView; 209 KOMonthView *mMonthView;
210 int currentPalette; 210 int currentPalette;
211 211
212 QDate mDate; 212 QDate mDate;
213 bool mPrimary; 213 bool mPrimary;
214 bool mHoliday; 214 bool mHoliday;
215 QString mHolidayString; 215 QString mHolidayString;
216 216
217 //QLabel *mLabel; 217 //QLabel *mLabel;
218 QPushButton *mLabel; 218 QPushButton *mLabel;
219 //QListBox *mItemList; 219 //QListBox *mItemList;
220#ifdef DESKTOP_VERSION 220#ifdef DESKTOP_VERSION
221 static QToolTipGroup *mToolTipGroup; 221 static QToolTipGroup *mToolTipGroup;
222#endif 222#endif
223 QSize mLabelSize; 223 QSize mLabelSize;
224 QSize mLabelBigSize; 224 QSize mLabelBigSize;
225 QPalette mHolidayPalette; 225 QPalette mHolidayPalette;
226 QPalette mStandardPalette; 226 QPalette mStandardPalette;
227 QPalette mPrimaryPalette; 227 QPalette mPrimaryPalette;
228 QPalette mNonPrimaryPalette; 228 QPalette mNonPrimaryPalette;
229 void setMyPalette(); 229 void setMyPalette();
230 QPalette getPalette (); 230 QPalette getPalette ();
231 231
232}; 232};
233 233
234 234
235class KOMonthView: public KOEventView 235class KOMonthView: public KOEventView
236{ 236{
237 Q_OBJECT 237 Q_OBJECT
238 public: 238 public:
239 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 239 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
240 ~KOMonthView(); 240 ~KOMonthView();
241 241
242 /** Returns maximum number of days supported by the komonthview */ 242 /** Returns maximum number of days supported by the komonthview */
243 virtual int maxDatesHint(); 243 virtual int maxDatesHint();
244 244
245 /** Returns number of currently shown dates. */ 245 /** Returns number of currently shown dates. */
246 virtual int currentDateCount(); 246 virtual int currentDateCount();
247 247
248 /** returns the currently selected events */ 248 /** returns the currently selected events */
249 virtual QPtrList<Incidence> selectedIncidences(); 249 virtual QPtrList<Incidence> selectedIncidences();
250 250
251 /** returns dates of the currently selected events */ 251 /** returns dates of the currently selected events */
252 virtual DateList selectedDates(); 252 virtual DateList selectedDates();
253 253
254 virtual void printPreview(CalPrinter *calPrinter, 254 virtual void printPreview(CalPrinter *calPrinter,
255 const QDate &, const QDate &); 255 const QDate &, const QDate &);
256 bool isMonthView() { return !mShowWeekView; } 256 bool isMonthView() { return !mShowWeekView; }
257 bool isUpdatePossible() { return updatePossible; } 257 bool isUpdatePossible() { return updatePossible; }
258 258
259 MonthViewCell * selectedCell(); 259 MonthViewCell * selectedCell();
260 bool skipResize; 260 bool skipResize;
261 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 261 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
262 void clearList(); 262 void clearList();
263 public slots: 263 public slots:
264 void incidenceHighlighted( Incidence *, MonthViewCell*, int ); 264 void incidenceHighlighted( Incidence *, MonthViewCell*, int );
265 void nextCell(); 265 void nextCell();
266 void prevCell(); 266 void prevCell();
267 virtual void updateView(); 267 virtual void updateView();
268 virtual void updateConfig(); 268 virtual void updateConfig();
269 virtual void showDates(const QDate &start, const QDate &end); 269 virtual void showDates(const QDate &start, const QDate &end);
270 virtual void showEvents(QPtrList<Event> eventList); 270 virtual void showEvents(QPtrList<Event> eventList);
271 271
272 void changeEventDisplay(Event *, int); 272 void changeEventDisplay(Event *, int);
273 273
274 void clearSelection(); 274 void clearSelection();
275 275
276 void showContextMenu( Incidence * ); 276 void showContextMenu( Incidence * );
277 277
278 void setSelectedCell( MonthViewCell * ); 278 void setSelectedCell( MonthViewCell * );
279 void setPopupCell( MonthViewCell * ); 279 void setPopupCell( MonthViewCell * );
280 void switchView(); 280 void switchView();
281 void setKeyBoardFocus();
282 void setKeyBFocus(); 281 void setKeyBFocus();
283 282
284 protected slots: 283 protected slots:
284 void setKeyBoardFocus();
285 void slotNewTodo(); 285 void slotNewTodo();
286 void slotNewEvent(); 286 void slotNewEvent();
287 void slotEditJournal(); 287 void slotEditJournal();
288 void slotComputeLayout(); 288 void slotComputeLayout();
289 void selectInternalWeekNum ( int ); 289 void selectInternalWeekNum ( int );
290 void processSelectionChange(); 290 void processSelectionChange();
291 signals: 291 signals:
292 void nextMonth(); 292 void nextMonth();
293 void prevMonth(); 293 void prevMonth();
294 void selectWeekNum ( int ); 294 void selectWeekNum ( int );
295 void selectMonth (); 295 void selectMonth ();
296 void showDaySignal( QDate ); 296 void showDaySignal( QDate );
297 void newTodoSignal( QDateTime, bool ); 297 void newTodoSignal( QDateTime, bool );
298 void showJournalSignal( int,QDate ); 298 void showJournalSignal( int,QDate );
299 protected: 299 protected:
300 void resizeEvent(QResizeEvent *); 300 void resizeEvent(QResizeEvent *);
301 void viewChanged(); 301 void viewChanged();
302 void updateDayLabels(); 302 void updateDayLabels();
303 303
304 private: 304 private:
305 int mKBFcounter;
305 QTimer* mComputeLayoutTimer; 306 QTimer* mComputeLayoutTimer;
306 NavigatorBar* mNavigatorBar; 307 NavigatorBar* mNavigatorBar;
307 int currentWeek(); 308 int currentWeek();
308 bool clPending; 309 bool clPending;
309 QWidgetStack * mWidStack; 310 QWidgetStack * mWidStack;
310 QWidget* mMonthView; 311 QWidget* mMonthView;
311 QWidget* mWeekView; 312 QWidget* mWeekView;
312 bool mShowWeekView; 313 bool mShowWeekView;
313 bool updatePossible; 314 bool updatePossible;
314 int mDaysPerWeek; 315 int mDaysPerWeek;
315 int mNumWeeks; 316 int mNumWeeks;
316 int mNumCells; 317 int mNumCells;
317 //bool mWeekStartsMonday; 318 //bool mWeekStartsMonday;
318 bool mShowSatSunComp; 319 bool mShowSatSunComp;
319 void computeLayout(); 320 void computeLayout();
320 void computeLayoutWeek(); 321 void computeLayoutWeek();
321 322
322 QPtrVector<MonthViewCell> mCells; 323 QPtrVector<MonthViewCell> mCells;
323 QPtrVector<QLabel> mDayLabels; 324 QPtrVector<QLabel> mDayLabels;
324 QPtrVector<KOWeekButton> mWeekLabels; 325 QPtrVector<KOWeekButton> mWeekLabels;
325 QPtrVector<MonthViewCell> mCellsW; 326 QPtrVector<MonthViewCell> mCellsW;
326 QPtrVector<QLabel> mDayLabelsW; 327 QPtrVector<QLabel> mDayLabelsW;
327 QPtrVector<KOWeekButton> mWeekLabelsW; 328 QPtrVector<KOWeekButton> mWeekLabelsW;
328 329
329 bool mShortDayLabelsM; 330 bool mShortDayLabelsM;
330 bool mShortDayLabelsW; 331 bool mShortDayLabelsW;
331 int mWidthLongDayLabel; 332 int mWidthLongDayLabel;
332 333
333 QDate mStartDate; 334 QDate mStartDate;
334 335
335 MonthViewCell *mSelectedCell; 336 MonthViewCell *mSelectedCell;
336 MonthViewCell *mPopupCell; 337 MonthViewCell *mPopupCell;
337 bool mFlagKeyPressed; 338 bool mFlagKeyPressed;
338 KOEventPopupMenu *mContextMenu; 339 KOEventPopupMenu *mContextMenu;
339 QPopupMenu *mNewItemMenu; 340 QPopupMenu *mNewItemMenu;
340 void keyPressEvent ( QKeyEvent * ) ; 341 void keyPressEvent ( QKeyEvent * ) ;
341 void keyReleaseEvent ( QKeyEvent * ) ; 342 void keyReleaseEvent ( QKeyEvent * ) ;
342 343
343}; 344};
344 345
345#endif 346#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 862d437..f68f032 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,2586 +1,2591 @@
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 "kojournalview.h" 50#include "kojournalview.h"
51#include "koagenda.h" 51#include "koagenda.h"
52#include "kodialogmanager.h" 52#include "kodialogmanager.h"
53#include "kdialogbase.h" 53#include "kdialogbase.h"
54#include "kapplication.h" 54#include "kapplication.h"
55#include "kofilterview.h" 55#include "kofilterview.h"
56#include "kstandarddirs.h" 56#include "kstandarddirs.h"
57#include "koprefs.h" 57#include "koprefs.h"
58#include "kfiledialog.h" 58#include "kfiledialog.h"
59#include "koglobals.h" 59#include "koglobals.h"
60#include "kglobal.h" 60#include "kglobal.h"
61#include "ktoolbar.h" 61#include "ktoolbar.h"
62#include "klocale.h" 62#include "klocale.h"
63#include "kconfig.h" 63#include "kconfig.h"
64#include "externalapphandler.h" 64#include "externalapphandler.h"
65#include <kglobalsettings.h> 65#include <kglobalsettings.h>
66 66
67using namespace KCal; 67using namespace KCal;
68#ifndef _WIN32_ 68#ifndef _WIN32_
69#include <unistd.h> 69#include <unistd.h>
70#else 70#else
71#ifdef _OL_IMPORT_ 71#ifdef _OL_IMPORT_
72#include "koimportoldialog.h" 72#include "koimportoldialog.h"
73#endif 73#endif
74#endif 74#endif
75#include "mainwindow.h" 75#include "mainwindow.h"
76 76
77 77
78class KOex2phonePrefs : public QDialog 78class KOex2phonePrefs : public QDialog
79{ 79{
80 public: 80 public:
81 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 81 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
82 QDialog( parent, name, true ) 82 QDialog( parent, name, true )
83 { 83 {
84 setCaption( i18n("Export to phone options") ); 84 setCaption( i18n("Export to phone options") );
85 QVBoxLayout* lay = new QVBoxLayout( this ); 85 QVBoxLayout* lay = new QVBoxLayout( this );
86 lay->setSpacing( 3 ); 86 lay->setSpacing( 3 );
87 lay->setMargin( 3 ); 87 lay->setMargin( 3 );
88 QLabel *lab; 88 QLabel *lab;
89 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 89 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
90 lab->setAlignment (AlignHCenter ); 90 lab->setAlignment (AlignHCenter );
91 QHBox* temphb; 91 QHBox* temphb;
92 temphb = new QHBox( this ); 92 temphb = new QHBox( this );
93 new QLabel( i18n("I/O device: "), temphb ); 93 new QLabel( i18n("I/O device: "), temphb );
94 mPhoneDevice = new QLineEdit( temphb); 94 mPhoneDevice = new QLineEdit( temphb);
95 lay->addWidget( temphb ); 95 lay->addWidget( temphb );
96 temphb = new QHBox( this ); 96 temphb = new QHBox( this );
97 new QLabel( i18n("Connection: "), temphb ); 97 new QLabel( i18n("Connection: "), temphb );
98 mPhoneConnection = new QLineEdit( temphb); 98 mPhoneConnection = new QLineEdit( temphb);
99 lay->addWidget( temphb ); 99 lay->addWidget( temphb );
100 temphb = new QHBox( this ); 100 temphb = new QHBox( this );
101 new QLabel( i18n("Model(opt.): "), temphb ); 101 new QLabel( i18n("Model(opt.): "), temphb );
102 mPhoneModel = new QLineEdit( temphb); 102 mPhoneModel = new QLineEdit( temphb);
103 lay->addWidget( temphb ); 103 lay->addWidget( temphb );
104 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 104 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
105 mWriteBackFuture->setChecked( true ); 105 mWriteBackFuture->setChecked( true );
106 lay->addWidget( mWriteBackFuture ); 106 lay->addWidget( mWriteBackFuture );
107 temphb = new QHBox( this ); 107 temphb = new QHBox( this );
108 new QLabel( i18n("Max. weeks in future: ") , temphb ); 108 new QLabel( i18n("Max. weeks in future: ") , temphb );
109 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 109 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
110 mWriteBackFutureWeeks->setValue( 8 ); 110 mWriteBackFutureWeeks->setValue( 8 );
111 lay->addWidget( temphb ); 111 lay->addWidget( temphb );
112 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 112 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
113 lab->setAlignment (AlignHCenter ); 113 lab->setAlignment (AlignHCenter );
114 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 114 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
115 lay->addWidget( ok ); 115 lay->addWidget( ok );
116 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 116 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
117 lay->addWidget( cancel ); 117 lay->addWidget( cancel );
118 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 118 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
119 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 119 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
120 resize( 220, 240 ); 120 resize( 220, 240 );
121 qApp->processEvents(); 121 qApp->processEvents();
122 int dw = QApplication::desktop()->width(); 122 int dw = QApplication::desktop()->width();
123 int dh = QApplication::desktop()->height(); 123 int dh = QApplication::desktop()->height();
124 move( (dw-width())/2, (dh - height() )/2 ); 124 move( (dw-width())/2, (dh - height() )/2 );
125 } 125 }
126 126
127public: 127public:
128 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 128 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
129 QCheckBox* mWriteBackFuture; 129 QCheckBox* mWriteBackFuture;
130 QSpinBox* mWriteBackFutureWeeks; 130 QSpinBox* mWriteBackFutureWeeks;
131}; 131};
132 132
133QPixmap* sgListViewCompletedPix[6]; 133QPixmap* sgListViewCompletedPix[6];
134 134
135 135
136int globalFlagBlockStartup; 136int globalFlagBlockStartup;
137MainWindow::MainWindow( QWidget *parent, const char *name ) : 137MainWindow::MainWindow( QWidget *parent, const char *name ) :
138 QMainWindow( parent, name ) 138 QMainWindow( parent, name )
139{ 139{
140 sgListViewCompletedPix[5] = &listviewPix; 140 sgListViewCompletedPix[5] = &listviewPix;
141 sgListViewCompletedPix[0] = &listviewPix0; 141 sgListViewCompletedPix[0] = &listviewPix0;
142 sgListViewCompletedPix[1] = &listviewPix20; 142 sgListViewCompletedPix[1] = &listviewPix20;
143 sgListViewCompletedPix[2] = &listviewPix40; 143 sgListViewCompletedPix[2] = &listviewPix40;
144 sgListViewCompletedPix[3] = &listviewPix60; 144 sgListViewCompletedPix[3] = &listviewPix60;
145 sgListViewCompletedPix[4] = &listviewPix80; 145 sgListViewCompletedPix[4] = &listviewPix80;
146 if ( sgListViewCompletedPix[5]->height() < 5 ) { 146 if ( sgListViewCompletedPix[5]->height() < 5 ) {
147 //int size = 12; 147 //int size = 12;
148 sgListViewCompletedPix[5]->resize( 11, 11 ); 148 sgListViewCompletedPix[5]->resize( 11, 11 );
149 sgListViewCompletedPix[5]->fill( Qt::white ); 149 sgListViewCompletedPix[5]->fill( Qt::white );
150 QPainter p ( sgListViewCompletedPix[5] ); 150 QPainter p ( sgListViewCompletedPix[5] );
151 p.drawRect( 0,0,11,11); 151 p.drawRect( 0,0,11,11);
152 p.drawLine ( 2, 5, 4 , 7 ) ; 152 p.drawLine ( 2, 5, 4 , 7 ) ;
153 p.drawLine ( 4 , 7 , 8, 3) ; 153 p.drawLine ( 4 , 7 , 8, 3) ;
154 int iii = 0; 154 int iii = 0;
155 for ( iii = 0; iii < 5; ++iii ) { 155 for ( iii = 0; iii < 5; ++iii ) {
156 sgListViewCompletedPix[iii]->resize( 11, 11 ); 156 sgListViewCompletedPix[iii]->resize( 11, 11 );
157 sgListViewCompletedPix[iii]->fill( Qt::white ); 157 sgListViewCompletedPix[iii]->fill( Qt::white );
158 QPainter p ( sgListViewCompletedPix[iii] ); 158 QPainter p ( sgListViewCompletedPix[iii] );
159 p.drawRect( 0,0,11,11); 159 p.drawRect( 0,0,11,11);
160 if ( iii ) 160 if ( iii )
161 p.fillRect( 1,1,iii*2,9,Qt::gray ); 161 p.fillRect( 1,1,iii*2,9,Qt::gray );
162 } 162 }
163 } 163 }
164 mClosed = false; 164 mClosed = false;
165 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 165 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
166 QString confFile = locateLocal("config","korganizerrc"); 166 QString confFile = locateLocal("config","korganizerrc");
167 QFileInfo finf ( confFile ); 167 QFileInfo finf ( confFile );
168 bool showWarning = !finf.exists(); 168 bool showWarning = !finf.exists();
169 setIcon(SmallIcon( "ko24" ) ); 169 setIcon(SmallIcon( "ko24" ) );
170 mBlockAtStartup = true; 170 mBlockAtStartup = true;
171 mFlagKeyPressed = false; 171 mFlagKeyPressed = false;
172 setCaption("KO/Pi"); 172 setCaption("KO/Pi");
173 KOPrefs *p = KOPrefs::instance(); 173 KOPrefs *p = KOPrefs::instance();
174 //KPimGlobalPrefs::instance()->setGlobalConfig(); 174 //KPimGlobalPrefs::instance()->setGlobalConfig();
175 p->mCurrentDisplayedView = 0; 175 p->mCurrentDisplayedView = 0;
176 if ( p->mHourSize > 22 ) 176 if ( p->mHourSize > 22 )
177 p->mHourSize = 22; 177 p->mHourSize = 22;
178 QMainWindow::ToolBarDock tbd; 178 QMainWindow::ToolBarDock tbd;
179 if ( p->mToolBarHor ) { 179 if ( p->mToolBarHor ) {
180 if ( p->mToolBarUp ) 180 if ( p->mToolBarUp )
181 tbd = Bottom; 181 tbd = Bottom;
182 else 182 else
183 tbd = Top; 183 tbd = Top;
184 } 184 }
185 else { 185 else {
186 if ( p->mToolBarUp ) 186 if ( p->mToolBarUp )
187 tbd = Right; 187 tbd = Right;
188 else 188 else
189 tbd = Left; 189 tbd = Left;
190 } 190 }
191 if ( KOPrefs::instance()->mUseAppColors ) 191 if ( KOPrefs::instance()->mUseAppColors )
192 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 192 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
193 globalFlagBlockStartup = 1; 193 globalFlagBlockStartup = 1;
194 iconToolBar = new QPEToolBar( this ); 194 iconToolBar = new QPEToolBar( this );
195 addToolBar (iconToolBar , tbd ); 195 addToolBar (iconToolBar , tbd );
196 196
197#ifdef DESKTOP_VERSION 197#ifdef DESKTOP_VERSION
198 if ( KOPrefs::instance()->mShowIconFilter ) 198 if ( KOPrefs::instance()->mShowIconFilter )
199#else 199#else
200 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 200 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
201#endif 201#endif
202 202
203{ 203{
204 if ( p->mToolBarHorF ) { 204 if ( p->mToolBarHorF ) {
205 if ( p->mToolBarUpF ) 205 if ( p->mToolBarUpF )
206 tbd = Bottom; 206 tbd = Bottom;
207 else 207 else
208 tbd = Top; 208 tbd = Top;
209 } 209 }
210 else { 210 else {
211 if ( p->mToolBarUpF ) 211 if ( p->mToolBarUpF )
212 tbd = Right; 212 tbd = Right;
213 else 213 else
214 tbd = Left; 214 tbd = Left;
215 } 215 }
216 filterToolBar = new QPEToolBar ( this ); 216 filterToolBar = new QPEToolBar ( this );
217 filterMenubar = new QMenuBar( 0 ); 217 filterMenubar = new QMenuBar( 0 );
218 QFontMetrics fm ( filterMenubar->font() ); 218 QFontMetrics fm ( filterMenubar->font() );
219 219
220 filterPopupMenu = new QPopupMenu( this ); 220 filterPopupMenu = new QPopupMenu( this );
221 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 221 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
222 QString addTest = "A"; 222 QString addTest = "A";
223 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 223 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
224#ifdef DESKTOP_VERSION 224#ifdef DESKTOP_VERSION
225 addTest = "AAABBBCCCx"; 225 addTest = "AAABBBCCCx";
226#else 226#else
227 addTest = "AAx"; 227 addTest = "AAx";
228#endif 228#endif
229 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 229 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
230 addToolBar (filterToolBar , tbd ); 230 addToolBar (filterToolBar , tbd );
231 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 231 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
232 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 232 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
233 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 233 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
234 filterToolBar->hide(); 234 filterToolBar->hide();
235 } else { 235 } else {
236 filterToolBar = 0; 236 filterToolBar = 0;
237 filterMenubar = 0; 237 filterMenubar = 0;
238 filterPopupMenu = 0; 238 filterPopupMenu = 0;
239 } 239 }
240 if ( p->mShowIconOnetoolbar ) { 240 if ( p->mShowIconOnetoolbar ) {
241 viewToolBar = iconToolBar ; 241 viewToolBar = iconToolBar ;
242 navigatorToolBar = iconToolBar ; 242 navigatorToolBar = iconToolBar ;
243 } else { 243 } else {
244#ifndef DESKTOP_VERSION 244#ifndef DESKTOP_VERSION
245 setToolBarsMovable( false ); 245 setToolBarsMovable( false );
246#endif 246#endif
247 if ( p->mToolBarHorV ) { 247 if ( p->mToolBarHorV ) {
248 if ( p->mToolBarUpV ) 248 if ( p->mToolBarUpV )
249 tbd = Bottom; 249 tbd = Bottom;
250 else 250 else
251 tbd = Top; 251 tbd = Top;
252 } 252 }
253 else { 253 else {
254 if ( p->mToolBarUpV ) 254 if ( p->mToolBarUpV )
255 tbd = Right; 255 tbd = Right;
256 else 256 else
257 tbd = Left; 257 tbd = Left;
258 } 258 }
259 viewToolBar = new QPEToolBar( this ); 259 viewToolBar = new QPEToolBar( this );
260 addToolBar (viewToolBar , tbd ); 260 addToolBar (viewToolBar , tbd );
261 if ( p->mToolBarHorN ) { 261 if ( p->mToolBarHorN ) {
262 if ( p->mToolBarUpN ) 262 if ( p->mToolBarUpN )
263 tbd = Bottom; 263 tbd = Bottom;
264 else 264 else
265 tbd = Top; 265 tbd = Top;
266 } 266 }
267 else { 267 else {
268 if ( p->mToolBarUpN ) 268 if ( p->mToolBarUpN )
269 tbd = Right; 269 tbd = Right;
270 else 270 else
271 tbd = Left; 271 tbd = Left;
272 } 272 }
273 navigatorToolBar = new QPEToolBar( this ); 273 navigatorToolBar = new QPEToolBar( this );
274 addToolBar (navigatorToolBar , tbd ); 274 addToolBar (navigatorToolBar , tbd );
275 } 275 }
276 276
277 277
278 278
279 mCalendarModifiedFlag = false; 279 mCalendarModifiedFlag = false;
280 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 280 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
281 splash->setAlignment ( AlignCenter ); 281 splash->setAlignment ( AlignCenter );
282 setCentralWidget( splash ); 282 setCentralWidget( splash );
283#ifndef DESKTOP_VERSION 283#ifndef DESKTOP_VERSION
284 showMaximized(); 284 showMaximized();
285#endif 285#endif
286 286
287 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 287 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
288 setDefaultPreferences(); 288 setDefaultPreferences();
289 mCalendar = new CalendarLocal(); 289 mCalendar = new CalendarLocal();
290 mView = new CalendarView( mCalendar, this,"mCalendar " ); 290 mView = new CalendarView( mCalendar, this,"mCalendar " );
291 mView->hide(); 291 mView->hide();
292 //mView->resize(splash->size() ); 292 //mView->resize(splash->size() );
293 initActions(); 293 initActions();
294 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 294 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
295 mSyncManager->setBlockSave(false); 295 mSyncManager->setBlockSave(false);
296 mView->setSyncManager(mSyncManager); 296 mView->setSyncManager(mSyncManager);
297#ifndef DESKTOP_VERSION 297#ifndef DESKTOP_VERSION
298 iconToolBar->show(); 298 iconToolBar->show();
299 qApp->processEvents(); 299 qApp->processEvents();
300#endif 300#endif
301 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 301 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
302 int vh = height() ; 302 int vh = height() ;
303 int vw = width(); 303 int vw = width();
304 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 304 //qDebug("Toolbar hei %d ",iconToolBar->height() );
305 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 305 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
306 vh -= iconToolBar->height(); 306 vh -= iconToolBar->height();
307 } else { 307 } else {
308 vw -= iconToolBar->height(); 308 vw -= iconToolBar->height();
309 } 309 }
310 //mView->setMaximumSize( splash->size() ); 310 //mView->setMaximumSize( splash->size() );
311 //mView->resize( splash->size() ); 311 //mView->resize( splash->size() );
312 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 312 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
313 mView->readSettings(); 313 mView->readSettings();
314 bool newFile = false; 314 bool newFile = false;
315 if( !QFile::exists( defaultFileName() ) ) { 315 if( !QFile::exists( defaultFileName() ) ) {
316 QFileInfo finfo ( defaultFileName() ); 316 QFileInfo finfo ( defaultFileName() );
317 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 317 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
318 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"; 318 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";
319 finfo.setFile( oldFile ); 319 finfo.setFile( oldFile );
320 if (finfo.exists() ) { 320 if (finfo.exists() ) {
321 KMessageBox::information( this, message); 321 KMessageBox::information( this, message);
322 mView->openCalendar( oldFile ); 322 mView->openCalendar( oldFile );
323 qApp->processEvents(); 323 qApp->processEvents();
324 } else { 324 } else {
325 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 325 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
326 finfo.setFile( oldFile ); 326 finfo.setFile( oldFile );
327 if (finfo.exists() ) { 327 if (finfo.exists() ) {
328 KMessageBox::information( this, message); 328 KMessageBox::information( this, message);
329 mView->openCalendar( oldFile ); 329 mView->openCalendar( oldFile );
330 qApp->processEvents(); 330 qApp->processEvents();
331 } 331 }
332 } 332 }
333 mView->saveCalendar( defaultFileName() ); 333 mView->saveCalendar( defaultFileName() );
334 newFile = true; 334 newFile = true;
335 } 335 }
336 336
337 QTime neededSaveTime = QDateTime::currentDateTime().time(); 337 QTime neededSaveTime = QDateTime::currentDateTime().time();
338 mView->loadCalendars(); 338 mView->loadCalendars();
339 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 339 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
340 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 340 qDebug("KO: Calendar loading time: %d ms",msNeeded );
341 341
342 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 342 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
343 KOPrefs::instance()->setAllDefaults(); 343 KOPrefs::instance()->setAllDefaults();
344 } 344 }
345 processIncidenceSelection( 0 ); 345 processIncidenceSelection( 0 );
346 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 346 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
347 SLOT( processIncidenceSelection( Incidence * ) ) ); 347 SLOT( processIncidenceSelection( Incidence * ) ) );
348 connect( mView, SIGNAL( modifiedChanged( bool ) ), 348 connect( mView, SIGNAL( modifiedChanged( bool ) ),
349 SLOT( slotModifiedChanged( bool ) ) ); 349 SLOT( slotModifiedChanged( bool ) ) );
350 350
351 351
352 connect( mView, SIGNAL( tempDisableBR(bool) ), 352 connect( mView, SIGNAL( tempDisableBR(bool) ),
353 SLOT( disableBR(bool) ) ); 353 SLOT( disableBR(bool) ) );
354 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 354 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
355 mView->setModified( false ); 355 mView->setModified( false );
356 mBlockAtStartup = false; 356 mBlockAtStartup = false;
357 mView->setModified( false ); 357 mView->setModified( false );
358 setCentralWidget( mView ); 358 setCentralWidget( mView );
359 globalFlagBlockStartup = 0; 359 globalFlagBlockStartup = 0;
360 mView->show(); 360 mView->show();
361 delete splash; 361 delete splash;
362 if ( newFile ) 362 if ( newFile )
363 mView->updateConfig(); 363 mView->updateConfig();
364 // qApp->processEvents(); 364 // qApp->processEvents();
365 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 365 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
366 //fillSyncMenu(); 366 //fillSyncMenu();
367 367
368 368
369 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 369 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
370 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 370 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
371 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 371 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
372 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 372 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
373 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 373 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
374 mSyncManager->setDefaultFileName( sentSyncFile()); 374 mSyncManager->setDefaultFileName( sentSyncFile());
375 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 375 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
376 mSyncManager->fillSyncMenu(); 376 mSyncManager->fillSyncMenu();
377 377
378 378
379 379
380 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 380 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
381 if ( showWarning ) { 381 if ( showWarning ) {
382 KMessageBox::information( this, 382 KMessageBox::information( this,
383 "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"); 383 "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");
384 qApp->processEvents(); 384 qApp->processEvents();
385 mView->dialogManager()->showSyncOptions(); 385 mView->dialogManager()->showSyncOptions();
386 } 386 }
387 387
388 //US listen for result adressed from Ka/Pi 388 //US listen for result adressed from Ka/Pi
389#ifndef DESKTOP_VERSION 389#ifndef DESKTOP_VERSION
390 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 390 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
391#endif 391#endif
392#ifndef DESKTOP_VERSION 392#ifndef DESKTOP_VERSION
393 infrared = 0; 393 infrared = 0;
394#endif 394#endif
395 updateFilterToolbar(); 395 updateFilterToolbar();
396 updateWeek( mView->startDate() ); 396 updateWeek( mView->startDate() );
397 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 397 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
398 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 398 SLOT( updateWeekNum( const KCal::DateList & ) ) );
399 mBRdisabled = false; 399 mBRdisabled = false;
400 //toggleBeamReceive(); 400 //toggleBeamReceive();
401 401
402 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 402 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
403} 403}
404MainWindow::~MainWindow() 404MainWindow::~MainWindow()
405{ 405{
406 //qDebug("MainWindow::~MainWindow() "); 406 //qDebug("MainWindow::~MainWindow() ");
407 //save toolbar location 407 //save toolbar location
408 delete mCalendar; 408 delete mCalendar;
409 delete mSyncManager; 409 delete mSyncManager;
410#ifndef DESKTOP_VERSION 410#ifndef DESKTOP_VERSION
411 if ( infrared ) 411 if ( infrared )
412 delete infrared; 412 delete infrared;
413#endif 413#endif
414 414
415 415
416} 416}
417 417
418void MainWindow::disableBR(bool b) 418void MainWindow::disableBR(bool b)
419{ 419{
420#ifndef DESKTOP_VERSION 420#ifndef DESKTOP_VERSION
421 if ( b ) { 421 if ( b ) {
422 if ( infrared ) { 422 if ( infrared ) {
423 toggleBeamReceive(); 423 toggleBeamReceive();
424 mBRdisabled = true; 424 mBRdisabled = true;
425 } 425 }
426 mBRdisabled = true; 426 mBRdisabled = true;
427 } else { 427 } else {
428 if ( mBRdisabled ) { 428 if ( mBRdisabled ) {
429 mBRdisabled = false; 429 mBRdisabled = false;
430 //makes no sense,because other cal ap is probably running 430 //makes no sense,because other cal ap is probably running
431 // toggleBeamReceive(); 431 // toggleBeamReceive();
432 } 432 }
433 } 433 }
434#endif 434#endif
435 435
436} 436}
437bool MainWindow::beamReceiveEnabled() 437bool MainWindow::beamReceiveEnabled()
438{ 438{
439#ifndef DESKTOP_VERSION 439#ifndef DESKTOP_VERSION
440 return ( infrared != 0 ); 440 return ( infrared != 0 );
441#endif 441#endif
442 return false; 442 return false;
443} 443}
444 444
445void MainWindow::toggleBeamReceive() 445void MainWindow::toggleBeamReceive()
446{ 446{
447 if ( mBRdisabled ) 447 if ( mBRdisabled )
448 return; 448 return;
449#ifndef DESKTOP_VERSION 449#ifndef DESKTOP_VERSION
450 if ( infrared ) { 450 if ( infrared ) {
451 qDebug("KO: Disable BeamReceive "); 451 qDebug("KO: Disable BeamReceive ");
452 delete infrared; 452 delete infrared;
453 infrared = 0; 453 infrared = 0;
454 brAction->setOn(false); 454 brAction->setOn(false);
455 return; 455 return;
456 } 456 }
457 qDebug("KO: Enable BeamReceive "); 457 qDebug("KO: Enable BeamReceive ");
458 brAction->setOn(true); 458 brAction->setOn(true);
459 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 459 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
460 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 460 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
461#endif 461#endif
462} 462}
463void MainWindow::showMaximized () 463void MainWindow::showMaximized ()
464{ 464{
465#ifndef DESKTOP_VERSION 465#ifndef DESKTOP_VERSION
466 if ( ! globalFlagBlockStartup ) 466 if ( ! globalFlagBlockStartup )
467 if ( mClosed ) 467 if ( mClosed )
468 mView->goToday(); 468 mView->goToday();
469#endif 469#endif
470 QWidget::showMaximized () ; 470 QWidget::showMaximized () ;
471 mClosed = false; 471 mClosed = false;
472} 472}
473void MainWindow::closeEvent( QCloseEvent* ce ) 473void MainWindow::closeEvent( QCloseEvent* ce )
474{ 474{
475 475
476 476
477 477
478 if ( ! KOPrefs::instance()->mAskForQuit ) { 478 if ( ! KOPrefs::instance()->mAskForQuit ) {
479 saveOnClose(); 479 saveOnClose();
480 mClosed = true; 480 mClosed = true;
481 ce->accept(); 481 ce->accept();
482 return; 482 return;
483 483
484 } 484 }
485 485
486 switch( QMessageBox::information( this, "KO/Pi", 486 switch( QMessageBox::information( this, "KO/Pi",
487 i18n("Do you really want\nto close KO/Pi?"), 487 i18n("Do you really want\nto close KO/Pi?"),
488 i18n("Close"), i18n("No"), 488 i18n("Close"), i18n("No"),
489 0, 0 ) ) { 489 0, 0 ) ) {
490 case 0: 490 case 0:
491 saveOnClose(); 491 saveOnClose();
492 mClosed = true; 492 mClosed = true;
493 ce->accept(); 493 ce->accept();
494 break; 494 break;
495 case 1: 495 case 1:
496 ce->ignore(); 496 ce->ignore();
497 break; 497 break;
498 case 2: 498 case 2:
499 499
500 default: 500 default:
501 break; 501 break;
502 } 502 }
503 503
504 504
505} 505}
506 506
507void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 507void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
508{ 508{
509 QDataStream stream( data, IO_ReadOnly ); 509 QDataStream stream( data, IO_ReadOnly );
510 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 510 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
511 //QString datamess; 511 //QString datamess;
512 //qDebug("message "); 512 //qDebug("message ");
513 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 513 qDebug("KO: QCOP message received: %s ", cmsg.data() );
514 514
515 if ( cmsg == "setDocument(QString)" ) { 515 if ( cmsg == "setDocument(QString)" ) {
516 QDataStream stream( data, IO_ReadOnly ); 516 QDataStream stream( data, IO_ReadOnly );
517 QString fileName; 517 QString fileName;
518 stream >> fileName; 518 stream >> fileName;
519 //qDebug("filename %s ", fileName.latin1()); 519 //qDebug("filename %s ", fileName.latin1());
520 showMaximized(); 520 showMaximized();
521 raise(); 521 raise();
522 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 522 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
523 mSyncManager->slotSyncMenu( 1002 ); 523 mSyncManager->slotSyncMenu( 1002 );
524 return; 524 return;
525 } 525 }
526 526
527 if ( cmsg == "-writeFile" ) { 527 if ( cmsg == "-writeFile" ) {
528 // I made from the "-writeFile" an "-writeAlarm" 528 // I made from the "-writeFile" an "-writeAlarm"
529 mView->viewManager()->showWhatsNextView(); 529 mView->viewManager()->showWhatsNextView();
530 mCalendar->checkAlarmForIncidence( 0, true); 530 mCalendar->checkAlarmForIncidence( 0, true);
531 showMaximized(); 531 showMaximized();
532 raise(); 532 raise();
533 return; 533 return;
534 534
535 } 535 }
536 if ( cmsg == "-writeFileSilent" ) { 536 if ( cmsg == "-writeFileSilent" ) {
537 // I made from the "-writeFile" an "-writeAlarm" 537 // I made from the "-writeFile" an "-writeAlarm"
538 // mView->viewManager()->showWhatsNextView(); 538 // mView->viewManager()->showWhatsNextView();
539 mCalendar->checkAlarmForIncidence( 0, true); 539 mCalendar->checkAlarmForIncidence( 0, true);
540 //showMaximized(); 540 //showMaximized();
541 //raise(); 541 //raise();
542 hide(); 542 hide();
543 return; 543 return;
544 } 544 }
545 if ( cmsg == "-newCountdown" ) { 545 if ( cmsg == "-newCountdown" ) {
546 qDebug("newCountdown "); 546 qDebug("newCountdown ");
547 547
548 } 548 }
549 QString msg ; 549 QString msg ;
550 QString allmsg = cmsg; 550 QString allmsg = cmsg;
551 while ( allmsg.length() > 0 ) { 551 while ( allmsg.length() > 0 ) {
552 int nextC = allmsg.find( "-", 1 ); 552 int nextC = allmsg.find( "-", 1 );
553 if ( nextC == -1 ) { 553 if ( nextC == -1 ) {
554 msg = allmsg; 554 msg = allmsg;
555 allmsg = ""; 555 allmsg = "";
556 } else{ 556 } else{
557 msg = allmsg.left( nextC ); 557 msg = allmsg.left( nextC );
558 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 558 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
559 } 559 }
560 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 560 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
561 if ( msg == "-newEvent" ) { 561 if ( msg == "-newEvent" ) {
562 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 562 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
563 } 563 }
564 if ( msg == "-newTodo" ) { 564 if ( msg == "-newTodo" ) {
565 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 565 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
566 } 566 }
567 if ( msg == "-showWN" ) { 567 if ( msg == "-showWN" ) {
568 mView->viewManager()->showWhatsNextView(); 568 mView->viewManager()->showWhatsNextView();
569 } 569 }
570 if ( msg == "-showTodo" ) { 570 if ( msg == "-showTodo" ) {
571 mView->viewManager()->showTodoView(); 571 mView->viewManager()->showTodoView();
572 } 572 }
573 if ( msg == "-showList" ) { 573 if ( msg == "-showList" ) {
574 mView->viewManager()->showListView(); 574 mView->viewManager()->showListView();
575 } 575 }
576 else if ( msg == "-showDay" ) { 576 else if ( msg == "-showDay" ) {
577 mView->viewManager()->showDayView(); 577 mView->viewManager()->showDayView();
578 } 578 }
579 else if ( msg == "-showWWeek" ) { 579 else if ( msg == "-showWWeek" ) {
580 mView->viewManager()->showWorkWeekView(); 580 mView->viewManager()->showWorkWeekView();
581 } 581 }
582 else if ( msg == "-ringSync" ) { 582 else if ( msg == "-ringSync" ) {
583 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 583 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
584 } 584 }
585 else if ( msg == "-showWeek" ) { 585 else if ( msg == "-showWeek" ) {
586 mView->viewManager()->showWeekView(); 586 mView->viewManager()->showWeekView();
587 } 587 }
588 else if ( msg == "-showTodo" ) { 588 else if ( msg == "-showTodo" ) {
589 mView->viewManager()->showTodoView(); 589 mView->viewManager()->showTodoView();
590 } 590 }
591 else if ( msg == "-showJournal" ) { 591 else if ( msg == "-showJournal" ) {
592 mView->dateNavigator()->selectDates( 1 ); 592 mView->dateNavigator()->selectDates( 1 );
593 mView->dateNavigator()->selectToday(); 593 mView->dateNavigator()->selectToday();
594 mView->viewManager()->showJournalView(); 594 mView->viewManager()->showJournalView();
595 } 595 }
596 else if ( msg == "-showKO" ) { 596 else if ( msg == "-showKO" ) {
597 mView->viewManager()->showNextXView(); 597 mView->viewManager()->showNextXView();
598 } 598 }
599 else if ( msg == "-showWNext" ) { 599 else if ( msg == "-showWNext" ) {
600 mView->viewManager()->showWhatsNextView(); 600 mView->viewManager()->showWhatsNextView();
601 } 601 }
602 else if ( msg == "nextView()" ) { 602 else if ( msg == "nextView()" ) {
603 mView->viewManager()->showNextView(); 603 mView->viewManager()->showNextView();
604 } 604 }
605 else if ( msg == "-showNextXView" ) { 605 else if ( msg == "-showNextXView" ) {
606 mView->viewManager()->showNextXView(); 606 mView->viewManager()->showNextXView();
607 } 607 }
608 608
609 609
610 } 610 }
611 611
612 showMaximized(); 612 showMaximized();
613 raise(); 613 raise();
614} 614}
615void MainWindow::startMultiSync() 615void MainWindow::startMultiSync()
616{ 616{
617 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 617 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
618 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 618 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
619 question, 619 question,
620 i18n("Yes"), i18n("No"), 620 i18n("Yes"), i18n("No"),
621 0, 0 ) != 0 ) { 621 0, 0 ) != 0 ) {
622 setCaption(i18n("Aborted! Nothing synced!")); 622 setCaption(i18n("Aborted! Nothing synced!"));
623 return; 623 return;
624 } 624 }
625 mSyncManager->multiSync( false ); 625 mSyncManager->multiSync( false );
626#ifndef DESKTOP_VERSION 626#ifndef DESKTOP_VERSION
627 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 627 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
628#endif 628#endif
629} 629}
630QPixmap MainWindow::loadPixmap( QString name ) 630QPixmap MainWindow::loadPixmap( QString name )
631{ 631{
632 return SmallIcon( name ); 632 return SmallIcon( name );
633 633
634} 634}
635void MainWindow::setUsesBigPixmaps ( bool b ) 635void MainWindow::setUsesBigPixmaps ( bool b )
636{ 636{
637 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 637 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
638 if ( b ) 638 if ( b )
639 qDebug("KO: BigPixmaps are not supported "); 639 qDebug("KO: BigPixmaps are not supported ");
640} 640}
641void MainWindow::initActions() 641void MainWindow::initActions()
642{ 642{
643 //KOPrefs::instance()->mShowFullMenu 643 //KOPrefs::instance()->mShowFullMenu
644 iconToolBar->clear(); 644 iconToolBar->clear();
645 KOPrefs *p = KOPrefs::instance(); 645 KOPrefs *p = KOPrefs::instance();
646 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 646 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
647 647
648 QPopupMenu *viewMenu = new QPopupMenu( this ); 648 QPopupMenu *viewMenu = new QPopupMenu( this );
649 QPopupMenu *actionMenu = new QPopupMenu( this ); 649 QPopupMenu *actionMenu = new QPopupMenu( this );
650 mCurrentItemMenu = new QPopupMenu ( this ); 650 mCurrentItemMenu = new QPopupMenu ( this );
651 QPopupMenu *importMenu = new QPopupMenu( this ); 651 QPopupMenu *importMenu = new QPopupMenu( this );
652 QPopupMenu *importMenu_X = new QPopupMenu( this ); 652 QPopupMenu *importMenu_X = new QPopupMenu( this );
653 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 653 QPopupMenu *exportMenu_X = new QPopupMenu( this );
654 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 654 QPopupMenu *beamMenu_X = new QPopupMenu( this );
655 selectFilterMenu = new QPopupMenu( this ); 655 selectFilterMenu = new QPopupMenu( this );
656 selectFilterMenu->setCheckable( true ); 656 selectFilterMenu->setCheckable( true );
657 syncMenu = new QPopupMenu( this ); 657 syncMenu = new QPopupMenu( this );
658 configureAgendaMenu = new QPopupMenu( this ); 658 configureAgendaMenu = new QPopupMenu( this );
659 configureToolBarMenu = new QPopupMenu( this ); 659 configureToolBarMenu = new QPopupMenu( this );
660 QPopupMenu *helpMenu = new QPopupMenu( this ); 660 QPopupMenu *helpMenu = new QPopupMenu( this );
661 QIconSet icon; 661 QIconSet icon;
662 int pixWid = 22, pixHei = 22; 662 int pixWid = 22, pixHei = 22;
663 QString pathString = ""; 663 QString pathString = "";
664 if ( !p->mToolBarMiniIcons ) { 664 if ( !p->mToolBarMiniIcons ) {
665 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 665 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
666 pathString += "icons16/"; 666 pathString += "icons16/";
667 pixWid = 18; pixHei = 16; 667 pixWid = 18; pixHei = 16;
668 } 668 }
669 } else { 669 } else {
670 pathString += "iconsmini/"; 670 pathString += "iconsmini/";
671 pixWid = 18; pixHei = 16; 671 pixWid = 18; pixHei = 16;
672 } 672 }
673 if ( KOPrefs::instance()->mShowFullMenu ) { 673 if ( KOPrefs::instance()->mShowFullMenu ) {
674 QMenuBar *menuBar1; 674 QMenuBar *menuBar1;
675 menuBar1 = menuBar(); 675 menuBar1 = menuBar();
676 menuBar1->insertItem( i18n("File"), importMenu ); 676 menuBar1->insertItem( i18n("File"), importMenu );
677 menuBar1->insertItem( i18n("View"), viewMenu ); 677 menuBar1->insertItem( i18n("View"), viewMenu );
678 menuBar1->insertItem( i18n("Actions"), actionMenu ); 678 menuBar1->insertItem( i18n("Actions"), actionMenu );
679#ifdef DESKTOP_VERSION 679#ifdef DESKTOP_VERSION
680 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 680 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
681 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 681 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
682#else 682#else
683 menuBar1->insertItem( i18n("Sync"), syncMenu ); 683 menuBar1->insertItem( i18n("Sync"), syncMenu );
684 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 684 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
685#endif 685#endif
686 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 686 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
687 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 687 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
688 menuBar1->insertItem( i18n("Help"), helpMenu ); 688 menuBar1->insertItem( i18n("Help"), helpMenu );
689 } else { 689 } else {
690 QPEMenuBar *menuBar1; 690 QPEMenuBar *menuBar1;
691 menuBar1 = new QPEMenuBar( iconToolBar ); 691 menuBar1 = new QPEMenuBar( iconToolBar );
692 QPopupMenu *menuBar = new QPopupMenu( this ); 692 QPopupMenu *menuBar = new QPopupMenu( this );
693 icon = loadPixmap( pathString + "z_menu" ); 693 icon = loadPixmap( pathString + "z_menu" );
694 menuBar1->insertItem( icon.pixmap(), menuBar); 694 menuBar1->insertItem( icon.pixmap(), menuBar);
695 //menuBar1->insertItem( i18n("ME"), menuBar); 695 //menuBar1->insertItem( i18n("ME"), menuBar);
696 menuBar->insertItem( i18n("File"), importMenu ); 696 menuBar->insertItem( i18n("File"), importMenu );
697 menuBar->insertItem( i18n("View"), viewMenu ); 697 menuBar->insertItem( i18n("View"), viewMenu );
698 menuBar->insertItem( i18n("Actions"), actionMenu ); 698 menuBar->insertItem( i18n("Actions"), actionMenu );
699 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 699 menuBar->insertItem( i18n("Synchronize"), syncMenu );
700 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 700 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
701 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 701 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
702 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 702 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
703 menuBar->insertItem( i18n("Help"), helpMenu ); 703 menuBar->insertItem( i18n("Help"), helpMenu );
704 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 704 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
705 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 705 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
706 } 706 }
707 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 707 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
708 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 708 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
709 709
710 710
711 mWeekBgColor = iconToolBar->backgroundColor(); 711 mWeekBgColor = iconToolBar->backgroundColor();
712 mWeekPixmap.resize( pixWid , pixHei ); 712 mWeekPixmap.resize( pixWid , pixHei );
713 mWeekPixmap.fill( mWeekBgColor ); 713 mWeekPixmap.fill( mWeekBgColor );
714 icon = mWeekPixmap; 714 icon = mWeekPixmap;
715 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 715 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
716 if ( p-> mShowIconWeekNum ) 716 if ( p-> mShowIconWeekNum )
717 mWeekAction->addTo( iconToolBar ); 717 mWeekAction->addTo( iconToolBar );
718 mWeekFont = font(); 718 mWeekFont = font();
719 719
720 int fontPoint = mWeekFont.pointSize(); 720 int fontPoint = mWeekFont.pointSize();
721 QFontMetrics f( mWeekFont ); 721 QFontMetrics f( mWeekFont );
722 int fontWid = f.width( "30" ); 722 int fontWid = f.width( "30" );
723 while ( fontWid > pixWid ) { 723 while ( fontWid > pixWid ) {
724 --fontPoint; 724 --fontPoint;
725 mWeekFont.setPointSize( fontPoint ); 725 mWeekFont.setPointSize( fontPoint );
726 QFontMetrics f( mWeekFont ); 726 QFontMetrics f( mWeekFont );
727 fontWid = f.width( "30" ); 727 fontWid = f.width( "30" );
728 //qDebug("dec-- "); 728 //qDebug("dec-- ");
729 } 729 }
730 730
731 connect( mWeekAction, SIGNAL( activated() ), 731 connect( mWeekAction, SIGNAL( activated() ),
732 this, SLOT( weekAction() ) ); 732 this, SLOT( weekAction() ) );
733 733
734 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 734 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
735 if ( p->mShowIconFilterview ) { 735 if ( p->mShowIconFilterview ) {
736 icon = loadPixmap( pathString + "filter" ); 736 icon = loadPixmap( pathString + "filter" );
737 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 737 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
738 connect( actionFilterMenuTB, SIGNAL( activated() ), 738 connect( actionFilterMenuTB, SIGNAL( activated() ),
739 this, SLOT( fillFilterMenuTB() ) ); 739 this, SLOT( fillFilterMenuTB() ) );
740 actionFilterMenuTB->addTo( iconToolBar ); 740 actionFilterMenuTB->addTo( iconToolBar );
741 selectFilterMenuTB = new QPopupMenu( this ); 741 selectFilterMenuTB = new QPopupMenu( this );
742 selectFilterMenuTB->setCheckable( true ); 742 selectFilterMenuTB->setCheckable( true );
743 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 743 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
744 } 744 }
745 745
746 //#endif 746 //#endif
747 // ****************** 747 // ******************
748 QAction *action; 748 QAction *action;
749 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 749 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
750 configureToolBarMenu->setCheckable( true ); 750 configureToolBarMenu->setCheckable( true );
751 751
752 752
753 configureAgendaMenu->setCheckable( true ); 753 configureAgendaMenu->setCheckable( true );
754 int iii ; 754 int iii ;
755 for ( iii = 1;iii<= 10 ;++iii ){ 755 for ( iii = 1;iii<= 10 ;++iii ){
756 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 756 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
757 } 757 }
758 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 758 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
759 759
760 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 760 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
761 this, SLOT( showConfigureAgenda( ) ) ); 761 this, SLOT( showConfigureAgenda( ) ) );
762 icon = loadPixmap( pathString + "today" ); 762 icon = loadPixmap( pathString + "today" );
763 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 763 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
764 today_action->addTo( actionMenu ); 764 today_action->addTo( actionMenu );
765 connect( today_action, SIGNAL( activated() ), 765 connect( today_action, SIGNAL( activated() ),
766 mView, SLOT( goToday() ) ); 766 mView, SLOT( goToday() ) );
767 767
768 icon = loadPixmap( pathString + "picker" ); 768 icon = loadPixmap( pathString + "picker" );
769 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 769 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
770 dPickerAction->addTo( actionMenu ); 770 dPickerAction->addTo( actionMenu );
771 connect( dPickerAction, SIGNAL( activated() ), 771 connect( dPickerAction, SIGNAL( activated() ),
772 mView, SLOT( showDatePicker() ) ); 772 mView, SLOT( showDatePicker() ) );
773 773
774 icon = loadPixmap( pathString + "search" ); 774 icon = loadPixmap( pathString + "search" );
775 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 775 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
776 search_action->addTo( actionMenu ); 776 search_action->addTo( actionMenu );
777 connect( search_action, SIGNAL( activated() ), 777 connect( search_action, SIGNAL( activated() ),
778 mView->dialogManager(), SLOT( showSearchDialog() ) ); 778 mView->dialogManager(), SLOT( showSearchDialog() ) );
779 779
780 actionMenu->insertSeparator(); 780 actionMenu->insertSeparator();
781 781
782 782
783 783
784 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 784 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
785 action->addTo( actionMenu ); 785 action->addTo( actionMenu );
786 connect( action, SIGNAL( activated() ), 786 connect( action, SIGNAL( activated() ),
787 mView, SLOT( undo_delete() ) ); 787 mView, SLOT( undo_delete() ) );
788 788
789 icon = loadPixmap( pathString + "newevent" ); 789 icon = loadPixmap( pathString + "newevent" );
790 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 790 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
791 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 791 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
792 configureToolBarMenu->insertSeparator(); 792 configureToolBarMenu->insertSeparator();
793 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 793 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
794 configureToolBarMenu->insertSeparator(); 794 configureToolBarMenu->insertSeparator();
795 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 795 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
796 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 796 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
797 797
798 actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 798 actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
799 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 799 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
800 mShowAction->addTo( mCurrentItemMenu ); 800 mShowAction->addTo( mCurrentItemMenu );
801 connect( mShowAction, SIGNAL( activated() ), 801 connect( mShowAction, SIGNAL( activated() ),
802 mView, SLOT( showIncidence() ) ); 802 mView, SLOT( showIncidence() ) );
803 803
804 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 804 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
805 mEditAction->addTo( mCurrentItemMenu ); 805 mEditAction->addTo( mCurrentItemMenu );
806 connect( mEditAction, SIGNAL( activated() ), 806 connect( mEditAction, SIGNAL( activated() ),
807 mView, SLOT( editIncidence() ) ); 807 mView, SLOT( editIncidence() ) );
808 808
809 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 809 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
810 mDeleteAction->addTo( mCurrentItemMenu ); 810 mDeleteAction->addTo( mCurrentItemMenu );
811 connect( mDeleteAction, SIGNAL( activated() ), 811 connect( mDeleteAction, SIGNAL( activated() ),
812 mView, SLOT( deleteIncidence() ) ); 812 mView, SLOT( deleteIncidence() ) );
813 813
814 814
815 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 815 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
816 mCloneAction->addTo( mCurrentItemMenu ); 816 mCloneAction->addTo( mCurrentItemMenu );
817 connect( mCloneAction, SIGNAL( activated() ), 817 connect( mCloneAction, SIGNAL( activated() ),
818 mView, SLOT( cloneIncidence() ) ); 818 mView, SLOT( cloneIncidence() ) );
819 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 819 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
820 mMoveAction->addTo( mCurrentItemMenu ); 820 mMoveAction->addTo( mCurrentItemMenu );
821 connect( mMoveAction, SIGNAL( activated() ), 821 connect( mMoveAction, SIGNAL( activated() ),
822 mView, SLOT( moveIncidence() ) ); 822 mView, SLOT( moveIncidence() ) );
823 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 823 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
824 mBeamAction->addTo(mCurrentItemMenu ); 824 mBeamAction->addTo(mCurrentItemMenu );
825 connect( mBeamAction, SIGNAL( activated() ), 825 connect( mBeamAction, SIGNAL( activated() ),
826 mView, SLOT( beamIncidence() ) ); 826 mView, SLOT( beamIncidence() ) );
827 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 827 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
828 mCancelAction->addTo( mCurrentItemMenu ); 828 mCancelAction->addTo( mCurrentItemMenu );
829 connect( mCancelAction, SIGNAL( activated() ), 829 connect( mCancelAction, SIGNAL( activated() ),
830 mView, SLOT( toggleCancelIncidence() ) ); 830 mView, SLOT( toggleCancelIncidence() ) );
831#ifdef DESKTOP_VERSION 831#ifdef DESKTOP_VERSION
832 actionMenu->insertSeparator(); 832 actionMenu->insertSeparator();
833#endif 833#endif
834 834
835 835
836 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 836 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
837 ne_action->addTo( actionMenu ); 837 ne_action->addTo( actionMenu );
838 connect( ne_action, SIGNAL( activated() ), 838 connect( ne_action, SIGNAL( activated() ),
839 mView, SLOT( newEvent() ) ); 839 mView, SLOT( newEvent() ) );
840 icon = loadPixmap( pathString + "newtodo" ); 840 icon = loadPixmap( pathString + "newtodo" );
841 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 841 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
842 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 842 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
843 nt_action->addTo( actionMenu ); 843 nt_action->addTo( actionMenu );
844 connect( nt_action, SIGNAL( activated() ), 844 connect( nt_action, SIGNAL( activated() ),
845 mView, SLOT( newTodo() ) ); 845 mView, SLOT( newTodo() ) );
846 846
847 847
848 848
849 // *********************** 849 // ***********************
850 if ( KOPrefs::instance()->mVerticalScreen ) { 850 if ( KOPrefs::instance()->mVerticalScreen ) {
851 icon = SmallIcon( "1updownarrow" ); 851 icon = SmallIcon( "1updownarrow" );
852 } else { 852 } else {
853 icon = SmallIcon("1leftrightarrow" ); 853 icon = SmallIcon("1leftrightarrow" );
854 } 854 }
855 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 855 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
856 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 856 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
857 FSaction->addTo( viewMenu ); 857 FSaction->addTo( viewMenu );
858 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 858 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
859 859
860 860
861 icon = loadPixmap( pathString + "filter" ); 861 icon = loadPixmap( pathString + "filter" );
862 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 862 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
863 icon = loadPixmap( pathString + "configure" ); 863 icon = loadPixmap( pathString + "configure" );
864 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 864 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
865 action->addTo( viewMenu ); 865 action->addTo( viewMenu );
866 connect( action, SIGNAL( activated() ), 866 connect( action, SIGNAL( activated() ),
867 mView, SLOT( toggleFilter() ) ); 867 mView, SLOT( toggleFilter() ) );
868 mToggleFilter = action; 868 mToggleFilter = action;
869 icon = loadPixmap( pathString + "navi" ); 869 icon = loadPixmap( pathString + "navi" );
870 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 870 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
871 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 871 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
872 action->addTo( viewMenu ); 872 action->addTo( viewMenu );
873 connect( action, SIGNAL( activated() ), 873 connect( action, SIGNAL( activated() ),
874 mView, SLOT( toggleDateNavigatorWidget() ) ); 874 mView, SLOT( toggleDateNavigatorWidget() ) );
875 mToggleNav = action ; 875 mToggleNav = action ;
876 icon = loadPixmap( pathString + "allday" ); 876 icon = loadPixmap( pathString + "allday" );
877 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 877 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
878 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 878 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
879 action->addTo( viewMenu ); 879 action->addTo( viewMenu );
880 connect( action, SIGNAL( activated() ), 880 connect( action, SIGNAL( activated() ),
881 mView, SLOT( toggleAllDaySize() ) ); 881 mView, SLOT( toggleAllDaySize() ) );
882 mToggleAllday = action; 882 mToggleAllday = action;
883 883
884 884
885 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 885 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
886 mToggleNav, SLOT( setEnabled ( bool ) ) ); 886 mToggleNav, SLOT( setEnabled ( bool ) ) );
887 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 887 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
888 // mToggleFilter, SLOT( setEnabled ( bool ) ) ); 888 // mToggleFilter, SLOT( setEnabled ( bool ) ) );
889 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 889 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
890 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 890 mToggleAllday, SLOT( setEnabled ( bool ) ) );
891 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 891 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
892 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 892 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
893 893
894 894
895 dPickerAction->addTo( iconToolBar ); 895 dPickerAction->addTo( iconToolBar );
896 viewMenu->insertSeparator(); 896 viewMenu->insertSeparator();
897 897
898 if ( p-> mShowIconToggleFull ) 898 if ( p-> mShowIconToggleFull )
899 FSaction->addTo( iconToolBar ); 899 FSaction->addTo( iconToolBar );
900 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 900 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
901 901
902 //******************** 902 //********************
903 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 903 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
904 904
905 905
906 icon = loadPixmap( pathString + "whatsnext" ); 906 icon = loadPixmap( pathString + "whatsnext" );
907 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 907 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
908 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 908 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
909 whatsnext_action->addTo( viewMenu ); 909 whatsnext_action->addTo( viewMenu );
910 connect( whatsnext_action, SIGNAL( activated() ), 910 connect( whatsnext_action, SIGNAL( activated() ),
911 mView->viewManager(), SLOT( showWhatsNextView() ) ); 911 mView->viewManager(), SLOT( showWhatsNextView() ) );
912 912
913 icon = loadPixmap( pathString + "xdays" ); 913 icon = loadPixmap( pathString + "xdays" );
914 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 914 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
915 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 915 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
916 xdays_action->addTo( viewMenu ); 916 xdays_action->addTo( viewMenu );
917 connect( xdays_action, SIGNAL( activated() ), 917 connect( xdays_action, SIGNAL( activated() ),
918 mView->viewManager(), SLOT( showNextXView() ) ); 918 mView->viewManager(), SLOT( showNextXView() ) );
919 919
920 920
921 icon = loadPixmap( pathString + "journal" ); 921 icon = loadPixmap( pathString + "journal" );
922 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 922 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
923 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 923 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
924 viewjournal_action->addTo( viewMenu ); 924 viewjournal_action->addTo( viewMenu );
925 connect( viewjournal_action, SIGNAL( activated() ), 925 connect( viewjournal_action, SIGNAL( activated() ),
926 mView->viewManager(), SLOT( showJournalView() ) ); 926 mView->viewManager(), SLOT( showJournalView() ) );
927 927
928 928
929 icon = loadPixmap( pathString + "day" ); 929 icon = loadPixmap( pathString + "day" );
930 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 930 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
931 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 931 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
932 day1_action->addTo( viewMenu ); 932 day1_action->addTo( viewMenu );
933 // action->addTo( toolBar ); 933 // action->addTo( toolBar );
934 connect( day1_action, SIGNAL( activated() ), 934 connect( day1_action, SIGNAL( activated() ),
935 mView->viewManager(), SLOT( showDayView() ) ); 935 mView->viewManager(), SLOT( showDayView() ) );
936 936
937 icon = loadPixmap( pathString + "workweek" ); 937 icon = loadPixmap( pathString + "workweek" );
938 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 938 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
939 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 939 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
940 day5_action->addTo( viewMenu ); 940 day5_action->addTo( viewMenu );
941 connect( day5_action, SIGNAL( activated() ), 941 connect( day5_action, SIGNAL( activated() ),
942 mView->viewManager(), SLOT( showWorkWeekView() ) ); 942 mView->viewManager(), SLOT( showWorkWeekView() ) );
943 943
944 icon = loadPixmap( pathString + "week" ); 944 icon = loadPixmap( pathString + "week" );
945 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 945 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
946 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 946 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
947 day7_action->addTo( viewMenu ); 947 day7_action->addTo( viewMenu );
948 connect( day7_action, SIGNAL( activated() ), 948 connect( day7_action, SIGNAL( activated() ),
949 mView->viewManager(), SLOT( showWeekView() ) ); 949 mView->viewManager(), SLOT( showWeekView() ) );
950 950
951 icon = loadPixmap( pathString + "workweek2" ); 951 icon = loadPixmap( pathString + "workweek2" );
952 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 952 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
953 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 953 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
954 day6_action->addTo( viewMenu ); 954 day6_action->addTo( viewMenu );
955 connect( day6_action, SIGNAL( activated() ), 955 connect( day6_action, SIGNAL( activated() ),
956 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 956 mView->viewManager(), SLOT( showMonthViewWeek() ) );
957 957
958 icon = loadPixmap( pathString + "month" ); 958 icon = loadPixmap( pathString + "month" );
959 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 959 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
960 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 960 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
961 month_action->addTo( viewMenu ); 961 month_action->addTo( viewMenu );
962 connect( month_action, SIGNAL( activated() ), 962 connect( month_action, SIGNAL( activated() ),
963 mView->viewManager(), SLOT( showMonthView() ) ); 963 mView->viewManager(), SLOT( showMonthView() ) );
964 964
965 icon = loadPixmap( pathString + "list" ); 965 icon = loadPixmap( pathString + "list" );
966 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 966 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
967 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 967 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
968 showlist_action->addTo( viewMenu ); 968 showlist_action->addTo( viewMenu );
969 connect( showlist_action, SIGNAL( activated() ), 969 connect( showlist_action, SIGNAL( activated() ),
970 mView->viewManager(), SLOT( showListView() ) ); 970 mView->viewManager(), SLOT( showListView() ) );
971 971
972 icon = loadPixmap( pathString + "todo" ); 972 icon = loadPixmap( pathString + "todo" );
973 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 973 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
974 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 974 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
975 todoview_action->addTo( viewMenu ); 975 todoview_action->addTo( viewMenu );
976 connect( todoview_action, SIGNAL( activated() ), 976 connect( todoview_action, SIGNAL( activated() ),
977 mView->viewManager(), SLOT( showTodoView() ) ); 977 mView->viewManager(), SLOT( showTodoView() ) );
978 978
979 979
980 980
981#if 0 981#if 0
982 action = new QAction( "view_timespan", "Time Span", 0, this ); 982 action = new QAction( "view_timespan", "Time Span", 0, this );
983 action->addTo( viewMenu ); 983 action->addTo( viewMenu );
984 connect( action, SIGNAL( activated() ), 984 connect( action, SIGNAL( activated() ),
985 mView->viewManager(), SLOT( showTimeSpanView() ) ); 985 mView->viewManager(), SLOT( showTimeSpanView() ) );
986#endif 986#endif
987 987
988 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 988 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
989 this ); 989 this );
990 mNewSubTodoAction->addTo( actionMenu ); 990 mNewSubTodoAction->addTo( actionMenu );
991 connect( mNewSubTodoAction, SIGNAL( activated() ), 991 connect( mNewSubTodoAction, SIGNAL( activated() ),
992 mView, SLOT( newSubTodo() ) ); 992 mView, SLOT( newSubTodo() ) );
993 993
994 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, 994 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
995 this ); 995 this );
996 action->addTo( actionMenu ); 996 action->addTo( actionMenu );
997 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 997 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
998 998
999 999
1000 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1000 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
1001 1001
1002 1002
1003 1003
1004 actionMenu->insertSeparator(); 1004 actionMenu->insertSeparator();
1005 action = new QAction( "manage cat", i18n("Edit category list..."), 0, 1005 action = new QAction( "manage cat", i18n("Edit category list..."), 0,
1006 this ); 1006 this );
1007 action->addTo( actionMenu ); 1007 action->addTo( actionMenu );
1008 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); 1008 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
1009 1009
1010 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1010 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1011 this ); 1011 this );
1012 action->addTo( actionMenu ); 1012 action->addTo( actionMenu );
1013 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1013 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1014 1014
1015 1015
1016 actionMenu->insertSeparator(); 1016 actionMenu->insertSeparator();
1017 icon = loadPixmap( pathString + "configure" ); 1017 icon = loadPixmap( pathString + "configure" );
1018 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 1018 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
1019 action->addTo( actionMenu ); 1019 action->addTo( actionMenu );
1020 connect( action, SIGNAL( activated() ), 1020 connect( action, SIGNAL( activated() ),
1021 mView, SLOT( edit_options() ) ); 1021 mView, SLOT( edit_options() ) );
1022 icon = loadPixmap( pathString + "configure" ); 1022 icon = loadPixmap( pathString + "configure" );
1023 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 1023 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
1024 action->addTo( actionMenu ); 1024 action->addTo( actionMenu );
1025 connect( action, SIGNAL( activated() ), 1025 connect( action, SIGNAL( activated() ),
1026 mView, SLOT( edit_global_options() ) ); 1026 mView, SLOT( edit_global_options() ) );
1027 if ( KOPrefs::instance()->mShowFullMenu ) { 1027 if ( KOPrefs::instance()->mShowFullMenu ) {
1028 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 1028 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
1029 1029
1030 } 1030 }
1031 // actionMenu->insertSeparator(); 1031 // actionMenu->insertSeparator();
1032 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 1032 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
1033 this ); 1033 this );
1034 action->addTo( importMenu_X ); 1034 action->addTo( importMenu_X );
1035 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 1035 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
1036 action = new QAction( "import_quick", i18n("Import last file"), 0, 1036 action = new QAction( "import_quick", i18n("Import last file"), 0,
1037 this ); 1037 this );
1038 action->addTo( importMenu_X ); 1038 action->addTo( importMenu_X );
1039 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 1039 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
1040 importMenu_X->insertSeparator(); 1040 importMenu_X->insertSeparator();
1041 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 1041 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
1042 this ); 1042 this );
1043 action->addTo( importMenu_X ); 1043 action->addTo( importMenu_X );
1044 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 1044 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
1045 //#ifndef DESKTOP_VERSION 1045 //#ifndef DESKTOP_VERSION
1046 importMenu_X->insertSeparator(); 1046 importMenu_X->insertSeparator();
1047 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 1047 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
1048 this ); 1048 this );
1049 action->addTo( importMenu_X ); 1049 action->addTo( importMenu_X );
1050 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 1050 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
1051 //#else 1051 //#else
1052#ifdef _OL_IMPORT_ 1052#ifdef _OL_IMPORT_
1053 importMenu_X->insertSeparator(); 1053 importMenu_X->insertSeparator();
1054 action = new QAction( "import_ol", i18n("Import from OL"), 0, 1054 action = new QAction( "import_ol", i18n("Import from OL"), 0,
1055 this ); 1055 this );
1056 action->addTo( importMenu_X ); 1056 action->addTo( importMenu_X );
1057 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1057 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1058#endif 1058#endif
1059 //#endif 1059 //#endif
1060 1060
1061 //importMenu->insertSeparator(); 1061 //importMenu->insertSeparator();
1062#if 0 1062#if 0
1063 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1063 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
1064 this ); 1064 this );
1065 action->addTo( importMenu ); 1065 action->addTo( importMenu );
1066 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1066 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1067#endif 1067#endif
1068 action = new QAction( "save_cal", i18n("Save Backup..."), 0, 1068 action = new QAction( "save_cal", i18n("Save Backup..."), 0,
1069 this ); 1069 this );
1070 action->addTo( importMenu ); 1070 action->addTo( importMenu );
1071 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1071 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1072 importMenu->insertSeparator(); 1072 importMenu->insertSeparator();
1073 importMenu->insertItem( i18n("Import"), importMenu_X ); 1073 importMenu->insertItem( i18n("Import"), importMenu_X );
1074 //importMenu->insertSeparator(); 1074 //importMenu->insertSeparator();
1075 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1075 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
1076 this ); 1076 this );
1077 action->addTo( exportMenu_X ); 1077 action->addTo( exportMenu_X );
1078 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1078 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1079 1079
1080 1080
1081 //LR 1081 //LR
1082 QPopupMenu *ex2phone = new QPopupMenu( this ); 1082 QPopupMenu *ex2phone = new QPopupMenu( this );
1083 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1083 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1084 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1084 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1085 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1085 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1086 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1086 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1087 1087
1088 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1088 importMenu->insertItem( i18n("Export"), exportMenu_X );
1089#ifndef DESKTOP_VERSION 1089#ifndef DESKTOP_VERSION
1090 //importMenu->insertSeparator(); 1090 //importMenu->insertSeparator();
1091 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1091 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1092 this ); 1092 this );
1093 brAction->addTo( beamMenu_X ); 1093 brAction->addTo( beamMenu_X );
1094 brAction->setToggleAction (true ) ; 1094 brAction->setToggleAction (true ) ;
1095 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1095 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1096 1096
1097 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1097 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1098 this ); 1098 this );
1099 action->addTo( beamMenu_X ); 1099 action->addTo( beamMenu_X );
1100 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1100 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1101 1101
1102 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1102 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1103 this ); 1103 this );
1104 action->addTo( beamMenu_X ); 1104 action->addTo( beamMenu_X );
1105 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1105 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1106 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1106 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1107#else 1107#else
1108 //importMenu->insertSeparator(); 1108 //importMenu->insertSeparator();
1109 icon = loadPixmap( pathString + "print" ); 1109 icon = loadPixmap( pathString + "print" );
1110 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1110 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1111 action->addTo( beamMenu_X ); 1111 action->addTo( beamMenu_X );
1112 connect( action, SIGNAL( activated() ), 1112 connect( action, SIGNAL( activated() ),
1113 this, SLOT( printCal() ) ); 1113 this, SLOT( printCal() ) );
1114 1114
1115 icon = loadPixmap( pathString + "print" ); 1115 icon = loadPixmap( pathString + "print" );
1116 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1116 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1117 action->addTo( beamMenu_X ); 1117 action->addTo( beamMenu_X );
1118 connect( action, SIGNAL( activated() ), 1118 connect( action, SIGNAL( activated() ),
1119 this, SLOT( printSel() ) ); 1119 this, SLOT( printSel() ) );
1120 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1120 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1121 action->addTo( beamMenu_X ); 1121 action->addTo( beamMenu_X );
1122 connect( action, SIGNAL( activated() ), 1122 connect( action, SIGNAL( activated() ),
1123 mView->viewManager(), SLOT( slotprintWNV() ) ); 1123 mView->viewManager(), SLOT( slotprintWNV() ) );
1124 1124
1125 1125
1126 icon = loadPixmap( pathString + "print" ); 1126 icon = loadPixmap( pathString + "print" );
1127 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); 1127 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
1128 action->addTo( beamMenu_X ); 1128 action->addTo( beamMenu_X );
1129 connect( action, SIGNAL( activated() ), 1129 connect( action, SIGNAL( activated() ),
1130 this, SLOT( printListView() ) ); 1130 this, SLOT( printListView() ) );
1131 1131
1132 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1132 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1133 action->addTo( beamMenu_X ); 1133 action->addTo( beamMenu_X );
1134 connect( action, SIGNAL( activated() ), 1134 connect( action, SIGNAL( activated() ),
1135 mView, SLOT( slotprintSelInc() ) ); 1135 mView, SLOT( slotprintSelInc() ) );
1136 1136
1137 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1137 importMenu->insertItem( i18n("Print"), beamMenu_X );
1138#endif 1138#endif
1139 1139
1140 importMenu->insertSeparator(); 1140 importMenu->insertSeparator();
1141 action = new QAction( "beam all", i18n("Save"), 0, 1141 action = new QAction( "beam all", i18n("Save"), 0,
1142 this ); 1142 this );
1143 action->addTo( importMenu ); 1143 action->addTo( importMenu );
1144 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1144 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1145 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1145 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1146 this ); 1146 this );
1147 action->addTo( importMenu ); 1147 action->addTo( importMenu );
1148 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1148 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1149 1149
1150 //menuBar->insertItem( "Configure",configureMenu ); 1150 //menuBar->insertItem( "Configure",configureMenu );
1151 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1151 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1152 icon = loadPixmap( "korganizer/korganizer" ); 1152 icon = loadPixmap( "korganizer/korganizer" );
1153 1153
1154 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1154 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1155 action->addTo( helpMenu ); 1155 action->addTo( helpMenu );
1156 connect( action, SIGNAL( activated() ), 1156 connect( action, SIGNAL( activated() ),
1157 SLOT( whatsNew() ) ); 1157 SLOT( whatsNew() ) );
1158 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1158 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1159 action->addTo( helpMenu ); 1159 action->addTo( helpMenu );
1160 connect( action, SIGNAL( activated() ), 1160 connect( action, SIGNAL( activated() ),
1161 SLOT( features() ) ); 1161 SLOT( features() ) );
1162 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1162 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1163 action->addTo( helpMenu ); 1163 action->addTo( helpMenu );
1164 connect( action, SIGNAL( activated() ), 1164 connect( action, SIGNAL( activated() ),
1165 SLOT( keyBindings() ) ); 1165 SLOT( keyBindings() ) );
1166 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1166 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1167 action->addTo( helpMenu ); 1167 action->addTo( helpMenu );
1168 connect( action, SIGNAL( activated() ), 1168 connect( action, SIGNAL( activated() ),
1169 SLOT( storagehowto() ) ); 1169 SLOT( storagehowto() ) );
1170 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); 1170 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1171 action->addTo( helpMenu ); 1171 action->addTo( helpMenu );
1172 connect( action, SIGNAL( activated() ), 1172 connect( action, SIGNAL( activated() ),
1173 SLOT( timetrackinghowto() ) ); 1173 SLOT( timetrackinghowto() ) );
1174 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1174 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1175 action->addTo( helpMenu ); 1175 action->addTo( helpMenu );
1176 connect( action, SIGNAL( activated() ), 1176 connect( action, SIGNAL( activated() ),
1177 SLOT( synchowto() ) ); 1177 SLOT( synchowto() ) );
1178 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1178 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1179 action->addTo( helpMenu ); 1179 action->addTo( helpMenu );
1180 connect( action, SIGNAL( activated() ), 1180 connect( action, SIGNAL( activated() ),
1181 SLOT( kdesynchowto() ) ); 1181 SLOT( kdesynchowto() ) );
1182 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1182 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1183 action->addTo( helpMenu ); 1183 action->addTo( helpMenu );
1184 connect( action, SIGNAL( activated() ), 1184 connect( action, SIGNAL( activated() ),
1185 SLOT( multisynchowto() ) ); 1185 SLOT( multisynchowto() ) );
1186 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1186 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1187 action->addTo( helpMenu ); 1187 action->addTo( helpMenu );
1188 connect( action, SIGNAL( activated() ), 1188 connect( action, SIGNAL( activated() ),
1189 SLOT( aboutAutoSaving() ) ); 1189 SLOT( aboutAutoSaving() ) );
1190 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1190 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1191 action->addTo( helpMenu ); 1191 action->addTo( helpMenu );
1192 connect( action, SIGNAL( activated() ), 1192 connect( action, SIGNAL( activated() ),
1193 SLOT( aboutKnownBugs() ) ); 1193 SLOT( aboutKnownBugs() ) );
1194 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1194 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1195 action->addTo( helpMenu ); 1195 action->addTo( helpMenu );
1196 connect( action, SIGNAL( activated() ), 1196 connect( action, SIGNAL( activated() ),
1197 SLOT( usertrans() ) ); 1197 SLOT( usertrans() ) );
1198 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1198 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1199 action->addTo( helpMenu ); 1199 action->addTo( helpMenu );
1200 connect( action, SIGNAL( activated() ), 1200 connect( action, SIGNAL( activated() ),
1201 SLOT( faq() ) ); 1201 SLOT( faq() ) );
1202 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1202 action = new QAction( "licence", i18n("Licence..."), 0, this );
1203 action->addTo( helpMenu ); 1203 action->addTo( helpMenu );
1204 connect( action, SIGNAL( activated() ), 1204 connect( action, SIGNAL( activated() ),
1205 SLOT( licence() ) ); 1205 SLOT( licence() ) );
1206 action = new QAction( "about", i18n("About..."), 0, this ); 1206 action = new QAction( "about", i18n("About..."), 0, this );
1207 action->addTo( helpMenu ); 1207 action->addTo( helpMenu );
1208 connect( action, SIGNAL( activated() ), 1208 connect( action, SIGNAL( activated() ),
1209 SLOT( about() ) ); 1209 SLOT( about() ) );
1210 //menuBar->insertSeparator(); 1210 //menuBar->insertSeparator();
1211 1211
1212 // ****************************************************** 1212 // ******************************************************
1213 // menubar icons 1213 // menubar icons
1214 1214
1215 1215
1216 1216
1217 //menuBar->insertItem( iconToolBar ); 1217 //menuBar->insertItem( iconToolBar );
1218 //xdays_action 1218 //xdays_action
1219 if (p-> mShowIconNewEvent) 1219 if (p-> mShowIconNewEvent)
1220 ne_action->addTo( iconToolBar ); 1220 ne_action->addTo( iconToolBar );
1221 if (p->mShowIconNewTodo ) 1221 if (p->mShowIconNewTodo )
1222 nt_action->addTo( iconToolBar ); 1222 nt_action->addTo( iconToolBar );
1223 if (p-> mShowIconSearch) 1223 if (p-> mShowIconSearch)
1224 search_action->addTo( iconToolBar ); 1224 search_action->addTo( iconToolBar );
1225 if (p-> mShowIconWhatsThis) 1225 if (p-> mShowIconWhatsThis)
1226 QWhatsThis::whatsThisButton ( iconToolBar ); 1226 QWhatsThis::whatsThisButton ( iconToolBar );
1227 if (p-> mShowIconNext) 1227 if (p-> mShowIconNext)
1228 whatsnext_action->addTo( viewToolBar ); 1228 whatsnext_action->addTo( viewToolBar );
1229 if (p-> mShowIconNextDays) 1229 if (p-> mShowIconNextDays)
1230 xdays_action->addTo( viewToolBar ); 1230 xdays_action->addTo( viewToolBar );
1231 if (p-> mShowIconJournal) 1231 if (p-> mShowIconJournal)
1232 viewjournal_action->addTo( viewToolBar ); 1232 viewjournal_action->addTo( viewToolBar );
1233 if (p-> mShowIconDay1) 1233 if (p-> mShowIconDay1)
1234 day1_action->addTo( viewToolBar ); 1234 day1_action->addTo( viewToolBar );
1235 if (p-> mShowIconDay5) 1235 if (p-> mShowIconDay5)
1236 day5_action->addTo( viewToolBar ); 1236 day5_action->addTo( viewToolBar );
1237 if (p-> mShowIconDay7) 1237 if (p-> mShowIconDay7)
1238 day7_action->addTo( viewToolBar ); 1238 day7_action->addTo( viewToolBar );
1239 if (p-> mShowIconDay6) 1239 if (p-> mShowIconDay6)
1240 day6_action->addTo( viewToolBar ); 1240 day6_action->addTo( viewToolBar );
1241 if (p-> mShowIconMonth) 1241 if (p-> mShowIconMonth)
1242 month_action->addTo( viewToolBar ); 1242 month_action->addTo( viewToolBar );
1243 if (p-> mShowIconList) 1243 if (p-> mShowIconList)
1244 showlist_action->addTo( viewToolBar ); 1244 showlist_action->addTo( viewToolBar );
1245 if (p-> mShowIconTodoview) 1245 if (p-> mShowIconTodoview)
1246 todoview_action->addTo( viewToolBar ); 1246 todoview_action->addTo( viewToolBar );
1247 1247
1248 icon = loadPixmap( pathString + "2leftarrowB" ); 1248 icon = loadPixmap( pathString + "2leftarrowB" );
1249 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1249 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1250 if (p-> mShowIconBackFast) { 1250 if (p-> mShowIconBackFast) {
1251 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1251 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1252 connect( action, SIGNAL( activated() ), 1252 connect( action, SIGNAL( activated() ),
1253 mView, SLOT( goPreviousMonth() ) ); 1253 mView, SLOT( goPreviousMonth() ) );
1254 action->addTo( navigatorToolBar ); 1254 action->addTo( navigatorToolBar );
1255 } 1255 }
1256 icon = loadPixmap( pathString + "1leftarrowB" ); 1256 icon = loadPixmap( pathString + "1leftarrowB" );
1257 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1257 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1258 if (p-> mShowIconBack) { 1258 if (p-> mShowIconBack) {
1259 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1259 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1260 connect( action, SIGNAL( activated() ), 1260 connect( action, SIGNAL( activated() ),
1261 mView, SLOT( goPrevious() ) ); 1261 mView, SLOT( goPrevious() ) );
1262 action->addTo( navigatorToolBar ); 1262 action->addTo( navigatorToolBar );
1263 } 1263 }
1264 icon = loadPixmap( pathString + "today" ); 1264 icon = loadPixmap( pathString + "today" );
1265 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1265 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1266 if (p-> mShowIconToday) 1266 if (p-> mShowIconToday)
1267 today_action->addTo( navigatorToolBar ); 1267 today_action->addTo( navigatorToolBar );
1268 icon = loadPixmap( pathString + "1rightarrowB" ); 1268 icon = loadPixmap( pathString + "1rightarrowB" );
1269 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1269 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1270 if (p-> mShowIconForward) { 1270 if (p-> mShowIconForward) {
1271 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1271 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1272 connect( action, SIGNAL( activated() ), 1272 connect( action, SIGNAL( activated() ),
1273 mView, SLOT( goNext() ) ); 1273 mView, SLOT( goNext() ) );
1274 action->addTo( navigatorToolBar ); 1274 action->addTo( navigatorToolBar );
1275 } 1275 }
1276 icon = loadPixmap( pathString + "2rightarrowB" ); 1276 icon = loadPixmap( pathString + "2rightarrowB" );
1277 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1277 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1278 if (p-> mShowIconForwardFast) { 1278 if (p-> mShowIconForwardFast) {
1279 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1279 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1280 connect( action, SIGNAL( activated() ), 1280 connect( action, SIGNAL( activated() ),
1281 mView, SLOT( goNextMonth() ) ); 1281 mView, SLOT( goNextMonth() ) );
1282 action->addTo( navigatorToolBar ); 1282 action->addTo( navigatorToolBar );
1283 } 1283 }
1284 1284
1285 1285
1286 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1286 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1287 1287
1288 1288
1289 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); 1289 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
1290 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); 1290 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
1291 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); 1291 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
1292 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); 1292 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true);
1293 1293
1294 if (p-> mShowIconNewEvent) 1294 if (p-> mShowIconNewEvent)
1295 configureToolBarMenu->setItemChecked( 10, true ); 1295 configureToolBarMenu->setItemChecked( 10, true );
1296 if (p->mShowIconNewTodo ) 1296 if (p->mShowIconNewTodo )
1297 configureToolBarMenu->setItemChecked( 20, true ); 1297 configureToolBarMenu->setItemChecked( 20, true );
1298 if (p-> mShowIconSearch) 1298 if (p-> mShowIconSearch)
1299 configureToolBarMenu->setItemChecked( 120, true ); 1299 configureToolBarMenu->setItemChecked( 120, true );
1300 if (p-> mShowIconList) 1300 if (p-> mShowIconList)
1301 configureToolBarMenu->setItemChecked( 30, true ); 1301 configureToolBarMenu->setItemChecked( 30, true );
1302 if (p-> mShowIconDay1) 1302 if (p-> mShowIconDay1)
1303 configureToolBarMenu->setItemChecked( 40, true ); 1303 configureToolBarMenu->setItemChecked( 40, true );
1304 if (p-> mShowIconDay5) 1304 if (p-> mShowIconDay5)
1305 configureToolBarMenu->setItemChecked( 50, true ); 1305 configureToolBarMenu->setItemChecked( 50, true );
1306 if (p-> mShowIconDay6) 1306 if (p-> mShowIconDay6)
1307 configureToolBarMenu->setItemChecked( 75, true ); 1307 configureToolBarMenu->setItemChecked( 75, true );
1308 if (p-> mShowIconDay7) 1308 if (p-> mShowIconDay7)
1309 configureToolBarMenu->setItemChecked( 60, true ); 1309 configureToolBarMenu->setItemChecked( 60, true );
1310 if (p-> mShowIconMonth) 1310 if (p-> mShowIconMonth)
1311 configureToolBarMenu->setItemChecked( 70, true ); 1311 configureToolBarMenu->setItemChecked( 70, true );
1312 if (p-> mShowIconTodoview) 1312 if (p-> mShowIconTodoview)
1313 configureToolBarMenu->setItemChecked( 80, true ); 1313 configureToolBarMenu->setItemChecked( 80, true );
1314 if (p-> mShowIconBackFast) 1314 if (p-> mShowIconBackFast)
1315 configureToolBarMenu->setItemChecked( 200, true ); 1315 configureToolBarMenu->setItemChecked( 200, true );
1316 if (p-> mShowIconBack) 1316 if (p-> mShowIconBack)
1317 configureToolBarMenu->setItemChecked( 210, true ); 1317 configureToolBarMenu->setItemChecked( 210, true );
1318 if (p-> mShowIconToday) 1318 if (p-> mShowIconToday)
1319 configureToolBarMenu->setItemChecked( 130, true ); 1319 configureToolBarMenu->setItemChecked( 130, true );
1320 if (p-> mShowIconForward) 1320 if (p-> mShowIconForward)
1321 configureToolBarMenu->setItemChecked( 220, true ); 1321 configureToolBarMenu->setItemChecked( 220, true );
1322 if (p-> mShowIconForwardFast) 1322 if (p-> mShowIconForwardFast)
1323 configureToolBarMenu->setItemChecked( 230, true ); 1323 configureToolBarMenu->setItemChecked( 230, true );
1324 if (p-> mShowIconNextDays) 1324 if (p-> mShowIconNextDays)
1325 configureToolBarMenu->setItemChecked( 100, true ); 1325 configureToolBarMenu->setItemChecked( 100, true );
1326 if (p-> mShowIconNext) 1326 if (p-> mShowIconNext)
1327 configureToolBarMenu->setItemChecked( 110, true ); 1327 configureToolBarMenu->setItemChecked( 110, true );
1328 if (p-> mShowIconJournal) 1328 if (p-> mShowIconJournal)
1329 configureToolBarMenu->setItemChecked( 90, true ); 1329 configureToolBarMenu->setItemChecked( 90, true );
1330 if (p-> mShowIconWhatsThis) 1330 if (p-> mShowIconWhatsThis)
1331 configureToolBarMenu->setItemChecked( 300, true ); 1331 configureToolBarMenu->setItemChecked( 300, true );
1332 if (p-> mShowIconWeekNum) 1332 if (p-> mShowIconWeekNum)
1333 configureToolBarMenu->setItemChecked( 400, true ); 1333 configureToolBarMenu->setItemChecked( 400, true );
1334 if (!p-> mShowIconStretch) { 1334 if (!p-> mShowIconStretch) {
1335 QLabel* dummy = new QLabel( iconToolBar ); 1335 QLabel* dummy = new QLabel( iconToolBar );
1336 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1336 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1337 dummy->setMinimumWidth( 0 ); 1337 dummy->setMinimumWidth( 0 );
1338 iconToolBar->setStretchableWidget ( dummy ) ; 1338 iconToolBar->setStretchableWidget ( dummy ) ;
1339 } 1339 }
1340 else { 1340 else {
1341 iconToolBar->setHorizontalStretchable (true ); 1341 iconToolBar->setHorizontalStretchable (true );
1342 viewToolBar->setHorizontalStretchable (true ); 1342 viewToolBar->setHorizontalStretchable (true );
1343 navigatorToolBar->setHorizontalStretchable (true ); 1343 navigatorToolBar->setHorizontalStretchable (true );
1344 iconToolBar->setVerticalStretchable (true ); 1344 iconToolBar->setVerticalStretchable (true );
1345 viewToolBar->setVerticalStretchable (true ); 1345 viewToolBar->setVerticalStretchable (true );
1346 navigatorToolBar->setVerticalStretchable (true ); 1346 navigatorToolBar->setVerticalStretchable (true );
1347 configureToolBarMenu->setItemChecked( 5, true ); 1347 configureToolBarMenu->setItemChecked( 5, true );
1348 } 1348 }
1349 if (p-> mShowIconFilter) 1349 if (p-> mShowIconFilter)
1350 configureToolBarMenu->setItemChecked( 7, true ); 1350 configureToolBarMenu->setItemChecked( 7, true );
1351 if (p-> mShowIconOnetoolbar) 1351 if (p-> mShowIconOnetoolbar)
1352 configureToolBarMenu->setItemChecked( 6, true ); 1352 configureToolBarMenu->setItemChecked( 6, true );
1353 1353
1354 1354
1355 if ( filterMenubar ) { 1355 if ( filterMenubar ) {
1356 filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); 1356 filterMenubar->reparent(filterToolBar,0,QPoint(0,0) );
1357 connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) ); 1357 connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) );
1358 } 1358 }
1359 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1359 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1360 configureAgenda( p->mHourSize ); 1360 configureAgenda( p->mHourSize );
1361 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1361 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1362} 1362}
1363 1363
1364void MainWindow::exportToPhone( int mode ) 1364void MainWindow::exportToPhone( int mode )
1365{ 1365{
1366 1366
1367 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1367 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1368 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1368 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1369 KOex2phonePrefs ex2phone; 1369 KOex2phonePrefs ex2phone;
1370 1370
1371 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1371 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1372 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1372 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1373 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1373 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1374 if ( mode == 1 ) 1374 if ( mode == 1 )
1375 ex2phone.setCaption(i18n("Export complete calendar")); 1375 ex2phone.setCaption(i18n("Export complete calendar"));
1376 if ( mode == 2 ) 1376 if ( mode == 2 )
1377 ex2phone.setCaption(i18n("Export filtered calendar")); 1377 ex2phone.setCaption(i18n("Export filtered calendar"));
1378 1378
1379 if ( !ex2phone.exec() ) { 1379 if ( !ex2phone.exec() ) {
1380 return; 1380 return;
1381 } 1381 }
1382 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1382 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1383 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1383 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1384 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1384 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1385 1385
1386 int inFuture = 0; 1386 int inFuture = 0;
1387 if ( ex2phone.mWriteBackFuture->isChecked() ) 1387 if ( ex2phone.mWriteBackFuture->isChecked() )
1388 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1388 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1389 QPtrList<Incidence> delSel; 1389 QPtrList<Incidence> delSel;
1390 if ( mode == 1 ) 1390 if ( mode == 1 )
1391 delSel = mCalendar->rawIncidences(); 1391 delSel = mCalendar->rawIncidences();
1392 if ( mode == 2 ) 1392 if ( mode == 2 )
1393 delSel = mCalendar->incidences(); 1393 delSel = mCalendar->incidences();
1394 CalendarLocal* cal = new CalendarLocal(); 1394 CalendarLocal* cal = new CalendarLocal();
1395 cal->setLocalTime(); 1395 cal->setLocalTime();
1396 Incidence *incidence = delSel.first(); 1396 Incidence *incidence = delSel.first();
1397 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1397 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1398 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1398 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1399 while ( incidence ) { 1399 while ( incidence ) {
1400 if ( incidence->typeID() != journalID ) { 1400 if ( incidence->typeID() != journalID ) {
1401 bool add = true; 1401 bool add = true;
1402 if ( inFuture ) { 1402 if ( inFuture ) {
1403 QDateTime dt; 1403 QDateTime dt;
1404 if ( incidence->typeID() == todoID ) { 1404 if ( incidence->typeID() == todoID ) {
1405 Todo * t = (Todo*)incidence; 1405 Todo * t = (Todo*)incidence;
1406 if ( t->hasDueDate() ) 1406 if ( t->hasDueDate() )
1407 dt = t->dtDue(); 1407 dt = t->dtDue();
1408 else 1408 else
1409 dt = cur.addSecs( 62 ); 1409 dt = cur.addSecs( 62 );
1410 } 1410 }
1411 else { 1411 else {
1412 bool ok; 1412 bool ok;
1413 dt = incidence->getNextOccurence( cur, &ok ); 1413 dt = incidence->getNextOccurence( cur, &ok );
1414 if ( !ok ) 1414 if ( !ok )
1415 dt = cur.addSecs( -62 ); 1415 dt = cur.addSecs( -62 );
1416 } 1416 }
1417 if ( dt < cur || dt > end ) { 1417 if ( dt < cur || dt > end ) {
1418 add = false; 1418 add = false;
1419 } 1419 }
1420 } 1420 }
1421 if ( add ) { 1421 if ( add ) {
1422 Incidence *in = incidence->clone(); 1422 Incidence *in = incidence->clone();
1423 cal->addIncidence( in ); 1423 cal->addIncidence( in );
1424 } 1424 }
1425 } 1425 }
1426 incidence = delSel.next(); 1426 incidence = delSel.next();
1427 } 1427 }
1428 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1428 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1429 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1429 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1430 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1430 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1431 1431
1432 setCaption( i18n("Writing to phone...")); 1432 setCaption( i18n("Writing to phone..."));
1433 if ( PhoneFormat::writeToPhone( cal ) ) 1433 if ( PhoneFormat::writeToPhone( cal ) )
1434 setCaption( i18n("Export to phone successful!")); 1434 setCaption( i18n("Export to phone successful!"));
1435 else 1435 else
1436 setCaption( i18n("Error exporting to phone!")); 1436 setCaption( i18n("Error exporting to phone!"));
1437 delete cal; 1437 delete cal;
1438} 1438}
1439 1439
1440 1440
1441void MainWindow::setDefaultPreferences() 1441void MainWindow::setDefaultPreferences()
1442{ 1442{
1443 KOPrefs *p = KOPrefs::instance(); 1443 KOPrefs *p = KOPrefs::instance();
1444 1444
1445 p->mCompactDialogs = true; 1445 p->mCompactDialogs = true;
1446 p->mConfirm = true; 1446 p->mConfirm = true;
1447 // p->mEnableQuickTodo = false; 1447 // p->mEnableQuickTodo = false;
1448 1448
1449} 1449}
1450 1450
1451QString MainWindow::resourcePath() 1451QString MainWindow::resourcePath()
1452{ 1452{
1453 return KGlobal::iconLoader()->iconPath(); 1453 return KGlobal::iconLoader()->iconPath();
1454} 1454}
1455 1455
1456void MainWindow::displayText( QString text ,QString cap ) 1456void MainWindow::displayText( QString text ,QString cap )
1457{ 1457{
1458 QDialog dia( this, "name", true ); ; 1458 QDialog dia( this, "name", true ); ;
1459 dia.setCaption( cap ); 1459 dia.setCaption( cap );
1460 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1460 QVBoxLayout* lay = new QVBoxLayout( &dia );
1461 lay->setSpacing( 3 ); 1461 lay->setSpacing( 3 );
1462 lay->setMargin( 3 ); 1462 lay->setMargin( 3 );
1463 QTextBrowser tb ( &dia ); 1463 QTextBrowser tb ( &dia );
1464 lay->addWidget( &tb ); 1464 lay->addWidget( &tb );
1465 tb.setText( text ); 1465 tb.setText( text );
1466#ifdef DESKTOP_VERSION 1466#ifdef DESKTOP_VERSION
1467 dia.resize( 640, 480); 1467 dia.resize( 640, 480);
1468#else 1468#else
1469 dia.showMaximized(); 1469 dia.showMaximized();
1470#endif 1470#endif
1471 dia.exec(); 1471 dia.exec();
1472} 1472}
1473 1473
1474void MainWindow::features() 1474void MainWindow::features()
1475{ 1475{
1476 1476
1477 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1477 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1478} 1478}
1479 1479
1480void MainWindow::usertrans() 1480void MainWindow::usertrans()
1481{ 1481{
1482 1482
1483 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1483 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1484} 1484}
1485 1485
1486void MainWindow::storagehowto() 1486void MainWindow::storagehowto()
1487{ 1487{
1488 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 1488 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
1489} 1489}
1490void MainWindow::timetrackinghowto() 1490void MainWindow::timetrackinghowto()
1491{ 1491{
1492 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); 1492 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" );
1493} 1493}
1494void MainWindow::kdesynchowto() 1494void MainWindow::kdesynchowto()
1495{ 1495{
1496 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1496 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1497} 1497}
1498void MainWindow::multisynchowto() 1498void MainWindow::multisynchowto()
1499{ 1499{
1500 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1500 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1501} 1501}
1502void MainWindow::synchowto() 1502void MainWindow::synchowto()
1503{ 1503{
1504 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1504 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1505} 1505}
1506void MainWindow::faq() 1506void MainWindow::faq()
1507{ 1507{
1508 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1508 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1509 1509
1510} 1510}
1511void MainWindow::whatsNew() 1511void MainWindow::whatsNew()
1512{ 1512{
1513 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1513 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1514 1514
1515} 1515}
1516void MainWindow::licence() 1516void MainWindow::licence()
1517{ 1517{
1518 KApplication::showLicence(); 1518 KApplication::showLicence();
1519 1519
1520} 1520}
1521void MainWindow::about() 1521void MainWindow::about()
1522{ 1522{
1523 QString version; 1523 QString version;
1524#include <../version> 1524#include <../version>
1525 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1525 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1526 i18n("KOrganizer/Platform-independent\n") + 1526 i18n("KOrganizer/Platform-independent\n") +
1527 "(KO/Pi) " + version + " - " + 1527 "(KO/Pi) " + version + " - " +
1528 1528
1529#ifdef DESKTOP_VERSION 1529#ifdef DESKTOP_VERSION
1530 i18n("Desktop Edition\n") + 1530 i18n("Desktop Edition\n") +
1531#else 1531#else
1532 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1532 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1533#endif 1533#endif
1534 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!") ); 1534 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!") );
1535} 1535}
1536void MainWindow::keyBindings() 1536void MainWindow::keyBindings()
1537{ 1537{
1538 QString cap = i18n("KO/Pi Keys + Colors"); 1538 QString cap = i18n("KO/Pi Keys + Colors");
1539 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1539 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1540 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1540 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1541 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1541 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1542 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1542 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1543 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1543 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1544 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1544 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1545 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ 1545 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
1546 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1546 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1547 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1547 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1548 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1548 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1549 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1549 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1550 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1550 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1551 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1551 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1552 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1552 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1553 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1553 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1554 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1554 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1555 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1555 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1556 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1556 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1557 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1557 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1558 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1558 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1559 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1559 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1560 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1560 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1561 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1561 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1562 i18n("<p><h3>In agenda view:</h3></p>\n") + 1562 i18n("<p><h3>In agenda view:</h3></p>\n") +
1563 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1563 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1564 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1564 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1565 i18n("<p><h3>In todo view:</h3></p>\n") + 1565 i18n("<p><h3>In todo view:</h3></p>\n") +
1566 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1566 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1567 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1567 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1568 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1568 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1569 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1569 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1570 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1570 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1571 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1571 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1572 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1572 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1573 i18n("<p><h3>In list view:</h3></p>\n") + 1573 i18n("<p><h3>In list view:</h3></p>\n") +
1574 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1574 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1575 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1575 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1576 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1576 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1577 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1577 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1578 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1578 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1579 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1579 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1580 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1580 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1581 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1581 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1582 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1582 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1583 i18n("<p><b>E</b>: Edit item</p>\n") + 1583 i18n("<p><b>E</b>: Edit item</p>\n") +
1584 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1584 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1585 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1585 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1586 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1586 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1587 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1587 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1588 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1588 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1589 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1589 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1590 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1590 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1591 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1591 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1592 i18n("<p><b>White</b>: Item readonly</p>\n"); 1592 i18n("<p><b>White</b>: Item readonly</p>\n");
1593 displayText( text, cap); 1593 displayText( text, cap);
1594} 1594}
1595void MainWindow::aboutAutoSaving() 1595void MainWindow::aboutAutoSaving()
1596{ 1596{
1597 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"); 1597 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");
1598 1598
1599 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1599 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1600 1600
1601} 1601}
1602void MainWindow::aboutKnownBugs() 1602void MainWindow::aboutKnownBugs()
1603{ 1603{
1604 QMessageBox* msg; 1604 QMessageBox* msg;
1605 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1605 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1606 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")+ 1606 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")+
1607 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1607 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1608 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1608 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1609 i18n("\nor report them in the bugtracker on\n") + 1609 i18n("\nor report them in the bugtracker on\n") +
1610 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1610 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1611 QMessageBox::NoIcon, 1611 QMessageBox::NoIcon,
1612 QMessageBox::Ok, 1612 QMessageBox::Ok,
1613 QMessageBox::NoButton, 1613 QMessageBox::NoButton,
1614 QMessageBox::NoButton); 1614 QMessageBox::NoButton);
1615 msg->exec(); 1615 msg->exec();
1616 delete msg; 1616 delete msg;
1617 1617
1618} 1618}
1619 1619
1620QString MainWindow::defaultFileName() 1620QString MainWindow::defaultFileName()
1621{ 1621{
1622 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1622 return locateLocal( "data", "korganizer/mycalendar.ics" );
1623} 1623}
1624QString MainWindow::syncFileName() 1624QString MainWindow::syncFileName()
1625{ 1625{
1626#ifdef DESKTOP_VERSION 1626#ifdef DESKTOP_VERSION
1627 return locateLocal( "tmp", "synccalendar.ics" ); 1627 return locateLocal( "tmp", "synccalendar.ics" );
1628#else 1628#else
1629 return QString( "/tmp/synccalendar.ics" ); 1629 return QString( "/tmp/synccalendar.ics" );
1630#endif 1630#endif
1631} 1631}
1632#include "koglobals.h" 1632#include "koglobals.h"
1633#include <kcalendarsystem.h> 1633#include <kcalendarsystem.h>
1634void MainWindow::updateWeek(QDate seda) 1634void MainWindow::updateWeek(QDate seda)
1635{ 1635{
1636 int weekNum = KGlobal::locale()->weekNum ( seda ); 1636 int weekNum = KGlobal::locale()->weekNum ( seda );
1637 mWeekPixmap.fill( mWeekBgColor ); 1637 mWeekPixmap.fill( mWeekBgColor );
1638 QPainter p ( &mWeekPixmap ); 1638 QPainter p ( &mWeekPixmap );
1639 p.setFont( mWeekFont ); 1639 p.setFont( mWeekFont );
1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1641 p.end(); 1641 p.end();
1642 QIconSet icon3 ( mWeekPixmap ); 1642 QIconSet icon3 ( mWeekPixmap );
1643 mWeekAction->setIconSet ( icon3 ); 1643 mWeekAction->setIconSet ( icon3 );
1644 1644
1645} 1645}
1646void MainWindow::updateWeekNum(const DateList &selectedDates) 1646void MainWindow::updateWeekNum(const DateList &selectedDates)
1647{ 1647{
1648 updateWeek( selectedDates.first() ); 1648 updateWeek( selectedDates.first() );
1649} 1649}
1650void MainWindow::processIncidenceSelection( Incidence *incidence ) 1650void MainWindow::processIncidenceSelection( Incidence *incidence )
1651{ 1651{
1652 1652
1653 if ( !incidence ) { 1653 if ( !incidence ) {
1654 enableIncidenceActions( false ); 1654 enableIncidenceActions( false );
1655 1655
1656 mNewSubTodoAction->setEnabled( false ); 1656 mNewSubTodoAction->setEnabled( false );
1657 setCaptionToDates(); 1657 setCaptionToDates();
1658 return; 1658 return;
1659 1659
1660 } 1660 }
1661 1661
1662 //KGlobal::locale()->formatDateTime(nextA, true); 1662 //KGlobal::locale()->formatDateTime(nextA, true);
1663 QString startString = ""; 1663 QString startString = "";
1664 if ( incidence->typeID() != todoID ) { 1664 if ( incidence->typeID() != todoID ) {
1665 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1665 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1666 if ( incidence->doesFloat() ) { 1666 if ( incidence->doesFloat() ) {
1667 startString += ": "+incidence->dtStartDateStr( true ); 1667 startString += ": "+incidence->dtStartDateStr( true );
1668 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1668 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1669 1669
1670 } else { 1670 } else {
1671 startString = ": "+incidence->dtStartStr(true); 1671 startString = ": "+incidence->dtStartStr(true);
1672 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1672 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1673 1673
1674 } 1674 }
1675 1675
1676 } else { 1676 } else {
1677 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1677 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1678 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1678 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1679 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1679 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1680 1680
1681 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1681 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1682 bool ok; 1682 bool ok;
1683 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1683 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1684 if ( ok ) { 1684 if ( ok ) {
1685 int years = noc.date().year() - incidence->dtStart().date().year(); 1685 int years = noc.date().year() - incidence->dtStart().date().year();
1686 startString += i18n(" (%1 y.)"). arg( years ); 1686 startString += i18n(" (%1 y.)"). arg( years );
1687 } 1687 }
1688 } 1688 }
1689 else 1689 else
1690 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1690 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1691 } 1691 }
1692 1692
1693 } 1693 }
1694 else 1694 else
1695 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1695 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1696 if ( !incidence->location().isEmpty() ) 1696 if ( !incidence->location().isEmpty() )
1697 startString += " (" +incidence->location()+")"; 1697 startString += " (" +incidence->location()+")";
1698 setCaption( incidence->summary()+startString); 1698 setCaption( incidence->summary()+startString);
1699 1699
1700 enableIncidenceActions( true ); 1700 enableIncidenceActions( true );
1701 1701
1702 if ( incidence->typeID() == eventID ) { 1702 if ( incidence->typeID() == eventID ) {
1703 mShowAction->setText( i18n("Show Event...") ); 1703 mShowAction->setText( i18n("Show Event...") );
1704 mEditAction->setText( i18n("Edit Event...") ); 1704 mEditAction->setText( i18n("Edit Event...") );
1705 mDeleteAction->setText( i18n("Delete Event...") ); 1705 mDeleteAction->setText( i18n("Delete Event...") );
1706 1706
1707 mNewSubTodoAction->setEnabled( false ); 1707 mNewSubTodoAction->setEnabled( false );
1708 } else if ( incidence->typeID() == todoID ) { 1708 } else if ( incidence->typeID() == todoID ) {
1709 mShowAction->setText( i18n("Show Todo...") ); 1709 mShowAction->setText( i18n("Show Todo...") );
1710 mEditAction->setText( i18n("Edit Todo...") ); 1710 mEditAction->setText( i18n("Edit Todo...") );
1711 mDeleteAction->setText( i18n("Delete Todo...") ); 1711 mDeleteAction->setText( i18n("Delete Todo...") );
1712 1712
1713 mNewSubTodoAction->setEnabled( true ); 1713 mNewSubTodoAction->setEnabled( true );
1714 } else { 1714 } else {
1715 mShowAction->setText( i18n("Show...") ); 1715 mShowAction->setText( i18n("Show...") );
1716 mShowAction->setText( i18n("Edit...") ); 1716 mShowAction->setText( i18n("Edit...") );
1717 mShowAction->setText( i18n("Delete...") ); 1717 mShowAction->setText( i18n("Delete...") );
1718 1718
1719 mNewSubTodoAction->setEnabled( false ); 1719 mNewSubTodoAction->setEnabled( false );
1720 } 1720 }
1721} 1721}
1722 1722
1723void MainWindow::enableIncidenceActions( bool enabled ) 1723void MainWindow::enableIncidenceActions( bool enabled )
1724{ 1724{
1725 1725
1726#ifndef DESKTOP_VERSION 1726#ifndef DESKTOP_VERSION
1727 mCurrentItemMenu->setEnabled( enabled ); 1727 mCurrentItemMenu->setEnabled( enabled );
1728#else 1728#else
1729 mShowAction->setEnabled( enabled ); 1729 mShowAction->setEnabled( enabled );
1730 mEditAction->setEnabled( enabled ); 1730 mEditAction->setEnabled( enabled );
1731 mDeleteAction->setEnabled( enabled ); 1731 mDeleteAction->setEnabled( enabled );
1732 1732
1733 mCloneAction->setEnabled( enabled ); 1733 mCloneAction->setEnabled( enabled );
1734 mMoveAction->setEnabled( enabled ); 1734 mMoveAction->setEnabled( enabled );
1735 mBeamAction->setEnabled( enabled ); 1735 mBeamAction->setEnabled( enabled );
1736 mCancelAction->setEnabled( enabled ); 1736 mCancelAction->setEnabled( enabled );
1737#endif 1737#endif
1738} 1738}
1739 1739
1740void MainWindow::importOL() 1740void MainWindow::importOL()
1741{ 1741{
1742#ifdef _OL_IMPORT_ 1742#ifdef _OL_IMPORT_
1743 mView->clearAllViews(); 1743 mView->clearAllViews();
1744 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1744 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1745 id->exec(); 1745 id->exec();
1746 delete id; 1746 delete id;
1747 mView->calendar()->checkAlarmForIncidence( 0, true ); 1747 mView->calendar()->checkAlarmForIncidence( 0, true );
1748 mView->updateView(); 1748 mView->updateView();
1749#endif 1749#endif
1750} 1750}
1751void MainWindow::importBday() 1751void MainWindow::importBday()
1752{ 1752{
1753 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1753 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1754 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1754 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1755 i18n("Import!"), i18n("Cancel"), 0, 1755 i18n("Import!"), i18n("Cancel"), 0,
1756 0, 1 ); 1756 0, 1 );
1757 if ( result == 0 ) { 1757 if ( result == 0 ) {
1758 mView->importBday(); 1758 mView->importBday();
1759 1759
1760 } 1760 }
1761 1761
1762 1762
1763} 1763}
1764void MainWindow::importQtopia() 1764void MainWindow::importQtopia()
1765{ 1765{
1766 //#ifndef DESKTOP_VERSION 1766 //#ifndef DESKTOP_VERSION
1767 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"); 1767 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");
1768#ifdef DESKTOP_VERSION 1768#ifdef DESKTOP_VERSION
1769 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"); 1769 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");
1770#endif 1770#endif
1771 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1771 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1772 i18n("Import!"), i18n("Cancel"), 0, 1772 i18n("Import!"), i18n("Cancel"), 0,
1773 0, 1 ); 1773 0, 1 );
1774 if ( result == 0 ) { 1774 if ( result == 0 ) {
1775#ifndef DESKTOP_VERSION 1775#ifndef DESKTOP_VERSION
1776 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1776 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1777 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1777 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1778 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1778 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1779#else 1779#else
1780 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1780 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1781 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1781 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1782 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1782 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1783#endif 1783#endif
1784 mView->importQtopia( categories, datebook, todolist ); 1784 mView->importQtopia( categories, datebook, todolist );
1785 } 1785 }
1786 mView->calendar()->reInitAlarmSettings(); 1786 mView->calendar()->reInitAlarmSettings();
1787#if 0 1787#if 0
1788 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1788 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1789 i18n("Not supported \non desktop!\n"), 1789 i18n("Not supported \non desktop!\n"),
1790 i18n("Ok"), i18n("Cancel"), 0, 1790 i18n("Ok"), i18n("Cancel"), 0,
1791 0, 1 ); 1791 0, 1 );
1792 1792
1793#endif 1793#endif
1794} 1794}
1795 1795
1796void MainWindow::saveOnClose() 1796void MainWindow::saveOnClose()
1797{ 1797{
1798 KOPrefs *p = KOPrefs::instance(); 1798 KOPrefs *p = KOPrefs::instance();
1799 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1799 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1800 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1800 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1801 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1801 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1802 if ( filterToolBar ) { 1802 if ( filterToolBar ) {
1803 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1803 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1804 } 1804 }
1805#ifdef DESKTOP_VERSION 1805#ifdef DESKTOP_VERSION
1806 1806
1807 QPoint myP; 1807 QPoint myP;
1808 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1808 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1809 if ( p->mToolBarHor ) 1809 if ( p->mToolBarHor )
1810 p->mToolBarUp = myP.y() > height()/2; 1810 p->mToolBarUp = myP.y() > height()/2;
1811 else 1811 else
1812 p->mToolBarUp = myP.x() > width()/2; 1812 p->mToolBarUp = myP.x() > width()/2;
1813 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1813 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1814 if ( p->mToolBarHorV ) 1814 if ( p->mToolBarHorV )
1815 p->mToolBarUpV = myP.y() > height()/2; 1815 p->mToolBarUpV = myP.y() > height()/2;
1816 else 1816 else
1817 p->mToolBarUpV = myP.x() > width()/2 ; 1817 p->mToolBarUpV = myP.x() > width()/2 ;
1818 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1818 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1819 if ( p->mToolBarHorN ) 1819 if ( p->mToolBarHorN )
1820 p->mToolBarUpN = myP.y() > height()/2; 1820 p->mToolBarUpN = myP.y() > height()/2;
1821 else 1821 else
1822 p->mToolBarUpN = myP.x() > width()/2 ; 1822 p->mToolBarUpN = myP.x() > width()/2 ;
1823 if ( filterToolBar ) { 1823 if ( filterToolBar ) {
1824 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1824 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1825 if ( p->mToolBarHorF ) 1825 if ( p->mToolBarHorF )
1826 p->mToolBarUpF = myP.y() > height()/2; 1826 p->mToolBarUpF = myP.y() > height()/2;
1827 else 1827 else
1828 p->mToolBarUpF = myP.x() > width()/2 ; 1828 p->mToolBarUpF = myP.x() > width()/2 ;
1829 } 1829 }
1830#else 1830#else
1831 if ( p->mToolBarHor ) 1831 if ( p->mToolBarHor )
1832 p->mToolBarUp = iconToolBar->y() > height()/2; 1832 p->mToolBarUp = iconToolBar->y() > height()/2;
1833 else 1833 else
1834 p->mToolBarUp = iconToolBar->x() > width()/2; 1834 p->mToolBarUp = iconToolBar->x() > width()/2;
1835 if ( p->mToolBarHorV ) 1835 if ( p->mToolBarHorV )
1836 p->mToolBarUpV = viewToolBar->y() > height()/2; 1836 p->mToolBarUpV = viewToolBar->y() > height()/2;
1837 else 1837 else
1838 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1838 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1839 1839
1840 if ( p->mToolBarHorN ) 1840 if ( p->mToolBarHorN )
1841 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1841 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1842 else 1842 else
1843 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1843 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1844 if ( filterToolBar ) { 1844 if ( filterToolBar ) {
1845 if ( p->mToolBarHorF ) 1845 if ( p->mToolBarHorF )
1846 p->mToolBarUpF = filterToolBar->y() > height()/2; 1846 p->mToolBarUpF = filterToolBar->y() > height()/2;
1847 else 1847 else
1848 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1848 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1849 } 1849 }
1850#endif 1850#endif
1851 save(); 1851 save();
1852 mView->writeSettings(); 1852 mView->writeSettings();
1853 mView->checkSuspendAlarm(); 1853 mView->checkSuspendAlarm();
1854} 1854}
1855void MainWindow::slotModifiedChanged( bool ) 1855void MainWindow::slotModifiedChanged( bool )
1856{ 1856{
1857 if ( mBlockAtStartup ) 1857 if ( mBlockAtStartup )
1858 return; 1858 return;
1859 1859
1860 int msec; 1860 int msec;
1861 // we store the changes after 1 minute, 1861 // we store the changes after 1 minute,
1862 // and for safety reasons after 10 minutes again 1862 // and for safety reasons after 10 minutes again
1863 if ( !mSyncManager->blockSave() ) 1863 if ( !mSyncManager->blockSave() )
1864 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1864 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1865 else 1865 else
1866 msec = 1000 * 600; 1866 msec = 1000 * 600;
1867 mSaveTimer.start( msec, true ); // 1 minute 1867 mSaveTimer.start( msec, true ); // 1 minute
1868 qDebug("KO: Saving File in %d secs!", msec/1000); 1868 qDebug("KO: Saving File in %d secs!", msec/1000);
1869 mCalendarModifiedFlag = true; 1869 mCalendarModifiedFlag = true;
1870} 1870}
1871void MainWindow::saveStopTimer() 1871void MainWindow::saveStopTimer()
1872{ 1872{
1873 mSaveTimer.stop(); 1873 mSaveTimer.stop();
1874} 1874}
1875void MainWindow::backupAllFiles() 1875void MainWindow::backupAllFiles()
1876{ 1876{
1877 QDate reference ( 2000,1,1); 1877 QDate reference ( 2000,1,1);
1878 int daysTo = reference.daysTo ( QDate::currentDate() ); 1878 int daysTo = reference.daysTo ( QDate::currentDate() );
1879 setCaption(i18n("Creating backup ... please wait ..." )); 1879 setCaption(i18n("Creating backup ... please wait ..." ));
1880 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1880 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1881 // we need the file path, the backup dir and the number of bups as param 1881 // we need the file path, the backup dir and the number of bups as param
1882 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1882 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1883 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1883 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1884 bupDir = KGlobalSettings::backupDataDir(); 1884 bupDir = KGlobalSettings::backupDataDir();
1885 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1885 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1886 if ( retval == 0 ) { 1886 if ( retval == 0 ) {
1887 setCaption(i18n("Backup cancelled" )); 1887 setCaption(i18n("Backup cancelled" ));
1888 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1888 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1889 // retval == 0 : backup skipped for today, try again tomorrow 1889 // retval == 0 : backup skipped for today, try again tomorrow
1890 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1890 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1891 } else if ( retval == 1 ){ 1891 } else if ( retval == 1 ){
1892 qDebug("KO: Backup created."); 1892 qDebug("KO: Backup created.");
1893 // backup ok 1893 // backup ok
1894 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1894 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1895 KopiCalendarFile * cal = calendars.first(); 1895 KopiCalendarFile * cal = calendars.first();
1896 cal = calendars.next(); 1896 cal = calendars.next();
1897 while ( cal ) { 1897 while ( cal ) {
1898 if ( !cal->mErrorOnLoad ) { 1898 if ( !cal->mErrorOnLoad ) {
1899 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1899 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1900 } 1900 }
1901 cal = calendars.next(); 1901 cal = calendars.next();
1902 } 1902 }
1903 KOPrefs::instance()->mLastBackupDate = daysTo; 1903 KOPrefs::instance()->mLastBackupDate = daysTo;
1904 setCaption(i18n("Backup succesfully finished" )); 1904 setCaption(i18n("Backup succesfully finished" ));
1905 } else if ( retval == 2 ){ 1905 } else if ( retval == 2 ){
1906 setCaption(i18n("Backup globally disabled" )); 1906 setCaption(i18n("Backup globally disabled" ));
1907 qDebug("KO: Backup globally cancelled."); 1907 qDebug("KO: Backup globally cancelled.");
1908 // backup globally cancelled 1908 // backup globally cancelled
1909 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1909 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1910 } 1910 }
1911 // retval == 3: do nothing, try again later 1911 // retval == 3: do nothing, try again later
1912} 1912}
1913void MainWindow::save() 1913void MainWindow::save()
1914{ 1914{
1915
1915 if ( mView->viewManager()->journalView() ) 1916 if ( mView->viewManager()->journalView() )
1916 mView->viewManager()->journalView()->checkModified(); 1917 mView->viewManager()->journalView()->checkModified();
1917 if ( !mCalendarModifiedFlag ) { 1918 if ( !mCalendarModifiedFlag ) {
1918 qDebug("KO: Calendar not modified. Nothing saved."); 1919 qDebug("KO: Calendar not modified. Nothing saved.");
1919 return; 1920 return;
1920 } 1921 }
1921 if ( mSyncManager->blockSave() ) 1922 if ( mSyncManager->blockSave() )
1922 return; 1923 return;
1923 mSyncManager->setBlockSave(true); 1924 mSyncManager->setBlockSave(true);
1924 if ( mView->checkAllFileVersions() ) { 1925 if ( mView->checkAllFileVersions() ) {
1925 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 1926 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1926 QDate reference ( 2000,1,1); 1927 QDate reference ( 2000,1,1);
1927 int daysTo = reference.daysTo ( QDate::currentDate() ); 1928 int daysTo = reference.daysTo ( QDate::currentDate() );
1928 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 1929 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
1929 backupAllFiles(); 1930 backupAllFiles();
1930 } 1931 }
1931 ; // KPimGlobalPrefs::instance()->mLastBackupDate 1932 ; // KPimGlobalPrefs::instance()->mLastBackupDate
1932 } 1933 }
1933 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1934 QTime neededSaveTime = QDateTime::currentDateTime().time();
1934 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1935 if ( !isMinimized () )
1936 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1935 qDebug("KO: Start saving data to file!"); 1937 qDebug("KO: Start saving data to file!");
1936 mView->saveCalendars(); 1938 mView->saveCalendars();
1937 mCalendarModifiedFlag = false; 1939 mCalendarModifiedFlag = false;
1938 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1940 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1939 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1941 qDebug("KO: Needed %d ms for saving.",msNeeded );
1940 QString savemes; 1942 QString savemes;
1941 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1943 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1942 setCaption(savemes); 1944 if ( !isMinimized () )
1945 setCaption(savemes);
1946 else
1947 qDebug(savemes);
1943 } else 1948 } else
1944 setCaption(i18n("Saving cancelled!")); 1949 setCaption(i18n("Saving cancelled!"));
1945 mSyncManager->setBlockSave( false ); 1950 mSyncManager->setBlockSave( false );
1946} 1951}
1947 1952
1948void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1953void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1949{ 1954{
1950 if ( !e->isAutoRepeat() ) { 1955 if ( !e->isAutoRepeat() ) {
1951 mFlagKeyPressed = false; 1956 mFlagKeyPressed = false;
1952 } 1957 }
1953} 1958}
1954void MainWindow::keyPressEvent ( QKeyEvent * e ) 1959void MainWindow::keyPressEvent ( QKeyEvent * e )
1955{ 1960{
1956 qApp->processEvents(); 1961 qApp->processEvents();
1957 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1962 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1958 e->ignore(); 1963 e->ignore();
1959 // qDebug(" ignore %d",e->isAutoRepeat() ); 1964 // qDebug(" ignore %d",e->isAutoRepeat() );
1960 return; 1965 return;
1961 } 1966 }
1962 if (! e->isAutoRepeat() ) 1967 if (! e->isAutoRepeat() )
1963 mFlagKeyPressed = true; 1968 mFlagKeyPressed = true;
1964 KOPrefs *p = KOPrefs::instance(); 1969 KOPrefs *p = KOPrefs::instance();
1965 bool showSelectedDates = false; 1970 bool showSelectedDates = false;
1966 int size; 1971 int size;
1967 int pro = 0; 1972 int pro = 0;
1968 //qDebug("MainWindow::keyPressEvent "); 1973 //qDebug("MainWindow::keyPressEvent ");
1969 switch ( e->key() ) { 1974 switch ( e->key() ) {
1970 case Qt::Key_Right: 1975 case Qt::Key_Right:
1971 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1976 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1972 mView->goNextMonth(); 1977 mView->goNextMonth();
1973 else 1978 else
1974 mView->goNext(); 1979 mView->goNext();
1975 showSelectedDates = true; 1980 showSelectedDates = true;
1976 break; 1981 break;
1977 case Qt::Key_Left: 1982 case Qt::Key_Left:
1978 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1983 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1979 mView->goPreviousMonth(); 1984 mView->goPreviousMonth();
1980 else 1985 else
1981 mView->goPrevious(); 1986 mView->goPrevious();
1982 showSelectedDates = true; 1987 showSelectedDates = true;
1983 break; 1988 break;
1984 case Qt::Key_Down: 1989 case Qt::Key_Down:
1985 mView->viewManager()->agendaView()->scrollOneHourDown(); 1990 mView->viewManager()->agendaView()->scrollOneHourDown();
1986 break; 1991 break;
1987 case Qt::Key_Up: 1992 case Qt::Key_Up:
1988 mView->viewManager()->agendaView()->scrollOneHourUp(); 1993 mView->viewManager()->agendaView()->scrollOneHourUp();
1989 break; 1994 break;
1990 case Qt::Key_K: 1995 case Qt::Key_K:
1991 mView->viewManager()->showMonthViewWeek(); 1996 mView->viewManager()->showMonthViewWeek();
1992 break; 1997 break;
1993 case Qt::Key_I: 1998 case Qt::Key_I:
1994 mView->showIncidence(); 1999 mView->showIncidence();
1995 break; 2000 break;
1996 case Qt::Key_Delete: 2001 case Qt::Key_Delete:
1997 case Qt::Key_Backspace: 2002 case Qt::Key_Backspace:
1998 mView->deleteIncidence(); 2003 mView->deleteIncidence();
1999 break; 2004 break;
2000 case Qt::Key_D: 2005 case Qt::Key_D:
2001 mView->viewManager()->showDayView(); 2006 mView->viewManager()->showDayView();
2002 showSelectedDates = true; 2007 showSelectedDates = true;
2003 break; 2008 break;
2004 case Qt::Key_O: 2009 case Qt::Key_O:
2005 mView->toggleFilerEnabled( ); 2010 mView->toggleFilerEnabled( );
2006 break; 2011 break;
2007 case Qt::Key_0: 2012 case Qt::Key_0:
2008 case Qt::Key_1: 2013 case Qt::Key_1:
2009 case Qt::Key_2: 2014 case Qt::Key_2:
2010 case Qt::Key_3: 2015 case Qt::Key_3:
2011 case Qt::Key_4: 2016 case Qt::Key_4:
2012 case Qt::Key_5: 2017 case Qt::Key_5:
2013 case Qt::Key_6: 2018 case Qt::Key_6:
2014 case Qt::Key_7: 2019 case Qt::Key_7:
2015 case Qt::Key_8: 2020 case Qt::Key_8:
2016 case Qt::Key_9: 2021 case Qt::Key_9:
2017 pro = e->key()-48; 2022 pro = e->key()-48;
2018 if ( pro == 0 ) 2023 if ( pro == 0 )
2019 pro = 10; 2024 pro = 10;
2020 if ( e->state() == Qt::ControlButton) 2025 if ( e->state() == Qt::ControlButton)
2021 pro += 10; 2026 pro += 10;
2022 break; 2027 break;
2023 case Qt::Key_M: 2028 case Qt::Key_M:
2024 mView->viewManager()->showMonthView(); 2029 mView->viewManager()->showMonthView();
2025 showSelectedDates = true; 2030 showSelectedDates = true;
2026 break; 2031 break;
2027 case Qt::Key_Insert: 2032 case Qt::Key_Insert:
2028 mView->newEvent(); 2033 mView->newEvent();
2029 break; 2034 break;
2030 case Qt::Key_S : 2035 case Qt::Key_S :
2031 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2036 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2032 mView->newSubTodo(); 2037 mView->newSubTodo();
2033 else 2038 else
2034 mView->dialogManager()->showSearchDialog(); 2039 mView->dialogManager()->showSearchDialog();
2035 break; 2040 break;
2036 case Qt::Key_Y : 2041 case Qt::Key_Y :
2037 case Qt::Key_Z : 2042 case Qt::Key_Z :
2038 mView->viewManager()->showWorkWeekView(); 2043 mView->viewManager()->showWorkWeekView();
2039 showSelectedDates = true; 2044 showSelectedDates = true;
2040 break; 2045 break;
2041 case Qt::Key_U : 2046 case Qt::Key_U :
2042 mView->viewManager()->showWeekView(); 2047 mView->viewManager()->showWeekView();
2043 showSelectedDates = true; 2048 showSelectedDates = true;
2044 break; 2049 break;
2045 case Qt::Key_H : 2050 case Qt::Key_H :
2046 keyBindings(); 2051 keyBindings();
2047 break; 2052 break;
2048 case Qt::Key_W: 2053 case Qt::Key_W:
2049 mView->viewManager()->showWhatsNextView(); 2054 mView->viewManager()->showWhatsNextView();
2050 break; 2055 break;
2051 case Qt::Key_L: 2056 case Qt::Key_L:
2052 mView->viewManager()->showListView(); 2057 mView->viewManager()->showListView();
2053 break; 2058 break;
2054 case Qt::Key_N: 2059 case Qt::Key_N:
2055 mView->viewManager()->showNextView(); 2060 mView->viewManager()->showNextView();
2056 break; 2061 break;
2057 case Qt::Key_V: 2062 case Qt::Key_V:
2058 mView->viewManager()->showTodoView(); 2063 mView->viewManager()->showTodoView();
2059 break; 2064 break;
2060 case Qt::Key_C: 2065 case Qt::Key_C:
2061 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2066 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2062 break; 2067 break;
2063 case Qt::Key_P: 2068 case Qt::Key_P:
2064 mView->showDatePicker( ); 2069 mView->showDatePicker( );
2065 break; 2070 break;
2066 case Qt::Key_F: 2071 case Qt::Key_F:
2067 mView->editFilters(); 2072 mView->editFilters();
2068 break; 2073 break;
2069 case Qt::Key_R: 2074 case Qt::Key_R:
2070 mView->toggleFilter(); 2075 mView->toggleFilter();
2071 break; 2076 break;
2072 case Qt::Key_X: 2077 case Qt::Key_X:
2073 if ( e->state() == Qt::ControlButton ) 2078 if ( e->state() == Qt::ControlButton )
2074 mView->toggleDateNavigatorWidget(); 2079 mView->toggleDateNavigatorWidget();
2075 else { 2080 else {
2076 mView->viewManager()->showNextXView(); 2081 mView->viewManager()->showNextXView();
2077 showSelectedDates = true; 2082 showSelectedDates = true;
2078 } 2083 }
2079 break; 2084 break;
2080 case Qt::Key_Space: 2085 case Qt::Key_Space:
2081 mView->toggleExpand(); 2086 mView->toggleExpand();
2082 break; 2087 break;
2083 case Qt::Key_A: 2088 case Qt::Key_A:
2084 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2089 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2085 mView->showNextAlarms(); 2090 mView->showNextAlarms();
2086 else 2091 else
2087 mView->toggleAllDaySize(); 2092 mView->toggleAllDaySize();
2088 break; 2093 break;
2089 case Qt::Key_T: 2094 case Qt::Key_T:
2090 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2095 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2091 mView->newTodo(); 2096 mView->newTodo();
2092 else { 2097 else {
2093 mView->goToday(); 2098 mView->goToday();
2094 showSelectedDates = true; 2099 showSelectedDates = true;
2095 } 2100 }
2096 break; 2101 break;
2097 case Qt::Key_J: 2102 case Qt::Key_J:
2098 mView->viewManager()->showJournalView(); 2103 mView->viewManager()->showJournalView();
2099 break; 2104 break;
2100 case Qt::Key_B: 2105 case Qt::Key_B:
2101 mView->editIncidenceDescription();; 2106 mView->editIncidenceDescription();;
2102 break; 2107 break;
2103 // case Qt::Key_Return: 2108 // case Qt::Key_Return:
2104 case Qt::Key_E: 2109 case Qt::Key_E:
2105 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2110 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2106 mView->newEvent(); 2111 mView->newEvent();
2107 else 2112 else
2108 mView->editIncidence(); 2113 mView->editIncidence();
2109 break; 2114 break;
2110 case Qt::Key_Plus: 2115 case Qt::Key_Plus:
2111 size = p->mHourSize +2; 2116 size = p->mHourSize +2;
2112 if ( size <= 22 ) 2117 if ( size <= 22 )
2113 configureAgenda( size ); 2118 configureAgenda( size );
2114 break; 2119 break;
2115 case Qt::Key_Minus: 2120 case Qt::Key_Minus:
2116 size = p->mHourSize - 2; 2121 size = p->mHourSize - 2;
2117 if ( size >= 4 ) 2122 if ( size >= 4 )
2118 configureAgenda( size ); 2123 configureAgenda( size );
2119 break; 2124 break;
2120 2125
2121 2126
2122 default: 2127 default:
2123 e->ignore(); 2128 e->ignore();
2124 } 2129 }
2125 if ( pro > 0 ) { 2130 if ( pro > 0 ) {
2126 selectFilter( pro+1 ); 2131 selectFilter( pro+1 );
2127 } 2132 }
2128 if ( showSelectedDates ) { 2133 if ( showSelectedDates ) {
2129 ;// setCaptionToDates(); 2134 ;// setCaptionToDates();
2130 } 2135 }
2131 2136
2132} 2137}
2133void MainWindow::fillFilterMenuTB() 2138void MainWindow::fillFilterMenuTB()
2134{ 2139{
2135 selectFilterMenuTB->clear(); 2140 selectFilterMenuTB->clear();
2136 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2141 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2137 selectFilterMenuTB->insertSeparator(); 2142 selectFilterMenuTB->insertSeparator();
2138 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2143 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2139 2144
2140 selectFilterMenuTB->insertSeparator(); 2145 selectFilterMenuTB->insertSeparator();
2141 QPtrList<CalFilter> fili = mView->filters(); 2146 QPtrList<CalFilter> fili = mView->filters();
2142 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2147 CalFilter *curfilter = mView->filterView()->selectedFilter();
2143 CalFilter *filter = fili.first(); 2148 CalFilter *filter = fili.first();
2144 int iii = 2; 2149 int iii = 2;
2145 bool checkitem = mView->filterView()->filtersEnabled(); 2150 bool checkitem = mView->filterView()->filtersEnabled();
2146 while(filter) { 2151 while(filter) {
2147 selectFilterMenuTB->insertItem( filter->name(), iii ); 2152 selectFilterMenuTB->insertItem( filter->name(), iii );
2148 if ( filter == curfilter) 2153 if ( filter == curfilter)
2149 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2154 selectFilterMenuTB->setItemChecked( iii, checkitem );
2150 filter = fili.next(); 2155 filter = fili.next();
2151 ++iii; 2156 ++iii;
2152 } 2157 }
2153 if ( !checkitem ) 2158 if ( !checkitem )
2154 selectFilterMenuTB->setItemChecked( 1, true ); 2159 selectFilterMenuTB->setItemChecked( 1, true );
2155 2160
2156 int x = 0; 2161 int x = 0;
2157 int y = iconToolBar->height(); 2162 int y = iconToolBar->height();
2158 int dX = 0; 2163 int dX = 0;
2159 int dY = 0; 2164 int dY = 0;
2160 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2165 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2161 if ( iconToolBar->y() > height()/2 ) { 2166 if ( iconToolBar->y() > height()/2 ) {
2162 dY = selectFilterMenuTB->sizeHint().height()+8; 2167 dY = selectFilterMenuTB->sizeHint().height()+8;
2163 y = 0; 2168 y = 0;
2164 } 2169 }
2165 } else { 2170 } else {
2166 if ( iconToolBar->x() > width()/2 ) { // right side 2171 if ( iconToolBar->x() > width()/2 ) { // right side
2167 x=0; 2172 x=0;
2168 dX= selectFilterMenuTB->sizeHint().width()+8; 2173 dX= selectFilterMenuTB->sizeHint().width()+8;
2169 y = 0; 2174 y = 0;
2170 } else { 2175 } else {
2171 x= iconToolBar->width(); 2176 x= iconToolBar->width();
2172 y = 0; 2177 y = 0;
2173 } 2178 }
2174 } 2179 }
2175 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2180 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2176 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2181 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2177} 2182}
2178void MainWindow::fillFilterMenu() 2183void MainWindow::fillFilterMenu()
2179{ 2184{
2180 selectFilterMenu->clear(); 2185 selectFilterMenu->clear();
2181 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2186 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2182 selectFilterMenu->insertSeparator(); 2187 selectFilterMenu->insertSeparator();
2183 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2188 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2184 2189
2185 selectFilterMenu->insertSeparator(); 2190 selectFilterMenu->insertSeparator();
2186 QPtrList<CalFilter> fili = mView->filters(); 2191 QPtrList<CalFilter> fili = mView->filters();
2187 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2192 CalFilter *curfilter = mView->filterView()->selectedFilter();
2188 CalFilter *filter = fili.first(); 2193 CalFilter *filter = fili.first();
2189 int iii = 2; 2194 int iii = 2;
2190 bool checkitem = mView->filterView()->filtersEnabled(); 2195 bool checkitem = mView->filterView()->filtersEnabled();
2191 while(filter) { 2196 while(filter) {
2192 selectFilterMenu->insertItem( filter->name(), iii ); 2197 selectFilterMenu->insertItem( filter->name(), iii );
2193 if ( filter == curfilter) 2198 if ( filter == curfilter)
2194 selectFilterMenu->setItemChecked( iii, checkitem ); 2199 selectFilterMenu->setItemChecked( iii, checkitem );
2195 filter = fili.next(); 2200 filter = fili.next();
2196 ++iii; 2201 ++iii;
2197 } 2202 }
2198 if ( !checkitem ) 2203 if ( !checkitem )
2199 selectFilterMenu->setItemChecked( 1, true ); 2204 selectFilterMenu->setItemChecked( 1, true );
2200} 2205}
2201void MainWindow::fillFilterMenuPopup() 2206void MainWindow::fillFilterMenuPopup()
2202{ 2207{
2203 filterPopupMenu->clear(); 2208 filterPopupMenu->clear();
2204 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2209 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2205 2210
2206 filterPopupMenu->insertSeparator(); 2211 filterPopupMenu->insertSeparator();
2207 QPtrList<CalFilter> fili = mView->filters(); 2212 QPtrList<CalFilter> fili = mView->filters();
2208 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2213 CalFilter *curfilter = mView->filterView()->selectedFilter();
2209 CalFilter *filter = fili.first(); 2214 CalFilter *filter = fili.first();
2210 int iii = 1; 2215 int iii = 1;
2211 bool checkitem = mView->filterView()->filtersEnabled(); 2216 bool checkitem = mView->filterView()->filtersEnabled();
2212 while(filter) { 2217 while(filter) {
2213 filterPopupMenu->insertItem( filter->name(), iii ); 2218 filterPopupMenu->insertItem( filter->name(), iii );
2214 if ( filter == curfilter) 2219 if ( filter == curfilter)
2215 filterPopupMenu->setItemChecked( iii, checkitem ); 2220 filterPopupMenu->setItemChecked( iii, checkitem );
2216 filter = fili.next(); 2221 filter = fili.next();
2217 ++iii; 2222 ++iii;
2218 } 2223 }
2219 if ( !checkitem ) 2224 if ( !checkitem )
2220 filterPopupMenu->setItemChecked( 0, true ); 2225 filterPopupMenu->setItemChecked( 0, true );
2221} 2226}
2222void MainWindow::selectFilter( int fil ) 2227void MainWindow::selectFilter( int fil )
2223{ 2228{
2224 2229
2225 if ( fil == 0 ) { 2230 if ( fil == 0 ) {
2226 mView->editFilters( ); 2231 mView->editFilters( );
2227 } else if ( fil == 1 ){ 2232 } else if ( fil == 1 ){
2228 if ( mView->filterView()->filtersEnabled() ) 2233 if ( mView->filterView()->filtersEnabled() )
2229 mView->toggleFilerEnabled( ); 2234 mView->toggleFilerEnabled( );
2230 } else { 2235 } else {
2231 if ( !mView->filterView()->filtersEnabled() ) { 2236 if ( !mView->filterView()->filtersEnabled() ) {
2232 mView->filterView()->blockSignals( true ); 2237 mView->filterView()->blockSignals( true );
2233 mView->toggleFilerEnabled( ); 2238 mView->toggleFilerEnabled( );
2234 mView->filterView()->blockSignals( false ); 2239 mView->filterView()->blockSignals( false );
2235 } 2240 }
2236 mView->selectFilter( fil-2 ); 2241 mView->selectFilter( fil-2 );
2237 } 2242 }
2238} 2243}
2239void MainWindow::updateFilterToolbar() 2244void MainWindow::updateFilterToolbar()
2240{ 2245{
2241 if ( filterMenubar ) { 2246 if ( filterMenubar ) {
2242 if ( !mView->filterView()->filtersEnabled() ) { 2247 if ( !mView->filterView()->filtersEnabled() ) {
2243 filterMenubar->changeItem( 0, i18n("No Filter") ); 2248 filterMenubar->changeItem( 0, i18n("No Filter") );
2244 } else { 2249 } else {
2245 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2250 CalFilter *curfilter = mView->filterView()->selectedFilter();
2246 if ( curfilter ) { 2251 if ( curfilter ) {
2247 filterMenubar->changeItem( 0, curfilter->name() ); 2252 filterMenubar->changeItem( 0, curfilter->name() );
2248 } 2253 }
2249 } 2254 }
2250 } 2255 }
2251} 2256}
2252void MainWindow::selectFilterPopup( int fil ) 2257void MainWindow::selectFilterPopup( int fil )
2253{ 2258{
2254 selectFilter( fil + 1 ); 2259 selectFilter( fil + 1 );
2255 2260
2256} 2261}
2257void MainWindow::configureToolBar( int item ) 2262void MainWindow::configureToolBar( int item )
2258{ 2263{
2259 2264
2260 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2265 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2261 KOPrefs *p = KOPrefs::instance(); 2266 KOPrefs *p = KOPrefs::instance();
2262 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2267 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2263 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2268 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2264 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2269 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2265 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2270 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2266 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2271 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2267 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2272 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2268 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2273 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2269 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2274 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2270 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2275 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2271 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2276 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2272 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2277 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2273 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2278 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2274 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2279 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2275 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2280 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2276 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2281 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2277 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2282 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2278 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2283 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2279 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2284 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2280 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2285 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2281 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2286 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2282 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2287 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2283 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2288 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2284 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2289 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2285 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2290 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2286 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2291 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2287 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2292 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2288 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2293 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2289 // initActions(); 2294 // initActions();
2290 setCaption ( i18n("Toolbar changes needs a restart!") ); 2295 setCaption ( i18n("Toolbar changes needs a restart!") );
2291} 2296}
2292void MainWindow::setCaption ( const QString & c ) 2297void MainWindow::setCaption ( const QString & c )
2293{ 2298{
2294 QString cap = c; 2299 QString cap = c;
2295 cap.replace( QRegExp("\n"), " " ); 2300 cap.replace( QRegExp("\n"), " " );
2296 cap = cap.stripWhiteSpace(); 2301 cap = cap.stripWhiteSpace();
2297 if ( cap.isEmpty() ) 2302 if ( cap.isEmpty() )
2298 cap = "KO/Pi"; 2303 cap = "KO/Pi";
2299 QWidget::setCaption( cap ); 2304 QWidget::setCaption( cap );
2300} 2305}
2301void MainWindow::setCaptionToDates() 2306void MainWindow::setCaptionToDates()
2302{ 2307{
2303 QString selDates; 2308 QString selDates;
2304 QDate date = mView->startDate(); 2309 QDate date = mView->startDate();
2305 if ( ! date.isValid() ) { 2310 if ( ! date.isValid() ) {
2306 setCaption(""); 2311 setCaption("");
2307 return; 2312 return;
2308 } 2313 }
2309 selDates = KGlobal::locale()->formatDate( date, true); 2314 selDates = KGlobal::locale()->formatDate( date, true);
2310 if (mView->startDate() < mView->endDate() ) 2315 if (mView->startDate() < mView->endDate() )
2311 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2316 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2312 else { 2317 else {
2313 QString addString; 2318 QString addString;
2314 if ( date == QDateTime::currentDateTime().date() ) 2319 if ( date == QDateTime::currentDateTime().date() )
2315 addString = i18n("Today"); 2320 addString = i18n("Today");
2316 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2321 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2317 addString = i18n("Tomorrow"); 2322 addString = i18n("Tomorrow");
2318 if ( !addString.isEmpty() ) 2323 if ( !addString.isEmpty() )
2319 selDates = addString+", "+selDates ; 2324 selDates = addString+", "+selDates ;
2320 } 2325 }
2321 setCaption( i18n("Dates: ") + selDates ); 2326 setCaption( i18n("Dates: ") + selDates );
2322 2327
2323} 2328}
2324void MainWindow::showConfigureAgenda( ) 2329void MainWindow::showConfigureAgenda( )
2325{ 2330{
2326 int iii; 2331 int iii;
2327 for ( iii = 1;iii<= 10 ;++iii ){ 2332 for ( iii = 1;iii<= 10 ;++iii ){
2328 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2333 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2329 } 2334 }
2330 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2335 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2331} 2336}
2332void MainWindow::configureAgenda( int item ) 2337void MainWindow::configureAgenda( int item )
2333{ 2338{
2334 if ( KOPrefs::instance()->mHourSize == item ) 2339 if ( KOPrefs::instance()->mHourSize == item )
2335 return; 2340 return;
2336 KOPrefs::instance()->mHourSize=item; 2341 KOPrefs::instance()->mHourSize=item;
2337 mView->viewManager()->agendaView()->updateConfig(); 2342 mView->viewManager()->agendaView()->updateConfig();
2338} 2343}
2339 2344
2340void MainWindow::saveCalendar() 2345void MainWindow::saveCalendar()
2341{ 2346{
2342 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2347 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2343 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2348 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2344 bupDir = KGlobalSettings::backupDataDir(); 2349 bupDir = KGlobalSettings::backupDataDir();
2345 bupDir = KGlobal::formatMessage ( bupDir, 0 ); 2350 bupDir = KGlobal::formatMessage ( bupDir, 0 );
2346 QString bupHint; 2351 QString bupHint;
2347 if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) 2352 if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
2348 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); 2353 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
2349 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; 2354 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;
2350 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; 2355 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
2351 KPimGlobalPrefs::instance()->mBackupEnabled = false; 2356 KPimGlobalPrefs::instance()->mBackupEnabled = false;
2352 save(); 2357 save();
2353 KPimGlobalPrefs::instance()->mBackupEnabled = enabled; 2358 KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
2354 backupAllFiles(); 2359 backupAllFiles();
2355} 2360}
2356void MainWindow::loadCalendar() 2361void MainWindow::loadCalendar()
2357{ 2362{
2358 2363
2359 2364
2360#if 0 2365#if 0
2361 QString fn = KOPrefs::instance()->mLastLoadFile; 2366 QString fn = KOPrefs::instance()->mLastLoadFile;
2362 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2367 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2363 2368
2364 if ( fn == "" ) 2369 if ( fn == "" )
2365 return; 2370 return;
2366 QFileInfo info; 2371 QFileInfo info;
2367 info.setFile( fn ); 2372 info.setFile( fn );
2368 QString mess; 2373 QString mess;
2369 bool loadbup = true; 2374 bool loadbup = true;
2370 if ( info. exists() ) { 2375 if ( info. exists() ) {
2371 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2376 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2372 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2377 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2373 mess, 2378 mess,
2374 i18n("Load!"), i18n("Cancel"), 0, 2379 i18n("Load!"), i18n("Cancel"), 0,
2375 0, 1 ); 2380 0, 1 );
2376 if ( result != 0 ) { 2381 if ( result != 0 ) {
2377 loadbup = false; 2382 loadbup = false;
2378 } 2383 }
2379 } else { 2384 } else {
2380 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2385 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2381 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2386 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2382 0, 1 ); 2387 0, 1 );
2383 2388
2384 return; 2389 return;
2385 } 2390 }
2386 if ( loadbup ) { 2391 if ( loadbup ) {
2387 mView->openCalendar( fn ); 2392 mView->openCalendar( fn );
2388 KOPrefs::instance()->mLastLoadFile = fn; 2393 KOPrefs::instance()->mLastLoadFile = fn;
2389 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2394 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2390 setCaption(mess); 2395 setCaption(mess);
2391 } 2396 }
2392#endif 2397#endif
2393 2398
2394} 2399}
2395void MainWindow::quickImportIcal() 2400void MainWindow::quickImportIcal()
2396{ 2401{
2397 importFile( KOPrefs::instance()->mLastImportFile, false ); 2402 importFile( KOPrefs::instance()->mLastImportFile, false );
2398} 2403}
2399void MainWindow::importFile( QString fn, bool quick ) 2404void MainWindow::importFile( QString fn, bool quick )
2400{ 2405{
2401 QFileInfo info; 2406 QFileInfo info;
2402 info.setFile( fn ); 2407 info.setFile( fn );
2403 QString mess; 2408 QString mess;
2404 if ( !info. exists() ) { 2409 if ( !info. exists() ) {
2405 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2410 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2406 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2411 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2407 mess ); 2412 mess );
2408 return; 2413 return;
2409 } 2414 }
2410 int result = 0; 2415 int result = 0;
2411 if ( !quick ) { 2416 if ( !quick ) {
2412 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 )); 2417 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 ));
2413 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2418 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2414 mess, 2419 mess,
2415 "Import", "Cancel", 0, 2420 "Import", "Cancel", 0,
2416 0, 1 ); 2421 0, 1 );
2417 } 2422 }
2418 if ( result == 0 ) { 2423 if ( result == 0 ) {
2419 if ( mView->openCalendar( fn, true )) { 2424 if ( mView->openCalendar( fn, true )) {
2420 KOPrefs::instance()->mLastImportFile = fn; 2425 KOPrefs::instance()->mLastImportFile = fn;
2421 setCaption(i18n("Imported file successfully")); 2426 setCaption(i18n("Imported file successfully"));
2422 } else { 2427 } else {
2423 setCaption(i18n("Error importing file")); 2428 setCaption(i18n("Error importing file"));
2424 } 2429 }
2425 } 2430 }
2426} 2431}
2427 2432
2428void MainWindow::importIcal() 2433void MainWindow::importIcal()
2429{ 2434{
2430 2435
2431 QString fn =KOPrefs::instance()->mLastImportFile; 2436 QString fn =KOPrefs::instance()->mLastImportFile;
2432 2437
2433 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2438 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2434 if ( fn == "" ) 2439 if ( fn == "" )
2435 return; 2440 return;
2436 importFile( fn, true ); 2441 importFile( fn, true );
2437 2442
2438} 2443}
2439 2444
2440void MainWindow::exportVCalendar() 2445void MainWindow::exportVCalendar()
2441{ 2446{
2442 QString fn = KOPrefs::instance()->mLastVcalFile; 2447 QString fn = KOPrefs::instance()->mLastVcalFile;
2443 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2448 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2444 if ( fn == "" ) 2449 if ( fn == "" )
2445 return; 2450 return;
2446 QFileInfo info; 2451 QFileInfo info;
2447 info.setFile( fn ); 2452 info.setFile( fn );
2448 QString mes; 2453 QString mes;
2449 bool createbup = true; 2454 bool createbup = true;
2450 if ( info. exists() ) { 2455 if ( info. exists() ) {
2451 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2456 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2452 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2457 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2453 i18n("Overwrite!"), i18n("Cancel"), 0, 2458 i18n("Overwrite!"), i18n("Cancel"), 0,
2454 0, 1 ); 2459 0, 1 );
2455 if ( result != 0 ) { 2460 if ( result != 0 ) {
2456 createbup = false; 2461 createbup = false;
2457 } 2462 }
2458 } 2463 }
2459 if ( createbup ) { 2464 if ( createbup ) {
2460 if ( mView->exportVCalendar( fn ) ) { 2465 if ( mView->exportVCalendar( fn ) ) {
2461 KOPrefs::instance()->mLastVcalFile = fn; 2466 KOPrefs::instance()->mLastVcalFile = fn;
2462 if ( fn.length() > 20 ) 2467 if ( fn.length() > 20 )
2463 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2468 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2464 else 2469 else
2465 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2470 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2466 setCaption(mes); 2471 setCaption(mes);
2467 } 2472 }
2468 } 2473 }
2469 2474
2470} 2475}
2471QString MainWindow::sentSyncFile() 2476QString MainWindow::sentSyncFile()
2472{ 2477{
2473#ifdef DESKTOP_VERSION 2478#ifdef DESKTOP_VERSION
2474 return locateLocal( "tmp", "copysynccal.ics" ); 2479 return locateLocal( "tmp", "copysynccal.ics" );
2475#else 2480#else
2476 return QString( "/tmp/copysynccal.ics" ); 2481 return QString( "/tmp/copysynccal.ics" );
2477#endif 2482#endif
2478} 2483}
2479 2484
2480void MainWindow::syncFileRequest() 2485void MainWindow::syncFileRequest()
2481{ 2486{
2482 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2487 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2483 mSyncManager->slotSyncMenu( 999 ); 2488 mSyncManager->slotSyncMenu( 999 );
2484 } 2489 }
2485 2490
2486 setCaption(i18n("Saving Data to temp file ..." )); 2491 setCaption(i18n("Saving Data to temp file ..." ));
2487 mView->saveCalendar( sentSyncFile() ); 2492 mView->saveCalendar( sentSyncFile() );
2488 setCaption(i18n("Data saved to temp file!" )); 2493 setCaption(i18n("Data saved to temp file!" ));
2489 2494
2490} 2495}
2491void MainWindow::getFile( bool success ) 2496void MainWindow::getFile( bool success )
2492{ 2497{
2493 if ( ! success ) { 2498 if ( ! success ) {
2494 setCaption( i18n("Error receiving file. Nothing changed!") ); 2499 setCaption( i18n("Error receiving file. Nothing changed!") );
2495 return; 2500 return;
2496 } 2501 }
2497 mView->openCalendar( sentSyncFile() ); 2502 mView->openCalendar( sentSyncFile() );
2498 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2503 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2499 mSyncManager->slotSyncMenu( 999 ); 2504 mSyncManager->slotSyncMenu( 999 );
2500 } 2505 }
2501 setCaption( i18n("Pi-Sync successful!") ); 2506 setCaption( i18n("Pi-Sync successful!") );
2502} 2507}
2503void MainWindow::printListView() 2508void MainWindow::printListView()
2504{ 2509{
2505 2510
2506 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."); 2511 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.");
2507 2512
2508 KMessageBox::information( this, message); 2513 KMessageBox::information( this, message);
2509} 2514}
2510void MainWindow::printSel( ) 2515void MainWindow::printSel( )
2511{ 2516{
2512 mView->viewManager()->agendaView()->agenda()->printSelection(); 2517 mView->viewManager()->agendaView()->agenda()->printSelection();
2513} 2518}
2514 2519
2515void MainWindow::printCal() 2520void MainWindow::printCal()
2516{ 2521{
2517 mView->print();//mCp->showDialog(); 2522 mView->print();//mCp->showDialog();
2518} 2523}
2519 2524
2520 2525
2521#include "libkdepim/kdatepicker.h" 2526#include "libkdepim/kdatepicker.h"
2522#include <kdatetbl.h> 2527#include <kdatetbl.h>
2523 2528
2524void MainWindow::weekAction() 2529void MainWindow::weekAction()
2525{ 2530{
2526 int month; 2531 int month;
2527 KPopupFrame* popup = new KPopupFrame(this); 2532 KPopupFrame* popup = new KPopupFrame(this);
2528 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2533 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2529 // ----- 2534 // -----
2530 picker->resize(picker->sizeHint()); 2535 picker->resize(picker->sizeHint());
2531 popup->setMainWidget(picker); 2536 popup->setMainWidget(picker);
2532 picker->setFocus(); 2537 picker->setFocus();
2533 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2538 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2534 int x = 0; 2539 int x = 0;
2535 int y = iconToolBar->height(); 2540 int y = iconToolBar->height();
2536 int dX = 0; 2541 int dX = 0;
2537 int dY = 0; 2542 int dY = 0;
2538 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2543 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2539 if ( iconToolBar->y() > height()/2 ) { 2544 if ( iconToolBar->y() > height()/2 ) {
2540 dY = picker->sizeHint().height()+8; 2545 dY = picker->sizeHint().height()+8;
2541 y = 0; 2546 y = 0;
2542 } 2547 }
2543 } else { 2548 } else {
2544 if ( iconToolBar->x() > width()/2 ) { // right side 2549 if ( iconToolBar->x() > width()/2 ) { // right side
2545 x=0; 2550 x=0;
2546 dX= picker->sizeHint().width()+8; 2551 dX= picker->sizeHint().width()+8;
2547 y = 0; 2552 y = 0;
2548 } else { 2553 } else {
2549 x= iconToolBar->width(); 2554 x= iconToolBar->width();
2550 y = 0; 2555 y = 0;
2551 } 2556 }
2552 } 2557 }
2553 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2558 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2554 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2559 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2555 { 2560 {
2556 month = picker->getResult(); 2561 month = picker->getResult();
2557 emit selectWeek ( month ); 2562 emit selectWeek ( month );
2558 //qDebug("weekSelected %d ", month); 2563 //qDebug("weekSelected %d ", month);
2559 } 2564 }
2560 delete popup; 2565 delete popup;
2561} 2566}
2562 2567
2563void MainWindow::hideEvent ( QHideEvent * ) 2568void MainWindow::hideEvent ( QHideEvent * )
2564{ 2569{
2565 QString message; 2570 QString message;
2566 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2571 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2567 if ( nextA.isValid() ) { 2572 if ( nextA.isValid() ) {
2568 QString sum = mCalendar->nextSummary(); 2573 QString sum = mCalendar->nextSummary();
2569 2574
2570 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)); 2575 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));
2571 setCaption( message ); 2576 setCaption( message );
2572 } 2577 }
2573} 2578}
2574 2579
2575void MainWindow::resizeEvent( QResizeEvent* e) 2580void MainWindow::resizeEvent( QResizeEvent* e)
2576{ 2581{
2577#ifndef DESKTOP_VERSION 2582#ifndef DESKTOP_VERSION
2578 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2583 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2579 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2584 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2580 filterToolBar->hide(); 2585 filterToolBar->hide();
2581 else 2586 else
2582 filterToolBar->show(); 2587 filterToolBar->show();
2583 } 2588 }
2584#endif 2589#endif
2585 QMainWindow::resizeEvent( e); 2590 QMainWindow::resizeEvent( e);
2586} 2591}