summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt5
-rw-r--r--bin/kdepim/kopiemail/germantranslation.txt6
-rw-r--r--korganizer/calendarview.cpp10
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/mainwindow.cpp12
6 files changed, 25 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index c0078be..23ff53c 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,755 +1,760 @@
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 1.9.19 ************
4
5Added a lot of missing translations to KA/Pi,
6added some missing translations to KO/Pi and OM/Pi.
7
3********** VERSION 1.9.18 ************ 8********** VERSION 1.9.18 ************
4 9
5FYI: The VERSION 1.9.17 was a testing release only. 10FYI: The VERSION 1.9.17 was a testing release only.
6Please read the changelog of VERSION 1.9.17 as well. 11Please read the changelog of VERSION 1.9.17 as well.
7 12
8Cleaned up the syncing config dialog. 13Cleaned up the syncing config dialog.
9Added sync config options for date range for events. 14Added sync config options for date range for events.
10Added sync config options for filters on incoming data. 15Added sync config options for filters on incoming data.
11Added sync config options for filters on outgoing data. 16Added sync config options for filters on outgoing data.
12Please read the updated SyncHowTo about the new filter settings. 17Please read the updated SyncHowTo about the new filter settings.
13These filter settings make it now possible to sync with shared 18These filter settings make it now possible to sync with shared
14calendars without writing back private or confidential data 19calendars without writing back private or confidential data
15(via the outgoing filters). 20(via the outgoing filters).
16To sync only with particular parts of a shared calendar, 21To sync only with particular parts of a shared calendar,
17the incoming filter settings can be used. 22the incoming filter settings can be used.
18An example can be found in the SyncHowTo. 23An example can be found in the SyncHowTo.
19Same for shared addressbooks. 24Same for shared addressbooks.
20 25
21Added a setting for the global kdepim data storage. 26Added a setting for the global kdepim data storage.
22Usually the data is stored in (yourhomedir/kdepim). 27Usually the data is stored in (yourhomedir/kdepim).
23Now you can set in the Global config dialog TAB, subTAB "Data storage path" 28Now you can set in the Global config dialog TAB, subTAB "Data storage path"
24a directory where all the kdepim data is stored. 29a directory where all the kdepim data is stored.
25That makes it easy to save all kdepim data on a SD card on the Z, for example. 30That makes it easy to save all kdepim data on a SD card on the Z, for example.
26 31
27KO/Pi: 32KO/Pi:
28The timeedit input has a pulldown list for times. 33The timeedit input has a pulldown list for times.
29If opened, this pulldown list should now has the right time highlighted. 34If opened, this pulldown list should now has the right time highlighted.
30Added the possibility to exclude events/todos/journals in a filter. 35Added the possibility to exclude events/todos/journals in a filter.
31You should exclude journals, if you do not want them to sync with a public calendar. 36You should exclude journals, if you do not want them to sync with a public calendar.
32 37
33KA/Pi: 38KA/Pi:
34Added the possibility to in/exclude public/private/confidential contacts to a filter. 39Added the possibility to in/exclude public/private/confidential contacts to a filter.
35If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... 40If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ...
36Added printing of card view and details view on desktop. 41Added printing of card view and details view on desktop.
37Printing of list view is not working... 42Printing of list view is not working...
38Added button for removing pictures in contact editor. 43Added button for removing pictures in contact editor.
39Parsing data fix of KA/Pi version 1.9.17. 44Parsing data fix of KA/Pi version 1.9.17.
40Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. 45Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
41Fixed some syncing merging problems. 46Fixed some syncing merging problems.
42 47
43 48
44********** VERSION 1.9.17 ************ 49********** VERSION 1.9.17 ************
45 50
46KO/Pi: 51KO/Pi:
47Fixed that tooltips were not updated after moving an item in agenda view. 52Fixed that tooltips were not updated after moving an item in agenda view.
48Fixed a bug in sorting start date for recurring events in list view. 53Fixed a bug in sorting start date for recurring events in list view.
49Changed the left button in todo viewer from "Agenda" to "Set completed". 54Changed the left button in todo viewer from "Agenda" to "Set completed".
50This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. 55This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View.
51Added more info in the todo viewer: Startdate, parent/sub todos. 56Added more info in the todo viewer: Startdate, parent/sub todos.
52 57
53 58
54KA/Pi: 59KA/Pi:
55All fields search does now actually search all the (possible) fields, 60All fields search does now actually search all the (possible) fields,
56not only those listed in the contact list. 61not only those listed in the contact list.
57Made is possible to inline a picture in a vcard on the Z. 62Made is possible to inline a picture in a vcard on the Z.
58This was only possible on the desktop, now is it possible on the Z as well. 63This was only possible on the desktop, now is it possible on the Z as well.
59Fixed of missing save settings after filter configuration. 64Fixed of missing save settings after filter configuration.
60Made saving of addressbook much faster. 65Made saving of addressbook much faster.
61Fixed extension widget layout problem. 66Fixed extension widget layout problem.
62Fixed saving of default formatted name settings. 67Fixed saving of default formatted name settings.
63Fixed formatted name handling in edit dialog. 68Fixed formatted name handling in edit dialog.
64Added an option for changing formatted names of many contacts 69Added an option for changing formatted names of many contacts
65(menu: File - Change - Set formatted name). 70(menu: File - Change - Set formatted name).
66 71
67QWhatsThis was not working on the Z ( only black rectangle was shown). 72QWhatsThis was not working on the Z ( only black rectangle was shown).
68This is Fixed. 73This is Fixed.
69 74
70KDE-Sync: 75KDE-Sync:
71Now readonly KDE resources are synced as well. 76Now readonly KDE resources are synced as well.
72(They are not changed in KDE itself, of course). 77(They are not changed in KDE itself, of course).
73 78
74 79
75 80
76********** VERSION 1.9.16 ************ 81********** VERSION 1.9.16 ************
77 82
78KO/Pi: 83KO/Pi:
79Fixed search dialog size on Z 6000 (480x640 display). 84Fixed search dialog size on Z 6000 (480x640 display).
80Added setting to hide/show time in agenda items. 85Added setting to hide/show time in agenda items.
81Added setting to hide not running todos in todo view. 86Added setting to hide not running todos in todo view.
82Added columns for start date/time in todo view. 87Added columns for start date/time in todo view.
83Replaced the solid half-hour lines in agenda view by dot lines. 88Replaced the solid half-hour lines in agenda view by dot lines.
84Added possibility of printing the What's Next View on the desktop 89Added possibility of printing the What's Next View on the desktop
85(i.e. Windows and Linux). 90(i.e. Windows and Linux).
86Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 91Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
87Added tooltips in month view.(Tooltips only available on desktop) 92Added tooltips in month view.(Tooltips only available on desktop)
88 93
89Fixed a strange problem in KO/Pi alarm applet. 94Fixed a strange problem in KO/Pi alarm applet.
90Did not find the actual problem, 95Did not find the actual problem,
91such that now Qtopia reboots again if deinstalling the alarm applet. 96such that now Qtopia reboots again if deinstalling the alarm applet.
92But the alarm applet should work again. 97But the alarm applet should work again.
93 98
94KA/Pi: 99KA/Pi:
95Fixed the problem, that internal pictures were not saved. 100Fixed the problem, that internal pictures were not saved.
96 101
97Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 102Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
98 103
99Fixed some minor problems. (Like word wrap in help text windows). 104Fixed some minor problems. (Like word wrap in help text windows).
100 105
101Fixed a compiling problem in microkde/kresources. 106Fixed a compiling problem in microkde/kresources.
102 107
103KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 108KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
104This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 109This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
105such that now syncing KO/Pi with Sharp DTM should work on the 110such that now syncing KO/Pi with Sharp DTM should work on the
106Zaurus C 3000 model. 111Zaurus C 3000 model.
107 112
108********** VERSION 1.9.15 ************ 113********** VERSION 1.9.15 ************
109 114
110Usebilty enhancements in KO/Pi: 115Usebilty enhancements in KO/Pi:
111When clicking on the date in a month view cell, the day view is shown. 116When clicking on the date in a month view cell, the day view is shown.
112Old behaviour was, that the "new event" dialog popped up. 117Old behaviour was, that the "new event" dialog popped up.
113 118
114Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 119Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
115That means, you can restore the latest 120That means, you can restore the latest
116event/todo/journal you have deleted. 121event/todo/journal you have deleted.
117A journal is deleted, if you clear all the text of the journal. 122A journal is deleted, if you clear all the text of the journal.
118 123
119Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 124Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
120 125
121KA/Pi starting in 480x640 resolution: 126KA/Pi starting in 480x640 resolution:
122Hide the filter action in toolbar 127Hide the filter action in toolbar
123and added icons for undo/delete/redo in toolbar. 128and added icons for undo/delete/redo in toolbar.
124 129
125Change in OM/Pi ViewMail dialog: 130Change in OM/Pi ViewMail dialog:
126When clicking on the "delete" icon the mail is deleted after confirmation as usual. 131When clicking on the "delete" icon the mail is deleted after confirmation as usual.
127But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 132But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
128 133
129Fixed a crash when deleting mail-accounts in OM/Pi. 134Fixed a crash when deleting mail-accounts in OM/Pi.
130 135
131 136
132********** VERSION 1.9.14 ************ 137********** VERSION 1.9.14 ************
133 138
134Fixed some problems with the dialog sizes when switching 139Fixed some problems with the dialog sizes when switching
135portrait/landscape mode on 640x480 PDA display. 140portrait/landscape mode on 640x480 PDA display.
136 141
137Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 142Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
138 143
139Fixed an ugly bug in KOpieMail: 144Fixed an ugly bug in KOpieMail:
140KOpieMail was not able to write files (mails) to MSDOS file system, 145KOpieMail was not able to write files (mails) to MSDOS file system,
141like on an usual preformatted SD card. That should work now. 146like on an usual preformatted SD card. That should work now.
142To save your mail data on the Sd card do the following: 147To save your mail data on the Sd card do the following:
143Create a dir on the SD card: 148Create a dir on the SD card:
144mkdir /mnt/card/localmail 149mkdir /mnt/card/localmail
145Go to your home dir: 150Go to your home dir:
146cd 151cd
147Go to kopiemail data storage dir: 152Go to kopiemail data storage dir:
148cd kdepim/apps/kopiemail 153cd kdepim/apps/kopiemail
149Create a symlink to the SD card: 154Create a symlink to the SD card:
150ls -s /mnt/card/localmail 155ls -s /mnt/card/localmail
151Now KOpieMail will store all mails on the SD card. 156Now KOpieMail will store all mails on the SD card.
152 157
153KO/Pi Monthview: 158KO/Pi Monthview:
154Now "Go to Today" selects the current month from day 1-end, 159Now "Go to Today" selects the current month from day 1-end,
155not the current date + some days. 160not the current date + some days.
156I.e. "Go to Today" shows now always 161I.e. "Go to Today" shows now always
157the current month with first day of month in the first row. 162the current month with first day of month in the first row.
158 163
159Added missing German translation. 164Added missing German translation.
160 165
161Fixed icons of executeable on Wintendo. 166Fixed icons of executeable on Wintendo.
162 167
163Added a "Show next Mail" button to the OM/Pi 168Added a "Show next Mail" button to the OM/Pi
164mail viewer such that the mail below the current mail 169mail viewer such that the mail below the current mail
165in the mail list view of the current folder 170in the mail list view of the current folder
166can be read with a single click. 171can be read with a single click.
167 172
168 173
169********** VERSION 1.9.13 ************ 174********** VERSION 1.9.13 ************
170 175
171Fixed nasty PwM/Pi file reading bug, when 176Fixed nasty PwM/Pi file reading bug, when
172the used hash algo of file is different then the global 177the used hash algo of file is different then the global
173hash algo. 178hash algo.
174 179
175Added KA/Pi support for opie mailit mailapplication. 180Added KA/Pi support for opie mailit mailapplication.
176 181
177Fixed some bugs in OM/Pi. 182Fixed some bugs in OM/Pi.
178Now character conversion tables are available for the Zaurus 183Now character conversion tables are available for the Zaurus
179to make OM/Pi working properly. 184to make OM/Pi working properly.
180To get the character conversion in OM/Pi working, please download 185To get the character conversion in OM/Pi working, please download
181at the sourceforge project site the package 186at the sourceforge project site the package
182sr-character-conversion_SharpROM_arm.ipk.zip 187sr-character-conversion_SharpROM_arm.ipk.zip
183(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 188(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
184from the section "general files for KDE/Pim" 189from the section "general files for KDE/Pim"
185Instructions how to install this package are in a ReadMe in this file. 190Instructions how to install this package are in a ReadMe in this file.
186 191
187 192
188Fixed the orientation change problem in KA/Pi when switching 193Fixed the orientation change problem in KA/Pi when switching
189portrait/landscape mode. 194portrait/landscape mode.
190 195
191French translation available for KA/Pi and OM/Pi. 196French translation available for KA/Pi and OM/Pi.
192 197
193Fixed some problems with categories in KO/Pi in DTM sync. 198Fixed some problems with categories in KO/Pi in DTM sync.
194 199
195Added selection dialog for export to phone in KA/Pi. 200Added selection dialog for export to phone in KA/Pi.
196 201
197If in KO/Pi is an attendee selected to add to a meeting and this 202If in KO/Pi is an attendee selected to add to a meeting and this
198attendee is already in the list of attendees, this person is not added 203attendee is already in the list of attendees, this person is not added
199again. 204again.
200 205
201Some menu cleanup in KA/Pi. 206Some menu cleanup in KA/Pi.
202 207
203********** VERSION 1.9.12 ************ 208********** VERSION 1.9.12 ************
204 209
205Fix for the bug in KO/Pi What's Next view of version 1.9.11. 210Fix for the bug in KO/Pi What's Next view of version 1.9.11.
206 211
207Bugfix: Licence file is now shown again. 212Bugfix: Licence file is now shown again.
208 213
209OM/Pi now supports Unicode (utf8 charset). 214OM/Pi now supports Unicode (utf8 charset).
210Fixed some bugs in OM/Pi. 215Fixed some bugs in OM/Pi.
211 216
212KA/Pi has more German translation. 217KA/Pi has more German translation.
213 218
214 219
215********** VERSION 1.9.11 ************ 220********** VERSION 1.9.11 ************
216 221
217Fixed several problems in PWM/Pi, like 222Fixed several problems in PWM/Pi, like
218asking the user, if unsaved changed are pending 223asking the user, if unsaved changed are pending
219when closing the app. 224when closing the app.
220And PwM/Pi handles now different texts for the 225And PwM/Pi handles now different texts for the
221fields Description, Username, Password, configurable per category. 226fields Description, Username, Password, configurable per category.
222 227
223Fixed a crash in KO/Pi , when importing/loading vcs files 228Fixed a crash in KO/Pi , when importing/loading vcs files
224which have an entry with an attendee with state: 229which have an entry with an attendee with state:
225NEEDS ACTION 230NEEDS ACTION
226 231
227Fixed some problems in the German translation of OM/Pi, 232Fixed some problems in the German translation of OM/Pi,
228which makes some dialogs not fitting on the screen 233which makes some dialogs not fitting on the screen
229of the Z 5500. 234of the Z 5500.
230 235
231Fixed Qtopia crash, when disabling/deinstalling 236Fixed Qtopia crash, when disabling/deinstalling
232KO/Pi alarm applet. 237KO/Pi alarm applet.
233 238
234Implemented direct KDE<->KA/Pi sync for KA/Pi running 239Implemented direct KDE<->KA/Pi sync for KA/Pi running
235on Linux desktop. 240on Linux desktop.
236 241
237Added feature "remove sync info" to sync menu. 242Added feature "remove sync info" to sync menu.
238 243
239Tweaked the KO/Pi What's next view a bit, added 244Tweaked the KO/Pi What's next view a bit, added
240setting to hide events that are done. 245setting to hide events that are done.
241 246
242Disabled "beam receive enabled" on startup to 247Disabled "beam receive enabled" on startup to
243avoid problems if Fastload is enabled. 248avoid problems if Fastload is enabled.
244Please set "beam receive enabled", 249Please set "beam receive enabled",
245if you want to receive data via IR. 250if you want to receive data via IR.
246 251
247Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 252Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
248on Linux desktop. 253on Linux desktop.
249 254
250Made in KA/Pi scrolling possible, if details view is selected. 255Made in KA/Pi scrolling possible, if details view is selected.
251(The keyboard focus is set automatically to the search line) 256(The keyboard focus is set automatically to the search line)
252 257
253Fixed a bug in DMT sync, that a new entry in DTM was added 258Fixed a bug in DMT sync, that a new entry in DTM was added
254on every sync to Kx/Pi. 259on every sync to Kx/Pi.
255 260
256Fixed missing writing of KA/Pi categories to DMT entries when syncing. 261Fixed missing writing of KA/Pi categories to DMT entries when syncing.
257 262
258Fixed a bug in DMT sync with todos created in KO/Pi containing 263Fixed a bug in DMT sync with todos created in KO/Pi containing
259non-latin1 characters. 264non-latin1 characters.
260 265
261Rearranged package contents of Sharp-ipks and made all 266Rearranged package contents of Sharp-ipks and made all
262packages installable on SD again. 267packages installable on SD again.
263 268
264Fixed the writing of addressbook data in DTM sync. 269Fixed the writing of addressbook data in DTM sync.
265Empty fields in KA/Pi were not removed. 270Empty fields in KA/Pi were not removed.
266 271
267Added better category handling in KA/Pi: 272Added better category handling in KA/Pi:
268Added item 273Added item
269Edit Categories and 274Edit Categories and
270Manage new categories 275Manage new categories
271to the settings menu. 276to the settings menu.
272Possible to configure a view to display categories. 277Possible to configure a view to display categories.
273 278
274Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. 279Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
275 280
276Fixed displaying of "free" days and time in KO Monthview and Agendaview. 281Fixed displaying of "free" days and time in KO Monthview and Agendaview.
277 282
278... and many other bugfixes. 283... and many other bugfixes.
279 284
280********** VERSION 1.9.10 ************ 285********** VERSION 1.9.10 ************
281 286
282Many internal small bugfixes. 287Many internal small bugfixes.
283And fix of the "big" bug in KO/Pi, 288And fix of the "big" bug in KO/Pi,
284that after Syncing the appointments had an offset by several hours. 289that after Syncing the appointments had an offset by several hours.
285That was a problem with the internal timezone setting, 290That was a problem with the internal timezone setting,
286introduced by the changed timezone configuration settings. 291introduced by the changed timezone configuration settings.
287 292
288German translation for OM/Pi is now available. 293German translation for OM/Pi is now available.
289 294
290 295
291********** VERSION 1.9.9 ************ 296********** VERSION 1.9.9 ************
292 297
293KDE-Pim/Pi has a new Member! 298KDE-Pim/Pi has a new Member!
294It is called PWM/Pi (Passwordmanager/platform-independent) 299It is called PWM/Pi (Passwordmanager/platform-independent)
295and it is available for the Zaurus. 300and it is available for the Zaurus.
296It is planned, that it will be available later for Windows. 301It is planned, that it will be available later for Windows.
297(And for Linux, of course). 302(And for Linux, of course).
298It is a port of the Passwordmanager of KDE. 303It is a port of the Passwordmanager of KDE.
299It will need the MicroKDElibs to run. 304It will need the MicroKDElibs to run.
300 305
301Made loading of addressbooks in KA/Pi up to 7 times faster! 306Made loading of addressbooks in KA/Pi up to 7 times faster!
302The bigger your addressbook file, the more starting speed 307The bigger your addressbook file, the more starting speed
303will you gain. (relatively) 308will you gain. (relatively)
304 309
305The Qtopia addressbook connector is now platform independend 310The Qtopia addressbook connector is now platform independend
306as well and should work on any platform for importing/exporting 311as well and should work on any platform for importing/exporting
307Qtopia and Opie XML files. 312Qtopia and Opie XML files.
308 313
309Added a +30min feature to the timezone settings to make 314Added a +30min feature to the timezone settings to make
310KDE-Pim/Pi useable in Australia and other parts on the 315KDE-Pim/Pi useable in Australia and other parts on the
311world with strange timezones ;-) 316world with strange timezones ;-)
312 317
313German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 318German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
314 319
315It is now possible to disable the 320It is now possible to disable the
316"receive data via infrared" feature, such that syncing with 321"receive data via infrared" feature, such that syncing with
317Outlook is now possible again with Kx/Pi runing. 322Outlook is now possible again with Kx/Pi runing.
318Please disable it, before syncing Sharp DTM with Outlook. 323Please disable it, before syncing Sharp DTM with Outlook.
319For your convenience, the "receive data via infrared" feature 324For your convenience, the "receive data via infrared" feature
320is disabled automatically, if you sync Kx/Pi with DTM. 325is disabled automatically, if you sync Kx/Pi with DTM.
321You have to enable it again manually after syncing. 326You have to enable it again manually after syncing.
322Enabling this feature makes it impossible to start the 327Enabling this feature makes it impossible to start the
323Sharp DTM apps. If this feature is enabled, you will only get the 328Sharp DTM apps. If this feature is enabled, you will only get the
324alarm notification from KO/Pi and not from the Sharp calendar. 329alarm notification from KO/Pi and not from the Sharp calendar.
325This is very useful if you sync KO/Pi with Sharp DTM, 330This is very useful if you sync KO/Pi with Sharp DTM,
326because after syncing you usually would get notified about 331because after syncing you usually would get notified about
327an alarm by KO/Pi and the Sharp Calendar. 332an alarm by KO/Pi and the Sharp Calendar.
328 333
329Together with the Linux desktop version of KO/Pi 334Together with the Linux desktop version of KO/Pi
330it is now possible to sync KO/Pi on the Zaurus 335it is now possible to sync KO/Pi on the Zaurus
331with the complete KDE-desktop (3.3 or later) 336with the complete KDE-desktop (3.3 or later)
332calendar data easily. 337calendar data easily.
333That makes it possible to sync the Z with one 338That makes it possible to sync the Z with one
334click of a mouse with the KDE-Desktop. 339click of a mouse with the KDE-Desktop.
335This feature it available for all Zaurus platforms KO/Pi 340This feature it available for all Zaurus platforms KO/Pi
336is running on. 341is running on.
337The only thing needed is a running KO/Pi on Linux and 342The only thing needed is a running KO/Pi on Linux and
338a compiled version of the small 343a compiled version of the small
339KDE-Pim/Pi<->KDE-Desktop access command line program, 344KDE-Pim/Pi<->KDE-Desktop access command line program,
340which is in the KDE-Pim/Pi sources available. 345which is in the KDE-Pim/Pi sources available.
341 346
342The "KDE-desktop" syncing feature for KA/Pi will follow 347The "KDE-desktop" syncing feature for KA/Pi will follow
343in the next releases. 348in the next releases.
344 349
345Fixed the vcard export bug, which had the version 1.9.8. 350Fixed the vcard export bug, which had the version 1.9.8.
346 351
347Added missing GERMAN translation to KO/Pi. 352Added missing GERMAN translation to KO/Pi.
348Hi PsionX, could you add the missing french translation?Thx! 353Hi PsionX, could you add the missing french translation?Thx!
349 354
350Translation files for KA/Pi are available as well. 355Translation files for KA/Pi are available as well.
351GERMAN translation will be available in the next release. 356GERMAN translation will be available in the next release.
352PsionX ( yres, you again ;-) ), could you start translating 357PsionX ( yres, you again ;-) ), could you start translating
353KA/Pi? Thx! 358KA/Pi? Thx!
354 359
355You can download the version 1.9.9 at 360You can download the version 1.9.9 at
356 361
357http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 362http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
358 363
359Note: 364Note:
360To run the mail program OM/Pi you need libopenssl. 365To run the mail program OM/Pi you need libopenssl.
361A link to a download loaction is available at 366A link to a download loaction is available at
362ZSI at www.killefiz.de 367ZSI at www.killefiz.de
363 368
364 369
365********** VERSION 1.9.8 ************ 370********** VERSION 1.9.8 ************
366 371
367Fixed character decoding in OM/Pi. 372Fixed character decoding in OM/Pi.
368(e.g. German "Umlaute" were not displayed properly.) 373(e.g. German "Umlaute" were not displayed properly.)
369 374
370Made is possible to reparent todos in KO/Pi. 375Made is possible to reparent todos in KO/Pi.
371Use contextmenu or keys (look at Help-Keys + Colors) for that. 376Use contextmenu or keys (look at Help-Keys + Colors) for that.
372 377
373Added the missing Sync-Howto and WhatsNew to the packages. 378Added the missing Sync-Howto and WhatsNew to the packages.
374 379
375KO/Pi on Linux desktop can now sync with KDE desktop. 380KO/Pi on Linux desktop can now sync with KDE desktop.
376That means: When using KO/Pi on Linux desktop for syncing with 381That means: When using KO/Pi on Linux desktop for syncing with
377KDE desktop and the Zaurus, the Zaurus can be synced now 382KDE desktop and the Zaurus, the Zaurus can be synced now
378with all KDE-Calendar resources, not only with one local file. 383with all KDE-Calendar resources, not only with one local file.
379(That makes it possible to sync the Zaurus with the 384(That makes it possible to sync the Zaurus with the
380calendar data on a Kolab server) 385calendar data on a Kolab server)
381 386
382KA/Pi syncing with KDE desktop will be available in the next version. 387KA/Pi syncing with KDE desktop will be available in the next version.
383 388
384 389
385********** VERSION 1.9.7 ************ 390********** VERSION 1.9.7 ************
386 391
387KO/Pi - KA/Pi on Windows: 392KO/Pi - KA/Pi on Windows:
388Now a directory can be defined by the user, where the 393Now a directory can be defined by the user, where the
389application/config data should be saved. 394application/config data should be saved.
390 Define your desired path in the evironment variable 395 Define your desired path in the evironment variable
391 MICROKDEHOME 396 MICROKDEHOME
392 before starting KO/Pi or KA/Pi. 397 before starting KO/Pi or KA/Pi.
393 398
394An easy Kx/Pi to Kx/Pi syncing is now possible 399An easy Kx/Pi to Kx/Pi syncing is now possible
395(it is called Pi-Sync) via network. 400(it is called Pi-Sync) via network.
396Please look at the Sync Howto. 401Please look at the Sync Howto.
397 402
398Exporting of calendar data and contacts to mobile phones is now possible. 403Exporting of calendar data and contacts to mobile phones is now possible.
399The SyncHowto is updated with information howto 404The SyncHowto is updated with information howto
400access/sync mobile phones. 405access/sync mobile phones.
401Please look at the Sync Howto. 406Please look at the Sync Howto.
402 407
403Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 408Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
404Please disable Fastload for the original contact/calendar applications 409Please disable Fastload for the original contact/calendar applications
405and close them. 410and close them.
406KO/Pi and KA/Pi must be running in order to receive the data. 411KO/Pi and KA/Pi must be running in order to receive the data.
407(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 412(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
408 413
409In the KA/Pi details view are now the preferred tel. numbers displayed on top 414In the KA/Pi details view are now the preferred tel. numbers displayed on top
410of the other data ( emails/tel.numbers/addresses) 415of the other data ( emails/tel.numbers/addresses)
411 416
412Fixed some syncing problems in KA/Pi. 417Fixed some syncing problems in KA/Pi.
413 418
414Added font settings for the KA/Pi details view. 419Added font settings for the KA/Pi details view.
415Added fields "children's name" and "gender" to KA/Pi. 420Added fields "children's name" and "gender" to KA/Pi.
416 421
417Made searching in KA/Pi better: 422Made searching in KA/Pi better:
418Now the first item in a view is selected after a search automatically and 423Now the first item in a view is selected after a search automatically and
419the views can be scrolled up/down when the search input field has the keyboard focus. 424the views can be scrolled up/down when the search input field has the keyboard focus.
420 425
421And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 426And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
422 427
423 428
424********** VERSION 1.9.6 ************ 429********** VERSION 1.9.6 ************
425 430
426Changes in the external application communication on the Zaurus 431Changes in the external application communication on the Zaurus
427in order to use less RAM when the apps are running. 432in order to use less RAM when the apps are running.
428First syncing of addressbooks (KA/Pi) is possible. 433First syncing of addressbooks (KA/Pi) is possible.
429 434
430 435
431********** VERSION 1.9.5a ************ 436********** VERSION 1.9.5a ************
432 437
433Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 438Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
434Fixed some small bugs. 439Fixed some small bugs.
435KA/Pi shows now the birthday in summary view. 440KA/Pi shows now the birthday in summary view.
436Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 441Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
437for displaying dates. 442for displaying dates.
438 443
439 444
440********** VERSION 1.9.5 ************ 445********** VERSION 1.9.5 ************
441 446
442There is still no Addressbook syncing! 447There is still no Addressbook syncing!
443 448
444New in 1.9.5: 449New in 1.9.5:
445 450
446Many bugfixes. 451Many bugfixes.
447Better searching in KA/Pi. 452Better searching in KA/Pi.
448You can configure in KA/Pi if you want to search only after 453You can configure in KA/Pi if you want to search only after
449<return> key pressed. 454<return> key pressed.
450 455
451Better mail downloading in OM/Pi. 456Better mail downloading in OM/Pi.
452 457
453First experimental alpha version of sync of KO/Pi with mobile phones. 458First experimental alpha version of sync of KO/Pi with mobile phones.
454See gammu documentation for supported phones. 459See gammu documentation for supported phones.
455You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp. 460You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp.
456Quick hint how to use: 461Quick hint how to use:
457NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 462NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
458Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 463Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
459Create syncprofile - mobile device 464Create syncprofile - mobile device
460Remove entry for model. (Leave empty ). 465Remove entry for model. (Leave empty ).
461Enable infrared on Zaurus and your Phone. 466Enable infrared on Zaurus and your Phone.
462Sync. 467Sync.
463To get a more detailed log, start kopi from konsole. 468To get a more detailed log, start kopi from konsole.
464 469
465********** VERSION 1.9.4 ************ 470********** VERSION 1.9.4 ************
466 471
467This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 472This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
468 473
469WARNING: 474WARNING:
470PLEASE BACKUP ALL YOUR DATA! 475PLEASE BACKUP ALL YOUR DATA!
471We have changed a lot and maybe there are some unknown problems. 476We have changed a lot and maybe there are some unknown problems.
472 477
473SYNC HANDLING HAS CHANGED! 478SYNC HANDLING HAS CHANGED!
474Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 479Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
475(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 480(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
476 481
477You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 482You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
478If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well. 483If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well.
479 484
480As programs are available: 485As programs are available:
481KO/Pi (korganizer ipk) - a calendar program. 486KO/Pi (korganizer ipk) - a calendar program.
482KA/Pi (kaddressbook ipk ) - an addressbook 487KA/Pi (kaddressbook ipk ) - an addressbook
483OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 488OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
484 489
485An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 490An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
486(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 491(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
487 492
488All the applications are installed in a "Pim" TAB. 493All the applications are installed in a "Pim" TAB.
489If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk 494If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk
490 495
491All the application are integrated. 496All the application are integrated.
492Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail. 497Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail.
493 498
494HINT: 499HINT:
495If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 500If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
496 501
497What's new? 502What's new?
498 503
499SYNC HANDLING HAS CHANGED! 504SYNC HANDLING HAS CHANGED!
500Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 505Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
501(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 506(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
502 507
503New in OM/Pi: 508New in OM/Pi:
504When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails. 509When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails.
505 510
506New in KO/Pi: 511New in KO/Pi:
507French is now available for KO/Pi. 512French is now available for KO/Pi.
508Choose menu:Actions - Configure:TAB locale 513Choose menu:Actions - Configure:TAB locale
509Syncing has changed. 514Syncing has changed.
510Phone sync available soon. 515Phone sync available soon.
511Not much changes, I cannot remember them ... 516Not much changes, I cannot remember them ...
512 517
513New in KA/Pi: 518New in KA/Pi:
514Beaming possible. 519Beaming possible.
515Sharp DTM readonly access possible( create a new DTM resource ); 520Sharp DTM readonly access possible( create a new DTM resource );
516Better searching possible. 521Better searching possible.
517Search is performed only after pressing the return key. 522Search is performed only after pressing the return key.
518Use wildcard * to specify parts of a name. 523Use wildcard * to specify parts of a name.
519 524
520Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * . 525Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * .
521 526
522A big improvement is the new management of the contact access. 527A big improvement is the new management of the contact access.
523In version 1.9.3, every application was using their own addressbook access data. 528In version 1.9.3, every application was using their own addressbook access data.
524That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 529That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
525That was wasting of memory, if you had several hundreds of contacts. 530That was wasting of memory, if you had several hundreds of contacts.
526 531
527Now only KA/Pi accesses the addressbook. 532Now only KA/Pi accesses the addressbook.
528If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them. 533If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them.
529If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 534If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
530That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 535That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
531 536
532New in the KO/Pi alarm applet: 537New in the KO/Pi alarm applet:
533Configure your own timer popup menu! 538Configure your own timer popup menu!
534(Text and minutes for timer countdown) 539(Text and minutes for timer countdown)
535Just edit the file 540Just edit the file
536(yourhomedir)/.kopialarmtimerrc 541(yourhomedir)/.kopialarmtimerrc
537and start/stop a timer to get a new menu with the data of this file. 542and start/stop a timer to get a new menu with the data of this file.
538 543
539********** VERSION 1.9.3 ************ 544********** VERSION 1.9.3 ************
5401) 5451)
541Now KO/Pi on Windows imports directly the calendar data of 546Now KO/Pi on Windows imports directly the calendar data of
542an installed Outlook. Should work with OL version >= 2000. 547an installed Outlook. Should work with OL version >= 2000.
543 548
544********** VERSION 1.9.2 ************ 549********** VERSION 1.9.2 ************
5451) 5501)
546KDE-Pim/Pi has got a new member: 551KDE-Pim/Pi has got a new member:
547KmicroMail (KM/Pi) is a mail program, 552KmicroMail (KM/Pi) is a mail program,
548which can handle IMAP and POP mail access. 553which can handle IMAP and POP mail access.
549It is based on Opie-Mail v3. 554It is based on Opie-Mail v3.
550All dependencies to the Opie libraries ar removed, 555All dependencies to the Opie libraries ar removed,
551such that no additional Opie lib is needed. 556such that no additional Opie lib is needed.
552It is already integrated in KO/Pi and KA/Pi. 557It is already integrated in KO/Pi and KA/Pi.
553It it now available for the Zaurus,probably it 558It it now available for the Zaurus,probably it
554will be available for other platforms later. 559will be available for other platforms later.
555Hint: 560Hint:
556Create your own contact (name + email) 561Create your own contact (name + email)
557in KA/Pi, select this contact and choose menu: 562in KA/Pi, select this contact and choose menu:
558Settings - Set Who Am I. 563Settings - Set Who Am I.
559Now the settings of this contact are used as 564Now the settings of this contact are used as
560the sender data in KM/Pi. 565the sender data in KM/Pi.
5612) 5662)
562KDE-Pim/Pi is split up in five different 567KDE-Pim/Pi is split up in five different
563packages now precompiled for Sharp Zaurus: 568packages now precompiled for Sharp Zaurus:
564--kmicrokdelibs_1.9.2_arm.ipk 569--kmicrokdelibs_1.9.2_arm.ipk
565The libs are needed for any 570The libs are needed for any
566of the following programs: 571of the following programs:
567--kaddressbook_1.9.2_arm.ipk 572--kaddressbook_1.9.2_arm.ipk
568--kmicromail_1.9.2_arm.ipk 573--kmicromail_1.9.2_arm.ipk
569--korganizer_1.9.2_arm.ipk 574--korganizer_1.9.2_arm.ipk
570Independ from that, there is the alarm applet 575Independ from that, there is the alarm applet
571available for KO/Pi, which also offers 576available for KO/Pi, which also offers
572quick access for a new mail or 577quick access for a new mail or
573showing the addressbook.: 578showing the addressbook.:
574--korganizer-alarm_1.9.2_arm.ipk 579--korganizer-alarm_1.9.2_arm.ipk
575Independend means, that the alarm applet 580Independend means, that the alarm applet
576does not need any of the libs or programs above to run. 581does not need any of the libs or programs above to run.
577But it would be quite useless without these programs. 582But it would be quite useless without these programs.
578NOTE: 583NOTE:
579If you get a 584If you get a
580"This application depends on other programs" 585"This application depends on other programs"
581during installation of 586during installation of
582--kmicrokdelibs_1.9.2_arm.ipk 587--kmicrokdelibs_1.9.2_arm.ipk
583you probably do not have to care about that. 588you probably do not have to care about that.
584kmicrokdelibs_1.9.2 will come with some 589kmicrokdelibs_1.9.2 will come with some
585resource plugins, which needs additional libraries. 590resource plugins, which needs additional libraries.
586(E.g. libopie1, if you want to use the 591(E.g. libopie1, if you want to use the
587opie resource connector in KA/Pi). 592opie resource connector in KA/Pi).
588If you do not have this libraries installed, 593If you do not have this libraries installed,
589you simply cannot use the resource. 594you simply cannot use the resource.
590To make it clear: 595To make it clear:
591If the libraries are missing, the applications 596If the libraries are missing, the applications
592using kmicrokdelibs will start, 597using kmicrokdelibs will start,
593because the resources are plugins. 598because the resources are plugins.
5943) 5993)
595KO/Pi and friends are now installable on SD-Card! 600KO/Pi and friends are now installable on SD-Card!
596It is recommended to install all libs and apps 601It is recommended to install all libs and apps
597on the SD card or all in the internal storage. 602on the SD card or all in the internal storage.
598There may be problems, if this is mixed. 603There may be problems, if this is mixed.
5994) 6044)
600Fixed two bugs in the alarm notification on Windows. 605Fixed two bugs in the alarm notification on Windows.
6015) 6065)
602Great improvement! 607Great improvement!
603KO/Pi uses now the latest version of libical. 608KO/Pi uses now the latest version of libical.
604Libical is the library which actually reads 609Libical is the library which actually reads
605the calendar files and extract the data from it. 610the calendar files and extract the data from it.
606With the old version, there were problems 611With the old version, there were problems
607(crashes or program hangs) when licical did read 612(crashes or program hangs) when licical did read
608files, which were not stored from KO/Pi. 613files, which were not stored from KO/Pi.
609I do not know, if the new libical works perfect, 614I do not know, if the new libical works perfect,
610but actually it works much better than 615but actually it works much better than
611the old version. 616the old version.
612There are no problems with compatibility with 617There are no problems with compatibility with
613old calendar files of KO/Pi, of course! 618old calendar files of KO/Pi, of course!
6146) 6196)
615New in KA/Pi: 620New in KA/Pi:
616Opie addressbook resource connector available! 621Opie addressbook resource connector available!
617You will need libopie1 and the opie addressbook, 622You will need libopie1 and the opie addressbook,
618of course. 623of course.
619With the Opie addressbook resource connector, 624With the Opie addressbook resource connector,
620you can access the Opie addressbook readonly in KA/Pi. 625you can access the Opie addressbook readonly in KA/Pi.
621If you want to edit or import the data into KA/Pi, 626If you want to edit or import the data into KA/Pi,
622do this: 627do this:
623a) Create an Opie resource. 628a) Create an Opie resource.
624 (Menu: Settings-Configure Resources). 629 (Menu: Settings-Configure Resources).
625After configuration and restarting KA/Pi you should see 630After configuration and restarting KA/Pi you should see
626the Opie contacts in KA/Pi. 631the Opie contacts in KA/Pi.
627b) Select some or all Opie contacts. 632b) Select some or all Opie contacts.
628(NOTE: +++++ 633(NOTE: +++++
629To know exactly, what contacts are Opie contacts, 634To know exactly, what contacts are Opie contacts,
630do this: Choose menu: 635do this: Choose menu:
631View-Modify View - TAB Fields. 636View-Modify View - TAB Fields.
632Select in the above list "Resource" and click 637Select in the above list "Resource" and click
633down arrow to add it to the "Selected fields". 638down arrow to add it to the "Selected fields".
634Click OK. 639Click OK.
635Now you have a new column "Resource" in your list, 640Now you have a new column "Resource" in your list,
636where you can see, what an Opie resource is. 641where you can see, what an Opie resource is.
637++++ NOTE end.) 642++++ NOTE end.)
638Ok, we do have now some Opie contacts seleted. 643Ok, we do have now some Opie contacts seleted.
639(Use SHIFT or CTRL key in order to multiple select). 644(Use SHIFT or CTRL key in order to multiple select).
640c) Choose menu: Edit-Copy. 645c) Choose menu: Edit-Copy.
641d) Choose menu: Edit-Paste. 646d) Choose menu: Edit-Paste.
642e) Select the resource, you want to add the contacts to. 647e) Select the resource, you want to add the contacts to.
643Congrats! Now you have read/write access to the copied 648Congrats! Now you have read/write access to the copied
644opie contacts as "real" KA/Pi contacts. 649opie contacts as "real" KA/Pi contacts.
645 650
646 651
647********** VERSION 1.9.1 ************ 652********** VERSION 1.9.1 ************
6481) 6531)
649 +++ IMPORTANT 1 +++ 654 +++ IMPORTANT 1 +++
650 655
651The storing place of the default calendar 656The storing place of the default calendar
652file has changed! 657file has changed!
653The default calendar file was 658The default calendar file was
654Applications/korganizer/mycalendar.ics 659Applications/korganizer/mycalendar.ics
655on Zaurus and 660on Zaurus and
656(yourHomeDir)/korganizer/mycalendar.ics 661(yourHomeDir)/korganizer/mycalendar.ics
657on Windows/Linux desktop. Now it is 662on Windows/Linux desktop. Now it is
658(yourHomeDir)/kdepim/korganizer/mycalendar.ics 663(yourHomeDir)/kdepim/korganizer/mycalendar.ics
659on Zaurus, Windows and Linux. 664on Zaurus, Windows and Linux.
660To load the old file, choose menu 665To load the old file, choose menu
661File-Load calendar backup. 666File-Load calendar backup.
662(It should be loaded automatically 667(It should be loaded automatically
663at startup with a warning message displayed). 668at startup with a warning message displayed).
664The place of the configuration file has changed too. 669The place of the configuration file has changed too.
665If you want to use your old KO/Pi config, 670If you want to use your old KO/Pi config,
666copy it to 671copy it to
667(yourHomeDir)/kdepim/config/korganizerrc 672(yourHomeDir)/kdepim/config/korganizerrc
668Please read VERSION 1.9.0 - topic 3) as well! 673Please read VERSION 1.9.0 - topic 3) as well!
669 674
670 +++ IMPORTANT 2 +++ 675 +++ IMPORTANT 2 +++
671 676
672Because of the new paths, you will need 677Because of the new paths, you will need
673a new version of the KO/Pi alarm applet 678a new version of the KO/Pi alarm applet
674for Zaurus. 679for Zaurus.
675Use version >= 1.9.1 680Use version >= 1.9.1
676 681
6772) 6822)
678Now the QWhat'sThis Icon works for items 683Now the QWhat'sThis Icon works for items
679in the month view as well. 684in the month view as well.
680(See VERSION 1.7.8 Topic 1) ). 685(See VERSION 1.7.8 Topic 1) ).
6813) 6863)
682You can import birtsdays/anniversaries 687You can import birtsdays/anniversaries
683from KA/Pi into KO/Pi. 688from KA/Pi into KO/Pi.
684Choose menu File-Import birthdays. 689Choose menu File-Import birthdays.
685If you import twice, already imported items 690If you import twice, already imported items
686will not be imported again, if they 691will not be imported again, if they
687have not been changed in KO/Pi. 692have not been changed in KO/Pi.
6884) 6934)
689When syncing with sharp DTM, now a progress 694When syncing with sharp DTM, now a progress
690is shown, when the data is written back. 695is shown, when the data is written back.
691If there is much data in KO/Pi and no data 696If there is much data in KO/Pi and no data
692in DTM, that can take a long time. 697in DTM, that can take a long time.
693(But only for the first time ). 698(But only for the first time ).
6945) 6995)
695In the search dialog, you can search 700In the search dialog, you can search
696now for the name/email of an attendee 701now for the name/email of an attendee
697of an event/todo. 702of an event/todo.
698To get more space for displaying 703To get more space for displaying
699search results, the buttons 704search results, the buttons
700for "search" and "close" on the 705for "search" and "close" on the
701bottom are removed in the PDA version. 706bottom are removed in the PDA version.
702You have to click OK in the top right 707You have to click OK in the top right
703corner to do a search. 708corner to do a search.
7046) 7096)
705Now it is possible to disable the displaying 710Now it is possible to disable the displaying
706of todo items in the Allday part of the Agenda. 711of todo items in the Allday part of the Agenda.
707Choose Menu Action-Configure, 712Choose Menu Action-Configure,
708TAB Todo View, checkbox 713TAB Todo View, checkbox
709"Allday Agenda view shows todos" 714"Allday Agenda view shows todos"
7107) 7157)
711If FastLoad is enabled, now the settings and the 716If FastLoad is enabled, now the settings and the
712calendar data are saved, when KO/Pi is closed. 717calendar data are saved, when KO/Pi is closed.
713(If no Fastload is enabled, KO/Pi saves 718(If no Fastload is enabled, KO/Pi saves
714the data as well, of course) 719the data as well, of course)
7158) 7208)
716The Agenda View has a minimize-splitter now, 721The Agenda View has a minimize-splitter now,
717such that the height of the allday part can be 722such that the height of the allday part can be
718changed quickly. 723changed quickly.
719 724
720********** VERSION 1.9.0 ************ 725********** VERSION 1.9.0 ************
7211) 7261)
722KO/Pi is now merged with the new microKDE from KA/Pi. 727KO/Pi is now merged with the new microKDE from KA/Pi.
723KO/Pi accesses now KA/Pi as the addressbook. 728KO/Pi accesses now KA/Pi as the addressbook.
724The other ddressbook-plugins are not working any longer. 729The other ddressbook-plugins are not working any longer.
725(It is planned, that later KA/Pi itself uses these plugins) 730(It is planned, that later KA/Pi itself uses these plugins)
726New versions of KO/Pi are only available 731New versions of KO/Pi are only available
727together with KA/Pi as the KDE-Pim/Pi package. 732together with KA/Pi as the KDE-Pim/Pi package.
7282) 7332)
729If you click on an attendee of a meeting in the 734If you click on an attendee of a meeting in the
730event viewer, a detailed summary of the 735event viewer, a detailed summary of the
731attendee is shown. 736attendee is shown.
7323) 7373)
733The place of the configuration file has changed. 738The place of the configuration file has changed.
734If you want to use your old KO/Pi config, copy 739If you want to use your old KO/Pi config, copy
735Applications/korganizer/config_korganizerrc 740Applications/korganizer/config_korganizerrc
736to 741to
737Applications/korganizer/config/korganizerrc 742Applications/korganizer/config/korganizerrc
738 743
739********** VERSION 1.7.8 ************ 744********** VERSION 1.7.8 ************
7401) 7451)
741Now the QWhat'sThis ist working. 746Now the QWhat'sThis ist working.
742Enable the QWhat'sThis icon in the toolbar. 747Enable the QWhat'sThis icon in the toolbar.
743(You have to restart to reload the changed toolbar config). 748(You have to restart to reload the changed toolbar config).
744Now click on the QWhat'sThis Icon 749Now click on the QWhat'sThis Icon
745in the top right corner of KO/Pi. 750in the top right corner of KO/Pi.
746Then click on an item in the Agenda View: 751Then click on an item in the Agenda View:
747You will get a detailed display of the items content. 752You will get a detailed display of the items content.
7482) 7532)
749Some other very minor changes. 754Some other very minor changes.
750But I have forgotten the details ... 755But I have forgotten the details ...
751For that reason I start this log here: 756For that reason I start this log here:
752To document my changes, when I am doing it. 757To document my changes, when I am doing it.
753 758
754********** VERSION 1.7.7 ************ 759********** VERSION 1.7.7 ************
755Stable Version of KO/Pi 760Stable Version of KO/Pi
diff --git a/bin/kdepim/kopiemail/germantranslation.txt b/bin/kdepim/kopiemail/germantranslation.txt
index 5037f5f..6ebaafe 100644
--- a/bin/kdepim/kopiemail/germantranslation.txt
+++ b/bin/kdepim/kopiemail/germantranslation.txt
@@ -1,260 +1,260 @@
1{ " Local Time"," Locale Zeit" }, 1{ " Local Time"," Locale Zeit" },
2{ "Preferences","Vorlieben" }, 2{ "Preferences","Vorlieben" },
3{ "Ok","Ok" }, 3{ "Ok","Ok" },
4{ "Default","Standard" }, 4{ "Default","Standard" },
5{ "Cancel","Abbrechen" }, 5{ "Cancel","Abbrechen" },
6{ "Global","Global" }, 6{ "Global","Global" },
7{ "Email","Email" }, 7{ "Email","Email" },
8{ "Phone","Phone" }, 8{ "Phone","Phone" },
9{ "SMS","SMS" }, 9{ "SMS","SMS" },
10{ "Fax","Fax" }, 10{ "Fax","Fax" },
11{ "Pager","Pager" }, 11{ "Pager","Pager" },
12{ "SIP","SIP" }, 12{ "SIP","SIP" },
13{ "Language:(needs restart)","Sprache (Neustart!)" }, 13{ "Language:(needs restart)","Sprache (Neustart!)" },
14{ "English","Englisch" }, 14{ "English","Englisch" },
15{ "German","Deutsch" }, 15{ "German","Deutsch" },
16{ "French","Französich" }, 16{ "French","Französich" },
17{ "Italian","Italienisch" }, 17{ "Italian","Italienisch" },
18{ "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" }, 18{ "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" },
19{ "Time Format(nr):","Zeit Format(Neustart!)" }, 19{ "Time Format(nr):","Zeit Format(Neustart!)" },
20{ "24:00","24:00" }, 20{ "24:00","24:00" },
21{ "12:00am","12:00am" }, 21{ "12:00am","12:00am" },
22{ "Week starts on Sunday","Woche beginnt Sonntags" }, 22{ "Week starts on Sunday","Woche beginnt Sonntags" },
23{ "Locale","Localisation" }, 23{ "Locale","Localisation" },
24{ "Date Format:","Datums Format:" }, 24{ "Date Format:","Datums Format:" },
25{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 25{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
26{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 26{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
27{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 27{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
28{ "User defined","Benutzerdefiniert" }, 28{ "User defined","Benutzerdefiniert" },
29{ "User long date:","Format langes Datum:" }, 29{ "User long date:","Format langes Datum:" },
30{ "User short date:","Format kurzes Datum:" }, 30{ "User short date:","Format kurzes Datum:" },
31{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, 31{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" },
32{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 32{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
33{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 33{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
34{ "Date Format","Datums Format" }, 34{ "Date Format","Datums Format" },
35{ "Timezone:","Zeitzone:" }, 35{ "Timezone:","Zeitzone:" },
36{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 36{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
37{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 37{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
38{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 38{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
39{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 39{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
40{ "Daylight start:","Sommerzeit Beginn:" }, 40{ "Daylight start:","Sommerzeit Beginn:" },
41{ "Mon","Mo" }, 41{ "Mon","Mo" },
42{ "Tue","Di" }, 42{ "Tue","Di" },
43{ "Wed","Mi" }, 43{ "Wed","Mi" },
44{ "Thu","Do" }, 44{ "Thu","Do" },
45{ "Fri","Fr" }, 45{ "Fri","Fr" },
46{ "Sat","Sa" }, 46{ "Sat","Sa" },
47{ "Sun","So" }, 47{ "Sun","So" },
48{ "January","Januar" }, 48{ "January","Januar" },
49{ "February","Februar" }, 49{ "February","Februar" },
50{ "March","März" }, 50{ "March","März" },
51{ "April","April" }, 51{ "April","April" },
52{ "May","Mai" }, 52{ "May","Mai" },
53{ "June","Juni" }, 53{ "June","Juni" },
54{ "July","Juli" }, 54{ "July","Juli" },
55{ "August","August" }, 55{ "August","August" },
56{ "September","September" }, 56{ "September","September" },
57{ "October","Oktober" }, 57{ "October","Oktober" },
58{ "November","November" }, 58{ "November","November" },
59{ "December","Dezember" }, 59{ "December","Dezember" },
60{ "tomorrow","morgen" }, 60{ "tomorrow","morgen" },
61{ "today","heute" }, 61{ "today","heute" },
62{ "yesterday","gestern" }, 62{ "yesterday","gestern" },
63{ "Monday","Montag" }, 63{ "Monday","Montag" },
64{ "Tuesday","Dienstag" }, 64{ "Tuesday","Dienstag" },
65{ "Wednesday","Mittwoch" }, 65{ "Wednesday","Mittwoch" },
66{ "Thursday","Donnerstag" }, 66{ "Thursday","Donnerstag" },
67{ "Friday","Freitag" }, 67{ "Friday","Freitag" },
68{ "Saturday","Samstag" }, 68{ "Saturday","Samstag" },
69{ "Sunday","Sonntag" }, 69{ "Sunday","Sonntag" },
70{ "Daylight end:","Sommerzeit Ende:" }, 70{ "Daylight end:","Sommerzeit Ende:" },
71{ "Time Zone","Zeitzone" }, 71{ "Time Zone","Zeitzone" },
72{ "Used Mail Client","Benutzter Mail Client" }, 72{ "Used Mail Client","Benutzter Mail Client" },
73{ "Channel:","Channel:" }, 73{ "Channel:","Channel:" },
74{ "Message:","Message:" }, 74{ "Message:","Message:" },
75{ "Parameters:","Parameter:" }, 75{ "Parameters:","Parameter:" },
76{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 76{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
77{ "extra Message:","extra Message:" }, 77{ "extra Message:","extra Message:" },
78{ "extra Parameters:","extra Parameter:" }, 78{ "extra Parameters:","extra Parameter:" },
79{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 79{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
80{ "External Apps.","Externe Appl." }, 80{ "External Apps.","Externe Appl." },
81{ "General","Allgemein" }, 81{ "General","Allgemein" },
82{ "Full &name:","Vor- und &Nachname:" }, 82{ "Full &name:","Vor- und &Nachname:" },
83{ "E&mail address:","E&mail Adresse:" }, 83{ "E&mail address:","E&mail Adresse:" },
84{ "Fonts","Schriftart" }, 84{ "Fonts","Schriftart" },
85{ "Choose...","Wähle..." }, 85{ "Choose...","Wähle..." },
86{ "Used %1 Client","Benutzter %1 Client" }, 86{ "Used %1 Client","Benutzter %1 Client" },
87{ "No email client installed","Kein Email Klient installiert" }, 87{ "No email client installed","Kein Email Klient installiert" },
88{ "Userdefined email client","Benutzerdef. Email Klient" }, 88{ "Userdefined email client","Benutzerdef. Email Klient" },
89{ "OM/Pi email client","OM/Pi Email Klient" }, 89{ "OM/Pi email client","OM/Pi Email Klient" },
90{ "Delete","Löschen" }, 90{ "Delete","Löschen" },
91{ "New","Neu" }, 91{ "New","Neu" },
92{ "Edit","Bearbeite" }, 92{ "Edit","Bearbeite" },
93{ "Close","Schließen" }, 93{ "Close","Schließen" },
94{ "Size","Größe" }, 94{ "Size","Größe" },
95{ "Date","Datum" }, 95{ "Date","Datum" },
96{ "Please set at","Bitte einstellen in" }, 96{ "Please set at","Bitte einstellen in" },
97{ "Settings@General TAB","Einstellungen@Allgemein TAB" }, 97{ "Settings@General TAB","Einstellungen@Allgemein TAB" },
98{ "KOpieMail/Pi","KOpieMail/Pi" }, 98{ "KOpieMail/Pi","KOpieMail/Pi" },
99{ "Mail","Mail" }, 99{ "Mail","Mail" },
100{ "Settings","Konfig" }, 100{ "Settings","Konfig" },
101{ "Get all new mails","Hole alle neuen Mails" }, 101{ "Get all new mails","Hole alle neuen Mails" },
102{ "Get new messages","Hole neue mails" }, 102{ "Get new messages","Hole neue mails" },
103{ "Compose new mail","Schreibe neue Mail" }, 103{ "Compose new mail","Schreibe neue Mail" },
104{ "Send queued mails","Sende gespeicherte Mails" }, 104{ "Send queued mails","Sende gespeicherte Mails" },
105{ "Show/Hide folders","Zeige Verzeichnisse" }, 105{ "Show/Hide folders","Zeige Verzeichnisse" },
106{ "Delete Mail","Lösche Mail" }, 106{ "Delete Mail","Lösche Mail" },
107{ "Edit settings","Ändere Einstellungen" }, 107{ "Edit settings","Ändere Einstellungen" },
108{ "Configure accounts","Konfiguriere Zugänge" }, 108{ "Configure accounts","Konfiguriere Zugänge" },
109{ "Mailbox","Mailbox" }, 109{ "Mailbox","Mailbox" },
110{ "Subject","Betreff" }, 110{ "Subject","Betreff" },
111{ "Sender","Sender" }, 111{ "Sender","Sender" },
112{ "Size","Größe" }, 112{ "Size","Größe" },
113{ "Date","Datum" }, 113{ "Date","Datum" },
114{ "Close","Schliessen" }, 114{ "Close","Schliessen" },
115{ "Help","Hilfe" }, 115{ "Help","Hilfe" },
116{ "About","Über" }, 116{ "About","Über" },
117{ "Licence","Lizenz" }, 117{ "Licence","Lizenz" },
118{ "LibEtPan Licence","LibEtPan Lizenz" }, 118{ "LibEtPan Licence","LibEtPan Lizenz" },
119{ "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" }, 119{ "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" },
120{ "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" }, 120{ "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" },
121{ "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" }, 121{ "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" },
122{ "View mail as html","Zeige Mails als html" }, 122{ "View mail as html","Zeige Mails als html" },
123{ "Send mails later","Sende Mails später" }, 123{ "Send mails later","Sende Mails später" },
124{ "Application(nr)","Applikation(nr)" }, 124{ "Application(nr)","Applikation(nr)" },
125{ "OK","OK" }, 125{ "OK","OK" },
126{ "Compose mail:","Verfasse Mail:" }, 126{ "Compose mail:","Verfasse Mail:" },
127{ "Dear Mr.","Hallo Herr" }, 127{ "Dear Mr.","Hallo Herr" },
128{ "Read mail:","Lese Mail:" }, 128{ "Read mail:","Lese Mail:" },
129{ "Hello","Hallo" }, 129{ "Hello","Hallo" },
130{ "Configure Accounts","Konfigure Zugänge" }, 130{ "Configure Accounts","Konfigure Zugänge" },
131{ "Name of the Account","Name des Zugangs" }, 131{ "Name of the Account","Name des Zugangs" },
132{ "News","News" }, 132{ "News","News" },
133{ "Account","Zugang" }, 133{ "Account","Zugang" },
134{ "Type","Typ" }, 134{ "Type","Typ" },
135{ "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" }, 135{ "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" },
136{ "Error","Fehler" }, 136{ "Error","Fehler" },
137{ "Configure NNTP","Konfiguriere News" }, 137{ "Configure NNTP","Konfiguriere News" },
138{ "Port","Port" }, 138{ "Port","Port" },
139{ "Server","Server" }, 139{ "Server","Server" },
140{ "Use SSL","Benutze SSL" }, 140{ "Use SSL","Benutze SSL" },
141{ "User","Benutzer" }, 141{ "User","Benutzer" },
142{ "Password","Passwort" }, 142{ "Password","Passwort" },
143{ "Use Login","Benutze Login" }, 143{ "Use Login","Benutze Login" },
144{ "Newsgroup","Newsgroup" }, 144{ "Newsgroup","Newsgroup" },
145{ "Get newsgroup list from server","Hole Newsgroup Liste vom Server" }, 145{ "Get newsgroup list from server","Hole Newsgroup Liste vom Server" },
146{ "Filter:","Filter:" }, 146{ "Filter:","Filter:" },
147{ "Show subscribed","Zeige abbonnierte" }, 147{ "Show subscribed","Zeige abbonnierte" },
148{ "Groups","NewsGroups" }, 148{ "Groups","NewsGroups" },
149{ "Configure IMAP","Konfiguriere IMAP" }, 149{ "Configure IMAP","Konfiguriere IMAP" },
150{ "Use secure sockets:","Benutze sichere Verbindung:" }, 150{ "Use secure sockets:","Benutze sichere Verbindung:" },
151{ "ssh $SERVER exec","ssh $SERVER exec" }, 151{ "ssh $SERVER exec","ssh $SERVER exec" },
152{ "Prefix","Prefix" }, 152{ "Prefix","Prefix" },
153{ "Local storage folder:","Lokales Verzeichnis:" }, 153{ "Local storage folder:","Lokales Verzeichnis:" },
154{ "Get only messages smaller","Hole nur Nachrichten kleiner" }, 154{ "Get only messages smaller","Hole nur Nachrichten kleiner" },
155{ "kB","kB" }, 155{ "kB","kB" },
156{ "Leave Messages on Server","Belasse Nachrichten auf dem Server" }, 156{ "Leave Messages on Server","Belasse Nachrichten auf dem Server" },
157{ "Configure POP3","Konfiguriere POP3" }, 157{ "Configure POP3","Konfiguriere POP3" },
158{ "ssh $SERVER exec imapd","ssh $SERVER exec imapd" }, 158{ "ssh $SERVER exec imapd","ssh $SERVER exec imapd" },
159{ "Configure SMTP","Konfiguriere SMTP" }, 159{ "Configure SMTP","Konfiguriere SMTP" },
160{ "Name of the SMTP Server","Name des SMTP Servers" }, 160{ "Name of the SMTP Server","Name des SMTP Servers" },
161{ "Port of the SMTP Server","Port des SMTP Servers" }, 161{ "Port of the SMTP Server","Port des SMTP Servers" },
162{ "Fetching folder list","Hole Verzeichnis Liste" }, 162{ "Fetching folder list","Hole Verzeichnis Liste" },
163{ "Fetch ","Hole " }, 163{ "Fetch ","Hole " },
164{ "Fetching header list","Hole Titel Liste" }, 164{ "Fetching header list","Hole Titel Liste" },
165{ "Mailbox has %1 mails","Mailbox hat %1 Mails" }, 165{ "Mailbox has %1 mails","Mailbox hat %1 Mails" },
166{ "Read this mail","Lies diese Mail" }, 166{ "Read this mail","Lies diese Mail" },
167{ "Move/Copy this mail","Verschiebe/kopiere diese Mail" }, 167{ "Move/Copy this mail","Verschiebe/kopiere diese Mail" },
168{ "Delete this mail","Lösche diese Mail" }, 168{ "Delete this mail","Lösche diese Mail" },
169{ "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" }, 169{ "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" },
170{ "Delete all selected mails","Lösche alle selektierten Mails" }, 170{ "Delete all selected mails","Lösche alle selektierten Mails" },
171{ "Clear selection","Selektion aufheben" }, 171{ "Clear selection","Selektion aufheben" },
172{ "Reply","Antworten" }, 172{ "Reply","Antworten" },
173{ "Forward","Weiterleiten" }, 173{ "Forward","Weiterleiten" },
174{ "Attachments","Anhang" }, 174{ "Attachments","Anhang" },
175{ "Show Html","Zeige in html" }, 175{ "Show Html","Zeige in html" },
176{ "Description","Beschreibung" }, 176{ "Description","Beschreibung" },
177{ "Filename","Dateiname" }, 177{ "Filename","Dateiname" },
178{ "E-Mail by %1","E-Mail von %1" }, 178{ "E-Mail by %1","E-Mail von %1" },
179{ "Cc","Kopie" }, 179{ "Cc","Kopie" },
180{ "To","An" }, 180{ "To","An" },
181{ "From","Von" }, 181{ "From","Von" },
182{ "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" }, 182{ "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" },
183{ "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" }, 183{ "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" },
184{ "Move/Copie all mails","Verschiebe/kopiere alle Mails" }, 184{ "Move/Copie all mails","Verschiebe/kopiere alle Mails" },
185{ "Delete all mails","Lösche alle Mails" }, 185{ "Delete all mails","Lösche alle Mails" },
186{ "Create new subfolder","Neues Unterverzeichnis" }, 186{ "Create new subfolder","Neues Unterverzeichnis" },
187{ "Delete folder","Lösche Verzeichnis" }, 187{ "Delete folder","Lösche Verzeichnis" },
188{ "Refresh folder list","Aktualisiere Verzeichnis Liste" }, 188{ "Refresh folder list","Aktualisiere Liste" },
189{ "Create new folder","Neues Verzeichnis" }, 189{ "Create new folder","Neues Verzeichnis" },
190{ "Disconnect","Disconnect" }, 190{ "Disconnect","Diskonnect" },
191{ "Set offline","Gehe offline" }, 191{ "Set offline","Gehe offline" },
192{ "Select target box","Wähle Ziel Box" }, 192{ "Select target box","Wähle Ziel Box" },
193{ "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" }, 193{ "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" },
194{ "Folder:","Verzeichnis:" }, 194{ "Folder:","Verzeichnis:" },
195{ "Account:","Zugang:" }, 195{ "Account:","Zugang:" },
196{ "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" }, 196{ "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" },
197{ "Move mail(s)","Verschiebe Mail(s)" }, 197{ "Move mail(s)","Verschiebe Mail(s)" },
198{ "only mails smaller","nur Mails kleiner" }, 198{ "only mails smaller","nur Mails kleiner" },
199{ " kB"," kB" }, 199{ " kB"," kB" },
200{ " message %1 of %2"," Nachricht %1 von %2" }, 200{ " message %1 of %2"," Nachricht %1 von %2" },
201{ "Copying...","Am Kopieren..." }, 201{ "Copying...","Am Kopieren..." },
202{ "Copy message %1 of %2","Kopiere Nachricht %1 von %2" }, 202{ "Copy message %1 of %2","Kopiere Nachricht %1 von %2" },
203{ "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" }, 203{ "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" },
204{ "Delete All Mails","Lösche alle Mails" }, 204{ "Delete All Mails","Lösche alle Mails" },
205{ "Deleting ...","Am Löschen..." }, 205{ "Deleting ...","Am Löschen..." },
206{ "Delete message %1 of %2","Lösche Nachricht %1 von %2" }, 206{ "Delete message %1 of %2","Lösche Nachricht %1 von %2" },
207{ "Compose Message","Verfasse Nachricht" }, 207{ "Compose Message","Verfasse Nachricht" },
208{ "Reply-To","Antwort-An" }, 208{ "Reply-To","Antwort-An" },
209{ "BCC","BCC" }, 209{ "BCC","BCC" },
210{ "Signature","Signatur" }, 210{ "Signature","Signatur" },
211{ "CC","Kopie" }, 211{ "CC","Kopie" },
212{ "Options","Optionen" }, 212{ "Options","Optionen" },
213{ "Delete File","Lösche Datei" }, 213{ "Delete File","Lösche Datei" },
214{ "Add File","Füge Datei hinzu" }, 214{ "Add File","Füge Datei hinzu" },
215{ "Attachment","Anhang" }, 215{ "Attachment","Anhang" },
216{ "send later","sende später" }, 216{ "send later","sende später" },
217{ "use:","via:" }, 217{ "use:","via:" },
218{ "Save","Speichern" }, 218{ "Save","Speichern" },
219{ "Name","Name" }, 219{ "Name","Name" },
220{ "No Receiver spezified","Kein Empfänger angegeben" }, 220{ "No Receiver spezified","Kein Empfänger angegeben" },
221{ "Sending mail","Sende Mail" }, 221{ "Sending mail","Sende Mail" },
222{ "No","Nein" }, 222{ "No","Nein" },
223{ "Yes","Ja" }, 223{ "Yes","Ja" },
224{ "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" }, 224{ "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" },
225{ "Store message?","Nachricht speichern?" }, 225{ "Store message?","Nachricht speichern?" },
226{ "Select Type","Selektiere Typ" }, 226{ "Select Type","Selektiere Typ" },
227{ "Select Account Type","Wähle Art des Zugangs" }, 227{ "Select Account Type","Wähle Art des Zugangs" },
228{ "IMAP","IMAP (online lesen)" }, 228{ "IMAP","IMAP (online lesen)" },
229{ "POP3","POP3 (holen)" }, 229{ "POP3","POP3 (holen)" },
230{ "SMTP","SMTP (senden)" }, 230{ "SMTP","SMTP (senden)" },
231{ "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" }, 231{ "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" },
232{ "Question","Eine Frage..." }, 232{ "Question","Eine Frage..." },
233{ "Send this message?","Nachricht wirklich senden?" }, 233{ "Send this message?","Nachricht wirklich senden?" },
234{ "Stop editing message","Stop editing message" }, 234{ "Stop editing message","Stop editing message" },
235{ "Sending mail %1 of %2","Sende Mail %1 von %2" }, 235{ "Sending mail %1 of %2","Sende Mail %1 von %2" },
236{ "%1 of %2 bytes send","%1 von %2 Bytes gesendet" }, 236{ "%1 of %2 bytes send","%1 von %2 Bytes gesendet" },
237{ "Refresh header list","Aktualisiere Titel Liste" }, 237{ "Refresh header list","Aktualisiere Titel Liste" },
238{ "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" }, 238{ "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" },
239{ "Mail queue flushed","Gespeicherte Mails gesendet!" }, 239{ "Mail queue flushed","Gespeicherte Mails gesendet!" },
240{ "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" }, 240{ "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" },
241{ "Show next mail","Zeige nächste Mail" }, 241{ "Show next mail","Zeige nächste Mail" },
242{ "End of List","Ende der Liste" }, 242{ "End of List","Ende der Liste" },
243{ "Language","Sprache" }, 243{ "Language","Sprache" },
244{ "Time Format","Zeit Format" }, 244{ "Time Format","Zeit Format" },
245{ "%1 groups subscribed","%1 Guppen abboniert" }, 245{ "%1 groups subscribed","%1 Guppen abboniert" },
246{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Ihr gerade genutztes Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverzeichnis)/apps/kopiemail/localmail" }, 246{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Ihr gerade genutztes Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverzeichnis)/apps/kopiemail/localmail" },
247{ "<b>Set new data storage dir:</b>","<b>Setze neues Datenspeicherverzeichnis:</b>" }, 247{ "<b>Set new data storage dir:</b>","<b>Setze neues Datenspeicherverzeichnis:</b>" },
248{ "Not existing dirs are created automatically","Nicht existierende Verzeichnisse werden erstellt" }, 248{ "Not existing dirs are created automatically","Nicht existierende Verzeichnisse werden erstellt" },
249{ "Save settings","Speichere Einstellungen" }, 249{ "Save settings","Speichere Einstellungen" },
250{ "Save standard","Speichere Standard" }, 250{ "Save standard","Speichere Standard" },
251{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 251{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
252{ "The settings of the storage\ndir is saved in the file\n%1","Die Einstellungen des Speicherverzeichnisses\nwerden in folgender Datei gespeichert:\n%1" }, 252{ "The settings of the storage\ndir is saved in the file\n%1","Die Einstellungen des Speicherverzeichnisses\nwerden in folgender Datei gespeichert:\n%1" },
253{ "Data storage path","Daten Speicherpfad" }, 253{ "Data storage path","Daten Speicherpfad" },
254{ "userdefined","benutzerdefiniert" }, 254{ "userdefined","benutzerdefiniert" },
255{ "","" }, 255{ "Reply to this mail","Beantworte diese Mail" },
256{ "","" }, 256{ "","" },
257{ "","" }, 257{ "","" },
258{ "","" }, 258{ "","" },
259{ "","" }, 259{ "","" },
260{ "","" }, 260{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9c10ba6..12af655 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,3875 +1,3877 @@
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 (preston.brown@yale.edu) 8 Preston Brown (preston.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 "statusdialog.h" 110#include "statusdialog.h"
111#include "kdatenavigator.h" 111#include "kdatenavigator.h"
112#include "kotodoview.h" 112#include "kotodoview.h"
113#include "datenavigator.h" 113#include "datenavigator.h"
114#include "resourceview.h" 114#include "resourceview.h"
115#include "navigatorbar.h" 115#include "navigatorbar.h"
116#include "searchdialog.h" 116#include "searchdialog.h"
117#include "mainwindow.h" 117#include "mainwindow.h"
118 118
119#include "calendarview.h" 119#include "calendarview.h"
120#ifndef DESKTOP_VERSION 120#ifndef DESKTOP_VERSION
121#include <qtopia/alarmserver.h> 121#include <qtopia/alarmserver.h>
122#endif 122#endif
123#ifndef _WIN32_ 123#ifndef _WIN32_
124#include <stdlib.h> 124#include <stdlib.h>
125#include <stdio.h> 125#include <stdio.h>
126#include <unistd.h> 126#include <unistd.h>
127#else 127#else
128#include <qprocess.h> 128#include <qprocess.h>
129#endif 129#endif
130 130
131#ifdef DESKTOP_VERSION 131#ifdef DESKTOP_VERSION
132#include <kabc/stdaddressbook.h> 132#include <kabc/stdaddressbook.h>
133#endif 133#endif
134using namespace KOrg; 134using namespace KOrg;
135using namespace KCal; 135using namespace KCal;
136extern int globalFlagBlockAgenda; 136extern int globalFlagBlockAgenda;
137extern int globalFlagBlockStartup; 137extern int globalFlagBlockStartup;
138 138
139 139
140 140
141class KOBeamPrefs : public QDialog 141class KOBeamPrefs : public QDialog
142{ 142{
143 public: 143 public:
144 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 144 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
145 QDialog( parent, name, true ) 145 QDialog( parent, name, true )
146 { 146 {
147 setCaption( i18n("Beam Options") ); 147 setCaption( i18n("Beam Options") );
148 QVBoxLayout* lay = new QVBoxLayout( this ); 148 QVBoxLayout* lay = new QVBoxLayout( this );
149 lay->setSpacing( 3 ); 149 lay->setSpacing( 3 );
150 lay->setMargin( 3 ); 150 lay->setMargin( 3 );
151 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 151 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
152 lay->addWidget( format ); 152 lay->addWidget( format );
153 format->setExclusive ( true ) ; 153 format->setExclusive ( true ) ;
154 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 154 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
155 lay->addWidget( time ); time->setExclusive ( true ) ; 155 lay->addWidget( time ); time->setExclusive ( true ) ;
156 vcal = new QRadioButton(" vCalendar ", format ); 156 vcal = new QRadioButton(" vCalendar ", format );
157 ical = new QRadioButton(" iCalendar ", format ); 157 ical = new QRadioButton(" iCalendar ", format );
158 vcal->setChecked( true ); 158 vcal->setChecked( true );
159 tz = new QRadioButton(i18n(" With timezone "), time ); 159 tz = new QRadioButton(i18n(" With timezone "), time );
160 local = new QRadioButton(i18n(" Local time "), time ); 160 local = new QRadioButton(i18n(" Local time "), time );
161 tz->setChecked( true ); 161 tz->setChecked( true );
162 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 162 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
163 lay->addWidget( ok ); 163 lay->addWidget( ok );
164 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 164 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
165 lay->addWidget( cancel ); 165 lay->addWidget( cancel );
166 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 166 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
167 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 167 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
168 resize( 200, 200 ); 168 resize( 200, 200 );
169 } 169 }
170 170
171 bool beamVcal() { return vcal->isChecked(); } 171 bool beamVcal() { return vcal->isChecked(); }
172 bool beamLocal() { return local->isChecked(); } 172 bool beamLocal() { return local->isChecked(); }
173private: 173private:
174 QRadioButton* vcal, *ical, *local, *tz; 174 QRadioButton* vcal, *ical, *local, *tz;
175}; 175};
176class KOCatPrefs : public QDialog 176class KOCatPrefs : public QDialog
177{ 177{
178 public: 178 public:
179 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 179 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
180 QDialog( parent, name, true ) 180 QDialog( parent, name, true )
181 { 181 {
182 setCaption( i18n("Manage new Categories") ); 182 setCaption( i18n("Manage new Categories") );
183 QVBoxLayout* lay = new QVBoxLayout( this ); 183 QVBoxLayout* lay = new QVBoxLayout( this );
184 lay->setSpacing( 3 ); 184 lay->setSpacing( 3 );
185 lay->setMargin( 3 ); 185 lay->setMargin( 3 );
186 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 186 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
187 lay->addWidget( lab ); 187 lay->addWidget( lab );
188 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 188 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
189 lay->addWidget( format ); 189 lay->addWidget( format );
190 format->setExclusive ( true ) ; 190 format->setExclusive ( true ) ;
191 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 191 addCatBut = new QRadioButton(i18n("Add to category list"), format );
192 new QRadioButton(i18n("Remove from Events/Todos"), format ); 192 new QRadioButton(i18n("Remove from Events/Todos"), format );
193 addCatBut->setChecked( true ); 193 addCatBut->setChecked( true );
194 QPushButton * ok = new QPushButton( i18n("OK"), this ); 194 QPushButton * ok = new QPushButton( i18n("OK"), this );
195 lay->addWidget( ok ); 195 lay->addWidget( ok );
196 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 196 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
197 lay->addWidget( cancel ); 197 lay->addWidget( cancel );
198 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 198 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
199 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 199 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
200 resize( 200, 200 ); 200 resize( 200, 200 );
201 } 201 }
202 202
203 bool addCat() { return addCatBut->isChecked(); } 203 bool addCat() { return addCatBut->isChecked(); }
204private: 204private:
205 QRadioButton* addCatBut; 205 QRadioButton* addCatBut;
206}; 206};
207 207
208 208
209 209
210CalendarView::CalendarView( CalendarResources *calendar, 210CalendarView::CalendarView( CalendarResources *calendar,
211 QWidget *parent, const char *name ) 211 QWidget *parent, const char *name )
212 : CalendarViewBase( parent, name ), 212 : CalendarViewBase( parent, name ),
213 mCalendar( calendar ), 213 mCalendar( calendar ),
214 mResourceManager( calendar->resourceManager() ) 214 mResourceManager( calendar->resourceManager() )
215{ 215{
216 216
217 mEventEditor = 0; 217 mEventEditor = 0;
218 mTodoEditor = 0; 218 mTodoEditor = 0;
219 219
220 init(); 220 init();
221} 221}
222 222
223CalendarView::CalendarView( Calendar *calendar, 223CalendarView::CalendarView( Calendar *calendar,
224 QWidget *parent, const char *name ) 224 QWidget *parent, const char *name )
225 : CalendarViewBase( parent, name ), 225 : CalendarViewBase( parent, name ),
226 mCalendar( calendar ), 226 mCalendar( calendar ),
227 mResourceManager( 0 ) 227 mResourceManager( 0 )
228{ 228{
229 229
230 mEventEditor = 0; 230 mEventEditor = 0;
231 mTodoEditor = 0; 231 mTodoEditor = 0;
232 init();} 232 init();}
233 233
234void CalendarView::init() 234void CalendarView::init()
235{ 235{
236 beamDialog = new KOBeamPrefs(); 236 beamDialog = new KOBeamPrefs();
237 mDatePickerMode = 0; 237 mDatePickerMode = 0;
238 mCurrentSyncDevice = ""; 238 mCurrentSyncDevice = "";
239 writeLocale(); 239 writeLocale();
240 mViewManager = new KOViewManager( this ); 240 mViewManager = new KOViewManager( this );
241 mDialogManager = new KODialogManager( this ); 241 mDialogManager = new KODialogManager( this );
242 mEventViewerDialog = 0; 242 mEventViewerDialog = 0;
243 mModified = false; 243 mModified = false;
244 mReadOnly = false; 244 mReadOnly = false;
245 mSelectedIncidence = 0; 245 mSelectedIncidence = 0;
246 mCalPrinter = 0; 246 mCalPrinter = 0;
247 mFilters.setAutoDelete(true); 247 mFilters.setAutoDelete(true);
248 248
249 mCalendar->registerObserver( this ); 249 mCalendar->registerObserver( this );
250 // TODO: Make sure that view is updated, when calendar is changed. 250 // TODO: Make sure that view is updated, when calendar is changed.
251 251
252 mStorage = new FileStorage( mCalendar ); 252 mStorage = new FileStorage( mCalendar );
253 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 253 mNavigator = new DateNavigator( this, "datevav", mViewManager );
254 254
255 QBoxLayout *topLayout = (QBoxLayout*)layout(); 255 QBoxLayout *topLayout = (QBoxLayout*)layout();
256#ifndef KORG_NOSPLITTER 256#ifndef KORG_NOSPLITTER
257 // create the main layout frames. 257 // create the main layout frames.
258 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 258 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
259 topLayout->addWidget(mPanner); 259 topLayout->addWidget(mPanner);
260 260
261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
262 "CalendarView::LeftFrame"); 262 "CalendarView::LeftFrame");
263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
264 264
265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, 265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
266 "CalendarView::DateNavigator", QDate::currentDate() ); 266 "CalendarView::DateNavigator", QDate::currentDate() );
267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
269 mTodoList->setNavigator( mNavigator ); 269 mTodoList->setNavigator( mNavigator );
270 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 270 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
271 271
272#ifdef KORG_NORESOURCEVIEW 272#ifdef KORG_NORESOURCEVIEW
273 mResourceView = 0; 273 mResourceView = 0;
274#else 274#else
275 if ( mResourceManager ) { 275 if ( mResourceManager ) {
276 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 276 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
277 mResourceView->updateView(); 277 mResourceView->updateView();
278 connect( mResourceView, SIGNAL( resourcesChanged() ), 278 connect( mResourceView, SIGNAL( resourcesChanged() ),
279 SLOT( updateView() ) ); 279 SLOT( updateView() ) );
280 } else { 280 } else {
281 mResourceView = 0; 281 mResourceView = 0;
282 } 282 }
283#endif 283#endif
284 QWidget *rightBox = new QWidget( mPanner ); 284 QWidget *rightBox = new QWidget( mPanner );
285 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 285 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
286 286
287 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 287 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
288 rightLayout->addWidget( mNavigatorBar ); 288 rightLayout->addWidget( mNavigatorBar );
289 289
290 mRightFrame = new QWidgetStack( rightBox ); 290 mRightFrame = new QWidgetStack( rightBox );
291 rightLayout->addWidget( mRightFrame, 1 ); 291 rightLayout->addWidget( mRightFrame, 1 );
292 292
293 mLeftFrame = mLeftSplitter; 293 mLeftFrame = mLeftSplitter;
294#else 294#else
295 QWidget *mainBox = new QWidget( this ); 295 QWidget *mainBox = new QWidget( this );
296 QWidget *leftFrame = new QWidget( mainBox ); 296 QWidget *leftFrame = new QWidget( mainBox );
297 297
298 QBoxLayout * mainBoxLayout; 298 QBoxLayout * mainBoxLayout;
299 QBoxLayout * leftFrameLayout; 299 QBoxLayout * leftFrameLayout;
300 if ( KOPrefs::instance()->mVerticalScreen ) { 300 if ( KOPrefs::instance()->mVerticalScreen ) {
301 mainBoxLayout = new QVBoxLayout(mainBox); 301 mainBoxLayout = new QVBoxLayout(mainBox);
302 leftFrameLayout = new QHBoxLayout(leftFrame ); 302 leftFrameLayout = new QHBoxLayout(leftFrame );
303 } else { 303 } else {
304 mainBoxLayout = new QHBoxLayout(mainBox); 304 mainBoxLayout = new QHBoxLayout(mainBox);
305 leftFrameLayout = new QVBoxLayout(leftFrame ); 305 leftFrameLayout = new QVBoxLayout(leftFrame );
306 } 306 }
307 topLayout->addWidget( mainBox ); 307 topLayout->addWidget( mainBox );
308 mainBoxLayout->addWidget (leftFrame); 308 mainBoxLayout->addWidget (leftFrame);
309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
310 "CalendarView::DateNavigator", QDate::currentDate()); 310 "CalendarView::DateNavigator", QDate::currentDate());
311 // mDateNavigator->blockSignals( true ); 311 // mDateNavigator->blockSignals( true );
312 leftFrameLayout->addWidget( mDateNavigator ); 312 leftFrameLayout->addWidget( mDateNavigator );
313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); 314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall");
315 mTodoList->setNavigator( mNavigator ); 315 mTodoList->setNavigator( mNavigator );
316 316
317 if ( QApplication::desktop()->width() < 480 ) { 317 if ( QApplication::desktop()->width() < 480 ) {
318 leftFrameLayout->addWidget(mFilterView); 318 leftFrameLayout->addWidget(mFilterView);
319 leftFrameLayout->addWidget(mTodoList, 2 ); 319 leftFrameLayout->addWidget(mTodoList, 2 );
320 320
321 } else { 321 } else {
322 leftFrameLayout->addWidget(mTodoList,2 ); 322 leftFrameLayout->addWidget(mTodoList,2 );
323 leftFrameLayout->addWidget(mFilterView ); 323 leftFrameLayout->addWidget(mFilterView );
324 } 324 }
325 mFilterView->hide(); 325 mFilterView->hide();
326 QWidget *rightBox = new QWidget( mainBox ); 326 QWidget *rightBox = new QWidget( mainBox );
327 mainBoxLayout->addWidget ( rightBox, 10 ); 327 mainBoxLayout->addWidget ( rightBox, 10 );
328 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 328 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
329 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 329 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
330 mRightFrame = new QWidgetStack( rightBox ); 330 mRightFrame = new QWidgetStack( rightBox );
331 rightLayout->addWidget( mNavigatorBar ); 331 rightLayout->addWidget( mNavigatorBar );
332 rightLayout->addWidget( mRightFrame, 10 ); 332 rightLayout->addWidget( mRightFrame, 10 );
333 333
334 mLeftFrame = leftFrame; 334 mLeftFrame = leftFrame;
335 if ( KOPrefs::instance()->mVerticalScreen ) { 335 if ( KOPrefs::instance()->mVerticalScreen ) {
336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
338 } else { 338 } else {
339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
341 } 341 }
342 342 if ( !KOPrefs::instance()->mShowDateNavigator)
343 mDateNavigator->hide();
343 //qDebug("Calendarview Size %d %d ", width(), height()); 344 //qDebug("Calendarview Size %d %d ", width(), height());
344#endif 345#endif
345 346
346 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 347 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
347 SLOT( showDates( const KCal::DateList & ) ) ); 348 SLOT( showDates( const KCal::DateList & ) ) );
348 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 349 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
349 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 350 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
350 351
351 connect( mNavigatorBar, SIGNAL( goPrevYear() ), 352 connect( mNavigatorBar, SIGNAL( goPrevYear() ),
352 mNavigator, SLOT( selectPreviousYear() ) ); 353 mNavigator, SLOT( selectPreviousYear() ) );
353 connect( mNavigatorBar, SIGNAL( goNextYear() ), 354 connect( mNavigatorBar, SIGNAL( goNextYear() ),
354 mNavigator, SLOT( selectNextYear() ) ); 355 mNavigator, SLOT( selectNextYear() ) );
355 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), 356 connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
356 mNavigator, SLOT( selectPreviousMonth() ) ); 357 mNavigator, SLOT( selectPreviousMonth() ) );
357 connect( mNavigatorBar, SIGNAL( goNextMonth() ), 358 connect( mNavigatorBar, SIGNAL( goNextMonth() ),
358 mNavigator, SLOT( selectNextMonth() ) ); 359 mNavigator, SLOT( selectNextMonth() ) );
359 360
360 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 361 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
361 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); 362 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
362 363
363 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 364 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
364 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 365 mNavigator, SLOT( selectWeek( const QDate & ) ) );
365 366
366 connect( mDateNavigator, SIGNAL( goPrevYear() ), 367 connect( mDateNavigator, SIGNAL( goPrevYear() ),
367 mNavigator, SLOT( selectPreviousYear() ) ); 368 mNavigator, SLOT( selectPreviousYear() ) );
368 connect( mDateNavigator, SIGNAL( goNextYear() ), 369 connect( mDateNavigator, SIGNAL( goNextYear() ),
369 mNavigator, SLOT( selectNextYear() ) ); 370 mNavigator, SLOT( selectNextYear() ) );
370 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 371 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
371 mNavigator, SLOT( selectPreviousMonth() ) ); 372 mNavigator, SLOT( selectPreviousMonth() ) );
372 connect( mDateNavigator, SIGNAL( goNextMonth() ), 373 connect( mDateNavigator, SIGNAL( goNextMonth() ),
373 mNavigator, SLOT( selectNextMonth() ) ); 374 mNavigator, SLOT( selectNextMonth() ) );
374 375
375 connect( mDateNavigator, SIGNAL( goPrevious() ), 376 connect( mDateNavigator, SIGNAL( goPrevious() ),
376 mNavigator, SLOT( selectPrevious() ) ); 377 mNavigator, SLOT( selectPrevious() ) );
377 connect( mDateNavigator, SIGNAL( goNext() ), 378 connect( mDateNavigator, SIGNAL( goNext() ),
378 mNavigator, SLOT( selectNext() ) ); 379 mNavigator, SLOT( selectNext() ) );
379 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 380 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
380 mNavigator, SLOT( slotMonthSelect( int ) ) ); 381 mNavigator, SLOT( slotMonthSelect( int ) ) );
381 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), 382 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
382 mNavigator, SLOT( slotMonthSelect( int ) ) ); 383 mNavigator, SLOT( slotMonthSelect( int ) ) );
383 384
384 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 385 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
385 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 386 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
386 387
387 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), 388 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
388 SLOT( eventAdded( Event *) ) ); 389 SLOT( eventAdded( Event *) ) );
389 390
390 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 391 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
391 392
392 connect( this, SIGNAL( configChanged() ), 393 connect( this, SIGNAL( configChanged() ),
393 mDateNavigator, SLOT( updateConfig() ) ); 394 mDateNavigator, SLOT( updateConfig() ) );
394 395
395 connect( mTodoList, SIGNAL( newTodoSignal() ), 396 connect( mTodoList, SIGNAL( newTodoSignal() ),
396 SLOT( newTodo() ) ); 397 SLOT( newTodo() ) );
397 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 398 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
398 SLOT( newSubTodo( Todo * ) ) ); 399 SLOT( newSubTodo( Todo * ) ) );
399 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 400 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
400 SLOT( editTodo( Todo * ) ) ); 401 SLOT( editTodo( Todo * ) ) );
401 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 402 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
402 SLOT( showTodo( Todo *) ) ); 403 SLOT( showTodo( Todo *) ) );
403 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 404 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
404 SLOT( deleteTodo( Todo *) ) ); 405 SLOT( deleteTodo( Todo *) ) );
405 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 406 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
406 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 407 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
407 SLOT( purgeCompleted() ) ); 408 SLOT( purgeCompleted() ) );
408 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 409 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
409 SIGNAL( todoModified( Todo *, int ) ) ); 410 SIGNAL( todoModified( Todo *, int ) ) );
410 411
411 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 412 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
412 this, SLOT ( cloneIncidence( Incidence * ) ) ); 413 this, SLOT ( cloneIncidence( Incidence * ) ) );
413 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 414 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
414 this, SLOT (cancelIncidence( Incidence * ) ) ); 415 this, SLOT (cancelIncidence( Incidence * ) ) );
415 416
416 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 417 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
417 this, SLOT ( moveIncidence( Incidence * ) ) ); 418 this, SLOT ( moveIncidence( Incidence * ) ) );
418 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 419 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
419 this, SLOT ( beamIncidence( Incidence * ) ) ); 420 this, SLOT ( beamIncidence( Incidence * ) ) );
420 421
421 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 422 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
422 this, SLOT ( todo_unsub( Todo * ) ) ); 423 this, SLOT ( todo_unsub( Todo * ) ) );
423 424
424 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 425 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
425 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 426 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
426 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 427 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
427 SLOT( updateTodo( Todo *, int ) ) ); 428 SLOT( updateTodo( Todo *, int ) ) );
428 connect( this, SIGNAL( todoModified( Todo *, int )), this, 429 connect( this, SIGNAL( todoModified( Todo *, int )), this,
429 SLOT( changeTodoDisplay( Todo *, int ) ) ); 430 SLOT( changeTodoDisplay( Todo *, int ) ) );
430 431
431 432
432 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 433 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
433 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 434 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
434 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 435 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
435 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 436 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
436 437
437 438
438 439
439 440
440 441
441 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 442 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
442 SLOT(checkClipboard())); 443 SLOT(checkClipboard()));
443 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 444 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
444 SLOT( processTodoListSelection( Incidence * ) ) ); 445 SLOT( processTodoListSelection( Incidence * ) ) );
445 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 446 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
446 447
447 // kdDebug() << "CalendarView::CalendarView() done" << endl; 448 // kdDebug() << "CalendarView::CalendarView() done" << endl;
448 449
449 mDateFrame = new QVBox(0,0,WType_Popup); 450 mDateFrame = new QVBox(0,0,WType_Popup);
450 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 451 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
451 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 452 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
452 mDateFrame->setLineWidth(3); 453 mDateFrame->setLineWidth(3);
453 mDateFrame->hide(); 454 mDateFrame->hide();
454 mDateFrame->setCaption( i18n( "Pick a date to display")); 455 mDateFrame->setCaption( i18n( "Pick a date to display"));
455 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 456 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
456 457
457 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 458 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
458 459
459 mEventEditor = mDialogManager->getEventEditor(); 460 mEventEditor = mDialogManager->getEventEditor();
460 mTodoEditor = mDialogManager->getTodoEditor(); 461 mTodoEditor = mDialogManager->getTodoEditor();
461 462
462 mFlagEditDescription = false; 463 mFlagEditDescription = false;
463 464
464 mSuspendTimer = new QTimer( this ); 465 mSuspendTimer = new QTimer( this );
465 mAlarmTimer = new QTimer( this ); 466 mAlarmTimer = new QTimer( this );
466 mRecheckAlarmTimer = new QTimer( this ); 467 mRecheckAlarmTimer = new QTimer( this );
467 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 468 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
468 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 469 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
469 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 470 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
470 mAlarmDialog = new AlarmDialog( this ); 471 mAlarmDialog = new AlarmDialog( this );
471 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 472 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
472 mAlarmDialog->setServerNotification( false ); 473 mAlarmDialog->setServerNotification( false );
473 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 474 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
474 475
475 476
476#ifndef DESKTOP_VERSION 477#ifndef DESKTOP_VERSION
477//US listen for arriving address resultsets 478//US listen for arriving address resultsets
478 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 479 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
479 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 480 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
480#endif 481#endif
481 482
482} 483}
483 484
484 485
485CalendarView::~CalendarView() 486CalendarView::~CalendarView()
486{ 487{
487 // kdDebug() << "~CalendarView()" << endl; 488 // kdDebug() << "~CalendarView()" << endl;
488 //qDebug("CalendarView::~CalendarView() "); 489 //qDebug("CalendarView::~CalendarView() ");
489 delete mDialogManager; 490 delete mDialogManager;
490 delete mViewManager; 491 delete mViewManager;
491 delete mStorage; 492 delete mStorage;
492 delete mDateFrame ; 493 delete mDateFrame ;
493 delete beamDialog; 494 delete beamDialog;
494 //kdDebug() << "~CalendarView() done" << endl; 495 //kdDebug() << "~CalendarView() done" << endl;
495} 496}
496 497
497void CalendarView::showDay( QDate d ) 498void CalendarView::showDay( QDate d )
498{ 499{
499 dateNavigator()->selectDate( d ); 500 dateNavigator()->selectDate( d );
500 mViewManager->showWeekView(); 501 mViewManager->showWeekView();
501 dateNavigator()->selectDate( d ); 502 dateNavigator()->selectDate( d );
502} 503}
503void CalendarView::timerAlarm() 504void CalendarView::timerAlarm()
504{ 505{
505 //qDebug("CalendarView::timerAlarm() "); 506 //qDebug("CalendarView::timerAlarm() ");
506 computeAlarm(mAlarmNotification ); 507 computeAlarm(mAlarmNotification );
507} 508}
508 509
509void CalendarView::suspendAlarm() 510void CalendarView::suspendAlarm()
510{ 511{
511 //qDebug(" CalendarView::suspendAlarm() "); 512 //qDebug(" CalendarView::suspendAlarm() ");
512 computeAlarm(mSuspendAlarmNotification ); 513 computeAlarm(mSuspendAlarmNotification );
513 514
514} 515}
515 516
516void CalendarView::startAlarm( QString mess , QString filename) 517void CalendarView::startAlarm( QString mess , QString filename)
517{ 518{
518 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 519 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
519 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 520 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
520 521
521} 522}
522 523
523void CalendarView::checkNextTimerAlarm() 524void CalendarView::checkNextTimerAlarm()
524{ 525{
525 mCalendar->checkAlarmForIncidence( 0, true ); 526 mCalendar->checkAlarmForIncidence( 0, true );
526} 527}
527 528
528void CalendarView::computeAlarm( QString msg ) 529void CalendarView::computeAlarm( QString msg )
529{ 530{
530 531
531 QString mess = msg; 532 QString mess = msg;
532 QString mAlarmMessage = mess.mid( 9 ); 533 QString mAlarmMessage = mess.mid( 9 );
533 QString filename = MainWindow::resourcePath(); 534 QString filename = MainWindow::resourcePath();
534 filename += "koalarm.wav"; 535 filename += "koalarm.wav";
535 QString tempfilename; 536 QString tempfilename;
536 if ( mess.left( 13 ) == "suspend_alarm") { 537 if ( mess.left( 13 ) == "suspend_alarm") {
537 bool error = false; 538 bool error = false;
538 int len = mess.mid( 13 ).find("+++"); 539 int len = mess.mid( 13 ).find("+++");
539 if ( len < 2 ) 540 if ( len < 2 )
540 error = true; 541 error = true;
541 else { 542 else {
542 tempfilename = mess.mid( 13, len ); 543 tempfilename = mess.mid( 13, len );
543 if ( !QFile::exists( tempfilename ) ) 544 if ( !QFile::exists( tempfilename ) )
544 error = true; 545 error = true;
545 } 546 }
546 if ( ! error ) { 547 if ( ! error ) {
547 filename = tempfilename; 548 filename = tempfilename;
548 } 549 }
549 mAlarmMessage = mess.mid( 13+len+3 ); 550 mAlarmMessage = mess.mid( 13+len+3 );
550 //qDebug("suspend file %s ",tempfilename.latin1() ); 551 //qDebug("suspend file %s ",tempfilename.latin1() );
551 startAlarm( mAlarmMessage, filename); 552 startAlarm( mAlarmMessage, filename);
552 return; 553 return;
553 } 554 }
554 if ( mess.left( 11 ) == "timer_alarm") { 555 if ( mess.left( 11 ) == "timer_alarm") {
555 //mTimerTime = 0; 556 //mTimerTime = 0;
556 startAlarm( mess.mid( 11 ), filename ); 557 startAlarm( mess.mid( 11 ), filename );
557 return; 558 return;
558 } 559 }
559 if ( mess.left( 10 ) == "proc_alarm") { 560 if ( mess.left( 10 ) == "proc_alarm") {
560 bool error = false; 561 bool error = false;
561 int len = mess.mid( 10 ).find("+++"); 562 int len = mess.mid( 10 ).find("+++");
562 if ( len < 2 ) 563 if ( len < 2 )
563 error = true; 564 error = true;
564 else { 565 else {
565 tempfilename = mess.mid( 10, len ); 566 tempfilename = mess.mid( 10, len );
566 if ( !QFile::exists( tempfilename ) ) 567 if ( !QFile::exists( tempfilename ) )
567 error = true; 568 error = true;
568 } 569 }
569 if ( error ) { 570 if ( error ) {
570 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 571 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
571 mAlarmMessage += mess.mid( 10+len+3+9 ); 572 mAlarmMessage += mess.mid( 10+len+3+9 );
572 } else { 573 } else {
573 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 574 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
574 //qDebug("-----system command %s ",tempfilename.latin1() ); 575 //qDebug("-----system command %s ",tempfilename.latin1() );
575#ifndef _WIN32_ 576#ifndef _WIN32_
576 if ( vfork () == 0 ) { 577 if ( vfork () == 0 ) {
577 execl ( tempfilename.latin1(), 0 ); 578 execl ( tempfilename.latin1(), 0 );
578 return; 579 return;
579 } 580 }
580#else 581#else
581 QProcess* p = new QProcess(); 582 QProcess* p = new QProcess();
582 p->addArgument( tempfilename.latin1() ); 583 p->addArgument( tempfilename.latin1() );
583 p->start(); 584 p->start();
584 return; 585 return;
585#endif 586#endif
586 587
587 return; 588 return;
588 } 589 }
589 590
590 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 591 //qDebug("+++++++system command %s ",tempfilename.latin1() );
591 } 592 }
592 if ( mess.left( 11 ) == "audio_alarm") { 593 if ( mess.left( 11 ) == "audio_alarm") {
593 bool error = false; 594 bool error = false;
594 int len = mess.mid( 11 ).find("+++"); 595 int len = mess.mid( 11 ).find("+++");
595 if ( len < 2 ) 596 if ( len < 2 )
596 error = true; 597 error = true;
597 else { 598 else {
598 tempfilename = mess.mid( 11, len ); 599 tempfilename = mess.mid( 11, len );
599 if ( !QFile::exists( tempfilename ) ) 600 if ( !QFile::exists( tempfilename ) )
600 error = true; 601 error = true;
601 } 602 }
602 if ( ! error ) { 603 if ( ! error ) {
603 filename = tempfilename; 604 filename = tempfilename;
604 } 605 }
605 mAlarmMessage = mess.mid( 11+len+3+9 ); 606 mAlarmMessage = mess.mid( 11+len+3+9 );
606 //qDebug("audio file command %s ",tempfilename.latin1() ); 607 //qDebug("audio file command %s ",tempfilename.latin1() );
607 } 608 }
608 if ( mess.left( 9 ) == "cal_alarm") { 609 if ( mess.left( 9 ) == "cal_alarm") {
609 mAlarmMessage = mess.mid( 9 ) ; 610 mAlarmMessage = mess.mid( 9 ) ;
610 } 611 }
611 612
612 startAlarm( mAlarmMessage, filename ); 613 startAlarm( mAlarmMessage, filename );
613 614
614 615
615} 616}
616 617
617void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 618void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
618{ 619{
619 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 620 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
620 621
621 mSuspendAlarmNotification = noti; 622 mSuspendAlarmNotification = noti;
622 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 623 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
623 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 624 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
624 mSuspendTimer->start( ms , true ); 625 mSuspendTimer->start( ms , true );
625 626
626} 627}
627 628
628void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 629void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
629{ 630{
630 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 631 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
631 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 632 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
632#ifndef DESKTOP_VERSION 633#ifndef DESKTOP_VERSION
633 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); 634 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() );
634#endif 635#endif
635 return; 636 return;
636 } 637 }
637 int maxSec; 638 int maxSec;
638 //maxSec = 5; //testing only 639 //maxSec = 5; //testing only
639 maxSec = 86400+3600; // one day+1hour 640 maxSec = 86400+3600; // one day+1hour
640 mAlarmNotification = noti; 641 mAlarmNotification = noti;
641 int sec = QDateTime::currentDateTime().secsTo( qdt ); 642 int sec = QDateTime::currentDateTime().secsTo( qdt );
642 if ( sec > maxSec ) { 643 if ( sec > maxSec ) {
643 mRecheckAlarmTimer->start( maxSec * 1000 ); 644 mRecheckAlarmTimer->start( maxSec * 1000 );
644 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 645 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
645 return; 646 return;
646 } else { 647 } else {
647 mRecheckAlarmTimer->stop(); 648 mRecheckAlarmTimer->stop();
648 } 649 }
649 //qDebug("Alarm timer started with secs: %d ", sec); 650 //qDebug("Alarm timer started with secs: %d ", sec);
650 mAlarmTimer->start( sec *1000 , true ); 651 mAlarmTimer->start( sec *1000 , true );
651 652
652} 653}
653// called by mRecheckAlarmTimer to get next alarm 654// called by mRecheckAlarmTimer to get next alarm
654// we need this, because a QTimer has only a max range of 25 days 655// we need this, because a QTimer has only a max range of 25 days
655void CalendarView::recheckTimerAlarm() 656void CalendarView::recheckTimerAlarm()
656{ 657{
657 mAlarmTimer->stop(); 658 mAlarmTimer->stop();
658 mRecheckAlarmTimer->stop(); 659 mRecheckAlarmTimer->stop();
659 mCalendar->checkAlarmForIncidence( 0, true ); 660 mCalendar->checkAlarmForIncidence( 0, true );
660} 661}
661void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 662void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
662{ 663{
663 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 664 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
664 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 665 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
665#ifndef DESKTOP_VERSION 666#ifndef DESKTOP_VERSION
666 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); 667 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() );
667#endif 668#endif
668 return; 669 return;
669 } 670 }
670 mAlarmTimer->stop(); 671 mAlarmTimer->stop();
671} 672}
672void CalendarView::selectWeekNum ( int num ) 673void CalendarView::selectWeekNum ( int num )
673{ 674{
674 dateNavigator()->selectWeek( num ); 675 dateNavigator()->selectWeek( num );
675 mViewManager->showWeekView(); 676 mViewManager->showWeekView();
676} 677}
677KOViewManager *CalendarView::viewManager() 678KOViewManager *CalendarView::viewManager()
678{ 679{
679 return mViewManager; 680 return mViewManager;
680} 681}
681 682
682KODialogManager *CalendarView::dialogManager() 683KODialogManager *CalendarView::dialogManager()
683{ 684{
684 return mDialogManager; 685 return mDialogManager;
685} 686}
686 687
687QDate CalendarView::startDate() 688QDate CalendarView::startDate()
688{ 689{
689 DateList dates = mNavigator->selectedDates(); 690 DateList dates = mNavigator->selectedDates();
690 691
691 return dates.first(); 692 return dates.first();
692} 693}
693 694
694QDate CalendarView::endDate() 695QDate CalendarView::endDate()
695{ 696{
696 DateList dates = mNavigator->selectedDates(); 697 DateList dates = mNavigator->selectedDates();
697 698
698 return dates.last(); 699 return dates.last();
699} 700}
700 701
701 702
702void CalendarView::createPrinter() 703void CalendarView::createPrinter()
703{ 704{
704#ifndef KORG_NOPRINTER 705#ifndef KORG_NOPRINTER
705 if (!mCalPrinter) { 706 if (!mCalPrinter) {
706 mCalPrinter = new CalPrinter(this, mCalendar); 707 mCalPrinter = new CalPrinter(this, mCalendar);
707 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 708 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
708 } 709 }
709#endif 710#endif
710} 711}
711 712
712 713
713//KOPrefs::instance()->mWriteBackFile 714//KOPrefs::instance()->mWriteBackFile
714//KOPrefs::instance()->mWriteBackExistingOnly 715//KOPrefs::instance()->mWriteBackExistingOnly
715 716
716// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 717// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
717// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 718// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
718// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 719// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
719// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 720// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
720// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 721// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
721// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 722// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
722 723
723int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 724int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
724{ 725{
725 726
726 // 0 equal 727 // 0 equal
727 // 1 take local 728 // 1 take local
728 // 2 take remote 729 // 2 take remote
729 // 3 cancel 730 // 3 cancel
730 QDateTime lastSync = mLastCalendarSync; 731 QDateTime lastSync = mLastCalendarSync;
731 QDateTime localMod = local->lastModified(); 732 QDateTime localMod = local->lastModified();
732 QDateTime remoteMod = remote->lastModified(); 733 QDateTime remoteMod = remote->lastModified();
733 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 734 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
734 bool remCh, locCh; 735 bool remCh, locCh;
735 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 736 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
736 //if ( remCh ) 737 //if ( remCh )
737 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 738 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
738 locCh = ( localMod > mLastCalendarSync ); 739 locCh = ( localMod > mLastCalendarSync );
739 if ( !remCh && ! locCh ) { 740 if ( !remCh && ! locCh ) {
740 //qDebug("both not changed "); 741 //qDebug("both not changed ");
741 lastSync = localMod.addDays(1); 742 lastSync = localMod.addDays(1);
742 if ( mode <= SYNC_PREF_ASK ) 743 if ( mode <= SYNC_PREF_ASK )
743 return 0; 744 return 0;
744 } else { 745 } else {
745 if ( locCh ) { 746 if ( locCh ) {
746 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1()); 747 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1());
747 lastSync = localMod.addDays( -1 ); 748 lastSync = localMod.addDays( -1 );
748 if ( !remCh ) 749 if ( !remCh )
749 remoteMod = ( lastSync.addDays( -1 ) ); 750 remoteMod = ( lastSync.addDays( -1 ) );
750 } else { 751 } else {
751 //qDebug(" not loc changed "); 752 //qDebug(" not loc changed ");
752 lastSync = localMod.addDays( 1 ); 753 lastSync = localMod.addDays( 1 );
753 if ( remCh ) 754 if ( remCh )
754 remoteMod =( lastSync.addDays( 1 ) ); 755 remoteMod =( lastSync.addDays( 1 ) );
755 756
756 } 757 }
757 } 758 }
758 full = true; 759 full = true;
759 if ( mode < SYNC_PREF_ASK ) 760 if ( mode < SYNC_PREF_ASK )
760 mode = SYNC_PREF_ASK; 761 mode = SYNC_PREF_ASK;
761 } else { 762 } else {
762 if ( localMod == remoteMod ) 763 if ( localMod == remoteMod )
763 // if ( local->revision() == remote->revision() ) 764 // if ( local->revision() == remote->revision() )
764 return 0; 765 return 0;
765 766
766 } 767 }
767 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 768 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
768 769
769 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 770 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
770 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 771 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
771 //full = true; //debug only 772 //full = true; //debug only
772 if ( full ) { 773 if ( full ) {
773 bool equ = false; 774 bool equ = false;
774 if ( local->type() == "Event" ) { 775 if ( local->type() == "Event" ) {
775 equ = (*((Event*) local) == *((Event*) remote)); 776 equ = (*((Event*) local) == *((Event*) remote));
776 } 777 }
777 else if ( local->type() =="Todo" ) 778 else if ( local->type() =="Todo" )
778 equ = (*((Todo*) local) == (*(Todo*) remote)); 779 equ = (*((Todo*) local) == (*(Todo*) remote));
779 else if ( local->type() =="Journal" ) 780 else if ( local->type() =="Journal" )
780 equ = (*((Journal*) local) == *((Journal*) remote)); 781 equ = (*((Journal*) local) == *((Journal*) remote));
781 if ( equ ) { 782 if ( equ ) {
782 //qDebug("equal "); 783 //qDebug("equal ");
783 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 784 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
784 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 785 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
785 } 786 }
786 if ( mode < SYNC_PREF_FORCE_LOCAL ) 787 if ( mode < SYNC_PREF_FORCE_LOCAL )
787 return 0; 788 return 0;
788 789
789 }//else //debug only 790 }//else //debug only
790 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 791 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
791 } 792 }
792 int result; 793 int result;
793 bool localIsNew; 794 bool localIsNew;
794 //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() ); 795 //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() );
795 796
796 if ( full && mode < SYNC_PREF_NEWEST ) 797 if ( full && mode < SYNC_PREF_NEWEST )
797 mode = SYNC_PREF_ASK; 798 mode = SYNC_PREF_ASK;
798 799
799 switch( mode ) { 800 switch( mode ) {
800 case SYNC_PREF_LOCAL: 801 case SYNC_PREF_LOCAL:
801 if ( lastSync > remoteMod ) 802 if ( lastSync > remoteMod )
802 return 1; 803 return 1;
803 if ( lastSync > localMod ) 804 if ( lastSync > localMod )
804 return 2; 805 return 2;
805 return 1; 806 return 1;
806 break; 807 break;
807 case SYNC_PREF_REMOTE: 808 case SYNC_PREF_REMOTE:
808 if ( lastSync > remoteMod ) 809 if ( lastSync > remoteMod )
809 return 1; 810 return 1;
810 if ( lastSync > localMod ) 811 if ( lastSync > localMod )
811 return 2; 812 return 2;
812 return 2; 813 return 2;
813 break; 814 break;
814 case SYNC_PREF_NEWEST: 815 case SYNC_PREF_NEWEST:
815 if ( localMod > remoteMod ) 816 if ( localMod > remoteMod )
816 return 1; 817 return 1;
817 else 818 else
818 return 2; 819 return 2;
819 break; 820 break;
820 case SYNC_PREF_ASK: 821 case SYNC_PREF_ASK:
821 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 822 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
822 if ( lastSync > remoteMod ) 823 if ( lastSync > remoteMod )
823 return 1; 824 return 1;
824 if ( lastSync > localMod ) 825 if ( lastSync > localMod )
825 return 2; 826 return 2;
826 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 827 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
827 localIsNew = localMod >= remoteMod; 828 localIsNew = localMod >= remoteMod;
828 if ( localIsNew ) 829 if ( localIsNew )
829 getEventViewerDialog()->setColorMode( 1 ); 830 getEventViewerDialog()->setColorMode( 1 );
830 else 831 else
831 getEventViewerDialog()->setColorMode( 2 ); 832 getEventViewerDialog()->setColorMode( 2 );
832 getEventViewerDialog()->setIncidence(local); 833 getEventViewerDialog()->setIncidence(local);
833 if ( localIsNew ) 834 if ( localIsNew )
834 getEventViewerDialog()->setColorMode( 2 ); 835 getEventViewerDialog()->setColorMode( 2 );
835 else 836 else
836 getEventViewerDialog()->setColorMode( 1 ); 837 getEventViewerDialog()->setColorMode( 1 );
837 getEventViewerDialog()->addIncidence(remote); 838 getEventViewerDialog()->addIncidence(remote);
838 getEventViewerDialog()->setColorMode( 0 ); 839 getEventViewerDialog()->setColorMode( 0 );
839 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 840 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
840 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 841 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
841 getEventViewerDialog()->showMe(); 842 getEventViewerDialog()->showMe();
842 result = getEventViewerDialog()->executeS( localIsNew ); 843 result = getEventViewerDialog()->executeS( localIsNew );
843 return result; 844 return result;
844 845
845 break; 846 break;
846 case SYNC_PREF_FORCE_LOCAL: 847 case SYNC_PREF_FORCE_LOCAL:
847 return 1; 848 return 1;
848 break; 849 break;
849 case SYNC_PREF_FORCE_REMOTE: 850 case SYNC_PREF_FORCE_REMOTE:
850 return 2; 851 return 2;
851 break; 852 break;
852 853
853 default: 854 default:
854 // SYNC_PREF_TAKE_BOTH not implemented 855 // SYNC_PREF_TAKE_BOTH not implemented
855 break; 856 break;
856 } 857 }
857 return 0; 858 return 0;
858} 859}
859Event* CalendarView::getLastSyncEvent() 860Event* CalendarView::getLastSyncEvent()
860{ 861{
861 Event* lse; 862 Event* lse;
862 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 863 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
863 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); 864 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
864 if (!lse) { 865 if (!lse) {
865 lse = new Event(); 866 lse = new Event();
866 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); 867 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
867 QString sum = ""; 868 QString sum = "";
868 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) 869 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
869 sum = "E: "; 870 sum = "E: ";
870 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); 871 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
871 lse->setDtStart( mLastCalendarSync ); 872 lse->setDtStart( mLastCalendarSync );
872 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 873 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
873 lse->setCategories( i18n("SyncEvent") ); 874 lse->setCategories( i18n("SyncEvent") );
874 lse->setReadOnly( true ); 875 lse->setReadOnly( true );
875 mCalendar->addEvent( lse ); 876 mCalendar->addEvent( lse );
876 } 877 }
877 878
878 return lse; 879 return lse;
879 880
880} 881}
881 882
882// we check, if the to delete event has a id for a profile 883// we check, if the to delete event has a id for a profile
883// if yes, we set this id in the profile to delete 884// if yes, we set this id in the profile to delete
884void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 885void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
885{ 886{
886 if ( lastSync.count() == 0 ) { 887 if ( lastSync.count() == 0 ) {
887 //qDebug(" lastSync.count() == 0"); 888 //qDebug(" lastSync.count() == 0");
888 return; 889 return;
889 } 890 }
890 if ( toDelete->type() == "Journal" ) 891 if ( toDelete->type() == "Journal" )
891 return; 892 return;
892 893
893 Event* eve = lastSync.first(); 894 Event* eve = lastSync.first();
894 895
895 while ( eve ) { 896 while ( eve ) {
896 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 897 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
897 if ( !id.isEmpty() ) { 898 if ( !id.isEmpty() ) {
898 QString des = eve->description(); 899 QString des = eve->description();
899 QString pref = "e"; 900 QString pref = "e";
900 if ( toDelete->type() == "Todo" ) 901 if ( toDelete->type() == "Todo" )
901 pref = "t"; 902 pref = "t";
902 des += pref+ id + ","; 903 des += pref+ id + ",";
903 eve->setReadOnly( false ); 904 eve->setReadOnly( false );
904 eve->setDescription( des ); 905 eve->setDescription( des );
905 //qDebug("setdes %s ", des.latin1()); 906 //qDebug("setdes %s ", des.latin1());
906 eve->setReadOnly( true ); 907 eve->setReadOnly( true );
907 } 908 }
908 eve = lastSync.next(); 909 eve = lastSync.next();
909 } 910 }
910 911
911} 912}
912void CalendarView::checkExternalId( Incidence * inc ) 913void CalendarView::checkExternalId( Incidence * inc )
913{ 914{
914 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 915 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
915 checkExternSyncEvent( lastSync, inc ); 916 checkExternSyncEvent( lastSync, inc );
916 917
917} 918}
918bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 919bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
919{ 920{
920 bool syncOK = true; 921 bool syncOK = true;
921 int addedEvent = 0; 922 int addedEvent = 0;
922 int addedEventR = 0; 923 int addedEventR = 0;
923 int deletedEventR = 0; 924 int deletedEventR = 0;
924 int deletedEventL = 0; 925 int deletedEventL = 0;
925 int changedLocal = 0; 926 int changedLocal = 0;
926 int changedRemote = 0; 927 int changedRemote = 0;
927 int filteredIN = 0; 928 int filteredIN = 0;
928 int filteredOUT = 0; 929 int filteredOUT = 0;
929 //QPtrList<Event> el = local->rawEvents(); 930 //QPtrList<Event> el = local->rawEvents();
930 Event* eventR; 931 Event* eventR;
931 QString uid; 932 QString uid;
932 int take; 933 int take;
933 Event* eventL; 934 Event* eventL;
934 Event* eventRSync; 935 Event* eventRSync;
935 Event* eventLSync; 936 Event* eventLSync;
936 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 937 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
937 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 938 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
938 bool fullDateRange = false; 939 bool fullDateRange = false;
939 local->resetTempSyncStat(); 940 local->resetTempSyncStat();
940 mLastCalendarSync = QDateTime::currentDateTime(); 941 mLastCalendarSync = QDateTime::currentDateTime();
941 if ( mSyncManager->syncWithDesktop() ) { 942 if ( mSyncManager->syncWithDesktop() ) {
942 remote->resetPilotStat(1); 943 remote->resetPilotStat(1);
943 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 944 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
944 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 945 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
945 qDebug("using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 946 qDebug("using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
946 } else { 947 } else {
947 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 948 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
948 } 949 }
949 } 950 }
950 QDateTime modifiedCalendar = mLastCalendarSync; 951 QDateTime modifiedCalendar = mLastCalendarSync;
951 eventLSync = getLastSyncEvent(); 952 eventLSync = getLastSyncEvent();
952 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 953 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
953 if ( eventR ) { 954 if ( eventR ) {
954 eventRSync = (Event*) eventR->clone(); 955 eventRSync = (Event*) eventR->clone();
955 remote->deleteEvent(eventR ); 956 remote->deleteEvent(eventR );
956 957
957 } else { 958 } else {
958 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 959 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
959 eventRSync = (Event*)eventLSync->clone(); 960 eventRSync = (Event*)eventLSync->clone();
960 } else { 961 } else {
961 fullDateRange = true; 962 fullDateRange = true;
962 eventRSync = new Event(); 963 eventRSync = new Event();
963 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 964 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
964 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 965 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
965 eventRSync->setDtStart( mLastCalendarSync ); 966 eventRSync->setDtStart( mLastCalendarSync );
966 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 967 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
967 eventRSync->setCategories( i18n("SyncEvent") ); 968 eventRSync->setCategories( i18n("SyncEvent") );
968 } 969 }
969 } 970 }
970 if ( eventLSync->dtStart() == mLastCalendarSync ) 971 if ( eventLSync->dtStart() == mLastCalendarSync )
971 fullDateRange = true; 972 fullDateRange = true;
972 973
973 if ( ! fullDateRange ) { 974 if ( ! fullDateRange ) {
974 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 975 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
975 976
976 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 977 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
977 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 978 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
978 fullDateRange = true; 979 fullDateRange = true;
979 } 980 }
980 } 981 }
981 if ( mSyncManager->syncWithDesktop() ) { 982 if ( mSyncManager->syncWithDesktop() ) {
982 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 983 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
983 } 984 }
984 if ( fullDateRange ) 985 if ( fullDateRange )
985 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 986 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
986 else 987 else
987 mLastCalendarSync = eventLSync->dtStart(); 988 mLastCalendarSync = eventLSync->dtStart();
988 // for resyncing if own file has changed 989 // for resyncing if own file has changed
989 if ( mCurrentSyncDevice == "deleteaftersync" ) { 990 if ( mCurrentSyncDevice == "deleteaftersync" ) {
990 mLastCalendarSync = loadedFileVersion; 991 mLastCalendarSync = loadedFileVersion;
991 //qDebug("setting mLastCalendarSync "); 992 //qDebug("setting mLastCalendarSync ");
992 } 993 }
993 //qDebug("*************************** "); 994 //qDebug("*************************** ");
994 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 995 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
995 QPtrList<Incidence> er = remote->rawIncidences(); 996 QPtrList<Incidence> er = remote->rawIncidences();
996 Incidence* inR = er.first(); 997 Incidence* inR = er.first();
997 Incidence* inL; 998 Incidence* inL;
998 QProgressBar bar( er.count(),0 ); 999 QProgressBar bar( er.count(),0 );
999 bar.setCaption (i18n("Syncing - close to abort!") ); 1000 bar.setCaption (i18n("Syncing - close to abort!") );
1000 1001
1001 // ************** setting up filter ************* 1002 // ************** setting up filter *************
1002 CalFilter *filterIN = 0; 1003 CalFilter *filterIN = 0;
1003 CalFilter *filterOUT = 0; 1004 CalFilter *filterOUT = 0;
1004 CalFilter *filter = mFilters.first(); 1005 CalFilter *filter = mFilters.first();
1005 while(filter) { 1006 while(filter) {
1006 if ( filter->name() == mSyncManager->mFilterInCal ) 1007 if ( filter->name() == mSyncManager->mFilterInCal )
1007 filterIN = filter; 1008 filterIN = filter;
1008 if ( filter->name() == mSyncManager->mFilterOutCal ) 1009 if ( filter->name() == mSyncManager->mFilterOutCal )
1009 filterOUT = filter; 1010 filterOUT = filter;
1010 filter = mFilters.next(); 1011 filter = mFilters.next();
1011 } 1012 }
1012 int w = 300; 1013 int w = 300;
1013 if ( QApplication::desktop()->width() < 320 ) 1014 if ( QApplication::desktop()->width() < 320 )
1014 w = 220; 1015 w = 220;
1015 int h = bar.sizeHint().height() ; 1016 int h = bar.sizeHint().height() ;
1016 int dw = QApplication::desktop()->width(); 1017 int dw = QApplication::desktop()->width();
1017 int dh = QApplication::desktop()->height(); 1018 int dh = QApplication::desktop()->height();
1018 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1019 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1019 bar.show(); 1020 bar.show();
1020 int modulo = (er.count()/10)+1; 1021 int modulo = (er.count()/10)+1;
1021 int incCounter = 0; 1022 int incCounter = 0;
1022 while ( inR ) { 1023 while ( inR ) {
1023 if ( ! bar.isVisible() ) 1024 if ( ! bar.isVisible() )
1024 return false; 1025 return false;
1025 if ( incCounter % modulo == 0 ) 1026 if ( incCounter % modulo == 0 )
1026 bar.setProgress( incCounter ); 1027 bar.setProgress( incCounter );
1027 ++incCounter; 1028 ++incCounter;
1028 uid = inR->uid(); 1029 uid = inR->uid();
1029 bool skipIncidence = false; 1030 bool skipIncidence = false;
1030 if ( uid.left(15) == QString("last-syncEvent-") ) 1031 if ( uid.left(15) == QString("last-syncEvent-") )
1031 skipIncidence = true; 1032 skipIncidence = true;
1032 QString idS; 1033 QString idS;
1033 qApp->processEvents(); 1034 qApp->processEvents();
1034 if ( !skipIncidence ) { 1035 if ( !skipIncidence ) {
1035 inL = local->incidence( uid ); 1036 inL = local->incidence( uid );
1036 if ( inL ) { // maybe conflict - same uid in both calendars 1037 if ( inL ) { // maybe conflict - same uid in both calendars
1037 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1038 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1038 //qDebug("take %d %s ", take, inL->summary().latin1()); 1039 //qDebug("take %d %s ", take, inL->summary().latin1());
1039 if ( take == 3 ) 1040 if ( take == 3 )
1040 return false; 1041 return false;
1041 if ( take == 1 ) {// take local ********************** 1042 if ( take == 1 ) {// take local **********************
1042 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1043 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1043 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1044 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1044 else 1045 else
1045 idS = inR->IDStr(); 1046 idS = inR->IDStr();
1046 remote->deleteIncidence( inR ); 1047 remote->deleteIncidence( inR );
1047 inR = inL->clone(); 1048 inR = inL->clone();
1048 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1049 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1049 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1050 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1050 inR->setIDStr( idS ); 1051 inR->setIDStr( idS );
1051 remote->addIncidence( inR ); 1052 remote->addIncidence( inR );
1052 if ( mSyncManager->syncWithDesktop() ) 1053 if ( mSyncManager->syncWithDesktop() )
1053 inR->setPilotId( 2 ); 1054 inR->setPilotId( 2 );
1054 ++changedRemote; 1055 ++changedRemote;
1055 } else {// take remote ********************** 1056 } else {// take remote **********************
1056 idS = inL->IDStr(); 1057 idS = inL->IDStr();
1057 int pid = inL->pilotId(); 1058 int pid = inL->pilotId();
1058 local->deleteIncidence( inL ); 1059 local->deleteIncidence( inL );
1059 inL = inR->clone(); 1060 inL = inR->clone();
1060 if ( mSyncManager->syncWithDesktop() ) 1061 if ( mSyncManager->syncWithDesktop() )
1061 inL->setPilotId( pid ); 1062 inL->setPilotId( pid );
1062 inL->setIDStr( idS ); 1063 inL->setIDStr( idS );
1063 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1064 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1064 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1065 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1065 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1066 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1066 } 1067 }
1067 local->addIncidence( inL ); 1068 local->addIncidence( inL );
1068 ++changedLocal; 1069 ++changedLocal;
1069 } 1070 }
1070 } 1071 }
1071 } else { // no conflict ********** add or delete remote 1072 } else { // no conflict ********** add or delete remote
1072 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1073 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1073 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1074 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1074 QString des = eventLSync->description(); 1075 QString des = eventLSync->description();
1075 QString pref = "e"; 1076 QString pref = "e";
1076 if ( inR->type() == "Todo" ) 1077 if ( inR->type() == "Todo" )
1077 pref = "t"; 1078 pref = "t";
1078 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1079 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1079 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1080 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1080 //remote->deleteIncidence( inR ); 1081 //remote->deleteIncidence( inR );
1081 ++deletedEventR; 1082 ++deletedEventR;
1082 } else { 1083 } else {
1083 inR->setLastModified( modifiedCalendar ); 1084 inR->setLastModified( modifiedCalendar );
1084 inL = inR->clone(); 1085 inL = inR->clone();
1085 inL->setIDStr( ":" ); 1086 inL->setIDStr( ":" );
1086 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1087 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1087 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1088 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1088 local->addIncidence( inL ); 1089 local->addIncidence( inL );
1089 ++addedEvent; 1090 ++addedEvent;
1090 1091
1091 } 1092 }
1092 } else { 1093 } else {
1093 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1094 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1094 inR->setLastModified( modifiedCalendar ); 1095 inR->setLastModified( modifiedCalendar );
1095 inL = inR->clone(); 1096 inL = inR->clone();
1096 inL->setIDStr( ":" ); 1097 inL->setIDStr( ":" );
1097 local->addIncidence( inL ); 1098 local->addIncidence( inL );
1098 ++addedEvent; 1099 ++addedEvent;
1099 1100
1100 } else { 1101 } else {
1101 checkExternSyncEvent(eventRSyncSharp, inR); 1102 checkExternSyncEvent(eventRSyncSharp, inR);
1102 remote->deleteIncidence( inR ); 1103 remote->deleteIncidence( inR );
1103 ++deletedEventR; 1104 ++deletedEventR;
1104 } 1105 }
1105 } 1106 }
1106 } else { 1107 } else {
1107 ++filteredIN; 1108 ++filteredIN;
1108 } 1109 }
1109 } 1110 }
1110 } 1111 }
1111 inR = er.next(); 1112 inR = er.next();
1112 } 1113 }
1113 QPtrList<Incidence> el = local->rawIncidences(); 1114 QPtrList<Incidence> el = local->rawIncidences();
1114 inL = el.first(); 1115 inL = el.first();
1115 modulo = (el.count()/10)+1; 1116 modulo = (el.count()/10)+1;
1116 bar.setCaption (i18n("Add / remove events") ); 1117 bar.setCaption (i18n("Add / remove events") );
1117 bar.setTotalSteps ( el.count() ) ; 1118 bar.setTotalSteps ( el.count() ) ;
1118 bar.show(); 1119 bar.show();
1119 incCounter = 0; 1120 incCounter = 0;
1120 1121
1121 while ( inL ) { 1122 while ( inL ) {
1122 1123
1123 qApp->processEvents(); 1124 qApp->processEvents();
1124 if ( ! bar.isVisible() ) 1125 if ( ! bar.isVisible() )
1125 return false; 1126 return false;
1126 if ( incCounter % modulo == 0 ) 1127 if ( incCounter % modulo == 0 )
1127 bar.setProgress( incCounter ); 1128 bar.setProgress( incCounter );
1128 ++incCounter; 1129 ++incCounter;
1129 uid = inL->uid(); 1130 uid = inL->uid();
1130 bool skipIncidence = false; 1131 bool skipIncidence = false;
1131 if ( uid.left(15) == QString("last-syncEvent-") ) 1132 if ( uid.left(15) == QString("last-syncEvent-") )
1132 skipIncidence = true; 1133 skipIncidence = true;
1133 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) 1134 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
1134 skipIncidence = true; 1135 skipIncidence = true;
1135 if ( !skipIncidence ) { 1136 if ( !skipIncidence ) {
1136 inR = remote->incidence( uid ); 1137 inR = remote->incidence( uid );
1137 if ( ! inR ) { 1138 if ( ! inR ) {
1138 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1139 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1139 // no conflict ********** add or delete local 1140 // no conflict ********** add or delete local
1140 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1141 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1141 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1142 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1142 checkExternSyncEvent(eventLSyncSharp, inL); 1143 checkExternSyncEvent(eventLSyncSharp, inL);
1143 local->deleteIncidence( inL ); 1144 local->deleteIncidence( inL );
1144 ++deletedEventL; 1145 ++deletedEventL;
1145 } else { 1146 } else {
1146 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1147 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1147 inL->removeID(mCurrentSyncDevice ); 1148 inL->removeID(mCurrentSyncDevice );
1148 ++addedEventR; 1149 ++addedEventR;
1149 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1150 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1150 inL->setLastModified( modifiedCalendar ); 1151 inL->setLastModified( modifiedCalendar );
1151 inR = inL->clone(); 1152 inR = inL->clone();
1152 inR->setIDStr( ":" ); 1153 inR->setIDStr( ":" );
1153 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1154 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1154 remote->addIncidence( inR ); 1155 remote->addIncidence( inR );
1155 } 1156 }
1156 } 1157 }
1157 } else { 1158 } else {
1158 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1159 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1159 checkExternSyncEvent(eventLSyncSharp, inL); 1160 checkExternSyncEvent(eventLSyncSharp, inL);
1160 local->deleteIncidence( inL ); 1161 local->deleteIncidence( inL );
1161 ++deletedEventL; 1162 ++deletedEventL;
1162 } else { 1163 } else {
1163 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1164 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1164 ++addedEventR; 1165 ++addedEventR;
1165 inL->setLastModified( modifiedCalendar ); 1166 inL->setLastModified( modifiedCalendar );
1166 inR = inL->clone(); 1167 inR = inL->clone();
1167 inR->setIDStr( ":" ); 1168 inR->setIDStr( ":" );
1168 remote->addIncidence( inR ); 1169 remote->addIncidence( inR );
1169 } 1170 }
1170 } 1171 }
1171 } 1172 }
1172 } else { 1173 } else {
1173 ++filteredOUT; 1174 ++filteredOUT;
1174 } 1175 }
1175 } 1176 }
1176 } 1177 }
1177 inL = el.next(); 1178 inL = el.next();
1178 } 1179 }
1179 int delFut = 0; 1180 int delFut = 0;
1180 int remRem = 0; 1181 int remRem = 0;
1181 if ( mSyncManager->mWriteBackInFuture ) { 1182 if ( mSyncManager->mWriteBackInFuture ) {
1182 er = remote->rawIncidences(); 1183 er = remote->rawIncidences();
1183 remRem = er.count(); 1184 remRem = er.count();
1184 inR = er.first(); 1185 inR = er.first();
1185 QDateTime dt; 1186 QDateTime dt;
1186 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1187 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1187 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1188 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1188 while ( inR ) { 1189 while ( inR ) {
1189 if ( inR->type() == "Todo" ) { 1190 if ( inR->type() == "Todo" ) {
1190 Todo * t = (Todo*)inR; 1191 Todo * t = (Todo*)inR;
1191 if ( t->hasDueDate() ) 1192 if ( t->hasDueDate() )
1192 dt = t->dtDue(); 1193 dt = t->dtDue();
1193 else 1194 else
1194 dt = cur.addSecs( 62 ); 1195 dt = cur.addSecs( 62 );
1195 } 1196 }
1196 else if (inR->type() == "Event" ) { 1197 else if (inR->type() == "Event" ) {
1197 bool ok; 1198 bool ok;
1198 dt = inR->getNextOccurence( cur, &ok ); 1199 dt = inR->getNextOccurence( cur, &ok );
1199 if ( !ok ) 1200 if ( !ok )
1200 dt = cur.addSecs( -62 ); 1201 dt = cur.addSecs( -62 );
1201 } 1202 }
1202 else 1203 else
1203 dt = inR->dtStart(); 1204 dt = inR->dtStart();
1204 if ( dt < cur || dt > end ) { 1205 if ( dt < cur || dt > end ) {
1205 remote->deleteIncidence( inR ); 1206 remote->deleteIncidence( inR );
1206 ++delFut; 1207 ++delFut;
1207 } 1208 }
1208 inR = er.next(); 1209 inR = er.next();
1209 } 1210 }
1210 } 1211 }
1211 bar.hide(); 1212 bar.hide();
1212 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1213 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1213 eventLSync->setReadOnly( false ); 1214 eventLSync->setReadOnly( false );
1214 eventLSync->setDtStart( mLastCalendarSync ); 1215 eventLSync->setDtStart( mLastCalendarSync );
1215 eventRSync->setDtStart( mLastCalendarSync ); 1216 eventRSync->setDtStart( mLastCalendarSync );
1216 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1217 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1217 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1218 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1218 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1219 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1219 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1220 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1220 eventLSync->setReadOnly( true ); 1221 eventLSync->setReadOnly( true );
1221 qDebug("********** %d %d ", mGlobalSyncMode == SYNC_MODE_NORMAL, mSyncManager->syncWithDesktop() ); 1222 qDebug("********** %d %d ", mGlobalSyncMode == SYNC_MODE_NORMAL, mSyncManager->syncWithDesktop() );
1222 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1223 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1223 remote->addEvent( eventRSync ); 1224 remote->addEvent( eventRSync );
1224 else 1225 else
1225 delete eventRSync; 1226 delete eventRSync;
1226 QString mes; 1227 QString mes;
1227 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 ); 1228 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 );
1228 QString delmess; 1229 QString delmess;
1229 if ( delFut ) { 1230 if ( delFut ) {
1230 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); 1231 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);
1231 mes += delmess; 1232 mes += delmess;
1232 } 1233 }
1233 mes = i18n("Local calendar changed!\n") +mes; 1234 mes = i18n("Local calendar changed!\n") +mes;
1234 mCalendar->checkAlarmForIncidence( 0, true ); 1235 mCalendar->checkAlarmForIncidence( 0, true );
1235 qDebug( mes ); 1236 qDebug( mes );
1236 if ( mSyncManager->mShowSyncSummary ) { 1237 if ( mSyncManager->mShowSyncSummary ) {
1237 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1238 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1238 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1239 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1239 qDebug("cancelled "); 1240 qDebug("cancelled ");
1240 return false; 1241 return false;
1241 } 1242 }
1242 } 1243 }
1243 return syncOK; 1244 return syncOK;
1244} 1245}
1245 1246
1246void CalendarView::setSyncDevice( QString s ) 1247void CalendarView::setSyncDevice( QString s )
1247{ 1248{
1248 mCurrentSyncDevice= s; 1249 mCurrentSyncDevice= s;
1249} 1250}
1250void CalendarView::setSyncName( QString s ) 1251void CalendarView::setSyncName( QString s )
1251{ 1252{
1252 mCurrentSyncName= s; 1253 mCurrentSyncName= s;
1253} 1254}
1254bool CalendarView::syncCalendar(QString filename, int mode) 1255bool CalendarView::syncCalendar(QString filename, int mode)
1255{ 1256{
1256 //qDebug("syncCalendar %s ", filename.latin1()); 1257 //qDebug("syncCalendar %s ", filename.latin1());
1257 mGlobalSyncMode = SYNC_MODE_NORMAL; 1258 mGlobalSyncMode = SYNC_MODE_NORMAL;
1258 CalendarLocal* calendar = new CalendarLocal(); 1259 CalendarLocal* calendar = new CalendarLocal();
1259 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1260 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1260 FileStorage* storage = new FileStorage( calendar ); 1261 FileStorage* storage = new FileStorage( calendar );
1261 bool syncOK = false; 1262 bool syncOK = false;
1262 storage->setFileName( filename ); 1263 storage->setFileName( filename );
1263 // qDebug("loading ... "); 1264 // qDebug("loading ... ");
1264 if ( storage->load() ) { 1265 if ( storage->load() ) {
1265 getEventViewerDialog()->setSyncMode( true ); 1266 getEventViewerDialog()->setSyncMode( true );
1266 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1267 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1267 getEventViewerDialog()->setSyncMode( false ); 1268 getEventViewerDialog()->setSyncMode( false );
1268 if ( syncOK ) { 1269 if ( syncOK ) {
1269 if ( mSyncManager->mWriteBackFile ) 1270 if ( mSyncManager->mWriteBackFile )
1270 { 1271 {
1271 storage->setSaveFormat( new ICalFormat() ); 1272 storage->setSaveFormat( new ICalFormat() );
1272 storage->save(); 1273 storage->save();
1273 } 1274 }
1274 } 1275 }
1275 setModified( true ); 1276 setModified( true );
1276 } 1277 }
1277 delete storage; 1278 delete storage;
1278 delete calendar; 1279 delete calendar;
1279 if ( syncOK ) 1280 if ( syncOK )
1280 updateView(); 1281 updateView();
1281 return syncOK; 1282 return syncOK;
1282} 1283}
1283 1284
1284void CalendarView::syncExternal( int mode ) 1285void CalendarView::syncExternal( int mode )
1285{ 1286{
1286 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1287 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1287 1288
1288 qApp->processEvents(); 1289 qApp->processEvents();
1289 CalendarLocal* calendar = new CalendarLocal(); 1290 CalendarLocal* calendar = new CalendarLocal();
1290 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1291 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1291 bool syncOK = false; 1292 bool syncOK = false;
1292 bool loadSuccess = false; 1293 bool loadSuccess = false;
1293 PhoneFormat* phoneFormat = 0; 1294 PhoneFormat* phoneFormat = 0;
1294 emit tempDisableBR(true); 1295 emit tempDisableBR(true);
1295#ifndef DESKTOP_VERSION 1296#ifndef DESKTOP_VERSION
1296 SharpFormat* sharpFormat = 0; 1297 SharpFormat* sharpFormat = 0;
1297 if ( mode == 0 ) { // sharp 1298 if ( mode == 0 ) { // sharp
1298 sharpFormat = new SharpFormat () ; 1299 sharpFormat = new SharpFormat () ;
1299 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1300 loadSuccess = sharpFormat->load( calendar, mCalendar );
1300 1301
1301 } else 1302 } else
1302#endif 1303#endif
1303 if ( mode == 1 ) { // phone 1304 if ( mode == 1 ) { // phone
1304 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1305 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1305 mSyncManager->mPhoneDevice, 1306 mSyncManager->mPhoneDevice,
1306 mSyncManager->mPhoneConnection, 1307 mSyncManager->mPhoneConnection,
1307 mSyncManager->mPhoneModel); 1308 mSyncManager->mPhoneModel);
1308 loadSuccess = phoneFormat->load( calendar,mCalendar); 1309 loadSuccess = phoneFormat->load( calendar,mCalendar);
1309 1310
1310 } else { 1311 } else {
1311 emit tempDisableBR(false); 1312 emit tempDisableBR(false);
1312 return; 1313 return;
1313 } 1314 }
1314 if ( loadSuccess ) { 1315 if ( loadSuccess ) {
1315 getEventViewerDialog()->setSyncMode( true ); 1316 getEventViewerDialog()->setSyncMode( true );
1316 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1317 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1317 getEventViewerDialog()->setSyncMode( false ); 1318 getEventViewerDialog()->setSyncMode( false );
1318 qApp->processEvents(); 1319 qApp->processEvents();
1319 if ( syncOK ) { 1320 if ( syncOK ) {
1320 if ( mSyncManager->mWriteBackFile ) 1321 if ( mSyncManager->mWriteBackFile )
1321 { 1322 {
1322 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1323 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1323 Incidence* inc = iL.first(); 1324 Incidence* inc = iL.first();
1324 if ( phoneFormat ) { 1325 if ( phoneFormat ) {
1325 while ( inc ) { 1326 while ( inc ) {
1326 inc->removeID(mCurrentSyncDevice); 1327 inc->removeID(mCurrentSyncDevice);
1327 inc = iL.next(); 1328 inc = iL.next();
1328 } 1329 }
1329 } 1330 }
1330#ifndef DESKTOP_VERSION 1331#ifndef DESKTOP_VERSION
1331 if ( sharpFormat ) 1332 if ( sharpFormat )
1332 sharpFormat->save(calendar); 1333 sharpFormat->save(calendar);
1333#endif 1334#endif
1334 if ( phoneFormat ) 1335 if ( phoneFormat )
1335 phoneFormat->save(calendar); 1336 phoneFormat->save(calendar);
1336 iL = calendar->rawIncidences(); 1337 iL = calendar->rawIncidences();
1337 inc = iL.first(); 1338 inc = iL.first();
1338 Incidence* loc; 1339 Incidence* loc;
1339 while ( inc ) { 1340 while ( inc ) {
1340 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1341 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1341 loc = mCalendar->incidence(inc->uid() ); 1342 loc = mCalendar->incidence(inc->uid() );
1342 if ( loc ) { 1343 if ( loc ) {
1343 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1344 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1344 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1345 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1345 } 1346 }
1346 } 1347 }
1347 inc = iL.next(); 1348 inc = iL.next();
1348 } 1349 }
1349 Incidence* lse = getLastSyncEvent(); 1350 Incidence* lse = getLastSyncEvent();
1350 if ( lse ) { 1351 if ( lse ) {
1351 lse->setReadOnly( false ); 1352 lse->setReadOnly( false );
1352 lse->setDescription( "" ); 1353 lse->setDescription( "" );
1353 lse->setReadOnly( true ); 1354 lse->setReadOnly( true );
1354 } 1355 }
1355 } 1356 }
1356 } else { 1357 } else {
1357 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1358 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1358 } 1359 }
1359 setModified( true ); 1360 setModified( true );
1360 } else { 1361 } else {
1361 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1362 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1362 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1363 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1363 question, i18n("Ok")) ; 1364 question, i18n("Ok")) ;
1364 1365
1365 } 1366 }
1366 delete calendar; 1367 delete calendar;
1367 updateView(); 1368 updateView();
1368 emit tempDisableBR(false); 1369 emit tempDisableBR(false);
1369 return ;//syncOK; 1370 return ;//syncOK;
1370 1371
1371} 1372}
1372 1373
1373bool CalendarView::importBday() 1374bool CalendarView::importBday()
1374{ 1375{
1375#ifndef KORG_NOKABC 1376#ifndef KORG_NOKABC
1376 1377
1377#ifdef DESKTOP_VERSION 1378#ifdef DESKTOP_VERSION
1378 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1379 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1379 KABC::AddressBook::Iterator it; 1380 KABC::AddressBook::Iterator it;
1380 int count = 0; 1381 int count = 0;
1381 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1382 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1382 ++count; 1383 ++count;
1383 } 1384 }
1384 QProgressBar bar(count,0 ); 1385 QProgressBar bar(count,0 );
1385 int w = 300; 1386 int w = 300;
1386 if ( QApplication::desktop()->width() < 320 ) 1387 if ( QApplication::desktop()->width() < 320 )
1387 w = 220; 1388 w = 220;
1388 int h = bar.sizeHint().height() ; 1389 int h = bar.sizeHint().height() ;
1389 int dw = QApplication::desktop()->width(); 1390 int dw = QApplication::desktop()->width();
1390 int dh = QApplication::desktop()->height(); 1391 int dh = QApplication::desktop()->height();
1391 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1392 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1392 bar.show(); 1393 bar.show();
1393 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1394 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1394 qApp->processEvents(); 1395 qApp->processEvents();
1395 count = 0; 1396 count = 0;
1396 int addCount = 0; 1397 int addCount = 0;
1397 KCal::Attendee* a = 0; 1398 KCal::Attendee* a = 0;
1398 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1399 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1399 if ( ! bar.isVisible() ) 1400 if ( ! bar.isVisible() )
1400 return false; 1401 return false;
1401 bar.setProgress( count++ ); 1402 bar.setProgress( count++ );
1402 qApp->processEvents(); 1403 qApp->processEvents();
1403 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1404 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1404 if ( (*it).birthday().date().isValid() ){ 1405 if ( (*it).birthday().date().isValid() ){
1405 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1406 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1406 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1407 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1407 ++addCount; 1408 ++addCount;
1408 } 1409 }
1409 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1410 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1410 if ( anni.isValid() ){ 1411 if ( anni.isValid() ){
1411 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1412 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1412 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1413 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1413 ++addCount; 1414 ++addCount;
1414 } 1415 }
1415 } 1416 }
1416 updateView(); 1417 updateView();
1417 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1418 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1418#else //DESKTOP_VERSION 1419#else //DESKTOP_VERSION
1419 1420
1420 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1421 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1421 // the result should now arrive through method insertBirthdays 1422 // the result should now arrive through method insertBirthdays
1422 1423
1423#endif //DESKTOP_VERSION 1424#endif //DESKTOP_VERSION
1424 1425
1425#endif //KORG_NOKABC 1426#endif //KORG_NOKABC
1426 1427
1427 1428
1428 return true; 1429 return true;
1429} 1430}
1430 1431
1431// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1432// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1432void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1433void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1433 const QStringList& anniversaryList, const QStringList& realNameList, 1434 const QStringList& anniversaryList, const QStringList& realNameList,
1434 const QStringList& emailList, const QStringList& assembledNameList, 1435 const QStringList& emailList, const QStringList& assembledNameList,
1435 const QStringList& uidList) 1436 const QStringList& uidList)
1436{ 1437{
1437 qDebug("CalendarView::insertBirthdays"); 1438 qDebug("CalendarView::insertBirthdays");
1438 if (uid == this->name()) 1439 if (uid == this->name())
1439 { 1440 {
1440 int count = birthdayList.count(); 1441 int count = birthdayList.count();
1441 int addCount = 0; 1442 int addCount = 0;
1442 KCal::Attendee* a = 0; 1443 KCal::Attendee* a = 0;
1443 1444
1444 qDebug("CalView 1 %i", count); 1445 qDebug("CalView 1 %i", count);
1445 1446
1446 QProgressBar bar(count,0 ); 1447 QProgressBar bar(count,0 );
1447 int w = 300; 1448 int w = 300;
1448 if ( QApplication::desktop()->width() < 320 ) 1449 if ( QApplication::desktop()->width() < 320 )
1449 w = 220; 1450 w = 220;
1450 int h = bar.sizeHint().height() ; 1451 int h = bar.sizeHint().height() ;
1451 int dw = QApplication::desktop()->width(); 1452 int dw = QApplication::desktop()->width();
1452 int dh = QApplication::desktop()->height(); 1453 int dh = QApplication::desktop()->height();
1453 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1454 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1454 bar.show(); 1455 bar.show();
1455 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1456 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1456 qApp->processEvents(); 1457 qApp->processEvents();
1457 1458
1458 QDate birthday; 1459 QDate birthday;
1459 QDate anniversary; 1460 QDate anniversary;
1460 QString realName; 1461 QString realName;
1461 QString email; 1462 QString email;
1462 QString assembledName; 1463 QString assembledName;
1463 QString uid; 1464 QString uid;
1464 bool ok = true; 1465 bool ok = true;
1465 for ( int i = 0; i < count; i++) 1466 for ( int i = 0; i < count; i++)
1466 { 1467 {
1467 if ( ! bar.isVisible() ) 1468 if ( ! bar.isVisible() )
1468 return; 1469 return;
1469 bar.setProgress( i ); 1470 bar.setProgress( i );
1470 qApp->processEvents(); 1471 qApp->processEvents();
1471 1472
1472 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1473 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1473 if (!ok) { 1474 if (!ok) {
1474 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1475 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1475 } 1476 }
1476 1477
1477 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1478 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1478 if (!ok) { 1479 if (!ok) {
1479 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1480 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1480 } 1481 }
1481 realName = realNameList[i]; 1482 realName = realNameList[i];
1482 email = emailList[i]; 1483 email = emailList[i];
1483 assembledName = assembledNameList[i]; 1484 assembledName = assembledNameList[i];
1484 uid = uidList[i]; 1485 uid = uidList[i];
1485 //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() ); 1486 //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() );
1486 1487
1487 if ( birthday.isValid() ){ 1488 if ( birthday.isValid() ){
1488 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1489 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1489 KCal::Attendee::ReqParticipant,uid) ; 1490 KCal::Attendee::ReqParticipant,uid) ;
1490 if ( addAnniversary( birthday, assembledName, a, true ) ) 1491 if ( addAnniversary( birthday, assembledName, a, true ) )
1491 ++addCount; 1492 ++addCount;
1492 } 1493 }
1493 1494
1494 if ( anniversary.isValid() ){ 1495 if ( anniversary.isValid() ){
1495 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1496 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1496 KCal::Attendee::ReqParticipant,uid) ; 1497 KCal::Attendee::ReqParticipant,uid) ;
1497 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1498 if ( addAnniversary( anniversary, assembledName, a, false ) )
1498 ++addCount; 1499 ++addCount;
1499 } 1500 }
1500 } 1501 }
1501 1502
1502 updateView(); 1503 updateView();
1503 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1504 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1504 1505
1505 } 1506 }
1506 1507
1507} 1508}
1508 1509
1509 1510
1510 1511
1511bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1512bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1512{ 1513{
1513 //qDebug("addAnni "); 1514 //qDebug("addAnni ");
1514 Event * ev = new Event(); 1515 Event * ev = new Event();
1515 if ( a ) { 1516 if ( a ) {
1516 ev->addAttendee( a ); 1517 ev->addAttendee( a );
1517 } 1518 }
1518 QString kind; 1519 QString kind;
1519 if ( birthday ) 1520 if ( birthday )
1520 kind = i18n( "Birthday" ); 1521 kind = i18n( "Birthday" );
1521 else 1522 else
1522 kind = i18n( "Anniversary" ); 1523 kind = i18n( "Anniversary" );
1523 ev->setSummary( name + " - " + kind ); 1524 ev->setSummary( name + " - " + kind );
1524 ev->setOrganizer(a->email()); 1525 ev->setOrganizer(a->email());
1525 ev->setCategories( kind ); 1526 ev->setCategories( kind );
1526 ev->setDtStart( QDateTime(date) ); 1527 ev->setDtStart( QDateTime(date) );
1527 ev->setDtEnd( QDateTime(date) ); 1528 ev->setDtEnd( QDateTime(date) );
1528 ev->setFloats( true ); 1529 ev->setFloats( true );
1529 Recurrence * rec = ev->recurrence(); 1530 Recurrence * rec = ev->recurrence();
1530 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1531 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1531 rec->addYearlyNum( date.month() ); 1532 rec->addYearlyNum( date.month() );
1532 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1533 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1533 delete ev; 1534 delete ev;
1534 return false; 1535 return false;
1535 } 1536 }
1536 return true; 1537 return true;
1537 1538
1538} 1539}
1539bool CalendarView::importQtopia( const QString &categories, 1540bool CalendarView::importQtopia( const QString &categories,
1540 const QString &datebook, 1541 const QString &datebook,
1541 const QString &todolist ) 1542 const QString &todolist )
1542{ 1543{
1543 1544
1544 QtopiaFormat qtopiaFormat; 1545 QtopiaFormat qtopiaFormat;
1545 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1546 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1546 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1547 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1547 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1548 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1548 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1549 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1549 1550
1550 updateView(); 1551 updateView();
1551 return true; 1552 return true;
1552 1553
1553#if 0 1554#if 0
1554 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1555 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1555 mCurrentSyncDevice = "qtopia-XML"; 1556 mCurrentSyncDevice = "qtopia-XML";
1556 if ( mSyncManager->mAskForPreferences ) 1557 if ( mSyncManager->mAskForPreferences )
1557 edit_sync_options(); 1558 edit_sync_options();
1558 qApp->processEvents(); 1559 qApp->processEvents();
1559 CalendarLocal* calendar = new CalendarLocal(); 1560 CalendarLocal* calendar = new CalendarLocal();
1560 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1561 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1561 bool syncOK = false; 1562 bool syncOK = false;
1562 QtopiaFormat qtopiaFormat; 1563 QtopiaFormat qtopiaFormat;
1563 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1564 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1564 bool loadOk = true; 1565 bool loadOk = true;
1565 if ( !categories.isEmpty() ) 1566 if ( !categories.isEmpty() )
1566 loadOk = qtopiaFormat.load( calendar, categories ); 1567 loadOk = qtopiaFormat.load( calendar, categories );
1567 if ( loadOk && !datebook.isEmpty() ) 1568 if ( loadOk && !datebook.isEmpty() )
1568 loadOk = qtopiaFormat.load( calendar, datebook ); 1569 loadOk = qtopiaFormat.load( calendar, datebook );
1569 if ( loadOk && !todolist.isEmpty() ) 1570 if ( loadOk && !todolist.isEmpty() )
1570 loadOk = qtopiaFormat.load( calendar, todolist ); 1571 loadOk = qtopiaFormat.load( calendar, todolist );
1571 1572
1572 if ( loadOk ) { 1573 if ( loadOk ) {
1573 getEventViewerDialog()->setSyncMode( true ); 1574 getEventViewerDialog()->setSyncMode( true );
1574 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1575 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1575 getEventViewerDialog()->setSyncMode( false ); 1576 getEventViewerDialog()->setSyncMode( false );
1576 qApp->processEvents(); 1577 qApp->processEvents();
1577 if ( syncOK ) { 1578 if ( syncOK ) {
1578 if ( mSyncManager->mWriteBackFile ) 1579 if ( mSyncManager->mWriteBackFile )
1579 { 1580 {
1580 // write back XML file 1581 // write back XML file
1581 1582
1582 } 1583 }
1583 setModified( true ); 1584 setModified( true );
1584 } 1585 }
1585 } else { 1586 } else {
1586 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1587 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1587 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1588 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1588 question, i18n("Ok")) ; 1589 question, i18n("Ok")) ;
1589 } 1590 }
1590 delete calendar; 1591 delete calendar;
1591 updateView(); 1592 updateView();
1592 return syncOK; 1593 return syncOK;
1593 1594
1594 1595
1595#endif 1596#endif
1596 1597
1597} 1598}
1598 1599
1599void CalendarView::setSyncEventsReadOnly() 1600void CalendarView::setSyncEventsReadOnly()
1600{ 1601{
1601 Event * ev; 1602 Event * ev;
1602 QPtrList<Event> eL = mCalendar->rawEvents(); 1603 QPtrList<Event> eL = mCalendar->rawEvents();
1603 ev = eL.first(); 1604 ev = eL.first();
1604 while ( ev ) { 1605 while ( ev ) {
1605 if ( ev->uid().left(15) == QString("last-syncEvent-") ) 1606 if ( ev->uid().left(15) == QString("last-syncEvent-") )
1606 ev->setReadOnly( true ); 1607 ev->setReadOnly( true );
1607 ev = eL.next(); 1608 ev = eL.next();
1608 } 1609 }
1609} 1610}
1610bool CalendarView::openCalendar(QString filename, bool merge) 1611bool CalendarView::openCalendar(QString filename, bool merge)
1611{ 1612{
1612 1613
1613 if (filename.isEmpty()) { 1614 if (filename.isEmpty()) {
1614 return false; 1615 return false;
1615 } 1616 }
1616 1617
1617 if (!QFile::exists(filename)) { 1618 if (!QFile::exists(filename)) {
1618 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1619 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1619 return false; 1620 return false;
1620 } 1621 }
1621 1622
1622 globalFlagBlockAgenda = 1; 1623 globalFlagBlockAgenda = 1;
1623 if (!merge) mCalendar->close(); 1624 if (!merge) mCalendar->close();
1624 1625
1625 mStorage->setFileName( filename ); 1626 mStorage->setFileName( filename );
1626 1627
1627 if ( mStorage->load() ) { 1628 if ( mStorage->load() ) {
1628 if ( merge ) ;//setModified( true ); 1629 if ( merge ) ;//setModified( true );
1629 else { 1630 else {
1630 //setModified( true ); 1631 //setModified( true );
1631 mViewManager->setDocumentId( filename ); 1632 mViewManager->setDocumentId( filename );
1632 mDialogManager->setDocumentId( filename ); 1633 mDialogManager->setDocumentId( filename );
1633 mTodoList->setDocumentId( filename ); 1634 mTodoList->setDocumentId( filename );
1634 } 1635 }
1635 globalFlagBlockAgenda = 2; 1636 globalFlagBlockAgenda = 2;
1636 // if ( getLastSyncEvent() ) 1637 // if ( getLastSyncEvent() )
1637 // getLastSyncEvent()->setReadOnly( true ); 1638 // getLastSyncEvent()->setReadOnly( true );
1638 mCalendar->reInitAlarmSettings(); 1639 mCalendar->reInitAlarmSettings();
1639 setSyncEventsReadOnly(); 1640 setSyncEventsReadOnly();
1640 updateUnmanagedViews(); 1641 updateUnmanagedViews();
1641 updateView(); 1642 updateView();
1642 if ( filename != MainWindow::defaultFileName() ) { 1643 if ( filename != MainWindow::defaultFileName() ) {
1643 saveCalendar( MainWindow::defaultFileName() ); 1644 saveCalendar( MainWindow::defaultFileName() );
1644 } else { 1645 } else {
1645 QFileInfo finf ( MainWindow::defaultFileName()); 1646 QFileInfo finf ( MainWindow::defaultFileName());
1646 if ( finf.exists() ) { 1647 if ( finf.exists() ) {
1647 setLoadedFileVersion( finf.lastModified () ); 1648 setLoadedFileVersion( finf.lastModified () );
1648 } 1649 }
1649 } 1650 }
1650 return true; 1651 return true;
1651 } else { 1652 } else {
1652 // while failing to load, the calendar object could 1653 // while failing to load, the calendar object could
1653 // have become partially populated. Clear it out. 1654 // have become partially populated. Clear it out.
1654 if ( !merge ) { 1655 if ( !merge ) {
1655 mCalendar->close(); 1656 mCalendar->close();
1656 mViewManager->setDocumentId( filename ); 1657 mViewManager->setDocumentId( filename );
1657 mDialogManager->setDocumentId( filename ); 1658 mDialogManager->setDocumentId( filename );
1658 mTodoList->setDocumentId( filename ); 1659 mTodoList->setDocumentId( filename );
1659 } 1660 }
1660 1661
1661 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 1662 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1662 1663
1663 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 1664 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
1664 globalFlagBlockAgenda = 2; 1665 globalFlagBlockAgenda = 2;
1665 mCalendar->reInitAlarmSettings(); 1666 mCalendar->reInitAlarmSettings();
1666 setSyncEventsReadOnly(); 1667 setSyncEventsReadOnly();
1667 updateUnmanagedViews(); 1668 updateUnmanagedViews();
1668 updateView(); 1669 updateView();
1669 } 1670 }
1670 return false; 1671 return false;
1671} 1672}
1672void CalendarView::showOpenError() 1673void CalendarView::showOpenError()
1673{ 1674{
1674 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 1675 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
1675} 1676}
1676void CalendarView::setLoadedFileVersion(QDateTime dt) 1677void CalendarView::setLoadedFileVersion(QDateTime dt)
1677{ 1678{
1678 loadedFileVersion = dt; 1679 loadedFileVersion = dt;
1679} 1680}
1680bool CalendarView::checkFileChanged(QString fn) 1681bool CalendarView::checkFileChanged(QString fn)
1681{ 1682{
1682 QFileInfo finf ( fn ); 1683 QFileInfo finf ( fn );
1683 if ( !finf.exists() ) 1684 if ( !finf.exists() )
1684 return true; 1685 return true;
1685 QDateTime dt = finf.lastModified (); 1686 QDateTime dt = finf.lastModified ();
1686 if ( dt <= loadedFileVersion ) 1687 if ( dt <= loadedFileVersion )
1687 return false; 1688 return false;
1688 return true; 1689 return true;
1689 1690
1690} 1691}
1691void CalendarView::watchSavedFile() 1692void CalendarView::watchSavedFile()
1692{ 1693{
1693 QFileInfo finf ( MainWindow::defaultFileName()); 1694 QFileInfo finf ( MainWindow::defaultFileName());
1694 if ( !finf.exists() ) 1695 if ( !finf.exists() )
1695 return; 1696 return;
1696 QDateTime dt = finf.lastModified (); 1697 QDateTime dt = finf.lastModified ();
1697 if ( dt < loadedFileVersion ) { 1698 if ( dt < loadedFileVersion ) {
1698 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 1699 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
1699 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 1700 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
1700 return; 1701 return;
1701 } 1702 }
1702 loadedFileVersion = dt; 1703 loadedFileVersion = dt;
1703} 1704}
1704 1705
1705bool CalendarView::checkFileVersion(QString fn) 1706bool CalendarView::checkFileVersion(QString fn)
1706{ 1707{
1707 QFileInfo finf ( fn ); 1708 QFileInfo finf ( fn );
1708 if ( !finf.exists() ) 1709 if ( !finf.exists() )
1709 return true; 1710 return true;
1710 QDateTime dt = finf.lastModified (); 1711 QDateTime dt = finf.lastModified ();
1711 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); 1712 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1());
1712 //qDebug("file on disk version %s",dt.toString().latin1()); 1713 //qDebug("file on disk version %s",dt.toString().latin1());
1713 if ( dt <= loadedFileVersion ) 1714 if ( dt <= loadedFileVersion )
1714 return true; 1715 return true;
1715 int km = KMessageBox::warningYesNoCancel(this, i18n("\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").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 1716 int km = KMessageBox::warningYesNoCancel(this, i18n("\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").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
1716 i18n("KO/Pi Warning"),i18n("Overwrite"), 1717 i18n("KO/Pi Warning"),i18n("Overwrite"),
1717 i18n("Sync+save")); 1718 i18n("Sync+save"));
1718 1719
1719 if ( km == KMessageBox::Cancel ) 1720 if ( km == KMessageBox::Cancel )
1720 return false; 1721 return false;
1721 if ( km == KMessageBox::Yes ) 1722 if ( km == KMessageBox::Yes )
1722 return true; 1723 return true;
1723 1724
1724 setSyncDevice("deleteaftersync" ); 1725 setSyncDevice("deleteaftersync" );
1725 mSyncManager->mAskForPreferences = true; 1726 mSyncManager->mAskForPreferences = true;
1726 mSyncManager->mSyncAlgoPrefs = 3; 1727 mSyncManager->mSyncAlgoPrefs = 3;
1727 mSyncManager->mWriteBackFile = false; 1728 mSyncManager->mWriteBackFile = false;
1728 mSyncManager->mWriteBackExistingOnly = false; 1729 mSyncManager->mWriteBackExistingOnly = false;
1729 mSyncManager->mShowSyncSummary = false; 1730 mSyncManager->mShowSyncSummary = false;
1730 syncCalendar( fn, 3 ); 1731 syncCalendar( fn, 3 );
1731 Event * e = getLastSyncEvent(); 1732 Event * e = getLastSyncEvent();
1732 mCalendar->deleteEvent ( e ); 1733 mCalendar->deleteEvent ( e );
1733 updateView(); 1734 updateView();
1734 return true; 1735 return true;
1735} 1736}
1736 1737
1737bool CalendarView::saveCalendar( QString filename ) 1738bool CalendarView::saveCalendar( QString filename )
1738{ 1739{
1739 1740
1740 // Store back all unsaved data into calendar object 1741 // Store back all unsaved data into calendar object
1741 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 1742 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
1742 if ( mViewManager->currentView() ) 1743 if ( mViewManager->currentView() )
1743 mViewManager->currentView()->flushView(); 1744 mViewManager->currentView()->flushView();
1744 1745
1745 1746
1746 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 1747 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
1747 mStorage->setSaveFormat( new ICalFormat() ); 1748 mStorage->setSaveFormat( new ICalFormat() );
1748 mStorage->setFileName( filename ); 1749 mStorage->setFileName( filename );
1749 bool success; 1750 bool success;
1750 success = mStorage->save(); 1751 success = mStorage->save();
1751 if ( !success ) { 1752 if ( !success ) {
1752 return false; 1753 return false;
1753 } 1754 }
1754 if ( filename == MainWindow::defaultFileName() ) { 1755 if ( filename == MainWindow::defaultFileName() ) {
1755 setLoadedFileVersion( lfv ); 1756 setLoadedFileVersion( lfv );
1756 watchSavedFile(); 1757 watchSavedFile();
1757 } 1758 }
1758 return true; 1759 return true;
1759} 1760}
1760 1761
1761void CalendarView::closeCalendar() 1762void CalendarView::closeCalendar()
1762{ 1763{
1763 1764
1764 // child windows no longer valid 1765 // child windows no longer valid
1765 emit closingDown(); 1766 emit closingDown();
1766 1767
1767 mCalendar->close(); 1768 mCalendar->close();
1768 setModified(false); 1769 setModified(false);
1769 updateView(); 1770 updateView();
1770} 1771}
1771 1772
1772void CalendarView::archiveCalendar() 1773void CalendarView::archiveCalendar()
1773{ 1774{
1774 mDialogManager->showArchiveDialog(); 1775 mDialogManager->showArchiveDialog();
1775} 1776}
1776 1777
1777 1778
1778void CalendarView::readSettings() 1779void CalendarView::readSettings()
1779{ 1780{
1780 1781
1781 1782
1782 // mViewManager->showAgendaView(); 1783 // mViewManager->showAgendaView();
1783 QString str; 1784 QString str;
1784 //qDebug("CalendarView::readSettings() "); 1785 //qDebug("CalendarView::readSettings() ");
1785 // read settings from the KConfig, supplying reasonable 1786 // read settings from the KConfig, supplying reasonable
1786 // defaults where none are to be found 1787 // defaults where none are to be found
1787 KConfig *config = KOGlobals::config(); 1788 KConfig *config = KOGlobals::config();
1788#ifndef KORG_NOSPLITTER 1789#ifndef KORG_NOSPLITTER
1789 config->setGroup("KOrganizer Geometry"); 1790 config->setGroup("KOrganizer Geometry");
1790 1791
1791 QValueList<int> sizes = config->readIntListEntry("Separator1"); 1792 QValueList<int> sizes = config->readIntListEntry("Separator1");
1792 if (sizes.count() != 2) { 1793 if (sizes.count() != 2) {
1793 sizes << mDateNavigator->minimumSizeHint().width(); 1794 sizes << mDateNavigator->minimumSizeHint().width();
1794 sizes << 300; 1795 sizes << 300;
1795 } 1796 }
1796 mPanner->setSizes(sizes); 1797 mPanner->setSizes(sizes);
1797 1798
1798 sizes = config->readIntListEntry("Separator2"); 1799 sizes = config->readIntListEntry("Separator2");
1799 if ( ( mResourceView && sizes.count() == 4 ) || 1800 if ( ( mResourceView && sizes.count() == 4 ) ||
1800 ( !mResourceView && sizes.count() == 3 ) ) { 1801 ( !mResourceView && sizes.count() == 3 ) ) {
1801 mLeftSplitter->setSizes(sizes); 1802 mLeftSplitter->setSizes(sizes);
1802 } 1803 }
1803#endif 1804#endif
1804 globalFlagBlockAgenda = 1; 1805 globalFlagBlockAgenda = 1;
1805 mViewManager->showAgendaView(); 1806 mViewManager->showAgendaView();
1806 //mViewManager->readSettings( config ); 1807 //mViewManager->readSettings( config );
1807 mTodoList->restoreLayout(config,QString("Todo Layout")); 1808 mTodoList->restoreLayout(config,QString("Todo Layout"));
1808 readFilterSettings(config); 1809 readFilterSettings(config);
1809 config->setGroup( "Views" ); 1810 config->setGroup( "Views" );
1810 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1811 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1811 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1812 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1812 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1813 else if ( dateCount == 7 ) mNavigator->selectWeek();
1813 else mNavigator->selectDates( dateCount ); 1814 else mNavigator->selectDates( dateCount );
1814 // mViewManager->readSettings( config ); 1815 // mViewManager->readSettings( config );
1815 updateConfig(); 1816 updateConfig();
1816 globalFlagBlockAgenda = 2; 1817 globalFlagBlockAgenda = 2;
1817 mViewManager->readSettings( config ); 1818 mViewManager->readSettings( config );
1818#ifdef DESKTOP_VERSION 1819#ifdef DESKTOP_VERSION
1819 config->setGroup("WidgetLayout"); 1820 config->setGroup("WidgetLayout");
1820 QStringList list; 1821 QStringList list;
1821 list = config->readListEntry("MainLayout"); 1822 list = config->readListEntry("MainLayout");
1822 int x,y,w,h; 1823 int x,y,w,h;
1823 if ( ! list.isEmpty() ) { 1824 if ( ! list.isEmpty() ) {
1824 x = list[0].toInt(); 1825 x = list[0].toInt();
1825 y = list[1].toInt(); 1826 y = list[1].toInt();
1826 w = list[2].toInt(); 1827 w = list[2].toInt();
1827 h = list[3].toInt(); 1828 h = list[3].toInt();
1828 topLevelWidget()->setGeometry(x,y,w,h); 1829 topLevelWidget()->setGeometry(x,y,w,h);
1829 1830
1830 } else { 1831 } else {
1831 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1832 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1832 } 1833 }
1833 list = config->readListEntry("EditEventLayout"); 1834 list = config->readListEntry("EditEventLayout");
1834 if ( ! list.isEmpty() ) { 1835 if ( ! list.isEmpty() ) {
1835 x = list[0].toInt(); 1836 x = list[0].toInt();
1836 y = list[1].toInt(); 1837 y = list[1].toInt();
1837 w = list[2].toInt(); 1838 w = list[2].toInt();
1838 h = list[3].toInt(); 1839 h = list[3].toInt();
1839 mEventEditor->setGeometry(x,y,w,h); 1840 mEventEditor->setGeometry(x,y,w,h);
1840 1841
1841 } 1842 }
1842 list = config->readListEntry("EditTodoLayout"); 1843 list = config->readListEntry("EditTodoLayout");
1843 if ( ! list.isEmpty() ) { 1844 if ( ! list.isEmpty() ) {
1844 x = list[0].toInt(); 1845 x = list[0].toInt();
1845 y = list[1].toInt(); 1846 y = list[1].toInt();
1846 w = list[2].toInt(); 1847 w = list[2].toInt();
1847 h = list[3].toInt(); 1848 h = list[3].toInt();
1848 mTodoEditor->setGeometry(x,y,w,h); 1849 mTodoEditor->setGeometry(x,y,w,h);
1849 1850
1850 } 1851 }
1851 list = config->readListEntry("ViewerLayout"); 1852 list = config->readListEntry("ViewerLayout");
1852 if ( ! list.isEmpty() ) { 1853 if ( ! list.isEmpty() ) {
1853 x = list[0].toInt(); 1854 x = list[0].toInt();
1854 y = list[1].toInt(); 1855 y = list[1].toInt();
1855 w = list[2].toInt(); 1856 w = list[2].toInt();
1856 h = list[3].toInt(); 1857 h = list[3].toInt();
1857 getEventViewerDialog()->setGeometry(x,y,w,h); 1858 getEventViewerDialog()->setGeometry(x,y,w,h);
1858 } 1859 }
1859#endif 1860#endif
1860 1861
1861} 1862}
1862 1863
1863 1864
1864void CalendarView::writeSettings() 1865void CalendarView::writeSettings()
1865{ 1866{
1866 // kdDebug() << "CalendarView::writeSettings" << endl; 1867 // kdDebug() << "CalendarView::writeSettings" << endl;
1867 1868
1868 KConfig *config = KOGlobals::config(); 1869 KConfig *config = KOGlobals::config();
1869 1870
1870#ifndef KORG_NOSPLITTER 1871#ifndef KORG_NOSPLITTER
1871 config->setGroup("KOrganizer Geometry"); 1872 config->setGroup("KOrganizer Geometry");
1872 1873
1873 QValueList<int> list = mPanner->sizes(); 1874 QValueList<int> list = mPanner->sizes();
1874 config->writeEntry("Separator1",list); 1875 config->writeEntry("Separator1",list);
1875 1876
1876 list = mLeftSplitter->sizes(); 1877 list = mLeftSplitter->sizes();
1877 config->writeEntry("Separator2",list); 1878 config->writeEntry("Separator2",list);
1878#endif 1879#endif
1879 1880
1880 mViewManager->writeSettings( config ); 1881 mViewManager->writeSettings( config );
1881 mTodoList->saveLayout(config,QString("Todo Layout")); 1882 mTodoList->saveLayout(config,QString("Todo Layout"));
1882 mDialogManager->writeSettings( config ); 1883 mDialogManager->writeSettings( config );
1883 //KOPrefs::instance()->usrWriteConfig(); 1884 //KOPrefs::instance()->usrWriteConfig();
1884 KOPrefs::instance()->writeConfig(); 1885 KOPrefs::instance()->writeConfig();
1885 1886
1886 writeFilterSettings(config); 1887 writeFilterSettings(config);
1887 1888
1888 config->setGroup( "Views" ); 1889 config->setGroup( "Views" );
1889 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1890 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1890 1891
1891#ifdef DESKTOP_VERSION 1892#ifdef DESKTOP_VERSION
1892 config->setGroup("WidgetLayout"); 1893 config->setGroup("WidgetLayout");
1893 QStringList list ;//= config->readListEntry("MainLayout"); 1894 QStringList list ;//= config->readListEntry("MainLayout");
1894 int x,y,w,h; 1895 int x,y,w,h;
1895 QWidget* wid; 1896 QWidget* wid;
1896 wid = topLevelWidget(); 1897 wid = topLevelWidget();
1897 x = wid->geometry().x(); 1898 x = wid->geometry().x();
1898 y = wid->geometry().y(); 1899 y = wid->geometry().y();
1899 w = wid->width(); 1900 w = wid->width();
1900 h = wid->height(); 1901 h = wid->height();
1901 list.clear(); 1902 list.clear();
1902 list << QString::number( x ); 1903 list << QString::number( x );
1903 list << QString::number( y ); 1904 list << QString::number( y );
1904 list << QString::number( w ); 1905 list << QString::number( w );
1905 list << QString::number( h ); 1906 list << QString::number( h );
1906 config->writeEntry("MainLayout",list ); 1907 config->writeEntry("MainLayout",list );
1907 1908
1908 wid = mEventEditor; 1909 wid = mEventEditor;
1909 x = wid->geometry().x(); 1910 x = wid->geometry().x();
1910 y = wid->geometry().y(); 1911 y = wid->geometry().y();
1911 w = wid->width(); 1912 w = wid->width();
1912 h = wid->height(); 1913 h = wid->height();
1913 list.clear(); 1914 list.clear();
1914 list << QString::number( x ); 1915 list << QString::number( x );
1915 list << QString::number( y ); 1916 list << QString::number( y );
1916 list << QString::number( w ); 1917 list << QString::number( w );
1917 list << QString::number( h ); 1918 list << QString::number( h );
1918 config->writeEntry("EditEventLayout",list ); 1919 config->writeEntry("EditEventLayout",list );
1919 1920
1920 wid = mTodoEditor; 1921 wid = mTodoEditor;
1921 x = wid->geometry().x(); 1922 x = wid->geometry().x();
1922 y = wid->geometry().y(); 1923 y = wid->geometry().y();
1923 w = wid->width(); 1924 w = wid->width();
1924 h = wid->height(); 1925 h = wid->height();
1925 list.clear(); 1926 list.clear();
1926 list << QString::number( x ); 1927 list << QString::number( x );
1927 list << QString::number( y ); 1928 list << QString::number( y );
1928 list << QString::number( w ); 1929 list << QString::number( w );
1929 list << QString::number( h ); 1930 list << QString::number( h );
1930 config->writeEntry("EditTodoLayout",list ); 1931 config->writeEntry("EditTodoLayout",list );
1931 wid = getEventViewerDialog(); 1932 wid = getEventViewerDialog();
1932 x = wid->geometry().x(); 1933 x = wid->geometry().x();
1933 y = wid->geometry().y(); 1934 y = wid->geometry().y();
1934 w = wid->width(); 1935 w = wid->width();
1935 h = wid->height(); 1936 h = wid->height();
1936 list.clear(); 1937 list.clear();
1937 list << QString::number( x ); 1938 list << QString::number( x );
1938 list << QString::number( y ); 1939 list << QString::number( y );
1939 list << QString::number( w ); 1940 list << QString::number( w );
1940 list << QString::number( h ); 1941 list << QString::number( h );
1941 config->writeEntry("ViewerLayout",list ); 1942 config->writeEntry("ViewerLayout",list );
1942 wid = mDialogManager->getSearchDialog(); 1943 wid = mDialogManager->getSearchDialog();
1943 if ( wid ) { 1944 if ( wid ) {
1944 x = wid->geometry().x(); 1945 x = wid->geometry().x();
1945 y = wid->geometry().y(); 1946 y = wid->geometry().y();
1946 w = wid->width(); 1947 w = wid->width();
1947 h = wid->height(); 1948 h = wid->height();
1948 list.clear(); 1949 list.clear();
1949 list << QString::number( x ); 1950 list << QString::number( x );
1950 list << QString::number( y ); 1951 list << QString::number( y );
1951 list << QString::number( w ); 1952 list << QString::number( w );
1952 list << QString::number( h ); 1953 list << QString::number( h );
1953 config->writeEntry("SearchLayout",list ); 1954 config->writeEntry("SearchLayout",list );
1954 } 1955 }
1955#endif 1956#endif
1956 1957
1957 1958
1958 config->sync(); 1959 config->sync();
1959} 1960}
1960 1961
1961void CalendarView::readFilterSettings(KConfig *config) 1962void CalendarView::readFilterSettings(KConfig *config)
1962{ 1963{
1963 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 1964 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
1964 1965
1965 mFilters.clear(); 1966 mFilters.clear();
1966 1967
1967 config->setGroup("General"); 1968 config->setGroup("General");
1968 QStringList filterList = config->readListEntry("CalendarFilters"); 1969 QStringList filterList = config->readListEntry("CalendarFilters");
1969 1970
1970 QStringList::ConstIterator it = filterList.begin(); 1971 QStringList::ConstIterator it = filterList.begin();
1971 QStringList::ConstIterator end = filterList.end(); 1972 QStringList::ConstIterator end = filterList.end();
1972 while(it != end) { 1973 while(it != end) {
1973 // kdDebug() << " filter: " << (*it) << endl; 1974 // kdDebug() << " filter: " << (*it) << endl;
1974 1975
1975 CalFilter *filter; 1976 CalFilter *filter;
1976 filter = new CalFilter(*it); 1977 filter = new CalFilter(*it);
1977 config->setGroup("Filter_" + (*it)); 1978 config->setGroup("Filter_" + (*it));
1978 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 1979 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
1979 filter->setCriteria(config->readNumEntry("Criteria",0)); 1980 filter->setCriteria(config->readNumEntry("Criteria",0));
1980 filter->setCategoryList(config->readListEntry("CategoryList")); 1981 filter->setCategoryList(config->readListEntry("CategoryList"));
1981 mFilters.append(filter); 1982 mFilters.append(filter);
1982 1983
1983 ++it; 1984 ++it;
1984 } 1985 }
1985 1986
1986 if (mFilters.count() == 0) { 1987 if (mFilters.count() == 0) {
1987 CalFilter *filter = new CalFilter(i18n("Default")); 1988 CalFilter *filter = new CalFilter(i18n("Default"));
1988 mFilters.append(filter); 1989 mFilters.append(filter);
1989 } 1990 }
1990 mFilterView->updateFilters(); 1991 mFilterView->updateFilters();
1991 config->setGroup("FilterView"); 1992 config->setGroup("FilterView");
1992 1993
1993 mFilterView->blockSignals(true); 1994 mFilterView->blockSignals(true);
1994 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 1995 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
1995 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 1996 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
1996 mFilterView->blockSignals(false); 1997 mFilterView->blockSignals(false);
1997 // We do it manually to avoid it being done twice by the above calls 1998 // We do it manually to avoid it being done twice by the above calls
1998 updateFilter(); 1999 updateFilter();
1999} 2000}
2000 2001
2001void CalendarView::writeFilterSettings(KConfig *config) 2002void CalendarView::writeFilterSettings(KConfig *config)
2002{ 2003{
2003 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2004 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2004 2005
2005 QStringList filterList; 2006 QStringList filterList;
2006 2007
2007 CalFilter *filter = mFilters.first(); 2008 CalFilter *filter = mFilters.first();
2008 while(filter) { 2009 while(filter) {
2009 // kdDebug() << " fn: " << filter->name() << endl; 2010 // kdDebug() << " fn: " << filter->name() << endl;
2010 filterList << filter->name(); 2011 filterList << filter->name();
2011 config->setGroup("Filter_" + filter->name()); 2012 config->setGroup("Filter_" + filter->name());
2012 config->writeEntry("Criteria",filter->criteria()); 2013 config->writeEntry("Criteria",filter->criteria());
2013 config->writeEntry("CategoryList",filter->categoryList()); 2014 config->writeEntry("CategoryList",filter->categoryList());
2014 filter = mFilters.next(); 2015 filter = mFilters.next();
2015 } 2016 }
2016 config->setGroup("General"); 2017 config->setGroup("General");
2017 config->writeEntry("CalendarFilters",filterList); 2018 config->writeEntry("CalendarFilters",filterList);
2018 2019
2019 config->setGroup("FilterView"); 2020 config->setGroup("FilterView");
2020 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2021 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2021 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2022 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2022} 2023}
2023 2024
2024 2025
2025void CalendarView::goToday() 2026void CalendarView::goToday()
2026{ 2027{
2027 if ( mViewManager->currentView()->isMonthView() ) 2028 if ( mViewManager->currentView()->isMonthView() )
2028 mNavigator->selectTodayMonth(); 2029 mNavigator->selectTodayMonth();
2029 else 2030 else
2030 mNavigator->selectToday(); 2031 mNavigator->selectToday();
2031} 2032}
2032 2033
2033void CalendarView::goNext() 2034void CalendarView::goNext()
2034{ 2035{
2035 mNavigator->selectNext(); 2036 mNavigator->selectNext();
2036} 2037}
2037 2038
2038void CalendarView::goPrevious() 2039void CalendarView::goPrevious()
2039{ 2040{
2040 mNavigator->selectPrevious(); 2041 mNavigator->selectPrevious();
2041} 2042}
2042void CalendarView::goNextMonth() 2043void CalendarView::goNextMonth()
2043{ 2044{
2044 mNavigator->selectNextMonth(); 2045 mNavigator->selectNextMonth();
2045} 2046}
2046 2047
2047void CalendarView::goPreviousMonth() 2048void CalendarView::goPreviousMonth()
2048{ 2049{
2049 mNavigator->selectPreviousMonth(); 2050 mNavigator->selectPreviousMonth();
2050} 2051}
2051void CalendarView::writeLocale() 2052void CalendarView::writeLocale()
2052{ 2053{
2053 //KPimGlobalPrefs::instance()->setGlobalConfig(); 2054 //KPimGlobalPrefs::instance()->setGlobalConfig();
2054#if 0 2055#if 0
2055 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 2056 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
2056 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 2057 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
2057 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 2058 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
2058 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 2059 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
2059 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 2060 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
2060 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 2061 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
2061 dummy = KOPrefs::instance()->mUserDateFormatShort; 2062 dummy = KOPrefs::instance()->mUserDateFormatShort;
2062 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 2063 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
2063 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 2064 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
2064 KOPrefs::instance()->mDaylightsavingStart, 2065 KOPrefs::instance()->mDaylightsavingStart,
2065 KOPrefs::instance()->mDaylightsavingEnd ); 2066 KOPrefs::instance()->mDaylightsavingEnd );
2066 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); 2067 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
2067#endif 2068#endif
2068} 2069}
2069void CalendarView::updateConfig() 2070void CalendarView::updateConfig()
2070{ 2071{
2071 writeLocale(); 2072 writeLocale();
2072 if ( KOPrefs::instance()->mUseAppColors ) 2073 if ( KOPrefs::instance()->mUseAppColors )
2073 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2074 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2074 emit configChanged(); 2075 emit configChanged();
2075 mTodoList->updateConfig(); 2076 mTodoList->updateConfig();
2076 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2077 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2077 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2078 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2078 // To make the "fill window" configurations work 2079 // To make the "fill window" configurations work
2079 //mViewManager->raiseCurrentView(); 2080 //mViewManager->raiseCurrentView();
2080} 2081}
2081 2082
2082 2083
2083void CalendarView::eventChanged(Event *event) 2084void CalendarView::eventChanged(Event *event)
2084{ 2085{
2085 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2086 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2086 //updateUnmanagedViews(); 2087 //updateUnmanagedViews();
2087} 2088}
2088 2089
2089void CalendarView::eventAdded(Event *event) 2090void CalendarView::eventAdded(Event *event)
2090{ 2091{
2091 changeEventDisplay(event,KOGlobals::EVENTADDED); 2092 changeEventDisplay(event,KOGlobals::EVENTADDED);
2092} 2093}
2093 2094
2094void CalendarView::eventToBeDeleted(Event *) 2095void CalendarView::eventToBeDeleted(Event *)
2095{ 2096{
2096 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2097 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2097} 2098}
2098 2099
2099void CalendarView::eventDeleted() 2100void CalendarView::eventDeleted()
2100{ 2101{
2101 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2102 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2102} 2103}
2103void CalendarView::changeTodoDisplay(Todo *which, int action) 2104void CalendarView::changeTodoDisplay(Todo *which, int action)
2104{ 2105{
2105 changeIncidenceDisplay((Incidence *)which, action); 2106 changeIncidenceDisplay((Incidence *)which, action);
2106 mDateNavigator->updateView(); //LR 2107 mDateNavigator->updateView(); //LR
2107 //mDialogManager->updateSearchDialog(); 2108 //mDialogManager->updateSearchDialog();
2108 2109
2109 if (which) { 2110 if (which) {
2110 mViewManager->updateWNview(); 2111 mViewManager->updateWNview();
2111 //mTodoList->updateView(); 2112 //mTodoList->updateView();
2112 } 2113 }
2113 2114
2114} 2115}
2115 2116
2116void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2117void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2117{ 2118{
2118 updateUnmanagedViews(); 2119 updateUnmanagedViews();
2119 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2120 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2120 if ( action == KOGlobals::EVENTDELETED ) { //delete 2121 if ( action == KOGlobals::EVENTDELETED ) { //delete
2121 mCalendar->checkAlarmForIncidence( 0, true ); 2122 mCalendar->checkAlarmForIncidence( 0, true );
2122 if ( mEventViewerDialog ) 2123 if ( mEventViewerDialog )
2123 mEventViewerDialog->hide(); 2124 mEventViewerDialog->hide();
2124 } 2125 }
2125 else 2126 else
2126 mCalendar->checkAlarmForIncidence( which , false ); 2127 mCalendar->checkAlarmForIncidence( which , false );
2127} 2128}
2128 2129
2129// most of the changeEventDisplays() right now just call the view's 2130// most of the changeEventDisplays() right now just call the view's
2130// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2131// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2131void CalendarView::changeEventDisplay(Event *which, int action) 2132void CalendarView::changeEventDisplay(Event *which, int action)
2132{ 2133{
2133 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2134 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2134 changeIncidenceDisplay((Incidence *)which, action); 2135 changeIncidenceDisplay((Incidence *)which, action);
2135 mDateNavigator->updateView(); 2136 mDateNavigator->updateView();
2136 //mDialogManager->updateSearchDialog(); 2137 //mDialogManager->updateSearchDialog();
2137 2138
2138 if (which) { 2139 if (which) {
2139 // If there is an event view visible update the display 2140 // If there is an event view visible update the display
2140 mViewManager->currentView()->changeEventDisplay(which,action); 2141 mViewManager->currentView()->changeEventDisplay(which,action);
2141 // TODO: check, if update needed 2142 // TODO: check, if update needed
2142 // if (which->getTodoStatus()) { 2143 // if (which->getTodoStatus()) {
2143 mTodoList->updateView(); 2144 mTodoList->updateView();
2144 // } 2145 // }
2145 } else { 2146 } else {
2146 mViewManager->currentView()->updateView(); 2147 mViewManager->currentView()->updateView();
2147 } 2148 }
2148} 2149}
2149 2150
2150 2151
2151void CalendarView::updateTodoViews() 2152void CalendarView::updateTodoViews()
2152{ 2153{
2153 2154
2154 mTodoList->updateView(); 2155 mTodoList->updateView();
2155 mViewManager->currentView()->updateView(); 2156 mViewManager->currentView()->updateView();
2156 2157
2157} 2158}
2158 2159
2159 2160
2160void CalendarView::updateView(const QDate &start, const QDate &end) 2161void CalendarView::updateView(const QDate &start, const QDate &end)
2161{ 2162{
2162 mTodoList->updateView(); 2163 mTodoList->updateView();
2163 mViewManager->updateView(start, end); 2164 mViewManager->updateView(start, end);
2164 //mDateNavigator->updateView(); 2165 //mDateNavigator->updateView();
2165} 2166}
2166 2167
2167void CalendarView::updateView() 2168void CalendarView::updateView()
2168{ 2169{
2169 DateList tmpList = mNavigator->selectedDates(); 2170 DateList tmpList = mNavigator->selectedDates();
2170 2171
2171 // We assume that the navigator only selects consecutive days.
2172 updateView( tmpList.first(), tmpList.last() );
2173 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2172 if ( KOPrefs::instance()->mHideNonStartedTodos )
2174 mTodoList->updateView(); 2173 mTodoList->updateView();
2174 // We assume that the navigator only selects consecutive days.
2175 updateView( tmpList.first(), tmpList.last() );
2175} 2176}
2176 2177
2177void CalendarView::updateUnmanagedViews() 2178void CalendarView::updateUnmanagedViews()
2178{ 2179{
2179 mDateNavigator->updateDayMatrix(); 2180 mDateNavigator->updateDayMatrix();
2180} 2181}
2181 2182
2182int CalendarView::msgItemDelete() 2183int CalendarView::msgItemDelete()
2183{ 2184{
2184 return KMessageBox::warningContinueCancel(this, 2185 return KMessageBox::warningContinueCancel(this,
2185 i18n("This item will be\npermanently deleted."), 2186 i18n("This item will be\npermanently deleted."),
2186 i18n("KO/Pi Confirmation"),i18n("Delete")); 2187 i18n("KO/Pi Confirmation"),i18n("Delete"));
2187} 2188}
2188 2189
2189 2190
2190void CalendarView::edit_cut() 2191void CalendarView::edit_cut()
2191{ 2192{
2192 Event *anEvent=0; 2193 Event *anEvent=0;
2193 2194
2194 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2195 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2195 2196
2196 if (mViewManager->currentView()->isEventView()) { 2197 if (mViewManager->currentView()->isEventView()) {
2197 if ( incidence && incidence->type() == "Event" ) { 2198 if ( incidence && incidence->type() == "Event" ) {
2198 anEvent = static_cast<Event *>(incidence); 2199 anEvent = static_cast<Event *>(incidence);
2199 } 2200 }
2200 } 2201 }
2201 2202
2202 if (!anEvent) { 2203 if (!anEvent) {
2203 KNotifyClient::beep(); 2204 KNotifyClient::beep();
2204 return; 2205 return;
2205 } 2206 }
2206 DndFactory factory( mCalendar ); 2207 DndFactory factory( mCalendar );
2207 factory.cutEvent(anEvent); 2208 factory.cutEvent(anEvent);
2208 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2209 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2209} 2210}
2210 2211
2211void CalendarView::edit_copy() 2212void CalendarView::edit_copy()
2212{ 2213{
2213 Event *anEvent=0; 2214 Event *anEvent=0;
2214 2215
2215 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2216 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2216 2217
2217 if (mViewManager->currentView()->isEventView()) { 2218 if (mViewManager->currentView()->isEventView()) {
2218 if ( incidence && incidence->type() == "Event" ) { 2219 if ( incidence && incidence->type() == "Event" ) {
2219 anEvent = static_cast<Event *>(incidence); 2220 anEvent = static_cast<Event *>(incidence);
2220 } 2221 }
2221 } 2222 }
2222 2223
2223 if (!anEvent) { 2224 if (!anEvent) {
2224 KNotifyClient::beep(); 2225 KNotifyClient::beep();
2225 return; 2226 return;
2226 } 2227 }
2227 DndFactory factory( mCalendar ); 2228 DndFactory factory( mCalendar );
2228 factory.copyEvent(anEvent); 2229 factory.copyEvent(anEvent);
2229} 2230}
2230 2231
2231void CalendarView::edit_paste() 2232void CalendarView::edit_paste()
2232{ 2233{
2233 QDate date = mNavigator->selectedDates().first(); 2234 QDate date = mNavigator->selectedDates().first();
2234 2235
2235 DndFactory factory( mCalendar ); 2236 DndFactory factory( mCalendar );
2236 Event *pastedEvent = factory.pasteEvent( date ); 2237 Event *pastedEvent = factory.pasteEvent( date );
2237 2238
2238 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2239 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2239} 2240}
2240 2241
2241void CalendarView::edit_options() 2242void CalendarView::edit_options()
2242{ 2243{
2243 mDialogManager->showOptionsDialog(); 2244 mDialogManager->showOptionsDialog();
2244 //writeSettings(); 2245 //writeSettings();
2245} 2246}
2246 2247
2247 2248
2248void CalendarView::slotSelectPickerDate( QDate d) 2249void CalendarView::slotSelectPickerDate( QDate d)
2249{ 2250{
2250 mDateFrame->hide(); 2251 mDateFrame->hide();
2251 if ( mDatePickerMode == 1 ) { 2252 if ( mDatePickerMode == 1 ) {
2252 mNavigator->slotDaySelect( d ); 2253 mNavigator->slotDaySelect( d );
2253 } else if ( mDatePickerMode == 2 ) { 2254 } else if ( mDatePickerMode == 2 ) {
2254 if ( mMoveIncidence->type() == "Todo" ) { 2255 if ( mMoveIncidence->type() == "Todo" ) {
2255 Todo * to = (Todo *) mMoveIncidence; 2256 Todo * to = (Todo *) mMoveIncidence;
2256 QTime tim; 2257 QTime tim;
2257 if ( to->hasDueDate() ) 2258 if ( to->hasDueDate() )
2258 tim = to->dtDue().time(); 2259 tim = to->dtDue().time();
2259 else { 2260 else {
2260 tim = QTime ( 0,0,0 ); 2261 tim = QTime ( 0,0,0 );
2261 to->setFloats( true ); 2262 to->setFloats( true );
2262 to->setHasDueDate( true ); 2263 to->setHasDueDate( true );
2263 } 2264 }
2264 QDateTime dt ( d,tim ); 2265 QDateTime dt ( d,tim );
2265 to->setDtDue( dt ); 2266 to->setDtDue( dt );
2266 todoChanged( to ); 2267 todoChanged( to );
2267 } else { 2268 } else {
2268 if ( mMoveIncidence->doesRecur() ) { 2269 if ( mMoveIncidence->doesRecur() ) {
2269#if 0 2270#if 0
2270 // PENDING implement this 2271 // PENDING implement this
2271 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2272 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2272 mCalendar()->addIncidence( newInc ); 2273 mCalendar()->addIncidence( newInc );
2273 if ( mMoveIncidence->type() == "Todo" ) 2274 if ( mMoveIncidence->type() == "Todo" )
2274 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2275 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2275 else 2276 else
2276 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2277 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2277 mMoveIncidence = newInc; 2278 mMoveIncidence = newInc;
2278 2279
2279#endif 2280#endif
2280 } 2281 }
2281 QTime tim = mMoveIncidence->dtStart().time(); 2282 QTime tim = mMoveIncidence->dtStart().time();
2282 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2283 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2283 QDateTime dt ( d,tim ); 2284 QDateTime dt ( d,tim );
2284 mMoveIncidence->setDtStart( dt ); 2285 mMoveIncidence->setDtStart( dt );
2285 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2286 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2286 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2287 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2287 } 2288 }
2288 2289
2289 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2290 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2290 } 2291 }
2291} 2292}
2292 2293
2293void CalendarView::removeCategories() 2294void CalendarView::removeCategories()
2294{ 2295{
2295 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2296 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2296 QStringList catList = KOPrefs::instance()->mCustomCategories; 2297 QStringList catList = KOPrefs::instance()->mCustomCategories;
2297 QStringList catIncList; 2298 QStringList catIncList;
2298 QStringList newCatList; 2299 QStringList newCatList;
2299 Incidence* inc = incList.first(); 2300 Incidence* inc = incList.first();
2300 int i; 2301 int i;
2301 int count = 0; 2302 int count = 0;
2302 while ( inc ) { 2303 while ( inc ) {
2303 newCatList.clear(); 2304 newCatList.clear();
2304 catIncList = inc->categories() ; 2305 catIncList = inc->categories() ;
2305 for( i = 0; i< catIncList.count(); ++i ) { 2306 for( i = 0; i< catIncList.count(); ++i ) {
2306 if ( catList.contains (catIncList[i])) 2307 if ( catList.contains (catIncList[i]))
2307 newCatList.append( catIncList[i] ); 2308 newCatList.append( catIncList[i] );
2308 } 2309 }
2309 newCatList.sort(); 2310 newCatList.sort();
2310 inc->setCategories( newCatList.join(",") ); 2311 inc->setCategories( newCatList.join(",") );
2311 inc = incList.next(); 2312 inc = incList.next();
2312 } 2313 }
2313} 2314}
2314 2315
2315int CalendarView::addCategories() 2316int CalendarView::addCategories()
2316{ 2317{
2317 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2318 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2318 QStringList catList = KOPrefs::instance()->mCustomCategories; 2319 QStringList catList = KOPrefs::instance()->mCustomCategories;
2319 QStringList catIncList; 2320 QStringList catIncList;
2320 Incidence* inc = incList.first(); 2321 Incidence* inc = incList.first();
2321 int i; 2322 int i;
2322 int count = 0; 2323 int count = 0;
2323 while ( inc ) { 2324 while ( inc ) {
2324 catIncList = inc->categories() ; 2325 catIncList = inc->categories() ;
2325 for( i = 0; i< catIncList.count(); ++i ) { 2326 for( i = 0; i< catIncList.count(); ++i ) {
2326 if ( !catList.contains (catIncList[i])) { 2327 if ( !catList.contains (catIncList[i])) {
2327 catList.append( catIncList[i] ); 2328 catList.append( catIncList[i] );
2328 //qDebug("add cat %s ", catIncList[i].latin1()); 2329 //qDebug("add cat %s ", catIncList[i].latin1());
2329 ++count; 2330 ++count;
2330 } 2331 }
2331 } 2332 }
2332 inc = incList.next(); 2333 inc = incList.next();
2333 } 2334 }
2334 catList.sort(); 2335 catList.sort();
2335 KOPrefs::instance()->mCustomCategories = catList; 2336 KOPrefs::instance()->mCustomCategories = catList;
2336 return count; 2337 return count;
2337} 2338}
2338 2339
2339void CalendarView::manageCategories() 2340void CalendarView::manageCategories()
2340{ 2341{
2341 KOCatPrefs* cp = new KOCatPrefs(); 2342 KOCatPrefs* cp = new KOCatPrefs();
2342 cp->show(); 2343 cp->show();
2343 int w =cp->sizeHint().width() ; 2344 int w =cp->sizeHint().width() ;
2344 int h = cp->sizeHint().height() ; 2345 int h = cp->sizeHint().height() ;
2345 int dw = QApplication::desktop()->width(); 2346 int dw = QApplication::desktop()->width();
2346 int dh = QApplication::desktop()->height(); 2347 int dh = QApplication::desktop()->height();
2347 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2348 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2348 if ( !cp->exec() ) { 2349 if ( !cp->exec() ) {
2349 delete cp; 2350 delete cp;
2350 return; 2351 return;
2351 } 2352 }
2352 int count = 0; 2353 int count = 0;
2353 if ( cp->addCat() ) { 2354 if ( cp->addCat() ) {
2354 count = addCategories(); 2355 count = addCategories();
2355 if ( count ) { 2356 if ( count ) {
2356 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2357 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2357 writeSettings(); 2358 writeSettings();
2358 } else 2359 } else
2359 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2360 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2360 } else { 2361 } else {
2361 removeCategories(); 2362 removeCategories();
2362 updateView(); 2363 updateView();
2363 } 2364 }
2364 delete cp; 2365 delete cp;
2365} 2366}
2366 2367
2367void CalendarView::beamIncidence(Incidence * Inc) 2368void CalendarView::beamIncidence(Incidence * Inc)
2368{ 2369{
2369 QPtrList<Incidence> delSel ; 2370 QPtrList<Incidence> delSel ;
2370 delSel.append(Inc); 2371 delSel.append(Inc);
2371 beamIncidenceList( delSel ); 2372 beamIncidenceList( delSel );
2372} 2373}
2373void CalendarView::beamCalendar() 2374void CalendarView::beamCalendar()
2374{ 2375{
2375 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2376 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2376 //qDebug("beamCalendar() "); 2377 //qDebug("beamCalendar() ");
2377 beamIncidenceList( delSel ); 2378 beamIncidenceList( delSel );
2378} 2379}
2379void CalendarView::beamFilteredCalendar() 2380void CalendarView::beamFilteredCalendar()
2380{ 2381{
2381 QPtrList<Incidence> delSel = mCalendar->incidences(); 2382 QPtrList<Incidence> delSel = mCalendar->incidences();
2382 //qDebug("beamFilteredCalendar() "); 2383 //qDebug("beamFilteredCalendar() ");
2383 beamIncidenceList( delSel ); 2384 beamIncidenceList( delSel );
2384} 2385}
2385void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2386void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2386{ 2387{
2387 if ( beamDialog->exec () == QDialog::Rejected ) 2388 if ( beamDialog->exec () == QDialog::Rejected )
2388 return; 2389 return;
2389#ifdef DESKTOP_VERSION 2390#ifdef DESKTOP_VERSION
2390 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2391 QString fn = locateLocal( "tmp", "kopibeamfile" );
2391#else 2392#else
2392 QString fn = "/tmp/kopibeamfile"; 2393 QString fn = "/tmp/kopibeamfile";
2393#endif 2394#endif
2394 QString mes; 2395 QString mes;
2395 bool createbup = true; 2396 bool createbup = true;
2396 if ( createbup ) { 2397 if ( createbup ) {
2397 QString description = "\n"; 2398 QString description = "\n";
2398 CalendarLocal* cal = new CalendarLocal(); 2399 CalendarLocal* cal = new CalendarLocal();
2399 if ( beamDialog->beamLocal() ) 2400 if ( beamDialog->beamLocal() )
2400 cal->setLocalTime(); 2401 cal->setLocalTime();
2401 else 2402 else
2402 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2403 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2403 Incidence *incidence = delSel.first(); 2404 Incidence *incidence = delSel.first();
2404 bool addText = false; 2405 bool addText = false;
2405 if ( delSel.count() < 10 ) 2406 if ( delSel.count() < 10 )
2406 addText = true; 2407 addText = true;
2407 else { 2408 else {
2408 description.sprintf(i18n(" %d items?"),delSel.count() ); 2409 description.sprintf(i18n(" %d items?"),delSel.count() );
2409 } 2410 }
2410 while ( incidence ) { 2411 while ( incidence ) {
2411 Incidence *in = incidence->clone(); 2412 Incidence *in = incidence->clone();
2412 if ( ! in->summary().isEmpty() ) { 2413 if ( ! in->summary().isEmpty() ) {
2413 in->setDescription(""); 2414 in->setDescription("");
2414 } else { 2415 } else {
2415 in->setSummary( in->description().left(20)); 2416 in->setSummary( in->description().left(20));
2416 in->setDescription(""); 2417 in->setDescription("");
2417 } 2418 }
2418 if ( addText ) 2419 if ( addText )
2419 description += in->summary() + "\n"; 2420 description += in->summary() + "\n";
2420 cal->addIncidence( in ); 2421 cal->addIncidence( in );
2421 incidence = delSel.next(); 2422 incidence = delSel.next();
2422 } 2423 }
2423 if ( beamDialog->beamVcal() ) { 2424 if ( beamDialog->beamVcal() ) {
2424 fn += ".vcs"; 2425 fn += ".vcs";
2425 FileStorage storage( cal, fn, new VCalFormat ); 2426 FileStorage storage( cal, fn, new VCalFormat );
2426 storage.save(); 2427 storage.save();
2427 } else { 2428 } else {
2428 fn += ".ics"; 2429 fn += ".ics";
2429 FileStorage storage( cal, fn, new ICalFormat( ) ); 2430 FileStorage storage( cal, fn, new ICalFormat( ) );
2430 storage.save(); 2431 storage.save();
2431 } 2432 }
2432 delete cal; 2433 delete cal;
2433 mes = i18n("KO/Pi: Ready for beaming"); 2434 mes = i18n("KO/Pi: Ready for beaming");
2434 topLevelWidget()->setCaption(mes); 2435 topLevelWidget()->setCaption(mes);
2435 KApplication::convert2latin1( fn ); 2436 KApplication::convert2latin1( fn );
2436#ifndef DESKTOP_VERSION 2437#ifndef DESKTOP_VERSION
2437 Ir *ir = new Ir( this ); 2438 Ir *ir = new Ir( this );
2438 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2439 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2439 ir->send( fn, description, "text/x-vCalendar" ); 2440 ir->send( fn, description, "text/x-vCalendar" );
2440#endif 2441#endif
2441 } 2442 }
2442} 2443}
2443void CalendarView::beamDone( Ir *ir ) 2444void CalendarView::beamDone( Ir *ir )
2444{ 2445{
2445#ifndef DESKTOP_VERSION 2446#ifndef DESKTOP_VERSION
2446 delete ir; 2447 delete ir;
2447#endif 2448#endif
2448 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2449 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2449 topLevelWidget()->raise(); 2450 topLevelWidget()->raise();
2450} 2451}
2451 2452
2452void CalendarView::moveIncidence(Incidence * inc ) 2453void CalendarView::moveIncidence(Incidence * inc )
2453{ 2454{
2454 if ( !inc ) return; 2455 if ( !inc ) return;
2455 // qDebug("showDatePickerForIncidence( ) "); 2456 // qDebug("showDatePickerForIncidence( ) ");
2456 if ( mDateFrame->isVisible() ) 2457 if ( mDateFrame->isVisible() )
2457 mDateFrame->hide(); 2458 mDateFrame->hide();
2458 else { 2459 else {
2459 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; 2460 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2460 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; 2461 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2461 int dw = QApplication::desktop()->width(); 2462 int dw = QApplication::desktop()->width();
2462 int dh = QApplication::desktop()->height(); 2463 int dh = QApplication::desktop()->height();
2463 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2464 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2464 mDateFrame->show(); 2465 mDateFrame->show();
2465 } 2466 }
2466 mDatePickerMode = 2; 2467 mDatePickerMode = 2;
2467 mMoveIncidence = inc ; 2468 mMoveIncidence = inc ;
2468 QDate da; 2469 QDate da;
2469 if ( mMoveIncidence->type() == "Todo" ) { 2470 if ( mMoveIncidence->type() == "Todo" ) {
2470 Todo * to = (Todo *) mMoveIncidence; 2471 Todo * to = (Todo *) mMoveIncidence;
2471 if ( to->hasDueDate() ) 2472 if ( to->hasDueDate() )
2472 da = to->dtDue().date(); 2473 da = to->dtDue().date();
2473 else 2474 else
2474 da = QDate::currentDate(); 2475 da = QDate::currentDate();
2475 } else { 2476 } else {
2476 da = mMoveIncidence->dtStart().date(); 2477 da = mMoveIncidence->dtStart().date();
2477 } 2478 }
2478 //PENDING set date for recurring incidence to date of recurrence 2479 //PENDING set date for recurring incidence to date of recurrence
2479 //mMoveIncidenceOldDate; 2480 //mMoveIncidenceOldDate;
2480 mDatePicker->setDate( da ); 2481 mDatePicker->setDate( da );
2481} 2482}
2482void CalendarView::showDatePicker( ) 2483void CalendarView::showDatePicker( )
2483{ 2484{
2484 //qDebug("CalendarView::showDatePicker( ) "); 2485 //qDebug("CalendarView::showDatePicker( ) ");
2485 if ( mDateFrame->isVisible() ) 2486 if ( mDateFrame->isVisible() )
2486 mDateFrame->hide(); 2487 mDateFrame->hide();
2487 else { 2488 else {
2488 int w =mDatePicker->sizeHint().width() ; 2489 int w =mDatePicker->sizeHint().width() ;
2489 int h = mDatePicker->sizeHint().height() ; 2490 int h = mDatePicker->sizeHint().height() ;
2490 int dw = QApplication::desktop()->width(); 2491 int dw = QApplication::desktop()->width();
2491 int dh = QApplication::desktop()->height(); 2492 int dh = QApplication::desktop()->height();
2492 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2493 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2493 mDateFrame->show(); 2494 mDateFrame->show();
2494 } 2495 }
2495 mDatePickerMode = 1; 2496 mDatePickerMode = 1;
2496 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2497 mDatePicker->setDate( mNavigator->selectedDates().first() );
2497} 2498}
2498 2499
2499void CalendarView::showEventEditor() 2500void CalendarView::showEventEditor()
2500{ 2501{
2501#ifdef DESKTOP_VERSION 2502#ifdef DESKTOP_VERSION
2502 mEventEditor->show(); 2503 mEventEditor->show();
2503#else 2504#else
2504 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 2505 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
2505 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2506 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2506 qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 2507 qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
2507 delete mEventEditor; 2508 delete mEventEditor;
2508 mEventEditor = mDialogManager->getEventEditor(); 2509 mEventEditor = mDialogManager->getEventEditor();
2509 } 2510 }
2510 mEventEditor->showMaximized(); 2511 mEventEditor->showMaximized();
2511 topLevelWidget()->setCaption( i18n("") ); 2512 topLevelWidget()->setCaption( i18n("") );
2512#endif 2513#endif
2513} 2514}
2514void CalendarView::showTodoEditor() 2515void CalendarView::showTodoEditor()
2515{ 2516{
2516#ifdef DESKTOP_VERSION 2517#ifdef DESKTOP_VERSION
2517 mTodoEditor->show(); 2518 mTodoEditor->show();
2518#else 2519#else
2519 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 2520 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
2520 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2521 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2521 qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 2522 qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
2522 delete mTodoEditor; 2523 delete mTodoEditor;
2523 mTodoEditor = mDialogManager->getTodoEditor(); 2524 mTodoEditor = mDialogManager->getTodoEditor();
2524 } 2525 }
2525 mTodoEditor->showMaximized(); 2526 mTodoEditor->showMaximized();
2526 topLevelWidget()->setCaption( i18n("") ); 2527 topLevelWidget()->setCaption( i18n("") );
2527#endif 2528#endif
2528} 2529}
2529 2530
2530void CalendarView::cloneIncidence() 2531void CalendarView::cloneIncidence()
2531{ 2532{
2532 Incidence *incidence = currentSelection(); 2533 Incidence *incidence = currentSelection();
2533 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2534 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2534 if ( incidence ) { 2535 if ( incidence ) {
2535 cloneIncidence(incidence); 2536 cloneIncidence(incidence);
2536 } 2537 }
2537} 2538}
2538void CalendarView::moveIncidence() 2539void CalendarView::moveIncidence()
2539{ 2540{
2540 Incidence *incidence = currentSelection(); 2541 Incidence *incidence = currentSelection();
2541 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2542 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2542 if ( incidence ) { 2543 if ( incidence ) {
2543 moveIncidence(incidence); 2544 moveIncidence(incidence);
2544 } 2545 }
2545} 2546}
2546void CalendarView::beamIncidence() 2547void CalendarView::beamIncidence()
2547{ 2548{
2548 Incidence *incidence = currentSelection(); 2549 Incidence *incidence = currentSelection();
2549 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2550 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2550 if ( incidence ) { 2551 if ( incidence ) {
2551 beamIncidence(incidence); 2552 beamIncidence(incidence);
2552 } 2553 }
2553} 2554}
2554void CalendarView::toggleCancelIncidence() 2555void CalendarView::toggleCancelIncidence()
2555{ 2556{
2556 Incidence *incidence = currentSelection(); 2557 Incidence *incidence = currentSelection();
2557 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2558 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2558 if ( incidence ) { 2559 if ( incidence ) {
2559 cancelIncidence(incidence); 2560 cancelIncidence(incidence);
2560 } 2561 }
2561} 2562}
2562 2563
2563 2564
2564void CalendarView::cancelIncidence(Incidence * inc ) 2565void CalendarView::cancelIncidence(Incidence * inc )
2565{ 2566{
2566 inc->setCancelled( ! inc->cancelled() ); 2567 inc->setCancelled( ! inc->cancelled() );
2567 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2568 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2568 updateView(); 2569 updateView();
2569} 2570}
2570void CalendarView::cloneIncidence(Incidence * orgInc ) 2571void CalendarView::cloneIncidence(Incidence * orgInc )
2571{ 2572{
2572 Incidence * newInc = orgInc->clone(); 2573 Incidence * newInc = orgInc->clone();
2573 newInc->recreate(); 2574 newInc->recreate();
2574 2575
2575 if ( newInc->type() == "Todo" ) { 2576 if ( newInc->type() == "Todo" ) {
2576 Todo* t = (Todo*) newInc; 2577 Todo* t = (Todo*) newInc;
2577 showTodoEditor(); 2578 showTodoEditor();
2578 mTodoEditor->editTodo( t ); 2579 mTodoEditor->editTodo( t );
2579 if ( mTodoEditor->exec() ) { 2580 if ( mTodoEditor->exec() ) {
2580 mCalendar->addTodo( t ); 2581 mCalendar->addTodo( t );
2581 updateView(); 2582 updateView();
2582 } else { 2583 } else {
2583 delete t; 2584 delete t;
2584 } 2585 }
2585 } 2586 }
2586 else { 2587 else {
2587 Event* e = (Event*) newInc; 2588 Event* e = (Event*) newInc;
2588 showEventEditor(); 2589 showEventEditor();
2589 mEventEditor->editEvent( e ); 2590 mEventEditor->editEvent( e );
2590 if ( mEventEditor->exec() ) { 2591 if ( mEventEditor->exec() ) {
2591 mCalendar->addEvent( e ); 2592 mCalendar->addEvent( e );
2592 updateView(); 2593 updateView();
2593 } else { 2594 } else {
2594 delete e; 2595 delete e;
2595 } 2596 }
2596 } 2597 }
2597} 2598}
2598 2599
2599void CalendarView::newEvent() 2600void CalendarView::newEvent()
2600{ 2601{
2601 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2602 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2602 KOAgendaView *aView = mViewManager->agendaView(); 2603 KOAgendaView *aView = mViewManager->agendaView();
2603 if (aView) { 2604 if (aView) {
2604 if (aView->selectionStart().isValid()) { 2605 if (aView->selectionStart().isValid()) {
2605 if (aView->selectedIsAllDay()) { 2606 if (aView->selectedIsAllDay()) {
2606 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 2607 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
2607 } else { 2608 } else {
2608 newEvent(aView->selectionStart(),aView->selectionEnd()); 2609 newEvent(aView->selectionStart(),aView->selectionEnd());
2609 } 2610 }
2610 return; 2611 return;
2611 } 2612 }
2612 } 2613 }
2613 2614
2614 QDate date = mNavigator->selectedDates().first(); 2615 QDate date = mNavigator->selectedDates().first();
2615 QDateTime current = QDateTime::currentDateTime(); 2616 QDateTime current = QDateTime::currentDateTime();
2616 if ( date <= current.date() ) { 2617 if ( date <= current.date() ) {
2617 int hour = current.time().hour() +1; 2618 int hour = current.time().hour() +1;
2618 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2619 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2619 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2620 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2620 } else 2621 } else
2621 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2622 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2622 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2623 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2623 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2624 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2624} 2625}
2625 2626
2626void CalendarView::newEvent(QDateTime fh) 2627void CalendarView::newEvent(QDateTime fh)
2627{ 2628{
2628 newEvent(fh, 2629 newEvent(fh,
2629 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2630 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2630} 2631}
2631 2632
2632void CalendarView::newEvent(QDate dt) 2633void CalendarView::newEvent(QDate dt)
2633{ 2634{
2634 newEvent(QDateTime(dt, QTime(0,0,0)), 2635 newEvent(QDateTime(dt, QTime(0,0,0)),
2635 QDateTime(dt, QTime(0,0,0)), true); 2636 QDateTime(dt, QTime(0,0,0)), true);
2636} 2637}
2637 2638
2638void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2639void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2639{ 2640{
2640 2641
2641 showEventEditor(); 2642 showEventEditor();
2642 mEventEditor->newEvent(fromHint,toHint,allDay); 2643 mEventEditor->newEvent(fromHint,toHint,allDay);
2643 if ( mFilterView->filtersEnabled() ) { 2644 if ( mFilterView->filtersEnabled() ) {
2644 CalFilter *filter = mFilterView->selectedFilter(); 2645 CalFilter *filter = mFilterView->selectedFilter();
2645 if (filter && filter->showCategories()) { 2646 if (filter && filter->showCategories()) {
2646 mEventEditor->setCategories(filter->categoryList().join(",") ); 2647 mEventEditor->setCategories(filter->categoryList().join(",") );
2647 } 2648 }
2648 if ( filter ) 2649 if ( filter )
2649 mEventEditor->setSecrecy( filter->getSecrecy() ); 2650 mEventEditor->setSecrecy( filter->getSecrecy() );
2650 } 2651 }
2651} 2652}
2652void CalendarView::todoAdded(Todo * t) 2653void CalendarView::todoAdded(Todo * t)
2653{ 2654{
2654 2655
2655 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2656 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2656 updateTodoViews(); 2657 updateTodoViews();
2657} 2658}
2658void CalendarView::todoChanged(Todo * t) 2659void CalendarView::todoChanged(Todo * t)
2659{ 2660{
2660 emit todoModified( t, 4 ); 2661 emit todoModified( t, 4 );
2661 // updateTodoViews(); 2662 // updateTodoViews();
2662} 2663}
2663void CalendarView::todoToBeDeleted(Todo *) 2664void CalendarView::todoToBeDeleted(Todo *)
2664{ 2665{
2665 //qDebug("todoToBeDeleted(Todo *) "); 2666 //qDebug("todoToBeDeleted(Todo *) ");
2666 updateTodoViews(); 2667 updateTodoViews();
2667} 2668}
2668void CalendarView::todoDeleted() 2669void CalendarView::todoDeleted()
2669{ 2670{
2670 //qDebug(" todoDeleted()"); 2671 //qDebug(" todoDeleted()");
2671 updateTodoViews(); 2672 updateTodoViews();
2672} 2673}
2673 2674
2674 2675
2675 2676
2676void CalendarView::newTodo() 2677void CalendarView::newTodo()
2677{ 2678{
2678 2679
2679 showTodoEditor(); 2680 showTodoEditor();
2680 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); 2681 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true);
2681 if ( mFilterView->filtersEnabled() ) { 2682 if ( mFilterView->filtersEnabled() ) {
2682 CalFilter *filter = mFilterView->selectedFilter(); 2683 CalFilter *filter = mFilterView->selectedFilter();
2683 if (filter && filter->showCategories()) { 2684 if (filter && filter->showCategories()) {
2684 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2685 mTodoEditor->setCategories(filter->categoryList().join(",") );
2685 } 2686 }
2686 if ( filter ) 2687 if ( filter )
2687 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2688 mTodoEditor->setSecrecy( filter->getSecrecy() );
2688 } 2689 }
2689} 2690}
2690 2691
2691void CalendarView::newSubTodo() 2692void CalendarView::newSubTodo()
2692{ 2693{
2693 Todo *todo = selectedTodo(); 2694 Todo *todo = selectedTodo();
2694 if ( todo ) newSubTodo( todo ); 2695 if ( todo ) newSubTodo( todo );
2695} 2696}
2696 2697
2697void CalendarView::newSubTodo(Todo *parentEvent) 2698void CalendarView::newSubTodo(Todo *parentEvent)
2698{ 2699{
2699 2700
2700 showTodoEditor(); 2701 showTodoEditor();
2701 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); 2702 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2702} 2703}
2703 2704
2704void CalendarView::newFloatingEvent() 2705void CalendarView::newFloatingEvent()
2705{ 2706{
2706 DateList tmpList = mNavigator->selectedDates(); 2707 DateList tmpList = mNavigator->selectedDates();
2707 QDate date = tmpList.first(); 2708 QDate date = tmpList.first();
2708 2709
2709 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2710 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2710 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2711 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2711} 2712}
2712 2713
2713 2714
2714void CalendarView::editEvent( Event *event ) 2715void CalendarView::editEvent( Event *event )
2715{ 2716{
2716 2717
2717 if ( !event ) return; 2718 if ( !event ) return;
2718 if ( event->isReadOnly() ) { 2719 if ( event->isReadOnly() ) {
2719 showEvent( event ); 2720 showEvent( event );
2720 return; 2721 return;
2721 } 2722 }
2722 showEventEditor(); 2723 showEventEditor();
2723 mEventEditor->editEvent( event , mFlagEditDescription); 2724 mEventEditor->editEvent( event , mFlagEditDescription);
2724} 2725}
2725void CalendarView::editJournal( Journal *jour ) 2726void CalendarView::editJournal( Journal *jour )
2726{ 2727{
2727 if ( !jour ) return; 2728 if ( !jour ) return;
2728 mDialogManager->hideSearchDialog(); 2729 mDialogManager->hideSearchDialog();
2729 mViewManager->showJournalView(); 2730 mViewManager->showJournalView();
2730 mNavigator->slotDaySelect( jour->dtStart().date() ); 2731 mNavigator->slotDaySelect( jour->dtStart().date() );
2731} 2732}
2732void CalendarView::editTodo( Todo *todo ) 2733void CalendarView::editTodo( Todo *todo )
2733{ 2734{
2734 if ( !todo ) return; 2735 if ( !todo ) return;
2735 2736
2736 if ( todo->isReadOnly() ) { 2737 if ( todo->isReadOnly() ) {
2737 showTodo( todo ); 2738 showTodo( todo );
2738 return; 2739 return;
2739 } 2740 }
2740 showTodoEditor(); 2741 showTodoEditor();
2741 mTodoEditor->editTodo( todo ,mFlagEditDescription); 2742 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2742 2743
2743} 2744}
2744 2745
2745KOEventViewerDialog* CalendarView::getEventViewerDialog() 2746KOEventViewerDialog* CalendarView::getEventViewerDialog()
2746{ 2747{
2747 if ( !mEventViewerDialog ) { 2748 if ( !mEventViewerDialog ) {
2748 mEventViewerDialog = new KOEventViewerDialog(this); 2749 mEventViewerDialog = new KOEventViewerDialog(this);
2749 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2750 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2750 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2751 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2751 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2752 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2752 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2753 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2753 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2754 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2754 viewManager(), SLOT( showAgendaView( bool ) ) ); 2755 viewManager(), SLOT( showAgendaView( bool ) ) );
2755 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 2756 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
2756 this, SLOT( todoChanged(Todo *) ) ); 2757 this, SLOT( todoChanged(Todo *) ) );
2757 mEventViewerDialog->resize( 640, 480 ); 2758 mEventViewerDialog->resize( 640, 480 );
2758 2759
2759 } 2760 }
2760 return mEventViewerDialog; 2761 return mEventViewerDialog;
2761} 2762}
2762void CalendarView::showEvent(Event *event) 2763void CalendarView::showEvent(Event *event)
2763{ 2764{
2764 getEventViewerDialog()->setEvent(event); 2765 getEventViewerDialog()->setEvent(event);
2765 getEventViewerDialog()->showMe(); 2766 getEventViewerDialog()->showMe();
2766} 2767}
2767 2768
2768void CalendarView::showTodo(Todo *event) 2769void CalendarView::showTodo(Todo *event)
2769{ 2770{
2770 getEventViewerDialog()->setTodo(event); 2771 getEventViewerDialog()->setTodo(event);
2771 getEventViewerDialog()->showMe(); 2772 getEventViewerDialog()->showMe();
2772} 2773}
2773void CalendarView::showJournal( Journal *jour ) 2774void CalendarView::showJournal( Journal *jour )
2774{ 2775{
2775 getEventViewerDialog()->setJournal(jour); 2776 getEventViewerDialog()->setJournal(jour);
2776 getEventViewerDialog()->showMe(); 2777 getEventViewerDialog()->showMe();
2777 2778
2778} 2779}
2779// void CalendarView::todoModified (Todo *event, int changed) 2780// void CalendarView::todoModified (Todo *event, int changed)
2780// { 2781// {
2781// // if (mDialogList.find (event) != mDialogList.end ()) { 2782// // if (mDialogList.find (event) != mDialogList.end ()) {
2782// // kdDebug() << "Todo modified and open" << endl; 2783// // kdDebug() << "Todo modified and open" << endl;
2783// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 2784// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
2784// // temp->modified (changed); 2785// // temp->modified (changed);
2785 2786
2786// // } 2787// // }
2787 2788
2788// mViewManager->updateView(); 2789// mViewManager->updateView();
2789// } 2790// }
2790 2791
2791void CalendarView::appointment_show() 2792void CalendarView::appointment_show()
2792{ 2793{
2793 Event *anEvent = 0; 2794 Event *anEvent = 0;
2794 2795
2795 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2796 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2796 2797
2797 if (mViewManager->currentView()->isEventView()) { 2798 if (mViewManager->currentView()->isEventView()) {
2798 if ( incidence && incidence->type() == "Event" ) { 2799 if ( incidence && incidence->type() == "Event" ) {
2799 anEvent = static_cast<Event *>(incidence); 2800 anEvent = static_cast<Event *>(incidence);
2800 } 2801 }
2801 } 2802 }
2802 2803
2803 if (!anEvent) { 2804 if (!anEvent) {
2804 KNotifyClient::beep(); 2805 KNotifyClient::beep();
2805 return; 2806 return;
2806 } 2807 }
2807 2808
2808 showEvent(anEvent); 2809 showEvent(anEvent);
2809} 2810}
2810 2811
2811void CalendarView::appointment_edit() 2812void CalendarView::appointment_edit()
2812{ 2813{
2813 Event *anEvent = 0; 2814 Event *anEvent = 0;
2814 2815
2815 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2816 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2816 2817
2817 if (mViewManager->currentView()->isEventView()) { 2818 if (mViewManager->currentView()->isEventView()) {
2818 if ( incidence && incidence->type() == "Event" ) { 2819 if ( incidence && incidence->type() == "Event" ) {
2819 anEvent = static_cast<Event *>(incidence); 2820 anEvent = static_cast<Event *>(incidence);
2820 } 2821 }
2821 } 2822 }
2822 2823
2823 if (!anEvent) { 2824 if (!anEvent) {
2824 KNotifyClient::beep(); 2825 KNotifyClient::beep();
2825 return; 2826 return;
2826 } 2827 }
2827 2828
2828 editEvent(anEvent); 2829 editEvent(anEvent);
2829} 2830}
2830 2831
2831void CalendarView::appointment_delete() 2832void CalendarView::appointment_delete()
2832{ 2833{
2833 Event *anEvent = 0; 2834 Event *anEvent = 0;
2834 2835
2835 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2836 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2836 2837
2837 if (mViewManager->currentView()->isEventView()) { 2838 if (mViewManager->currentView()->isEventView()) {
2838 if ( incidence && incidence->type() == "Event" ) { 2839 if ( incidence && incidence->type() == "Event" ) {
2839 anEvent = static_cast<Event *>(incidence); 2840 anEvent = static_cast<Event *>(incidence);
2840 } 2841 }
2841 } 2842 }
2842 2843
2843 if (!anEvent) { 2844 if (!anEvent) {
2844 KNotifyClient::beep(); 2845 KNotifyClient::beep();
2845 return; 2846 return;
2846 } 2847 }
2847 2848
2848 deleteEvent(anEvent); 2849 deleteEvent(anEvent);
2849} 2850}
2850 2851
2851void CalendarView::todo_resub( Todo * parent, Todo * sub ) 2852void CalendarView::todo_resub( Todo * parent, Todo * sub )
2852{ 2853{
2853 if (!sub) return; 2854 if (!sub) return;
2854 if (!parent) return; 2855 if (!parent) return;
2855 if ( sub->relatedTo() ) 2856 if ( sub->relatedTo() )
2856 sub->relatedTo()->removeRelation(sub); 2857 sub->relatedTo()->removeRelation(sub);
2857 sub->setRelatedTo(parent); 2858 sub->setRelatedTo(parent);
2858 sub->setRelatedToUid(parent->uid()); 2859 sub->setRelatedToUid(parent->uid());
2859 parent->addRelation(sub); 2860 parent->addRelation(sub);
2860 sub->updated(); 2861 sub->updated();
2861 parent->updated(); 2862 parent->updated();
2862 setModified(true); 2863 setModified(true);
2863 updateView(); 2864 updateView();
2864} 2865}
2865void CalendarView::todo_unsub(Todo *anTodo ) 2866void CalendarView::todo_unsub(Todo *anTodo )
2866{ 2867{
2867 // Todo *anTodo = selectedTodo(); 2868 // Todo *anTodo = selectedTodo();
2868 if (!anTodo) return; 2869 if (!anTodo) return;
2869 if (!anTodo->relatedTo()) return; 2870 if (!anTodo->relatedTo()) return;
2870 anTodo->relatedTo()->removeRelation(anTodo); 2871 anTodo->relatedTo()->removeRelation(anTodo);
2871 anTodo->setRelatedTo(0); 2872 anTodo->setRelatedTo(0);
2872 anTodo->updated(); 2873 anTodo->updated();
2873 anTodo->setRelatedToUid(""); 2874 anTodo->setRelatedToUid("");
2874 setModified(true); 2875 setModified(true);
2875 updateView(); 2876 updateView();
2876} 2877}
2877 2878
2878void CalendarView::deleteTodo(Todo *todo) 2879void CalendarView::deleteTodo(Todo *todo)
2879{ 2880{
2880 if (!todo) { 2881 if (!todo) {
2881 KNotifyClient::beep(); 2882 KNotifyClient::beep();
2882 return; 2883 return;
2883 } 2884 }
2884 if (KOPrefs::instance()->mConfirm) { 2885 if (KOPrefs::instance()->mConfirm) {
2885 switch (msgItemDelete()) { 2886 switch (msgItemDelete()) {
2886 case KMessageBox::Continue: // OK 2887 case KMessageBox::Continue: // OK
2887 if (!todo->relations().isEmpty()) { 2888 if (!todo->relations().isEmpty()) {
2888 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2889 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2889 i18n("Delete To-Do")); 2890 i18n("Delete To-Do"));
2890 } else { 2891 } else {
2891 checkExternalId( todo ); 2892 checkExternalId( todo );
2892 calendar()->deleteTodo(todo); 2893 calendar()->deleteTodo(todo);
2893 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2894 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2894 updateView(); 2895 updateView();
2895 } 2896 }
2896 break; 2897 break;
2897 } // switch 2898 } // switch
2898 } else { 2899 } else {
2899 if (!todo->relations().isEmpty()) { 2900 if (!todo->relations().isEmpty()) {
2900 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2901 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2901 i18n("Delete To-Do")); 2902 i18n("Delete To-Do"));
2902 } else { 2903 } else {
2903 checkExternalId( todo ); 2904 checkExternalId( todo );
2904 mCalendar->deleteTodo(todo); 2905 mCalendar->deleteTodo(todo);
2905 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2906 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2906 updateView(); 2907 updateView();
2907 } 2908 }
2908 } 2909 }
2909 emit updateSearchDialog(); 2910 emit updateSearchDialog();
2910} 2911}
2911void CalendarView::deleteJournal(Journal *jour) 2912void CalendarView::deleteJournal(Journal *jour)
2912{ 2913{
2913 if (!jour) { 2914 if (!jour) {
2914 KNotifyClient::beep(); 2915 KNotifyClient::beep();
2915 return; 2916 return;
2916 } 2917 }
2917 if (KOPrefs::instance()->mConfirm) { 2918 if (KOPrefs::instance()->mConfirm) {
2918 switch (msgItemDelete()) { 2919 switch (msgItemDelete()) {
2919 case KMessageBox::Continue: // OK 2920 case KMessageBox::Continue: // OK
2920 calendar()->deleteJournal(jour); 2921 calendar()->deleteJournal(jour);
2921 updateView(); 2922 updateView();
2922 break; 2923 break;
2923 } // switch 2924 } // switch
2924 } else { 2925 } else {
2925 calendar()->deleteJournal(jour);; 2926 calendar()->deleteJournal(jour);;
2926 updateView(); 2927 updateView();
2927 } 2928 }
2928 emit updateSearchDialog(); 2929 emit updateSearchDialog();
2929} 2930}
2930 2931
2931void CalendarView::deleteEvent(Event *anEvent) 2932void CalendarView::deleteEvent(Event *anEvent)
2932{ 2933{
2933 if (!anEvent) { 2934 if (!anEvent) {
2934 KNotifyClient::beep(); 2935 KNotifyClient::beep();
2935 return; 2936 return;
2936 } 2937 }
2937 2938
2938 if (anEvent->recurrence()->doesRecur()) { 2939 if (anEvent->recurrence()->doesRecur()) {
2939 QDate itemDate = mViewManager->currentSelectionDate(); 2940 QDate itemDate = mViewManager->currentSelectionDate();
2940 int km; 2941 int km;
2941 if (!itemDate.isValid()) { 2942 if (!itemDate.isValid()) {
2942 //kdDebug() << "Date Not Valid" << endl; 2943 //kdDebug() << "Date Not Valid" << endl;
2943 if (KOPrefs::instance()->mConfirm) { 2944 if (KOPrefs::instance()->mConfirm) {
2944 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 2945 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2945 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 2946 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
2946 i18n("KO/Pi Confirmation"),i18n("Delete All")); 2947 i18n("KO/Pi Confirmation"),i18n("Delete All"));
2947 if ( km == KMessageBox::Continue ) 2948 if ( km == KMessageBox::Continue )
2948 km = KMessageBox::No; // No = all below 2949 km = KMessageBox::No; // No = all below
2949 } else 2950 } else
2950 km = KMessageBox::No; 2951 km = KMessageBox::No;
2951 } else { 2952 } else {
2952 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + 2953 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
2953 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 2954 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
2954 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 2955 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
2955 i18n("KO/Pi Confirmation"),i18n("Current"), 2956 i18n("KO/Pi Confirmation"),i18n("Current"),
2956 i18n("All")); 2957 i18n("All"));
2957 } 2958 }
2958 switch(km) { 2959 switch(km) {
2959 2960
2960 case KMessageBox::No: // Continue // all 2961 case KMessageBox::No: // Continue // all
2961 //qDebug("KMessageBox::No "); 2962 //qDebug("KMessageBox::No ");
2962 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2963 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2963 schedule(Scheduler::Cancel,anEvent); 2964 schedule(Scheduler::Cancel,anEvent);
2964 2965
2965 checkExternalId( anEvent); 2966 checkExternalId( anEvent);
2966 mCalendar->deleteEvent(anEvent); 2967 mCalendar->deleteEvent(anEvent);
2967 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 2968 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
2968 break; 2969 break;
2969 2970
2970 // Disabled because it does not work 2971 // Disabled because it does not work
2971 //#if 0 2972 //#if 0
2972 case KMessageBox::Yes: // just this one 2973 case KMessageBox::Yes: // just this one
2973 //QDate qd = mNavigator->selectedDates().first(); 2974 //QDate qd = mNavigator->selectedDates().first();
2974 //if (!qd.isValid()) { 2975 //if (!qd.isValid()) {
2975 // kdDebug() << "no date selected, or invalid date" << endl; 2976 // kdDebug() << "no date selected, or invalid date" << endl;
2976 // KNotifyClient::beep(); 2977 // KNotifyClient::beep();
2977 // return; 2978 // return;
2978 //} 2979 //}
2979 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 2980 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
2980 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 2981 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
2981 anEvent->addExDate(itemDate); 2982 anEvent->addExDate(itemDate);
2982 int duration = anEvent->recurrence()->duration(); 2983 int duration = anEvent->recurrence()->duration();
2983 if ( duration > 0 ) { 2984 if ( duration > 0 ) {
2984 anEvent->recurrence()->setDuration( duration - 1 ); 2985 anEvent->recurrence()->setDuration( duration - 1 );
2985 } 2986 }
2986 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 2987 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
2987 } 2988 }
2988 break; 2989 break;
2989 //#endif 2990 //#endif
2990 } // switch 2991 } // switch
2991 } else { 2992 } else {
2992 if (KOPrefs::instance()->mConfirm) { 2993 if (KOPrefs::instance()->mConfirm) {
2993 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 2994 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2994 i18n("\nAre you sure you want\nto delete this event?"), 2995 i18n("\nAre you sure you want\nto delete this event?"),
2995 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 2996 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
2996 case KMessageBox::Continue: // OK 2997 case KMessageBox::Continue: // OK
2997 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2998 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2998 schedule(Scheduler::Cancel,anEvent); 2999 schedule(Scheduler::Cancel,anEvent);
2999 checkExternalId( anEvent); 3000 checkExternalId( anEvent);
3000 mCalendar->deleteEvent(anEvent); 3001 mCalendar->deleteEvent(anEvent);
3001 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3002 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3002 break; 3003 break;
3003 } // switch 3004 } // switch
3004 } else { 3005 } else {
3005 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3006 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3006 schedule(Scheduler::Cancel,anEvent); 3007 schedule(Scheduler::Cancel,anEvent);
3007 checkExternalId( anEvent); 3008 checkExternalId( anEvent);
3008 mCalendar->deleteEvent(anEvent); 3009 mCalendar->deleteEvent(anEvent);
3009 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3010 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3010 } 3011 }
3011 } // if-else 3012 } // if-else
3012 emit updateSearchDialog(); 3013 emit updateSearchDialog();
3013} 3014}
3014 3015
3015bool CalendarView::deleteEvent(const QString &uid) 3016bool CalendarView::deleteEvent(const QString &uid)
3016{ 3017{
3017 Event *ev = mCalendar->event(uid); 3018 Event *ev = mCalendar->event(uid);
3018 if (ev) { 3019 if (ev) {
3019 deleteEvent(ev); 3020 deleteEvent(ev);
3020 return true; 3021 return true;
3021 } else { 3022 } else {
3022 return false; 3023 return false;
3023 } 3024 }
3024} 3025}
3025 3026
3026/*****************************************************************************/ 3027/*****************************************************************************/
3027 3028
3028void CalendarView::action_mail() 3029void CalendarView::action_mail()
3029{ 3030{
3030#ifndef KORG_NOMAIL 3031#ifndef KORG_NOMAIL
3031 KOMailClient mailClient; 3032 KOMailClient mailClient;
3032 3033
3033 Incidence *incidence = currentSelection(); 3034 Incidence *incidence = currentSelection();
3034 3035
3035 if (!incidence) { 3036 if (!incidence) {
3036 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3037 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3037 return; 3038 return;
3038 } 3039 }
3039 if(incidence->attendeeCount() == 0 ) { 3040 if(incidence->attendeeCount() == 0 ) {
3040 KMessageBox::sorry(this, 3041 KMessageBox::sorry(this,
3041 i18n("Can't generate mail:\nNo attendees defined.\n")); 3042 i18n("Can't generate mail:\nNo attendees defined.\n"));
3042 return; 3043 return;
3043 } 3044 }
3044 3045
3045 CalendarLocal cal_tmp; 3046 CalendarLocal cal_tmp;
3046 Event *event = 0; 3047 Event *event = 0;
3047 Event *ev = 0; 3048 Event *ev = 0;
3048 if ( incidence && incidence->type() == "Event" ) { 3049 if ( incidence && incidence->type() == "Event" ) {
3049 event = static_cast<Event *>(incidence); 3050 event = static_cast<Event *>(incidence);
3050 ev = new Event(*event); 3051 ev = new Event(*event);
3051 cal_tmp.addEvent(ev); 3052 cal_tmp.addEvent(ev);
3052 } 3053 }
3053 ICalFormat mForm(); 3054 ICalFormat mForm();
3054 QString attachment = mForm.toString( &cal_tmp ); 3055 QString attachment = mForm.toString( &cal_tmp );
3055 if (ev) delete(ev); 3056 if (ev) delete(ev);
3056 3057
3057 mailClient.mailAttendees(currentSelection(), attachment); 3058 mailClient.mailAttendees(currentSelection(), attachment);
3058 3059
3059#endif 3060#endif
3060 3061
3061#if 0 3062#if 0
3062 Event *anEvent = 0; 3063 Event *anEvent = 0;
3063 if (mViewManager->currentView()->isEventView()) { 3064 if (mViewManager->currentView()->isEventView()) {
3064 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3065 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3065 } 3066 }
3066 3067
3067 if (!anEvent) { 3068 if (!anEvent) {
3068 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3069 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3069 return; 3070 return;
3070 } 3071 }
3071 if(anEvent->attendeeCount() == 0 ) { 3072 if(anEvent->attendeeCount() == 0 ) {
3072 KMessageBox::sorry(this, 3073 KMessageBox::sorry(this,
3073 i18n("Can't generate mail:\nNo attendees defined.\n")); 3074 i18n("Can't generate mail:\nNo attendees defined.\n"));
3074 return; 3075 return;
3075 } 3076 }
3076 3077
3077 mailobject.emailEvent(anEvent); 3078 mailobject.emailEvent(anEvent);
3078#endif 3079#endif
3079} 3080}
3080 3081
3081 3082
3082void CalendarView::schedule_publish(Incidence *incidence) 3083void CalendarView::schedule_publish(Incidence *incidence)
3083{ 3084{
3084 Event *event = 0; 3085 Event *event = 0;
3085 Todo *todo = 0; 3086 Todo *todo = 0;
3086 3087
3087 if (incidence == 0) { 3088 if (incidence == 0) {
3088 incidence = mViewManager->currentView()->selectedIncidences().first(); 3089 incidence = mViewManager->currentView()->selectedIncidences().first();
3089 if (incidence == 0) { 3090 if (incidence == 0) {
3090 incidence = mTodoList->selectedIncidences().first(); 3091 incidence = mTodoList->selectedIncidences().first();
3091 } 3092 }
3092 } 3093 }
3093 if ( incidence && incidence->type() == "Event" ) { 3094 if ( incidence && incidence->type() == "Event" ) {
3094 event = static_cast<Event *>(incidence); 3095 event = static_cast<Event *>(incidence);
3095 } else { 3096 } else {
3096 if ( incidence && incidence->type() == "Todo" ) { 3097 if ( incidence && incidence->type() == "Todo" ) {
3097 todo = static_cast<Todo *>(incidence); 3098 todo = static_cast<Todo *>(incidence);
3098 } 3099 }
3099 } 3100 }
3100 3101
3101 if (!event && !todo) { 3102 if (!event && !todo) {
3102 KMessageBox::sorry(this,i18n("No event selected.")); 3103 KMessageBox::sorry(this,i18n("No event selected."));
3103 return; 3104 return;
3104 } 3105 }
3105 3106
3106 PublishDialog *publishdlg = new PublishDialog(); 3107 PublishDialog *publishdlg = new PublishDialog();
3107 if (incidence->attendeeCount()>0) { 3108 if (incidence->attendeeCount()>0) {
3108 QPtrList<Attendee> attendees = incidence->attendees(); 3109 QPtrList<Attendee> attendees = incidence->attendees();
3109 attendees.first(); 3110 attendees.first();
3110 while ( attendees.current()!=0 ) { 3111 while ( attendees.current()!=0 ) {
3111 publishdlg->addAttendee(attendees.current()); 3112 publishdlg->addAttendee(attendees.current());
3112 attendees.next(); 3113 attendees.next();
3113 } 3114 }
3114 } 3115 }
3115 bool send = true; 3116 bool send = true;
3116 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3117 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3117 if ( publishdlg->exec() != QDialog::Accepted ) 3118 if ( publishdlg->exec() != QDialog::Accepted )
3118 send = false; 3119 send = false;
3119 } 3120 }
3120 if ( send ) { 3121 if ( send ) {
3121 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3122 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3122 if ( event ) { 3123 if ( event ) {
3123 Event *ev = new Event(*event); 3124 Event *ev = new Event(*event);
3124 ev->registerObserver(0); 3125 ev->registerObserver(0);
3125 ev->clearAttendees(); 3126 ev->clearAttendees();
3126 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3127 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3127 delete(ev); 3128 delete(ev);
3128 } 3129 }
3129 } else { 3130 } else {
3130 if ( todo ) { 3131 if ( todo ) {
3131 Todo *ev = new Todo(*todo); 3132 Todo *ev = new Todo(*todo);
3132 ev->registerObserver(0); 3133 ev->registerObserver(0);
3133 ev->clearAttendees(); 3134 ev->clearAttendees();
3134 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3135 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3135 delete(ev); 3136 delete(ev);
3136 } 3137 }
3137 } 3138 }
3138 } 3139 }
3139 } 3140 }
3140 delete publishdlg; 3141 delete publishdlg;
3141} 3142}
3142 3143
3143void CalendarView::schedule_request(Incidence *incidence) 3144void CalendarView::schedule_request(Incidence *incidence)
3144{ 3145{
3145 schedule(Scheduler::Request,incidence); 3146 schedule(Scheduler::Request,incidence);
3146} 3147}
3147 3148
3148void CalendarView::schedule_refresh(Incidence *incidence) 3149void CalendarView::schedule_refresh(Incidence *incidence)
3149{ 3150{
3150 schedule(Scheduler::Refresh,incidence); 3151 schedule(Scheduler::Refresh,incidence);
3151} 3152}
3152 3153
3153void CalendarView::schedule_cancel(Incidence *incidence) 3154void CalendarView::schedule_cancel(Incidence *incidence)
3154{ 3155{
3155 schedule(Scheduler::Cancel,incidence); 3156 schedule(Scheduler::Cancel,incidence);
3156} 3157}
3157 3158
3158void CalendarView::schedule_add(Incidence *incidence) 3159void CalendarView::schedule_add(Incidence *incidence)
3159{ 3160{
3160 schedule(Scheduler::Add,incidence); 3161 schedule(Scheduler::Add,incidence);
3161} 3162}
3162 3163
3163void CalendarView::schedule_reply(Incidence *incidence) 3164void CalendarView::schedule_reply(Incidence *incidence)
3164{ 3165{
3165 schedule(Scheduler::Reply,incidence); 3166 schedule(Scheduler::Reply,incidence);
3166} 3167}
3167 3168
3168void CalendarView::schedule_counter(Incidence *incidence) 3169void CalendarView::schedule_counter(Incidence *incidence)
3169{ 3170{
3170 schedule(Scheduler::Counter,incidence); 3171 schedule(Scheduler::Counter,incidence);
3171} 3172}
3172 3173
3173void CalendarView::schedule_declinecounter(Incidence *incidence) 3174void CalendarView::schedule_declinecounter(Incidence *incidence)
3174{ 3175{
3175 schedule(Scheduler::Declinecounter,incidence); 3176 schedule(Scheduler::Declinecounter,incidence);
3176} 3177}
3177 3178
3178void CalendarView::schedule_publish_freebusy(int daysToPublish) 3179void CalendarView::schedule_publish_freebusy(int daysToPublish)
3179{ 3180{
3180 QDateTime start = QDateTime::currentDateTime(); 3181 QDateTime start = QDateTime::currentDateTime();
3181 QDateTime end = start.addDays(daysToPublish); 3182 QDateTime end = start.addDays(daysToPublish);
3182 3183
3183 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3184 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3184 freebusy->setOrganizer(KOPrefs::instance()->email()); 3185 freebusy->setOrganizer(KOPrefs::instance()->email());
3185 3186
3186 3187
3187 PublishDialog *publishdlg = new PublishDialog(); 3188 PublishDialog *publishdlg = new PublishDialog();
3188 if ( publishdlg->exec() == QDialog::Accepted ) { 3189 if ( publishdlg->exec() == QDialog::Accepted ) {
3189 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3190 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3190 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3191 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3191 delete(freebusy); 3192 delete(freebusy);
3192 } 3193 }
3193 } 3194 }
3194 delete publishdlg; 3195 delete publishdlg;
3195} 3196}
3196 3197
3197void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 3198void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3198{ 3199{
3199 Event *event = 0; 3200 Event *event = 0;
3200 Todo *todo = 0; 3201 Todo *todo = 0;
3201 3202
3202 if (incidence == 0) { 3203 if (incidence == 0) {
3203 incidence = mViewManager->currentView()->selectedIncidences().first(); 3204 incidence = mViewManager->currentView()->selectedIncidences().first();
3204 if (incidence == 0) { 3205 if (incidence == 0) {
3205 incidence = mTodoList->selectedIncidences().first(); 3206 incidence = mTodoList->selectedIncidences().first();
3206 } 3207 }
3207 } 3208 }
3208 if ( incidence && incidence->type() == "Event" ) { 3209 if ( incidence && incidence->type() == "Event" ) {
3209 event = static_cast<Event *>(incidence); 3210 event = static_cast<Event *>(incidence);
3210 } 3211 }
3211 if ( incidence && incidence->type() == "Todo" ) { 3212 if ( incidence && incidence->type() == "Todo" ) {
3212 todo = static_cast<Todo *>(incidence); 3213 todo = static_cast<Todo *>(incidence);
3213 } 3214 }
3214 3215
3215 if (!event && !todo) { 3216 if (!event && !todo) {
3216 KMessageBox::sorry(this,i18n("No event selected.")); 3217 KMessageBox::sorry(this,i18n("No event selected."));
3217 return; 3218 return;
3218 } 3219 }
3219 3220
3220 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 3221 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
3221 KMessageBox::sorry(this,i18n("The event has no attendees.")); 3222 KMessageBox::sorry(this,i18n("The event has no attendees."));
3222 return; 3223 return;
3223 } 3224 }
3224 3225
3225 Event *ev = 0; 3226 Event *ev = 0;
3226 if (event) ev = new Event(*event); 3227 if (event) ev = new Event(*event);
3227 Todo *to = 0; 3228 Todo *to = 0;
3228 if (todo) to = new Todo(*todo); 3229 if (todo) to = new Todo(*todo);
3229 3230
3230 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 3231 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
3231 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 3232 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
3232 if (!me) { 3233 if (!me) {
3233 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 3234 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
3234 return; 3235 return;
3235 } 3236 }
3236 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 3237 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
3237 StatusDialog *statdlg = new StatusDialog(this); 3238 StatusDialog *statdlg = new StatusDialog(this);
3238 if (!statdlg->exec()==QDialog::Accepted) return; 3239 if (!statdlg->exec()==QDialog::Accepted) return;
3239 me->setStatus( statdlg->status() ); 3240 me->setStatus( statdlg->status() );
3240 delete(statdlg); 3241 delete(statdlg);
3241 } 3242 }
3242 Attendee *menew = new Attendee(*me); 3243 Attendee *menew = new Attendee(*me);
3243 if (ev) { 3244 if (ev) {
3244 ev->clearAttendees(); 3245 ev->clearAttendees();
3245 ev->addAttendee(menew,false); 3246 ev->addAttendee(menew,false);
3246 } else { 3247 } else {
3247 if (to) { 3248 if (to) {
3248 todo->clearAttendees(); 3249 todo->clearAttendees();
3249 todo->addAttendee(menew,false); 3250 todo->addAttendee(menew,false);
3250 } 3251 }
3251 } 3252 }
3252 } 3253 }
3253 3254
3254 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3255 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3255 if (ev) { 3256 if (ev) {
3256 if ( !dlg->addMessage(ev,method) ) delete(ev); 3257 if ( !dlg->addMessage(ev,method) ) delete(ev);
3257 } else { 3258 } else {
3258 if (to) { 3259 if (to) {
3259 if ( !dlg->addMessage(to,method) ) delete(to); 3260 if ( !dlg->addMessage(to,method) ) delete(to);
3260 } 3261 }
3261 } 3262 }
3262} 3263}
3263 3264
3264void CalendarView::openAddressbook() 3265void CalendarView::openAddressbook()
3265{ 3266{
3266 KRun::runCommand("kaddressbook"); 3267 KRun::runCommand("kaddressbook");
3267} 3268}
3268 3269
3269void CalendarView::setModified(bool modified) 3270void CalendarView::setModified(bool modified)
3270{ 3271{
3271 if ( modified ) 3272 if ( modified )
3272 emit signalmodified(); 3273 emit signalmodified();
3273 if (mModified != modified) { 3274 if (mModified != modified) {
3274 mModified = modified; 3275 mModified = modified;
3275 emit modifiedChanged(mModified); 3276 emit modifiedChanged(mModified);
3276 } 3277 }
3277} 3278}
3278 3279
3279bool CalendarView::isReadOnly() 3280bool CalendarView::isReadOnly()
3280{ 3281{
3281 return mReadOnly; 3282 return mReadOnly;
3282} 3283}
3283 3284
3284void CalendarView::setReadOnly(bool readOnly) 3285void CalendarView::setReadOnly(bool readOnly)
3285{ 3286{
3286 if (mReadOnly != readOnly) { 3287 if (mReadOnly != readOnly) {
3287 mReadOnly = readOnly; 3288 mReadOnly = readOnly;
3288 emit readOnlyChanged(mReadOnly); 3289 emit readOnlyChanged(mReadOnly);
3289 } 3290 }
3290} 3291}
3291 3292
3292bool CalendarView::isModified() 3293bool CalendarView::isModified()
3293{ 3294{
3294 return mModified; 3295 return mModified;
3295} 3296}
3296 3297
3297void CalendarView::printSetup() 3298void CalendarView::printSetup()
3298{ 3299{
3299#ifndef KORG_NOPRINTER 3300#ifndef KORG_NOPRINTER
3300 createPrinter(); 3301 createPrinter();
3301 3302
3302 mCalPrinter->setupPrinter(); 3303 mCalPrinter->setupPrinter();
3303#endif 3304#endif
3304} 3305}
3305 3306
3306void CalendarView::print() 3307void CalendarView::print()
3307{ 3308{
3308#ifndef KORG_NOPRINTER 3309#ifndef KORG_NOPRINTER
3309 createPrinter(); 3310 createPrinter();
3310 3311
3311 DateList tmpDateList = mNavigator->selectedDates(); 3312 DateList tmpDateList = mNavigator->selectedDates();
3312 mCalPrinter->print(CalPrinter::Month, 3313 mCalPrinter->print(CalPrinter::Month,
3313 tmpDateList.first(), tmpDateList.last()); 3314 tmpDateList.first(), tmpDateList.last());
3314#endif 3315#endif
3315} 3316}
3316 3317
3317void CalendarView::printPreview() 3318void CalendarView::printPreview()
3318{ 3319{
3319#ifndef KORG_NOPRINTER 3320#ifndef KORG_NOPRINTER
3320 kdDebug() << "CalendarView::printPreview()" << endl; 3321 kdDebug() << "CalendarView::printPreview()" << endl;
3321 3322
3322 createPrinter(); 3323 createPrinter();
3323 3324
3324 DateList tmpDateList = mNavigator->selectedDates(); 3325 DateList tmpDateList = mNavigator->selectedDates();
3325 3326
3326 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 3327 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
3327 tmpDateList.last()); 3328 tmpDateList.last());
3328#endif 3329#endif
3329} 3330}
3330 3331
3331void CalendarView::exportICalendar() 3332void CalendarView::exportICalendar()
3332{ 3333{
3333 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 3334 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
3334 3335
3335 // Force correct extension 3336 // Force correct extension
3336 if (filename.right(4) != ".ics") filename += ".ics"; 3337 if (filename.right(4) != ".ics") filename += ".ics";
3337 3338
3338 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3339 FileStorage storage( mCalendar, filename, new ICalFormat() );
3339 storage.save(); 3340 storage.save();
3340} 3341}
3341 3342
3342bool CalendarView::exportVCalendar( QString filename ) 3343bool CalendarView::exportVCalendar( QString filename )
3343{ 3344{
3344 if (mCalendar->journals().count() > 0) { 3345 if (mCalendar->journals().count() > 0) {
3345 int result = KMessageBox::warningContinueCancel(this, 3346 int result = KMessageBox::warningContinueCancel(this,
3346 i18n("The journal entries can not be\nexported to a vCalendar file."), 3347 i18n("The journal entries can not be\nexported to a vCalendar file."),
3347 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3348 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3348 true); 3349 true);
3349 if (result != KMessageBox::Continue) return false; 3350 if (result != KMessageBox::Continue) return false;
3350 } 3351 }
3351 3352
3352 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3353 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3353 3354
3354 // Force correct extension 3355 // Force correct extension
3355 if (filename.right(4) != ".vcs") filename += ".vcs"; 3356 if (filename.right(4) != ".vcs") filename += ".vcs";
3356 3357
3357 FileStorage storage( mCalendar, filename, new VCalFormat ); 3358 FileStorage storage( mCalendar, filename, new VCalFormat );
3358 return storage.save(); 3359 return storage.save();
3359 3360
3360} 3361}
3361 3362
3362void CalendarView::eventUpdated(Incidence *) 3363void CalendarView::eventUpdated(Incidence *)
3363{ 3364{
3364 setModified(); 3365 setModified();
3365 // Don't call updateView here. The code, which has caused the update of the 3366 // Don't call updateView here. The code, which has caused the update of the
3366 // event is responsible for updating the view. 3367 // event is responsible for updating the view.
3367 // updateView(); 3368 // updateView();
3368} 3369}
3369 3370
3370void CalendarView::adaptNavigationUnits() 3371void CalendarView::adaptNavigationUnits()
3371{ 3372{
3372 if (mViewManager->currentView()->isEventView()) { 3373 if (mViewManager->currentView()->isEventView()) {
3373 int days = mViewManager->currentView()->currentDateCount(); 3374 int days = mViewManager->currentView()->currentDateCount();
3374 if (days == 1) { 3375 if (days == 1) {
3375 emit changeNavStringPrev(i18n("&Previous Day")); 3376 emit changeNavStringPrev(i18n("&Previous Day"));
3376 emit changeNavStringNext(i18n("&Next Day")); 3377 emit changeNavStringNext(i18n("&Next Day"));
3377 } else { 3378 } else {
3378 emit changeNavStringPrev(i18n("&Previous Week")); 3379 emit changeNavStringPrev(i18n("&Previous Week"));
3379 emit changeNavStringNext(i18n("&Next Week")); 3380 emit changeNavStringNext(i18n("&Next Week"));
3380 } 3381 }
3381 } 3382 }
3382} 3383}
3383 3384
3384void CalendarView::processMainViewSelection( Incidence *incidence ) 3385void CalendarView::processMainViewSelection( Incidence *incidence )
3385{ 3386{
3386 if ( incidence ) mTodoList->clearSelection(); 3387 if ( incidence ) mTodoList->clearSelection();
3387 processIncidenceSelection( incidence ); 3388 processIncidenceSelection( incidence );
3388} 3389}
3389 3390
3390void CalendarView::processTodoListSelection( Incidence *incidence ) 3391void CalendarView::processTodoListSelection( Incidence *incidence )
3391{ 3392{
3392 if ( incidence && mViewManager->currentView() ) { 3393 if ( incidence && mViewManager->currentView() ) {
3393 mViewManager->currentView()->clearSelection(); 3394 mViewManager->currentView()->clearSelection();
3394 } 3395 }
3395 processIncidenceSelection( incidence ); 3396 processIncidenceSelection( incidence );
3396} 3397}
3397 3398
3398void CalendarView::processIncidenceSelection( Incidence *incidence ) 3399void CalendarView::processIncidenceSelection( Incidence *incidence )
3399{ 3400{
3400 if ( incidence == mSelectedIncidence ) return; 3401 if ( incidence == mSelectedIncidence ) return;
3401 3402
3402 mSelectedIncidence = incidence; 3403 mSelectedIncidence = incidence;
3403 3404
3404 emit incidenceSelected( mSelectedIncidence ); 3405 emit incidenceSelected( mSelectedIncidence );
3405 3406
3406 if ( incidence && incidence->type() == "Event" ) { 3407 if ( incidence && incidence->type() == "Event" ) {
3407 Event *event = static_cast<Event *>( incidence ); 3408 Event *event = static_cast<Event *>( incidence );
3408 if ( event->organizer() == KOPrefs::instance()->email() ) { 3409 if ( event->organizer() == KOPrefs::instance()->email() ) {
3409 emit organizerEventsSelected( true ); 3410 emit organizerEventsSelected( true );
3410 } else { 3411 } else {
3411 emit organizerEventsSelected(false); 3412 emit organizerEventsSelected(false);
3412 } 3413 }
3413 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3414 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3414 KOPrefs::instance()->email() ) ) { 3415 KOPrefs::instance()->email() ) ) {
3415 emit groupEventsSelected( true ); 3416 emit groupEventsSelected( true );
3416 } else { 3417 } else {
3417 emit groupEventsSelected(false); 3418 emit groupEventsSelected(false);
3418 } 3419 }
3419 return; 3420 return;
3420 } else { 3421 } else {
3421 if ( incidence && incidence->type() == "Todo" ) { 3422 if ( incidence && incidence->type() == "Todo" ) {
3422 emit todoSelected( true ); 3423 emit todoSelected( true );
3423 Todo *event = static_cast<Todo *>( incidence ); 3424 Todo *event = static_cast<Todo *>( incidence );
3424 if ( event->organizer() == KOPrefs::instance()->email() ) { 3425 if ( event->organizer() == KOPrefs::instance()->email() ) {
3425 emit organizerEventsSelected( true ); 3426 emit organizerEventsSelected( true );
3426 } else { 3427 } else {
3427 emit organizerEventsSelected(false); 3428 emit organizerEventsSelected(false);
3428 } 3429 }
3429 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3430 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3430 KOPrefs::instance()->email() ) ) { 3431 KOPrefs::instance()->email() ) ) {
3431 emit groupEventsSelected( true ); 3432 emit groupEventsSelected( true );
3432 } else { 3433 } else {
3433 emit groupEventsSelected(false); 3434 emit groupEventsSelected(false);
3434 } 3435 }
3435 return; 3436 return;
3436 } else { 3437 } else {
3437 emit todoSelected( false ); 3438 emit todoSelected( false );
3438 emit organizerEventsSelected(false); 3439 emit organizerEventsSelected(false);
3439 emit groupEventsSelected(false); 3440 emit groupEventsSelected(false);
3440 } 3441 }
3441 return; 3442 return;
3442 } 3443 }
3443 3444
3444 /* if ( incidence && incidence->type() == "Todo" ) { 3445 /* if ( incidence && incidence->type() == "Todo" ) {
3445 emit todoSelected( true ); 3446 emit todoSelected( true );
3446 } else { 3447 } else {
3447 emit todoSelected( false ); 3448 emit todoSelected( false );
3448 }*/ 3449 }*/
3449} 3450}
3450 3451
3451 3452
3452void CalendarView::checkClipboard() 3453void CalendarView::checkClipboard()
3453{ 3454{
3454#ifndef KORG_NODND 3455#ifndef KORG_NODND
3455 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 3456 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
3456 emit pasteEnabled(true); 3457 emit pasteEnabled(true);
3457 } else { 3458 } else {
3458 emit pasteEnabled(false); 3459 emit pasteEnabled(false);
3459 } 3460 }
3460#endif 3461#endif
3461} 3462}
3462 3463
3463void CalendarView::showDates(const DateList &selectedDates) 3464void CalendarView::showDates(const DateList &selectedDates)
3464{ 3465{
3465 // kdDebug() << "CalendarView::selectDates()" << endl; 3466 // kdDebug() << "CalendarView::selectDates()" << endl;
3466 3467
3467 if ( mViewManager->currentView() ) { 3468 if ( mViewManager->currentView() ) {
3468 updateView( selectedDates.first(), selectedDates.last() ); 3469 updateView( selectedDates.first(), selectedDates.last() );
3469 } else { 3470 } else {
3470 mViewManager->showAgendaView(); 3471 mViewManager->showAgendaView();
3471 } 3472 }
3472 3473
3473 QString selDates; 3474 QString selDates;
3474 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); 3475 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true);
3475 if (selectedDates.first() < selectedDates.last() ) 3476 if (selectedDates.first() < selectedDates.last() )
3476 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3477 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3477 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 3478 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
3478 3479
3479} 3480}
3480 3481
3481QPtrList<CalFilter> CalendarView::filters() 3482QPtrList<CalFilter> CalendarView::filters()
3482{ 3483{
3483 return mFilters; 3484 return mFilters;
3484 3485
3485} 3486}
3486void CalendarView::editFilters() 3487void CalendarView::editFilters()
3487{ 3488{
3488 // kdDebug() << "CalendarView::editFilters()" << endl; 3489 // kdDebug() << "CalendarView::editFilters()" << endl;
3489 3490
3490 CalFilter *filter = mFilters.first(); 3491 CalFilter *filter = mFilters.first();
3491 while(filter) { 3492 while(filter) {
3492 kdDebug() << " Filter: " << filter->name() << endl; 3493 kdDebug() << " Filter: " << filter->name() << endl;
3493 filter = mFilters.next(); 3494 filter = mFilters.next();
3494 } 3495 }
3495 3496
3496 mDialogManager->showFilterEditDialog(&mFilters); 3497 mDialogManager->showFilterEditDialog(&mFilters);
3497} 3498}
3498void CalendarView::toggleFilter() 3499void CalendarView::toggleFilter()
3499{ 3500{
3500 showFilter(! mFilterView->isVisible()); 3501 showFilter(! mFilterView->isVisible());
3501} 3502}
3502 3503
3503KOFilterView *CalendarView::filterView() 3504KOFilterView *CalendarView::filterView()
3504{ 3505{
3505 return mFilterView; 3506 return mFilterView;
3506} 3507}
3507void CalendarView::selectFilter( int fil ) 3508void CalendarView::selectFilter( int fil )
3508{ 3509{
3509 mFilterView->setSelectedFilter( fil ); 3510 mFilterView->setSelectedFilter( fil );
3510} 3511}
3511void CalendarView::showFilter(bool visible) 3512void CalendarView::showFilter(bool visible)
3512{ 3513{
3513 if (visible) mFilterView->show(); 3514 if (visible) mFilterView->show();
3514 else mFilterView->hide(); 3515 else mFilterView->hide();
3515} 3516}
3516void CalendarView::toggleFilerEnabled( ) 3517void CalendarView::toggleFilerEnabled( )
3517{ 3518{
3518 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3519 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3519 if ( !mFilterView->filtersEnabled() ) 3520 if ( !mFilterView->filtersEnabled() )
3520 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3521 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3521 3522
3522} 3523}
3523void CalendarView::updateFilter() 3524void CalendarView::updateFilter()
3524{ 3525{
3525 CalFilter *filter = mFilterView->selectedFilter(); 3526 CalFilter *filter = mFilterView->selectedFilter();
3526 if (filter) { 3527 if (filter) {
3527 if (mFilterView->filtersEnabled()) { 3528 if (mFilterView->filtersEnabled()) {
3528 topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() ); 3529 topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() );
3529 filter->setEnabled(true); 3530 filter->setEnabled(true);
3530 } 3531 }
3531 else filter->setEnabled(false); 3532 else filter->setEnabled(false);
3532 mCalendar->setFilter(filter); 3533 mCalendar->setFilter(filter);
3533 updateView(); 3534 updateView();
3534 } 3535 }
3535} 3536}
3536 3537
3537void CalendarView::filterEdited() 3538void CalendarView::filterEdited()
3538{ 3539{
3539 mFilterView->updateFilters(); 3540 mFilterView->updateFilters();
3540 updateFilter(); 3541 updateFilter();
3541 writeSettings(); 3542 writeSettings();
3542} 3543}
3543 3544
3544 3545
3545void CalendarView::takeOverEvent() 3546void CalendarView::takeOverEvent()
3546{ 3547{
3547 Incidence *incidence = currentSelection(); 3548 Incidence *incidence = currentSelection();
3548 3549
3549 if (!incidence) return; 3550 if (!incidence) return;
3550 3551
3551 incidence->setOrganizer(KOPrefs::instance()->email()); 3552 incidence->setOrganizer(KOPrefs::instance()->email());
3552 incidence->recreate(); 3553 incidence->recreate();
3553 incidence->setReadOnly(false); 3554 incidence->setReadOnly(false);
3554 3555
3555 updateView(); 3556 updateView();
3556} 3557}
3557 3558
3558void CalendarView::takeOverCalendar() 3559void CalendarView::takeOverCalendar()
3559{ 3560{
3560 // TODO: Create Calendar::allIncidences() function and use it here 3561 // TODO: Create Calendar::allIncidences() function and use it here
3561 3562
3562 QPtrList<Event> events = mCalendar->events(); 3563 QPtrList<Event> events = mCalendar->events();
3563 for(uint i=0; i<events.count(); ++i) { 3564 for(uint i=0; i<events.count(); ++i) {
3564 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 3565 events.at(i)->setOrganizer(KOPrefs::instance()->email());
3565 events.at(i)->recreate(); 3566 events.at(i)->recreate();
3566 events.at(i)->setReadOnly(false); 3567 events.at(i)->setReadOnly(false);
3567 } 3568 }
3568 3569
3569 QPtrList<Todo> todos = mCalendar->todos(); 3570 QPtrList<Todo> todos = mCalendar->todos();
3570 for(uint i=0; i<todos.count(); ++i) { 3571 for(uint i=0; i<todos.count(); ++i) {
3571 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 3572 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
3572 todos.at(i)->recreate(); 3573 todos.at(i)->recreate();
3573 todos.at(i)->setReadOnly(false); 3574 todos.at(i)->setReadOnly(false);
3574 } 3575 }
3575 3576
3576 QPtrList<Journal> journals = mCalendar->journals(); 3577 QPtrList<Journal> journals = mCalendar->journals();
3577 for(uint i=0; i<journals.count(); ++i) { 3578 for(uint i=0; i<journals.count(); ++i) {
3578 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 3579 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
3579 journals.at(i)->recreate(); 3580 journals.at(i)->recreate();
3580 journals.at(i)->setReadOnly(false); 3581 journals.at(i)->setReadOnly(false);
3581 } 3582 }
3582 3583
3583 updateView(); 3584 updateView();
3584} 3585}
3585 3586
3586void CalendarView::showIntro() 3587void CalendarView::showIntro()
3587{ 3588{
3588 kdDebug() << "To be implemented." << endl; 3589 kdDebug() << "To be implemented." << endl;
3589} 3590}
3590 3591
3591QWidgetStack *CalendarView::viewStack() 3592QWidgetStack *CalendarView::viewStack()
3592{ 3593{
3593 return mRightFrame; 3594 return mRightFrame;
3594} 3595}
3595 3596
3596QWidget *CalendarView::leftFrame() 3597QWidget *CalendarView::leftFrame()
3597{ 3598{
3598 return mLeftFrame; 3599 return mLeftFrame;
3599} 3600}
3600 3601
3601DateNavigator *CalendarView::dateNavigator() 3602DateNavigator *CalendarView::dateNavigator()
3602{ 3603{
3603 return mNavigator; 3604 return mNavigator;
3604} 3605}
3605 3606
3606KDateNavigator* CalendarView::dateNavigatorWidget() 3607KDateNavigator* CalendarView::dateNavigatorWidget()
3607{ 3608{
3608 return mDateNavigator; 3609 return mDateNavigator;
3609} 3610}
3610void CalendarView::toggleDateNavigatorWidget() 3611void CalendarView::toggleDateNavigatorWidget()
3611{ 3612{
3612 if (mDateNavigator->isVisible()) 3613 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
3614 if (!KOPrefs::instance()->mShowDateNavigator )
3613 mDateNavigator->hide(); 3615 mDateNavigator->hide();
3614 else 3616 else
3615 mDateNavigator->show(); 3617 mDateNavigator->show();
3616} 3618}
3617void CalendarView::addView(KOrg::BaseView *view) 3619void CalendarView::addView(KOrg::BaseView *view)
3618{ 3620{
3619 mViewManager->addView(view); 3621 mViewManager->addView(view);
3620} 3622}
3621 3623
3622void CalendarView::showView(KOrg::BaseView *view) 3624void CalendarView::showView(KOrg::BaseView *view)
3623{ 3625{
3624 mViewManager->showView(view, mLeftFrame->isVisible()); 3626 mViewManager->showView(view, mLeftFrame->isVisible());
3625} 3627}
3626 3628
3627Incidence *CalendarView::currentSelection() 3629Incidence *CalendarView::currentSelection()
3628{ 3630{
3629 return mViewManager->currentSelection(); 3631 return mViewManager->currentSelection();
3630} 3632}
3631void CalendarView::toggleAllDaySize() 3633void CalendarView::toggleAllDaySize()
3632{ 3634{
3633 /* 3635 /*
3634 if ( KOPrefs::instance()->mAllDaySize > 47 ) 3636 if ( KOPrefs::instance()->mAllDaySize > 47 )
3635 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 3637 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
3636 else 3638 else
3637 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 3639 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
3638 */ 3640 */
3639 viewManager()->agendaView()->toggleAllDay(); 3641 viewManager()->agendaView()->toggleAllDay();
3640} 3642}
3641void CalendarView::toggleExpand() 3643void CalendarView::toggleExpand()
3642{ 3644{
3643 // if ( mLeftFrame->isHidden() ) { 3645 // if ( mLeftFrame->isHidden() ) {
3644 // mLeftFrame->show(); 3646 // mLeftFrame->show();
3645 // emit calendarViewExpanded( false ); 3647 // emit calendarViewExpanded( false );
3646 // } else { 3648 // } else {
3647 // mLeftFrame->hide(); 3649 // mLeftFrame->hide();
3648 // emit calendarViewExpanded( true ); 3650 // emit calendarViewExpanded( true );
3649 // } 3651 // }
3650 3652
3651 globalFlagBlockAgenda = 1; 3653 globalFlagBlockAgenda = 1;
3652 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 3654 emit calendarViewExpanded( !mLeftFrame->isHidden() );
3653 globalFlagBlockAgenda = 5; 3655 globalFlagBlockAgenda = 5;
3654 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 3656 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
3655 //mViewManager->showView( 0, true ); 3657 //mViewManager->showView( 0, true );
3656} 3658}
3657 3659
3658void CalendarView::calendarModified( bool modified, Calendar * ) 3660void CalendarView::calendarModified( bool modified, Calendar * )
3659{ 3661{
3660 setModified( modified ); 3662 setModified( modified );
3661} 3663}
3662 3664
3663Todo *CalendarView::selectedTodo() 3665Todo *CalendarView::selectedTodo()
3664{ 3666{
3665 Incidence *incidence = currentSelection(); 3667 Incidence *incidence = currentSelection();
3666 if ( incidence && incidence->type() == "Todo" ) { 3668 if ( incidence && incidence->type() == "Todo" ) {
3667 return static_cast<Todo *>( incidence ); 3669 return static_cast<Todo *>( incidence );
3668 } 3670 }
3669 3671
3670 incidence = mTodoList->selectedIncidences().first(); 3672 incidence = mTodoList->selectedIncidences().first();
3671 if ( incidence && incidence->type() == "Todo" ) { 3673 if ( incidence && incidence->type() == "Todo" ) {
3672 return static_cast<Todo *>( incidence ); 3674 return static_cast<Todo *>( incidence );
3673 } 3675 }
3674 3676
3675 return 0; 3677 return 0;
3676} 3678}
3677 3679
3678void CalendarView::dialogClosing(Incidence *in) 3680void CalendarView::dialogClosing(Incidence *in)
3679{ 3681{
3680 // mDialogList.remove(in); 3682 // mDialogList.remove(in);
3681} 3683}
3682 3684
3683void CalendarView::showIncidence() 3685void CalendarView::showIncidence()
3684{ 3686{
3685 Incidence *incidence = currentSelection(); 3687 Incidence *incidence = currentSelection();
3686 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3688 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3687 if ( incidence ) { 3689 if ( incidence ) {
3688 ShowIncidenceVisitor v; 3690 ShowIncidenceVisitor v;
3689 v.act( incidence, this ); 3691 v.act( incidence, this );
3690 } 3692 }
3691} 3693}
3692void CalendarView::editIncidenceDescription() 3694void CalendarView::editIncidenceDescription()
3693{ 3695{
3694 mFlagEditDescription = true; 3696 mFlagEditDescription = true;
3695 editIncidence(); 3697 editIncidence();
3696 mFlagEditDescription = false; 3698 mFlagEditDescription = false;
3697} 3699}
3698void CalendarView::editIncidence() 3700void CalendarView::editIncidence()
3699{ 3701{
3700 // qDebug("editIncidence() "); 3702 // qDebug("editIncidence() ");
3701 Incidence *incidence = currentSelection(); 3703 Incidence *incidence = currentSelection();
3702 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3704 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3703 if ( incidence ) { 3705 if ( incidence ) {
3704 EditIncidenceVisitor v; 3706 EditIncidenceVisitor v;
3705 v.act( incidence, this ); 3707 v.act( incidence, this );
3706 } 3708 }
3707} 3709}
3708 3710
3709void CalendarView::deleteIncidence() 3711void CalendarView::deleteIncidence()
3710{ 3712{
3711 Incidence *incidence = currentSelection(); 3713 Incidence *incidence = currentSelection();
3712 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3714 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3713 if ( incidence ) { 3715 if ( incidence ) {
3714 deleteIncidence(incidence); 3716 deleteIncidence(incidence);
3715 } 3717 }
3716} 3718}
3717 3719
3718void CalendarView::showIncidence(Incidence *incidence) 3720void CalendarView::showIncidence(Incidence *incidence)
3719{ 3721{
3720 if ( incidence ) { 3722 if ( incidence ) {
3721 ShowIncidenceVisitor v; 3723 ShowIncidenceVisitor v;
3722 v.act( incidence, this ); 3724 v.act( incidence, this );
3723 } 3725 }
3724} 3726}
3725 3727
3726void CalendarView::editIncidence(Incidence *incidence) 3728void CalendarView::editIncidence(Incidence *incidence)
3727{ 3729{
3728 if ( incidence ) { 3730 if ( incidence ) {
3729 3731
3730 EditIncidenceVisitor v; 3732 EditIncidenceVisitor v;
3731 v.act( incidence, this ); 3733 v.act( incidence, this );
3732 3734
3733 } 3735 }
3734} 3736}
3735 3737
3736void CalendarView::deleteIncidence(Incidence *incidence) 3738void CalendarView::deleteIncidence(Incidence *incidence)
3737{ 3739{
3738 //qDebug(" CalendarView::deleteIncidence "); 3740 //qDebug(" CalendarView::deleteIncidence ");
3739 if ( incidence ) { 3741 if ( incidence ) {
3740 DeleteIncidenceVisitor v; 3742 DeleteIncidenceVisitor v;
3741 v.act( incidence, this ); 3743 v.act( incidence, this );
3742 } 3744 }
3743} 3745}
3744 3746
3745 3747
3746void CalendarView::lookForOutgoingMessages() 3748void CalendarView::lookForOutgoingMessages()
3747{ 3749{
3748 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 3750 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
3749 ogd->loadMessages(); 3751 ogd->loadMessages();
3750} 3752}
3751 3753
3752void CalendarView::lookForIncomingMessages() 3754void CalendarView::lookForIncomingMessages()
3753{ 3755{
3754 IncomingDialog *icd = mDialogManager->incomingDialog(); 3756 IncomingDialog *icd = mDialogManager->incomingDialog();
3755 icd->retrieve(); 3757 icd->retrieve();
3756} 3758}
3757 3759
3758bool CalendarView::removeCompletedSubTodos( Todo* t ) 3760bool CalendarView::removeCompletedSubTodos( Todo* t )
3759{ 3761{
3760 bool deleteTodo = true; 3762 bool deleteTodo = true;
3761 QPtrList<Incidence> subTodos; 3763 QPtrList<Incidence> subTodos;
3762 Incidence *aTodo; 3764 Incidence *aTodo;
3763 subTodos = t->relations(); 3765 subTodos = t->relations();
3764 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 3766 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
3765 if (! removeCompletedSubTodos( (Todo*) aTodo )) 3767 if (! removeCompletedSubTodos( (Todo*) aTodo ))
3766 deleteTodo = false; 3768 deleteTodo = false;
3767 } 3769 }
3768 if ( deleteTodo ) { 3770 if ( deleteTodo ) {
3769 if ( t->isCompleted() ) { 3771 if ( t->isCompleted() ) {
3770 checkExternalId( t ); 3772 checkExternalId( t );
3771 mCalendar->deleteTodo( t ); 3773 mCalendar->deleteTodo( t );
3772 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 3774 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
3773 } 3775 }
3774 else 3776 else
3775 deleteTodo = false; 3777 deleteTodo = false;
3776 } 3778 }
3777 return deleteTodo; 3779 return deleteTodo;
3778 3780
3779} 3781}
3780void CalendarView::purgeCompleted() 3782void CalendarView::purgeCompleted()
3781{ 3783{
3782 int result = KMessageBox::warningContinueCancel(this, 3784 int result = KMessageBox::warningContinueCancel(this,
3783 i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); 3785 i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge"));
3784 3786
3785 if (result == KMessageBox::Continue) { 3787 if (result == KMessageBox::Continue) {
3786 3788
3787 QPtrList<Todo> todoCal; 3789 QPtrList<Todo> todoCal;
3788 QPtrList<Todo> rootTodos; 3790 QPtrList<Todo> rootTodos;
3789 //QPtrList<Incidence> rel; 3791 //QPtrList<Incidence> rel;
3790 Todo *aTodo;//, *rTodo; 3792 Todo *aTodo;//, *rTodo;
3791 Incidence *rIncidence; 3793 Incidence *rIncidence;
3792 bool childDelete = false; 3794 bool childDelete = false;
3793 bool deletedOne = true; 3795 bool deletedOne = true;
3794 todoCal = calendar()->todos(); 3796 todoCal = calendar()->todos();
3795 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 3797 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
3796 if ( !aTodo->relatedTo() ) 3798 if ( !aTodo->relatedTo() )
3797 rootTodos.append( aTodo ); 3799 rootTodos.append( aTodo );
3798 } 3800 }
3799 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 3801 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
3800 removeCompletedSubTodos( aTodo ); 3802 removeCompletedSubTodos( aTodo );
3801 } 3803 }
3802 3804
3803 updateView(); 3805 updateView();
3804 } 3806 }
3805} 3807}
3806 3808
3807void CalendarView::slotCalendarChanged() 3809void CalendarView::slotCalendarChanged()
3808{ 3810{
3809 ; 3811 ;
3810} 3812}
3811 3813
3812NavigatorBar *CalendarView::navigatorBar() 3814NavigatorBar *CalendarView::navigatorBar()
3813{ 3815{
3814 return mNavigatorBar; 3816 return mNavigatorBar;
3815} 3817}
3816 3818
3817 3819
3818 3820
3819void CalendarView::keyPressEvent ( QKeyEvent *e) 3821void CalendarView::keyPressEvent ( QKeyEvent *e)
3820{ 3822{
3821 //qDebug(" alendarView::keyPressEvent "); 3823 //qDebug(" alendarView::keyPressEvent ");
3822 e->ignore(); 3824 e->ignore();
3823} 3825}
3824 3826
3825 3827
3826bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 3828bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
3827{ 3829{
3828 // mSyncManager = manager; 3830 // mSyncManager = manager;
3829 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 3831 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
3830 qDebug("SyncKDE request detected!"); 3832 qDebug("SyncKDE request detected!");
3831 } 3833 }
3832 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3834 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3833 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3835 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3834 return syncCalendar( filename, mode ); 3836 return syncCalendar( filename, mode );
3835} 3837}
3836bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 3838bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
3837{ 3839{
3838 //mSyncManager = manager; 3840 //mSyncManager = manager;
3839 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3841 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3840 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3842 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3841 if ( resource == "sharp" ) 3843 if ( resource == "sharp" )
3842 syncExternal( 0 ); 3844 syncExternal( 0 );
3843 if ( resource == "phone" ) 3845 if ( resource == "phone" )
3844 syncExternal( 1 ); 3846 syncExternal( 1 );
3845 // pending setmodified 3847 // pending setmodified
3846 return true; 3848 return true;
3847} 3849}
3848void CalendarView::setSyncManager(KSyncManager* manager) 3850void CalendarView::setSyncManager(KSyncManager* manager)
3849{ 3851{
3850 mSyncManager = manager; 3852 mSyncManager = manager;
3851} 3853}
3852 3854
3853void CalendarView::removeSyncInfo( QString syncProfile) 3855void CalendarView::removeSyncInfo( QString syncProfile)
3854{ 3856{
3855 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); 3857 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1());
3856 mCalendar->removeSyncInfo( syncProfile ); 3858 mCalendar->removeSyncInfo( syncProfile );
3857 3859
3858} 3860}
3859 3861
3860void CalendarView::undo_delete() 3862void CalendarView::undo_delete()
3861{ 3863{
3862 //qDebug("undo_delete() "); 3864 //qDebug("undo_delete() ");
3863 Incidence* undo = mCalendar->undoIncidence(); 3865 Incidence* undo = mCalendar->undoIncidence();
3864 if ( !undo ) { 3866 if ( !undo ) {
3865 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 3867 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
3866 i18n("KO/Pi")); 3868 i18n("KO/Pi"));
3867 return; 3869 return;
3868 } 3870 }
3869 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + 3871 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
3870 i18n("\nAre you sure you want\nto restore this?"), 3872 i18n("\nAre you sure you want\nto restore this?"),
3871 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 3873 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
3872 mCalendar->undoDeleteIncidence(); 3874 mCalendar->undoDeleteIncidence();
3873 updateView(); 3875 updateView();
3874 } 3876 }
3875} 3877}
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 0a767b6..4b26058 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,470 +1,471 @@
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 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "mainwindow.h" 47#include "mainwindow.h"
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("korganizerrc") 53 KPimPrefs("korganizerrc")
54{ 54{
55 mCategoryColors.setAutoDelete(true); 55 mCategoryColors.setAutoDelete(true);
56 fillMailDefaults(); 56 fillMailDefaults();
57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
58 QColor defaultHolidayColor = QColor(255,0,0); 58 QColor defaultHolidayColor = QColor(255,0,0);
59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
62 QColor defaultTodoDueTodayColor = QColor(255,220,100); 62 QColor defaultTodoDueTodayColor = QColor(255,220,100);
63 QColor defaultTodoOverdueColor = QColor(255,153,125); 63 QColor defaultTodoOverdueColor = QColor(255,153,125);
64 64
65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
66 mDefaultViewFont = QFont("helvetica",10); 66 mDefaultViewFont = QFont("helvetica",10);
67 mDefaultMonthViewFont = QFont("helvetica",8); 67 mDefaultMonthViewFont = QFont("helvetica",8);
68 mMarcusBainsFont= QFont("helvetica",10); 68 mMarcusBainsFont= QFont("helvetica",10);
69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
70 mEditBoxFont = QFont("helvetica",12); 70 mEditBoxFont = QFont("helvetica",12);
71 mJornalViewFont = QFont("helvetica",12); 71 mJornalViewFont = QFont("helvetica",12);
72 72
73 KPrefs::setCurrentGroup("General"); 73 KPrefs::setCurrentGroup("General");
74 74
75 75
76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
77 77
78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
80 addItemBool("ShowIconSearch",&mShowIconSearch,true); 80 addItemBool("ShowIconSearch",&mShowIconSearch,true);
81 addItemBool("ShowIconList",&mShowIconList,true); 81 addItemBool("ShowIconList",&mShowIconList,true);
82 addItemBool("ShowIconDay1",&mShowIconDay1,true); 82 addItemBool("ShowIconDay1",&mShowIconDay1,true);
83 addItemBool("ShowIconDay5",&mShowIconDay5,true); 83 addItemBool("ShowIconDay5",&mShowIconDay5,true);
84 addItemBool("ShowIconDay7",&mShowIconDay7,true); 84 addItemBool("ShowIconDay7",&mShowIconDay7,true);
85 addItemBool("ShowIconMonth",&mShowIconMonth,true); 85 addItemBool("ShowIconMonth",&mShowIconMonth,true);
86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
88 addItemBool("ShowIconBack",&mShowIconBack,true); 88 addItemBool("ShowIconBack",&mShowIconBack,true);
89 addItemBool("ShowIconToday",&mShowIconToday,true); 89 addItemBool("ShowIconToday",&mShowIconToday,true);
90 addItemBool("ShowIconForward",&mShowIconForward,true); 90 addItemBool("ShowIconForward",&mShowIconForward,true);
91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
94 addItemBool("ShowIconNext",&mShowIconNext,true); 94 addItemBool("ShowIconNext",&mShowIconNext,true);
95 addItemBool("ShowIconJournal",&mShowIconJournal,true); 95 addItemBool("ShowIconJournal",&mShowIconJournal,true);
96 addItemBool("ShowIconStretch",&mShowIconStretch,true); 96 addItemBool("ShowIconStretch",&mShowIconStretch,true);
97 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 97 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
98 98
99 addItemBool("AskForQuit",&mAskForQuit,false); 99 addItemBool("AskForQuit",&mAskForQuit,false);
100 100
101#ifndef DESKTOP_VERSION 101#ifndef DESKTOP_VERSION
102 addItemBool("ShowFullMenu",&mShowFullMenu,false); 102 addItemBool("ShowFullMenu",&mShowFullMenu,false);
103#else 103#else
104 addItemBool("ShowFullMenu",&mShowFullMenu,true); 104 addItemBool("ShowFullMenu",&mShowFullMenu,true);
105#endif 105#endif
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
116 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
119 119
120 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
121 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
122 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
123 123
124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
125 addItemBool("Enable Project View",&mEnableProjectView,false); 125 addItemBool("Enable Project View",&mEnableProjectView,false);
126 addItemBool("Auto Save",&mAutoSave,false); 126 addItemBool("Auto Save",&mAutoSave,false);
127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
128 addItemBool("Confirm Deletes",&mConfirm,true); 128 addItemBool("Confirm Deletes",&mConfirm,true);
129 addItemString("Archive File",&mArchiveFile); 129 addItemString("Archive File",&mArchiveFile);
130 addItemString("Html Export File",&mHtmlExportFile, 130 addItemString("Html Export File",&mHtmlExportFile,
131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
132 addItemBool("Html With Save",&mHtmlWithSave,false); 132 addItemBool("Html With Save",&mHtmlWithSave,false);
133 133
134 KPrefs::setCurrentGroup("Personal Settings"); 134 KPrefs::setCurrentGroup("Personal Settings");
135 135
136 addItemInt("Mail Client",&mMailClient,MailClientKMail); 136 addItemInt("Mail Client",&mMailClient,MailClientKMail);
137 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 137 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
138 addItemBool("Bcc",&mBcc,false); 138 addItemBool("Bcc",&mBcc,false);
139 139
140 KPrefs::setCurrentGroup("Time & Date"); 140 KPrefs::setCurrentGroup("Time & Date");
141 141
142 142
143 addItemInt("Default Start Time",&mStartTime,10); 143 addItemInt("Default Start Time",&mStartTime,10);
144 addItemInt("Default Duration",&mDefaultDuration,2); 144 addItemInt("Default Duration",&mDefaultDuration,2);
145 addItemInt("Default Alarm Time",&mAlarmTime,3); 145 addItemInt("Default Alarm Time",&mAlarmTime,3);
146 KPrefs::setCurrentGroup("AlarmSettings"); 146 KPrefs::setCurrentGroup("AlarmSettings");
147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
151 151
152 152
153 KPrefs::setCurrentGroup("Calendar"); 153 KPrefs::setCurrentGroup("Calendar");
154 154
155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
156 156
157 KPrefs::setCurrentGroup("Fonts"); 157 KPrefs::setCurrentGroup("Fonts");
158 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 158 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
159 addItemFont("TimeBar Font",&mTimeBarFont); 159 addItemFont("TimeBar Font",&mTimeBarFont);
160 addItemFont("MonthView Font",&mMonthViewFont); 160 addItemFont("MonthView Font",&mMonthViewFont);
161 addItemFont("AgendaView Font",&mAgendaViewFont); 161 addItemFont("AgendaView Font",&mAgendaViewFont);
162 addItemFont("MarcusBains Font",&mMarcusBainsFont); 162 addItemFont("MarcusBains Font",&mMarcusBainsFont);
163 addItemFont("TimeLabels Font",&mTimeLabelsFont); 163 addItemFont("TimeLabels Font",&mTimeLabelsFont);
164 addItemFont("TodoView Font",&mTodoViewFont); 164 addItemFont("TodoView Font",&mTodoViewFont);
165 addItemFont("ListView Font",&mListViewFont); 165 addItemFont("ListView Font",&mListViewFont);
166 addItemFont("DateNavigator Font",&mDateNavigatorFont); 166 addItemFont("DateNavigator Font",&mDateNavigatorFont);
167 addItemFont("EditBox Font",&mEditBoxFont); 167 addItemFont("EditBox Font",&mEditBoxFont);
168 addItemFont("JournalView Font",&mJornalViewFont); 168 addItemFont("JournalView Font",&mJornalViewFont);
169 addItemFont("WhatsNextView Font",&mWhatsNextFont); 169 addItemFont("WhatsNextView Font",&mWhatsNextFont);
170 addItemFont("EventView Font",&mEventViewFont); 170 addItemFont("EventView Font",&mEventViewFont);
171 171
172 KPrefs::setCurrentGroup("RemoteSyncing"); 172 KPrefs::setCurrentGroup("RemoteSyncing");
173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
176 addItemInt("LastSyncTime",&mLastSyncTime,0); 176 addItemInt("LastSyncTime",&mLastSyncTime,0);
177 177
178#ifdef _WIN32_ 178#ifdef _WIN32_
179 QString hdp= locateLocal("data","korganizer")+"\\\\"; 179 QString hdp= locateLocal("data","korganizer")+"\\\\";
180#else 180#else
181 QString hdp= locateLocal("data","korganizer")+"/"; 181 QString hdp= locateLocal("data","korganizer")+"/";
182#endif 182#endif
183 183
184 KPrefs::setCurrentGroup("LoadSaveFileNames"); 184 KPrefs::setCurrentGroup("LoadSaveFileNames");
185 185
186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
190 190
191 191
192 KPrefs::setCurrentGroup("Locale"); 192 KPrefs::setCurrentGroup("Locale");
193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
194 194
195 195
196 KPrefs::setCurrentGroup("Colors"); 196 KPrefs::setCurrentGroup("Colors");
197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
212 addItemBool("UseAppColors",&mUseAppColors,false); 212 addItemBool("UseAppColors",&mUseAppColors,false);
213 213
214 214
215 215
216 KPrefs::setCurrentGroup("Views"); 216 KPrefs::setCurrentGroup("Views");
217 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
217 addItemInt("Hour Size",&mHourSize,8); 218 addItemInt("Hour Size",&mHourSize,8);
218 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 219 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
219 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
220 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
221 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
222 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 223 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
223 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
224 addItemBool("Enable ToolTips",&mEnableToolTips,false); 225 addItemBool("Enable ToolTips",&mEnableToolTips,false);
225 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
226 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
227 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
228 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
229 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
230 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
231 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
232 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
233 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
234 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
235 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
236 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
237 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
238 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
239 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
240 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
241 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
242 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
243 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
244#ifdef DESKTOP_VERSION 245#ifdef DESKTOP_VERSION
245 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
246#else 247#else
247 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
248#endif 249#endif
249 addItemInt("Day Begins",&mDayBegins,7); 250 addItemInt("Day Begins",&mDayBegins,7);
250 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 251 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
251 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 252 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
252 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 253 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
253 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
254 255
255 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
256 addItemBool("Full View Month",&mFullViewMonth,true); 257 addItemBool("Full View Month",&mFullViewMonth,true);
257 addItemBool("Full View Todo",&mFullViewTodo,true); 258 addItemBool("Full View Todo",&mFullViewTodo,true);
258 addItemBool("Quick Todo",&mEnableQuickTodo,false); 259 addItemBool("Quick Todo",&mEnableQuickTodo,false);
259 260
260 addItemInt("Next X Days",&mNextXDays,3); 261 addItemInt("Next X Days",&mNextXDays,3);
261 262
262 KPrefs::setCurrentGroup("Printer"); 263 KPrefs::setCurrentGroup("Printer");
263 264
264 KPrefs::setCurrentGroup("Layout"); 265 KPrefs::setCurrentGroup("Layout");
265 266
266 addItemBool("CompactDialogs",&mCompactDialogs,false); 267 addItemBool("CompactDialogs",&mCompactDialogs,false);
267 addItemBool("VerticalScreen",&mVerticalScreen,true); 268 addItemBool("VerticalScreen",&mVerticalScreen,true);
268 269
269 KPrefs::setCurrentGroup("KOrganizer Plugins"); 270 KPrefs::setCurrentGroup("KOrganizer Plugins");
270 271
271 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
272 273
273 KPrefs::setCurrentGroup("Group Scheduling"); 274 KPrefs::setCurrentGroup("Group Scheduling");
274 275
275 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
276 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
277 addItemStringList("AdditionalMails",&mAdditionalMails,""); 278 addItemStringList("AdditionalMails",&mAdditionalMails,"");
278 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
279 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
280 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
281 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
282 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
283 284
284 KPrefs::setCurrentGroup( "Editors" ); 285 KPrefs::setCurrentGroup( "Editors" );
285 286
286 addItemStringList( "EventTemplates", &mEventTemplates ); 287 addItemStringList( "EventTemplates", &mEventTemplates );
287 addItemStringList( "TodoTemplates", &mTodoTemplates ); 288 addItemStringList( "TodoTemplates", &mTodoTemplates );
288 289
289 addItemInt("DestinationPolicy",&mDestination,standardDestination); 290 addItemInt("DestinationPolicy",&mDestination,standardDestination);
290 291
291 292
292 293
293} 294}
294 295
295 296
296KOPrefs::~KOPrefs() 297KOPrefs::~KOPrefs()
297{ 298{
298 if (mInstance == this) 299 if (mInstance == this)
299 mInstance = insd.setObject(0); 300 mInstance = insd.setObject(0);
300 301
301 //qDebug("KOPrefs::~KOPrefs() "); 302 //qDebug("KOPrefs::~KOPrefs() ");
302} 303}
303 304
304 305
305KOPrefs *KOPrefs::instance() 306KOPrefs *KOPrefs::instance()
306{ 307{
307 if (!mInstance) { 308 if (!mInstance) {
308 mInstance = insd.setObject(new KOPrefs()); 309 mInstance = insd.setObject(new KOPrefs());
309 mInstance->readConfig(); 310 mInstance->readConfig();
310 } 311 }
311 312
312 return mInstance; 313 return mInstance;
313} 314}
314 315
315void KOPrefs::usrSetDefaults() 316void KOPrefs::usrSetDefaults()
316{ 317{
317 318
318} 319}
319 320
320void KOPrefs::fillMailDefaults() 321void KOPrefs::fillMailDefaults()
321{ 322{
322 if (mName.isEmpty()) mName = i18n("Anonymous"); 323 if (mName.isEmpty()) mName = i18n("Anonymous");
323 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
324} 325}
325 326
326void KOPrefs::setTimeZoneIdDefault() 327void KOPrefs::setTimeZoneIdDefault()
327{ 328{
328 ; 329 ;
329} 330}
330 331
331void KOPrefs::setCategoryDefaults() 332void KOPrefs::setCategoryDefaults()
332{ 333{
333 mCustomCategories.clear(); 334 mCustomCategories.clear();
334 mCustomCategories = getDefaultList(); 335 mCustomCategories = getDefaultList();
335 336
336 QStringList::Iterator it; 337 QStringList::Iterator it;
337 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 338 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
338 setCategoryColor(*it,mDefaultCategoryColor); 339 setCategoryColor(*it,mDefaultCategoryColor);
339 } 340 }
340} 341}
341 342
342QStringList KOPrefs::getDefaultList() 343QStringList KOPrefs::getDefaultList()
343{ 344{
344 QStringList retval ; 345 QStringList retval ;
345 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 346 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
346 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 347 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
347 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 348 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
348 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 349 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
349 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 350 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
350 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 351 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
351 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 352 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
352 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 353 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
353 retval.sort(); 354 retval.sort();
354 return retval; 355 return retval;
355} 356}
356 357
357void KOPrefs::usrReadConfig() 358void KOPrefs::usrReadConfig()
358{ 359{
359 config()->setGroup("General"); 360 config()->setGroup("General");
360 361
361 mCustomCategories = config()->readListEntry("Custom Categories"); 362 mCustomCategories = config()->readListEntry("Custom Categories");
362 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { 363 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
363 mLocationDefaults.clear(); 364 mLocationDefaults.clear();
364 mEventSummaryUser.clear(); 365 mEventSummaryUser.clear();
365 mTodoSummaryUser.clear(); 366 mTodoSummaryUser.clear();
366 } 367 }
367 mOldLoadedLanguage = mOldLanguage ; 368 mOldLoadedLanguage = mOldLanguage ;
368 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 369 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
369 if (mLocationDefaults.isEmpty()) { 370 if (mLocationDefaults.isEmpty()) {
370 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 371 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
371 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 372 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
372 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 373 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
373 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 374 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
374 mLocationDefaults.sort(); 375 mLocationDefaults.sort();
375 } 376 }
376 377
377 if (mEventSummaryUser.isEmpty()) { 378 if (mEventSummaryUser.isEmpty()) {
378 mEventSummaryUser = getDefaultList() ; 379 mEventSummaryUser = getDefaultList() ;
379 } 380 }
380 if (mTodoSummaryUser.isEmpty()) { 381 if (mTodoSummaryUser.isEmpty()) {
381 mTodoSummaryUser = getDefaultList() ; 382 mTodoSummaryUser = getDefaultList() ;
382 } 383 }
383 384
384 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 385 if (mCustomCategories.isEmpty()) setCategoryDefaults();
385 386
386 config()->setGroup("Personal Settings"); 387 config()->setGroup("Personal Settings");
387 mName = config()->readEntry("user_name",""); 388 mName = config()->readEntry("user_name","");
388 mEmail = config()->readEntry("user_email",""); 389 mEmail = config()->readEntry("user_email","");
389 fillMailDefaults(); 390 fillMailDefaults();
390 391
391 config()->setGroup("Category Colors"); 392 config()->setGroup("Category Colors");
392 QStringList::Iterator it; 393 QStringList::Iterator it;
393 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 394 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
394 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 395 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
395 396
396 } 397 }
397 398
398 KPimPrefs::usrReadConfig(); 399 KPimPrefs::usrReadConfig();
399} 400}
400 401
401 402
402void KOPrefs::usrWriteConfig() 403void KOPrefs::usrWriteConfig()
403{ 404{
404 config()->setGroup("General"); 405 config()->setGroup("General");
405 config()->writeEntry("Custom Categories",mCustomCategories); 406 config()->writeEntry("Custom Categories",mCustomCategories);
406 407
407 config()->setGroup("Personal Settings"); 408 config()->setGroup("Personal Settings");
408 config()->writeEntry("user_name",mName); 409 config()->writeEntry("user_name",mName);
409 config()->writeEntry("user_email",mEmail); 410 config()->writeEntry("user_email",mEmail);
410 411
411 config()->setGroup("Category Colors"); 412 config()->setGroup("Category Colors");
412 QDictIterator<QColor> it(mCategoryColors); 413 QDictIterator<QColor> it(mCategoryColors);
413 while (it.current()) { 414 while (it.current()) {
414 config()->writeEntry(it.currentKey(),*(it.current())); 415 config()->writeEntry(it.currentKey(),*(it.current()));
415 ++it; 416 ++it;
416 } 417 }
417 418
418 419
419 KPimPrefs::usrWriteConfig(); 420 KPimPrefs::usrWriteConfig();
420} 421}
421 422
422void KOPrefs::setCategoryColor(QString cat,const QColor & color) 423void KOPrefs::setCategoryColor(QString cat,const QColor & color)
423{ 424{
424 mCategoryColors.replace(cat,new QColor(color)); 425 mCategoryColors.replace(cat,new QColor(color));
425} 426}
426 427
427QColor *KOPrefs::categoryColor(QString cat) 428QColor *KOPrefs::categoryColor(QString cat)
428{ 429{
429 QColor *color = 0; 430 QColor *color = 0;
430 431
431 if (!cat.isEmpty()) color = mCategoryColors[cat]; 432 if (!cat.isEmpty()) color = mCategoryColors[cat];
432 433
433 if (color) return color; 434 if (color) return color;
434 else return &mDefaultCategoryColor; 435 else return &mDefaultCategoryColor;
435} 436}
436 437
437void KOPrefs::setFullName(const QString &name) 438void KOPrefs::setFullName(const QString &name)
438{ 439{
439 mName = name; 440 mName = name;
440} 441}
441 442
442void KOPrefs::setEmail(const QString &email) 443void KOPrefs::setEmail(const QString &email)
443{ 444{
444 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 445 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
445 mEmail = email; 446 mEmail = email;
446} 447}
447 448
448QString KOPrefs::fullName() 449QString KOPrefs::fullName()
449{ 450{
450 if (mEmailControlCenter) { 451 if (mEmailControlCenter) {
451 KEMailSettings settings; 452 KEMailSettings settings;
452 return settings.getSetting(KEMailSettings::RealName); 453 return settings.getSetting(KEMailSettings::RealName);
453 } else { 454 } else {
454 return mName; 455 return mName;
455 } 456 }
456} 457}
457 458
458QString KOPrefs::email() 459QString KOPrefs::email()
459{ 460{
460 if (mEmailControlCenter) { 461 if (mEmailControlCenter) {
461 KEMailSettings settings; 462 KEMailSettings settings;
462 return settings.getSetting(KEMailSettings::EmailAddress); 463 return settings.getSetting(KEMailSettings::EmailAddress);
463 } else { 464 } else {
464 return mEmail; 465 return mEmail;
465 } 466 }
466} 467}
467KConfig* KOPrefs::getConfig() 468KConfig* KOPrefs::getConfig()
468{ 469{
469 return config(); 470 return config();
470} 471}
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 69722a1..b3acda7 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,276 +1,278 @@
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 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 KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29 29
30class KConfig; 30class KConfig;
31class QFont; 31class QFont;
32class QColor; 32class QColor;
33class QStringList; 33class QStringList;
34 34
35class KOPrefs : public KPimPrefs 35class KOPrefs : public KPimPrefs
36{ 36{
37 public: 37 public:
38 enum { FormatVCalendar, FormatICalendar }; 38 enum { FormatVCalendar, FormatICalendar };
39 enum { MailClientKMail, MailClientSendmail }; 39 enum { MailClientKMail, MailClientSendmail };
40 enum { IMIPDummy, IMIPKMail }; 40 enum { IMIPDummy, IMIPKMail };
41 enum { IMIPOutbox, IMIPdirectsend }; 41 enum { IMIPOutbox, IMIPdirectsend };
42 enum { neverAuto, addressbookAuto, selectedAuto }; 42 enum { neverAuto, addressbookAuto, selectedAuto };
43 enum { standardDestination, askDestination }; 43 enum { standardDestination, askDestination };
44 44
45 virtual ~KOPrefs(); 45 virtual ~KOPrefs();
46 46
47 /** Get instance of KOPrefs. It is made sure that there is only one 47 /** Get instance of KOPrefs. It is made sure that there is only one
48 instance. */ 48 instance. */
49 static KOPrefs *instance(); 49 static KOPrefs *instance();
50 50
51 /** Set preferences to default values */ 51 /** Set preferences to default values */
52 void usrSetDefaults(); 52 void usrSetDefaults();
53 53
54 /** Read preferences from config file */ 54 /** Read preferences from config file */
55 void usrReadConfig(); 55 void usrReadConfig();
56 56
57 /** Write preferences to config file */ 57 /** Write preferences to config file */
58 void usrWriteConfig(); 58 void usrWriteConfig();
59 void setCategoryDefaults(); 59 void setCategoryDefaults();
60 60
61 protected: 61 protected:
62 void setTimeZoneIdDefault(); 62 void setTimeZoneIdDefault();
63 63
64 /** Fill empty mail fields with default values. */ 64 /** Fill empty mail fields with default values. */
65 void fillMailDefaults(); 65 void fillMailDefaults();
66 66
67 private: 67 private:
68 /** Constructor disabled for public. Use instance() to create a KOPrefs 68 /** Constructor disabled for public. Use instance() to create a KOPrefs
69 object. */ 69 object. */
70 KOPrefs(); 70 KOPrefs();
71 71
72 static KOPrefs *mInstance; 72 static KOPrefs *mInstance;
73 QStringList getDefaultList(); 73 QStringList getDefaultList();
74 public: 74 public:
75 // preferences data 75 // preferences data
76 KConfig* getConfig(); 76 KConfig* getConfig();
77 void setFullName(const QString &); 77 void setFullName(const QString &);
78 QString fullName(); 78 QString fullName();
79 void setEmail(const QString &); 79 void setEmail(const QString &);
80 QString email(); 80 QString email();
81 81
82 QString mAdditional; 82 QString mAdditional;
83 83
84 bool mEmailControlCenter; 84 bool mEmailControlCenter;
85 85
86 bool mBcc; 86 bool mBcc;
87 bool mAutoSave; 87 bool mAutoSave;
88 int mAutoSaveInterval; 88 int mAutoSaveInterval;
89 bool mConfirm; 89 bool mConfirm;
90 90
91 bool mEnableGroupScheduling; 91 bool mEnableGroupScheduling;
92 bool mEnableProjectView; 92 bool mEnableProjectView;
93 93
94 int mDefaultFormat; 94 int mDefaultFormat;
95 int mMailClient; 95 int mMailClient;
96 96
97 int mStartTime; 97 int mStartTime;
98 int mDefaultDuration; 98 int mDefaultDuration;
99 int mAlarmTime; 99 int mAlarmTime;
100 100
101 int mWorkingHoursStart; 101 int mWorkingHoursStart;
102 int mWorkingHoursEnd; 102 int mWorkingHoursEnd;
103 bool mExcludeHolidays; 103 bool mExcludeHolidays;
104 bool mExcludeSaturdays; 104 bool mExcludeSaturdays;
105 bool mMarcusBainsShowSeconds; 105 bool mMarcusBainsShowSeconds;
106 106
107 QFont mTimeBarFont; 107 QFont mTimeBarFont;
108 QFont mMonthViewFont; 108 QFont mMonthViewFont;
109 QFont mAgendaViewFont; 109 QFont mAgendaViewFont;
110 QFont mMarcusBainsFont; 110 QFont mMarcusBainsFont;
111 QFont mTimeLabelsFont; 111 QFont mTimeLabelsFont;
112 QFont mTodoViewFont; 112 QFont mTodoViewFont;
113 QFont mListViewFont; 113 QFont mListViewFont;
114 QFont mDateNavigatorFont; 114 QFont mDateNavigatorFont;
115 QFont mEditBoxFont; 115 QFont mEditBoxFont;
116 QFont mJornalViewFont; 116 QFont mJornalViewFont;
117 QFont mWhatsNextFont; 117 QFont mWhatsNextFont;
118 QFont mEventViewFont; 118 QFont mEventViewFont;
119 119
120 120
121 121
122 122
123 QColor mHolidayColor; 123 QColor mHolidayColor;
124 QColor mHighlightColor; 124 QColor mHighlightColor;
125 QColor mEventColor; 125 QColor mEventColor;
126 QColor mAgendaBgColor; 126 QColor mAgendaBgColor;
127 QColor mWorkingHoursColor; 127 QColor mWorkingHoursColor;
128 QColor mTodoDueTodayColor; 128 QColor mTodoDueTodayColor;
129 QColor mTodoOverdueColor; 129 QColor mTodoOverdueColor;
130 QColor mMonthViewEvenColor; 130 QColor mMonthViewEvenColor;
131 QColor mMonthViewOddColor; 131 QColor mMonthViewOddColor;
132 QColor mMonthViewHolidayColor; 132 QColor mMonthViewHolidayColor;
133 bool mMonthViewUsesDayColors; 133 bool mMonthViewUsesDayColors;
134 bool mMonthViewSatSunTog; 134 bool mMonthViewSatSunTog;
135 QColor mAppColor1; 135 QColor mAppColor1;
136 QColor mAppColor2; 136 QColor mAppColor2;
137 bool mUseAppColors; 137 bool mUseAppColors;
138 138
139 int mDayBegins; 139 int mDayBegins;
140 int mHourSize; 140 int mHourSize;
141 int mAllDaySize; 141 int mAllDaySize;
142 bool mShowFullMenu; 142 bool mShowFullMenu;
143 bool mDailyRecur; 143 bool mDailyRecur;
144 bool mWeeklyRecur; 144 bool mWeeklyRecur;
145 bool mMonthDailyRecur; 145 bool mMonthDailyRecur;
146 bool mMonthWeeklyRecur; 146 bool mMonthWeeklyRecur;
147 bool mMonthShowIcons; 147 bool mMonthShowIcons;
148 bool mMonthShowShort; 148 bool mMonthShowShort;
149 bool mEnableToolTips; 149 bool mEnableToolTips;
150 bool mEnableMonthScroll; 150 bool mEnableMonthScroll;
151 bool mFullViewMonth; 151 bool mFullViewMonth;
152 bool mMonthViewUsesCategoryColor; 152 bool mMonthViewUsesCategoryColor;
153 bool mFullViewTodo; 153 bool mFullViewTodo;
154 bool mShowCompletedTodo; 154 bool mShowCompletedTodo;
155 bool mMarcusBainsEnabled; 155 bool mMarcusBainsEnabled;
156 int mNextXDays; 156 int mNextXDays;
157 int mWhatsNextDays; 157 int mWhatsNextDays;
158 int mWhatsNextPrios; 158 int mWhatsNextPrios;
159 bool mEnableQuickTodo; 159 bool mEnableQuickTodo;
160 160
161 bool mCompactDialogs; 161 bool mCompactDialogs;
162 bool mVerticalScreen; 162 bool mVerticalScreen;
163 163
164 bool mShowIconNewTodo; 164 bool mShowIconNewTodo;
165 bool mShowIconNewEvent; 165 bool mShowIconNewEvent;
166 bool mShowIconSearch; 166 bool mShowIconSearch;
167 bool mShowIconList; 167 bool mShowIconList;
168 bool mShowIconDay1; 168 bool mShowIconDay1;
169 bool mShowIconDay5; 169 bool mShowIconDay5;
170 bool mShowIconDay7; 170 bool mShowIconDay7;
171 bool mShowIconMonth; 171 bool mShowIconMonth;
172 bool mShowIconTodoview; 172 bool mShowIconTodoview;
173 bool mShowIconBackFast; 173 bool mShowIconBackFast;
174 bool mShowIconBack; 174 bool mShowIconBack;
175 bool mShowIconToday; 175 bool mShowIconToday;
176 bool mShowIconForward; 176 bool mShowIconForward;
177 bool mShowIconForwardFast; 177 bool mShowIconForwardFast;
178 bool mShowIconWhatsThis; 178 bool mShowIconWhatsThis;
179 bool mShowIconNextDays; 179 bool mShowIconNextDays;
180 bool mShowIconNext; 180 bool mShowIconNext;
181 bool mShowIconJournal; 181 bool mShowIconJournal;
182 182
183 bool mShowIconStretch; 183 bool mShowIconStretch;
184 184
185 bool mToolBarHor; 185 bool mToolBarHor;
186 bool mToolBarUp; 186 bool mToolBarUp;
187 bool mToolBarMiniIcons; 187 bool mToolBarMiniIcons;
188 188
189 bool mAskForQuit; 189 bool mAskForQuit;
190 bool mUsePassWd; 190 bool mUsePassWd;
191 bool mShowSyncEvents; 191 bool mShowSyncEvents;
192 bool mShowTodoInAgenda; 192 bool mShowTodoInAgenda;
193 bool mShowTimeInAgenda; 193 bool mShowTimeInAgenda;
194 bool mHideNonStartedTodos; 194 bool mHideNonStartedTodos;
195 195
196 int mLastSyncTime; 196 int mLastSyncTime;
197 void setCategoryColor(QString cat,const QColor & color); 197 void setCategoryColor(QString cat,const QColor & color);
198 QColor *categoryColor(QString cat); 198 QColor *categoryColor(QString cat);
199 199
200 QString mArchiveFile; 200 QString mArchiveFile;
201 QString mHtmlExportFile; 201 QString mHtmlExportFile;
202 bool mHtmlWithSave; 202 bool mHtmlWithSave;
203 203
204 QStringList mSelectedPlugins; 204 QStringList mSelectedPlugins;
205 205
206 QString mLastImportFile; 206 QString mLastImportFile;
207 QString mLastVcalFile; 207 QString mLastVcalFile;
208 QString mLastSaveFile; 208 QString mLastSaveFile;
209 QString mLastLoadFile; 209 QString mLastLoadFile;
210 210
211 211
212 QString mDefaultAlarmFile; 212 QString mDefaultAlarmFile;
213 int mIMIPScheduler; 213 int mIMIPScheduler;
214 int mIMIPSend; 214 int mIMIPSend;
215 QStringList mAdditionalMails; 215 QStringList mAdditionalMails;
216 int mIMIPAutoRefresh; 216 int mIMIPAutoRefresh;
217 int mIMIPAutoInsertReply; 217 int mIMIPAutoInsertReply;
218 int mIMIPAutoInsertRequest; 218 int mIMIPAutoInsertRequest;
219 int mIMIPAutoFreeBusy; 219 int mIMIPAutoFreeBusy;
220 int mIMIPAutoFreeBusyReply; 220 int mIMIPAutoFreeBusyReply;
221 221
222 QStringList mTodoTemplates; 222 QStringList mTodoTemplates;
223 QStringList mEventTemplates; 223 QStringList mEventTemplates;
224 224
225 int mDestination; 225 int mDestination;
226 226
227 227
228 bool mEditOnDoubleClick; 228 bool mEditOnDoubleClick;
229 bool mViewChangeHoldFullscreen; 229 bool mViewChangeHoldFullscreen;
230 bool mViewChangeHoldNonFullscreen; 230 bool mViewChangeHoldNonFullscreen;
231 bool mCenterOnCurrentTime; 231 bool mCenterOnCurrentTime;
232 bool mSetTimeToDayStartAt; 232 bool mSetTimeToDayStartAt;
233 bool mHighlightCurrentDay; 233 bool mHighlightCurrentDay;
234 bool mUseHighlightLightColor; 234 bool mUseHighlightLightColor;
235 bool mListViewMonthTimespan; 235 bool mListViewMonthTimespan;
236 bool mWNViewShowsParents; 236 bool mWNViewShowsParents;
237 bool mWNViewShowsPast; 237 bool mWNViewShowsPast;
238 bool mWNViewShowLocation; 238 bool mWNViewShowLocation;
239 bool mTodoViewShowsPercentage; 239 bool mTodoViewShowsPercentage;
240 bool mTodoViewUsesCatColors; 240 bool mTodoViewUsesCatColors;
241 bool mTodoViewUsesSmallFont; 241 bool mTodoViewUsesSmallFont;
242 bool mTodoViewUsesForegroundColor; 242 bool mTodoViewUsesForegroundColor;
243 bool mMonthViewUsesForegroundColor; 243 bool mMonthViewUsesForegroundColor;
244 244
245 bool mHightlightDateTimeEdit; 245 bool mHightlightDateTimeEdit;
246 bool mShortDateInViewer; 246 bool mShortDateInViewer;
247 247
248 bool mShowDateNavigator;
249
248 QStringList mLocationDefaults; 250 QStringList mLocationDefaults;
249 QStringList mEventSummaryUser; 251 QStringList mEventSummaryUser;
250 QStringList mTodoSummaryUser; 252 QStringList mTodoSummaryUser;
251 253
252 bool mUseInternalAlarmNotification; 254 bool mUseInternalAlarmNotification;
253 int mAlarmPlayBeeps; 255 int mAlarmPlayBeeps;
254 int mAlarmSuspendTime; 256 int mAlarmSuspendTime;
255 int mAlarmSuspendCount; 257 int mAlarmSuspendCount;
256 int mAlarmBeepInterval; 258 int mAlarmBeepInterval;
257 int mOldLanguage; 259 int mOldLanguage;
258 int mOldLoadedLanguage; 260 int mOldLoadedLanguage;
259 261
260 262
261 QString mActiveSyncPort; 263 QString mActiveSyncPort;
262 QString mActiveSyncIP; 264 QString mActiveSyncIP;
263 265
264 private: 266 private:
265 QDict<QColor> mCategoryColors; 267 QDict<QColor> mCategoryColors;
266 QColor mDefaultCategoryColor; 268 QColor mDefaultCategoryColor;
267 269
268 QFont mDefaultTimeBarFont; 270 QFont mDefaultTimeBarFont;
269 QFont mDefaultViewFont; 271 QFont mDefaultViewFont;
270 QFont mDefaultMonthViewFont; 272 QFont mDefaultMonthViewFont;
271 273
272 QString mName; 274 QString mName;
273 QString mEmail; 275 QString mEmail;
274}; 276};
275 277
276#endif 278#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 5ec7ddd..151b55b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -617,1282 +617,1286 @@ void MainWindow::initActions()
617 connect( action, SIGNAL( activated() ), 617 connect( action, SIGNAL( activated() ),
618 mView, SLOT( showDatePicker() ) ); 618 mView, SLOT( showDatePicker() ) );
619 action->addTo( iconToolBar ); 619 action->addTo( iconToolBar );
620 viewMenu->insertSeparator(); 620 viewMenu->insertSeparator();
621 icon = loadPixmap( pathString + "list" ); 621 icon = loadPixmap( pathString + "list" );
622 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 622 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
623 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 623 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
624 showlist_action->addTo( viewMenu ); 624 showlist_action->addTo( viewMenu );
625 connect( showlist_action, SIGNAL( activated() ), 625 connect( showlist_action, SIGNAL( activated() ),
626 mView->viewManager(), SLOT( showListView() ) ); 626 mView->viewManager(), SLOT( showListView() ) );
627 627
628 628
629 icon = loadPixmap( pathString + "day" ); 629 icon = loadPixmap( pathString + "day" );
630 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 630 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
631 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 631 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
632 day1_action->addTo( viewMenu ); 632 day1_action->addTo( viewMenu );
633 // action->addTo( toolBar ); 633 // action->addTo( toolBar );
634 connect( day1_action, SIGNAL( activated() ), 634 connect( day1_action, SIGNAL( activated() ),
635 mView->viewManager(), SLOT( showDayView() ) ); 635 mView->viewManager(), SLOT( showDayView() ) );
636 636
637 icon = loadPixmap( pathString + "workweek" ); 637 icon = loadPixmap( pathString + "workweek" );
638 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 638 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
639 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 639 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
640 day5_action->addTo( viewMenu ); 640 day5_action->addTo( viewMenu );
641 connect( day5_action, SIGNAL( activated() ), 641 connect( day5_action, SIGNAL( activated() ),
642 mView->viewManager(), SLOT( showWorkWeekView() ) ); 642 mView->viewManager(), SLOT( showWorkWeekView() ) );
643 643
644 icon = loadPixmap( pathString + "week" ); 644 icon = loadPixmap( pathString + "week" );
645 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 645 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
646 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 646 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
647 day7_action->addTo( viewMenu ); 647 day7_action->addTo( viewMenu );
648 connect( day7_action, SIGNAL( activated() ), 648 connect( day7_action, SIGNAL( activated() ),
649 mView->viewManager(), SLOT( showWeekView() ) ); 649 mView->viewManager(), SLOT( showWeekView() ) );
650 650
651 icon = loadPixmap( pathString + "month" ); 651 icon = loadPixmap( pathString + "month" );
652 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 652 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
653 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 653 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
654 month_action->addTo( viewMenu ); 654 month_action->addTo( viewMenu );
655 connect( month_action, SIGNAL( activated() ), 655 connect( month_action, SIGNAL( activated() ),
656 mView->viewManager(), SLOT( showMonthView() ) ); 656 mView->viewManager(), SLOT( showMonthView() ) );
657 657
658 icon = loadPixmap( pathString + "todo" ); 658 icon = loadPixmap( pathString + "todo" );
659 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 659 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
660 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 660 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
661 todoview_action->addTo( viewMenu ); 661 todoview_action->addTo( viewMenu );
662 connect( todoview_action, SIGNAL( activated() ), 662 connect( todoview_action, SIGNAL( activated() ),
663 mView->viewManager(), SLOT( showTodoView() ) ); 663 mView->viewManager(), SLOT( showTodoView() ) );
664 664
665 icon = loadPixmap( pathString + "journal" ); 665 icon = loadPixmap( pathString + "journal" );
666 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 666 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
667 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 667 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
668 viewjournal_action->addTo( viewMenu ); 668 viewjournal_action->addTo( viewMenu );
669 connect( viewjournal_action, SIGNAL( activated() ), 669 connect( viewjournal_action, SIGNAL( activated() ),
670 mView->viewManager(), SLOT( showJournalView() ) ); 670 mView->viewManager(), SLOT( showJournalView() ) );
671 671
672 icon = loadPixmap( pathString + "xdays" ); 672 icon = loadPixmap( pathString + "xdays" );
673 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); 673 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 );
674 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 674 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
675 xdays_action->addTo( viewMenu ); 675 xdays_action->addTo( viewMenu );
676 connect( xdays_action, SIGNAL( activated() ), 676 connect( xdays_action, SIGNAL( activated() ),
677 mView->viewManager(), SLOT( showNextXView() ) ); 677 mView->viewManager(), SLOT( showNextXView() ) );
678 678
679 icon = loadPixmap( pathString + "whatsnext" ); 679 icon = loadPixmap( pathString + "whatsnext" );
680 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); 680 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 );
681 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 681 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
682 whatsnext_action->addTo( viewMenu ); 682 whatsnext_action->addTo( viewMenu );
683 connect( whatsnext_action, SIGNAL( activated() ), 683 connect( whatsnext_action, SIGNAL( activated() ),
684 mView->viewManager(), SLOT( showWhatsNextView() ) ); 684 mView->viewManager(), SLOT( showWhatsNextView() ) );
685 685
686#if 0 686#if 0
687 action = new QAction( "view_timespan", "Time Span", 0, this ); 687 action = new QAction( "view_timespan", "Time Span", 0, this );
688 action->addTo( viewMenu ); 688 action->addTo( viewMenu );
689 connect( action, SIGNAL( activated() ), 689 connect( action, SIGNAL( activated() ),
690 mView->viewManager(), SLOT( showTimeSpanView() ) ); 690 mView->viewManager(), SLOT( showTimeSpanView() ) );
691#endif 691#endif
692 692
693 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 693 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
694 this ); 694 this );
695 mNewSubTodoAction->addTo( actionMenu ); 695 mNewSubTodoAction->addTo( actionMenu );
696 connect( mNewSubTodoAction, SIGNAL( activated() ), 696 connect( mNewSubTodoAction, SIGNAL( activated() ),
697 mView, SLOT( newSubTodo() ) ); 697 mView, SLOT( newSubTodo() ) );
698 698
699 actionMenu->insertSeparator(); 699 actionMenu->insertSeparator();
700 700
701 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 701 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
702 mShowAction->addTo( actionMenu ); 702 mShowAction->addTo( actionMenu );
703 connect( mShowAction, SIGNAL( activated() ), 703 connect( mShowAction, SIGNAL( activated() ),
704 mView, SLOT( showIncidence() ) ); 704 mView, SLOT( showIncidence() ) );
705 705
706 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 706 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
707 mEditAction->addTo( actionMenu ); 707 mEditAction->addTo( actionMenu );
708 connect( mEditAction, SIGNAL( activated() ), 708 connect( mEditAction, SIGNAL( activated() ),
709 mView, SLOT( editIncidence() ) ); 709 mView, SLOT( editIncidence() ) );
710 710
711 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 711 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
712 mDeleteAction->addTo( actionMenu ); 712 mDeleteAction->addTo( actionMenu );
713 connect( mDeleteAction, SIGNAL( activated() ), 713 connect( mDeleteAction, SIGNAL( activated() ),
714 mView, SLOT( deleteIncidence() ) ); 714 mView, SLOT( deleteIncidence() ) );
715 715
716 716
717 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 717 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
718 mCloneAction->addTo( actionMenu ); 718 mCloneAction->addTo( actionMenu );
719 connect( mCloneAction, SIGNAL( activated() ), 719 connect( mCloneAction, SIGNAL( activated() ),
720 mView, SLOT( cloneIncidence() ) ); 720 mView, SLOT( cloneIncidence() ) );
721 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 721 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
722 mMoveAction->addTo( actionMenu ); 722 mMoveAction->addTo( actionMenu );
723 connect( mMoveAction, SIGNAL( activated() ), 723 connect( mMoveAction, SIGNAL( activated() ),
724 mView, SLOT( moveIncidence() ) ); 724 mView, SLOT( moveIncidence() ) );
725 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 725 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
726 mBeamAction->addTo( actionMenu ); 726 mBeamAction->addTo( actionMenu );
727 connect( mBeamAction, SIGNAL( activated() ), 727 connect( mBeamAction, SIGNAL( activated() ),
728 mView, SLOT( beamIncidence() ) ); 728 mView, SLOT( beamIncidence() ) );
729 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 729 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
730 mCancelAction->addTo( actionMenu ); 730 mCancelAction->addTo( actionMenu );
731 connect( mCancelAction, SIGNAL( activated() ), 731 connect( mCancelAction, SIGNAL( activated() ),
732 mView, SLOT( toggleCancelIncidence() ) ); 732 mView, SLOT( toggleCancelIncidence() ) );
733 733
734 actionMenu->insertSeparator(); 734 actionMenu->insertSeparator();
735 735
736 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 736 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
737 this ); 737 this );
738 action->addTo( actionMenu ); 738 action->addTo( actionMenu );
739 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 739 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
740 740
741 icon = loadPixmap( pathString + "search" ); 741 icon = loadPixmap( pathString + "search" );
742 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 742 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
743 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); 743 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4);
744 search_action->addTo( actionMenu ); 744 search_action->addTo( actionMenu );
745 connect( search_action, SIGNAL( activated() ), 745 connect( search_action, SIGNAL( activated() ),
746 mView->dialogManager(), SLOT( showSearchDialog() ) ); 746 mView->dialogManager(), SLOT( showSearchDialog() ) );
747 747
748 icon = loadPixmap( pathString + "today" ); 748 icon = loadPixmap( pathString + "today" );
749 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 749 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
750 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 750 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
751 today_action->addTo( actionMenu ); 751 today_action->addTo( actionMenu );
752 connect( today_action, SIGNAL( activated() ), 752 connect( today_action, SIGNAL( activated() ),
753 mView, SLOT( goToday() ) ); 753 mView, SLOT( goToday() ) );
754 754
755 if ( KOPrefs::instance()->mShowFullMenu ) { 755 if ( KOPrefs::instance()->mShowFullMenu ) {
756 actionMenu->insertSeparator(); 756 actionMenu->insertSeparator();
757 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 757 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
758 758
759 } 759 }
760 // actionMenu->insertSeparator(); 760 // actionMenu->insertSeparator();
761 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 761 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
762 this ); 762 this );
763 action->addTo( importMenu ); 763 action->addTo( importMenu );
764 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 764 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
765 action = new QAction( "import_quick", i18n("Import last file"), 0, 765 action = new QAction( "import_quick", i18n("Import last file"), 0,
766 this ); 766 this );
767 action->addTo( importMenu ); 767 action->addTo( importMenu );
768 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 768 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
769 importMenu->insertSeparator(); 769 importMenu->insertSeparator();
770 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 770 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
771 this ); 771 this );
772 action->addTo( importMenu ); 772 action->addTo( importMenu );
773 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 773 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
774#ifndef DESKTOP_VERSION 774#ifndef DESKTOP_VERSION
775 importMenu->insertSeparator(); 775 importMenu->insertSeparator();
776 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 776 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
777 this ); 777 this );
778 action->addTo( importMenu ); 778 action->addTo( importMenu );
779 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 779 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
780#else 780#else
781#ifdef _WIN32_ 781#ifdef _WIN32_
782 importMenu->insertSeparator(); 782 importMenu->insertSeparator();
783 action = new QAction( "import_ol", i18n("Import from OL"), 0, 783 action = new QAction( "import_ol", i18n("Import from OL"), 0,
784 this ); 784 this );
785 action->addTo( importMenu ); 785 action->addTo( importMenu );
786 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 786 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
787#endif 787#endif
788#endif 788#endif
789 789
790 importMenu->insertSeparator(); 790 importMenu->insertSeparator();
791 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 791 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
792 this ); 792 this );
793 action->addTo( importMenu ); 793 action->addTo( importMenu );
794 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 794 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
795 795
796 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 796 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
797 this ); 797 this );
798 action->addTo( importMenu ); 798 action->addTo( importMenu );
799 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 799 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
800 800
801 importMenu->insertSeparator(); 801 importMenu->insertSeparator();
802 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 802 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
803 this ); 803 this );
804 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 804 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
805 805
806 806
807 //LR 807 //LR
808 QPopupMenu *ex2phone = new QPopupMenu( this ); 808 QPopupMenu *ex2phone = new QPopupMenu( this );
809 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 809 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
810 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 810 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
811 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 811 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
812 importMenu->insertItem( i18n("Export to phone"), ex2phone ); 812 importMenu->insertItem( i18n("Export to phone"), ex2phone );
813 813
814 importMenu->insertSeparator(); 814 importMenu->insertSeparator();
815 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 815 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
816 this ); 816 this );
817 action->addTo( importMenu ); 817 action->addTo( importMenu );
818 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 818 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
819#ifndef DESKTOP_VERSION 819#ifndef DESKTOP_VERSION
820 importMenu->insertSeparator(); 820 importMenu->insertSeparator();
821 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 821 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
822 this ); 822 this );
823 brAction->addTo( importMenu ); 823 brAction->addTo( importMenu );
824 brAction->setToggleAction (true ) ; 824 brAction->setToggleAction (true ) ;
825 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 825 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
826 826
827 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 827 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
828 this ); 828 this );
829 action->addTo( importMenu ); 829 action->addTo( importMenu );
830 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 830 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
831 831
832 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 832 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
833 this ); 833 this );
834 action->addTo( importMenu ); 834 action->addTo( importMenu );
835 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 835 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
836#else 836#else
837 importMenu->insertSeparator(); 837 importMenu->insertSeparator();
838 icon = loadPixmap( pathString + "print" ); 838 icon = loadPixmap( pathString + "print" );
839 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 839 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
840 action->addTo( importMenu ); 840 action->addTo( importMenu );
841 connect( action, SIGNAL( activated() ), 841 connect( action, SIGNAL( activated() ),
842 this, SLOT( printCal() ) ); 842 this, SLOT( printCal() ) );
843 843
844 icon = loadPixmap( pathString + "print" ); 844 icon = loadPixmap( pathString + "print" );
845 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 845 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
846 action->addTo( importMenu ); 846 action->addTo( importMenu );
847 connect( action, SIGNAL( activated() ), 847 connect( action, SIGNAL( activated() ),
848 this, SLOT( printSel() ) ); 848 this, SLOT( printSel() ) );
849 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 849 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
850 action->addTo( importMenu ); 850 action->addTo( importMenu );
851 connect( action, SIGNAL( activated() ), 851 connect( action, SIGNAL( activated() ),
852 mView->viewManager(), SIGNAL( printWNV() ) ); 852 mView->viewManager(), SIGNAL( printWNV() ) );
853#endif 853#endif
854 importMenu->insertSeparator(); 854 importMenu->insertSeparator();
855 action = new QAction( "beam all", i18n("Save"), 0, 855 action = new QAction( "beam all", i18n("Save"), 0,
856 this ); 856 this );
857 action->addTo( importMenu ); 857 action->addTo( importMenu );
858 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 858 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
859 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 859 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
860 this ); 860 this );
861 action->addTo( importMenu ); 861 action->addTo( importMenu );
862 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 862 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
863 863
864 //menuBar->insertItem( "Configure",configureMenu ); 864 //menuBar->insertItem( "Configure",configureMenu );
865 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 865 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
866 icon = loadPixmap( "korganizer/korganizer" ); 866 icon = loadPixmap( "korganizer/korganizer" );
867 867
868 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 868 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
869 action->addTo( helpMenu ); 869 action->addTo( helpMenu );
870 connect( action, SIGNAL( activated() ), 870 connect( action, SIGNAL( activated() ),
871 SLOT( whatsNew() ) ); 871 SLOT( whatsNew() ) );
872 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 872 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
873 action->addTo( helpMenu ); 873 action->addTo( helpMenu );
874 connect( action, SIGNAL( activated() ), 874 connect( action, SIGNAL( activated() ),
875 SLOT( features() ) ); 875 SLOT( features() ) );
876 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 876 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
877 action->addTo( helpMenu ); 877 action->addTo( helpMenu );
878 connect( action, SIGNAL( activated() ), 878 connect( action, SIGNAL( activated() ),
879 SLOT( keyBindings() ) ); 879 SLOT( keyBindings() ) );
880 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 880 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
881 action->addTo( helpMenu ); 881 action->addTo( helpMenu );
882 connect( action, SIGNAL( activated() ), 882 connect( action, SIGNAL( activated() ),
883 SLOT( synchowto() ) ); 883 SLOT( synchowto() ) );
884 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 884 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
885 action->addTo( helpMenu ); 885 action->addTo( helpMenu );
886 connect( action, SIGNAL( activated() ), 886 connect( action, SIGNAL( activated() ),
887 SLOT( kdesynchowto() ) ); 887 SLOT( kdesynchowto() ) );
888 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 888 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
889 action->addTo( helpMenu ); 889 action->addTo( helpMenu );
890 connect( action, SIGNAL( activated() ), 890 connect( action, SIGNAL( activated() ),
891 SLOT( multisynchowto() ) ); 891 SLOT( multisynchowto() ) );
892 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 892 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
893 action->addTo( helpMenu ); 893 action->addTo( helpMenu );
894 connect( action, SIGNAL( activated() ), 894 connect( action, SIGNAL( activated() ),
895 SLOT( aboutAutoSaving() ) ); 895 SLOT( aboutAutoSaving() ) );
896 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 896 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
897 action->addTo( helpMenu ); 897 action->addTo( helpMenu );
898 connect( action, SIGNAL( activated() ), 898 connect( action, SIGNAL( activated() ),
899 SLOT( aboutKnownBugs() ) ); 899 SLOT( aboutKnownBugs() ) );
900 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 900 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
901 action->addTo( helpMenu ); 901 action->addTo( helpMenu );
902 connect( action, SIGNAL( activated() ), 902 connect( action, SIGNAL( activated() ),
903 SLOT( usertrans() ) ); 903 SLOT( usertrans() ) );
904 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 904 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
905 action->addTo( helpMenu ); 905 action->addTo( helpMenu );
906 connect( action, SIGNAL( activated() ), 906 connect( action, SIGNAL( activated() ),
907 SLOT( faq() ) ); 907 SLOT( faq() ) );
908 action = new QAction( "licence", i18n("Licence..."), 0, this ); 908 action = new QAction( "licence", i18n("Licence..."), 0, this );
909 action->addTo( helpMenu ); 909 action->addTo( helpMenu );
910 connect( action, SIGNAL( activated() ), 910 connect( action, SIGNAL( activated() ),
911 SLOT( licence() ) ); 911 SLOT( licence() ) );
912 action = new QAction( "about", i18n("About..."), 0, this ); 912 action = new QAction( "about", i18n("About..."), 0, this );
913 action->addTo( helpMenu ); 913 action->addTo( helpMenu );
914 connect( action, SIGNAL( activated() ), 914 connect( action, SIGNAL( activated() ),
915 SLOT( about() ) ); 915 SLOT( about() ) );
916 //menuBar->insertSeparator(); 916 //menuBar->insertSeparator();
917 917
918 // ****************************************************** 918 // ******************************************************
919 // menubar icons 919 // menubar icons
920 920
921 921
922 iconToolBar->setHorizontalStretchable (true ); 922 iconToolBar->setHorizontalStretchable (true );
923 //menuBar->insertItem( iconToolBar ); 923 //menuBar->insertItem( iconToolBar );
924 //xdays_action 924 //xdays_action
925 if (p-> mShowIconNewEvent) 925 if (p-> mShowIconNewEvent)
926 ne_action->addTo( iconToolBar ); 926 ne_action->addTo( iconToolBar );
927 if (p->mShowIconNewTodo ) 927 if (p->mShowIconNewTodo )
928 nt_action->addTo( iconToolBar ); 928 nt_action->addTo( iconToolBar );
929 if (p-> mShowIconSearch) 929 if (p-> mShowIconSearch)
930 search_action->addTo( iconToolBar ); 930 search_action->addTo( iconToolBar );
931 if (p-> mShowIconNext) 931 if (p-> mShowIconNext)
932 whatsnext_action->addTo( iconToolBar ); 932 whatsnext_action->addTo( iconToolBar );
933 if (p-> mShowIconNextDays) 933 if (p-> mShowIconNextDays)
934 xdays_action->addTo( iconToolBar ); 934 xdays_action->addTo( iconToolBar );
935 if (p-> mShowIconList) 935 if (p-> mShowIconList)
936 showlist_action->addTo( iconToolBar ); 936 showlist_action->addTo( iconToolBar );
937 if (p-> mShowIconDay1) 937 if (p-> mShowIconDay1)
938 day1_action->addTo( iconToolBar ); 938 day1_action->addTo( iconToolBar );
939 if (p-> mShowIconDay5) 939 if (p-> mShowIconDay5)
940 day5_action->addTo( iconToolBar ); 940 day5_action->addTo( iconToolBar );
941 if (p-> mShowIconDay7) 941 if (p-> mShowIconDay7)
942 day7_action->addTo( iconToolBar ); 942 day7_action->addTo( iconToolBar );
943 if (p-> mShowIconMonth) 943 if (p-> mShowIconMonth)
944 month_action->addTo( iconToolBar ); 944 month_action->addTo( iconToolBar );
945 if (p-> mShowIconTodoview) 945 if (p-> mShowIconTodoview)
946 todoview_action->addTo( iconToolBar ); 946 todoview_action->addTo( iconToolBar );
947 if (p-> mShowIconJournal) 947 if (p-> mShowIconJournal)
948 viewjournal_action->addTo( iconToolBar ); 948 viewjournal_action->addTo( iconToolBar );
949 icon = loadPixmap( pathString + "2leftarrowB" ); 949 icon = loadPixmap( pathString + "2leftarrowB" );
950 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 950 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
951 if (p-> mShowIconBackFast) { 951 if (p-> mShowIconBackFast) {
952 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 952 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
953 connect( action, SIGNAL( activated() ), 953 connect( action, SIGNAL( activated() ),
954 mView, SLOT( goPreviousMonth() ) ); 954 mView, SLOT( goPreviousMonth() ) );
955 action->addTo( iconToolBar ); 955 action->addTo( iconToolBar );
956 } 956 }
957 icon = loadPixmap( pathString + "1leftarrowB" ); 957 icon = loadPixmap( pathString + "1leftarrowB" );
958 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 958 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
959 if (p-> mShowIconBack) { 959 if (p-> mShowIconBack) {
960 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 960 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
961 connect( action, SIGNAL( activated() ), 961 connect( action, SIGNAL( activated() ),
962 mView, SLOT( goPrevious() ) ); 962 mView, SLOT( goPrevious() ) );
963 action->addTo( iconToolBar ); 963 action->addTo( iconToolBar );
964 } 964 }
965 if (p-> mShowIconToday) 965 if (p-> mShowIconToday)
966 today_action->addTo( iconToolBar ); 966 today_action->addTo( iconToolBar );
967 icon = loadPixmap( pathString + "1rightarrowB" ); 967 icon = loadPixmap( pathString + "1rightarrowB" );
968 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 968 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
969 if (p-> mShowIconForward) { 969 if (p-> mShowIconForward) {
970 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 970 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
971 connect( action, SIGNAL( activated() ), 971 connect( action, SIGNAL( activated() ),
972 mView, SLOT( goNext() ) ); 972 mView, SLOT( goNext() ) );
973 action->addTo( iconToolBar ); 973 action->addTo( iconToolBar );
974 } 974 }
975 icon = loadPixmap( pathString + "2rightarrowB" ); 975 icon = loadPixmap( pathString + "2rightarrowB" );
976 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 976 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
977 if (p-> mShowIconForwardFast) { 977 if (p-> mShowIconForwardFast) {
978 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 978 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
979 connect( action, SIGNAL( activated() ), 979 connect( action, SIGNAL( activated() ),
980 mView, SLOT( goNextMonth() ) ); 980 mView, SLOT( goNextMonth() ) );
981 action->addTo( iconToolBar ); 981 action->addTo( iconToolBar );
982 } 982 }
983 983
984 984
985 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 985 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
986 986
987 if (p-> mShowIconNewEvent) 987 if (p-> mShowIconNewEvent)
988 configureToolBarMenu->setItemChecked( 10, true ); 988 configureToolBarMenu->setItemChecked( 10, true );
989 if (p->mShowIconNewTodo ) 989 if (p->mShowIconNewTodo )
990 configureToolBarMenu->setItemChecked( 20, true ); 990 configureToolBarMenu->setItemChecked( 20, true );
991 if (p-> mShowIconSearch) 991 if (p-> mShowIconSearch)
992 configureToolBarMenu->setItemChecked( 120, true ); 992 configureToolBarMenu->setItemChecked( 120, true );
993 if (p-> mShowIconList) 993 if (p-> mShowIconList)
994 configureToolBarMenu->setItemChecked( 30, true ); 994 configureToolBarMenu->setItemChecked( 30, true );
995 if (p-> mShowIconDay1) 995 if (p-> mShowIconDay1)
996 configureToolBarMenu->setItemChecked( 40, true ); 996 configureToolBarMenu->setItemChecked( 40, true );
997 if (p-> mShowIconDay5) 997 if (p-> mShowIconDay5)
998 configureToolBarMenu->setItemChecked( 50, true ); 998 configureToolBarMenu->setItemChecked( 50, true );
999 if (p-> mShowIconDay7) 999 if (p-> mShowIconDay7)
1000 configureToolBarMenu->setItemChecked( 60, true ); 1000 configureToolBarMenu->setItemChecked( 60, true );
1001 if (p-> mShowIconMonth) 1001 if (p-> mShowIconMonth)
1002 configureToolBarMenu->setItemChecked( 70, true ); 1002 configureToolBarMenu->setItemChecked( 70, true );
1003 if (p-> mShowIconTodoview) 1003 if (p-> mShowIconTodoview)
1004 configureToolBarMenu->setItemChecked( 80, true ); 1004 configureToolBarMenu->setItemChecked( 80, true );
1005 if (p-> mShowIconBackFast) 1005 if (p-> mShowIconBackFast)
1006 configureToolBarMenu->setItemChecked( 200, true ); 1006 configureToolBarMenu->setItemChecked( 200, true );
1007 if (p-> mShowIconBack) 1007 if (p-> mShowIconBack)
1008 configureToolBarMenu->setItemChecked( 210, true ); 1008 configureToolBarMenu->setItemChecked( 210, true );
1009 if (p-> mShowIconToday) 1009 if (p-> mShowIconToday)
1010 configureToolBarMenu->setItemChecked( 130, true ); 1010 configureToolBarMenu->setItemChecked( 130, true );
1011 if (p-> mShowIconForward) 1011 if (p-> mShowIconForward)
1012 configureToolBarMenu->setItemChecked( 220, true ); 1012 configureToolBarMenu->setItemChecked( 220, true );
1013 if (p-> mShowIconForwardFast) 1013 if (p-> mShowIconForwardFast)
1014 configureToolBarMenu->setItemChecked( 230, true ); 1014 configureToolBarMenu->setItemChecked( 230, true );
1015 if (p-> mShowIconNextDays) 1015 if (p-> mShowIconNextDays)
1016 configureToolBarMenu->setItemChecked( 100, true ); 1016 configureToolBarMenu->setItemChecked( 100, true );
1017 if (p-> mShowIconNext) 1017 if (p-> mShowIconNext)
1018 configureToolBarMenu->setItemChecked( 110, true ); 1018 configureToolBarMenu->setItemChecked( 110, true );
1019 if (p-> mShowIconJournal) 1019 if (p-> mShowIconJournal)
1020 configureToolBarMenu->setItemChecked( 90, true ); 1020 configureToolBarMenu->setItemChecked( 90, true );
1021 if (p-> mShowIconWhatsThis) 1021 if (p-> mShowIconWhatsThis)
1022 configureToolBarMenu->setItemChecked( 300, true ); 1022 configureToolBarMenu->setItemChecked( 300, true );
1023 1023
1024 QLabel* dummy = new QLabel( iconToolBar ); 1024 QLabel* dummy = new QLabel( iconToolBar );
1025 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1025 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1026 if (!p-> mShowIconStretch) 1026 if (!p-> mShowIconStretch)
1027 iconToolBar->setStretchableWidget ( dummy ) ; 1027 iconToolBar->setStretchableWidget ( dummy ) ;
1028 else 1028 else
1029 configureToolBarMenu->setItemChecked( 5, true ); 1029 configureToolBarMenu->setItemChecked( 5, true );
1030 if (p-> mShowIconWhatsThis) 1030 if (p-> mShowIconWhatsThis)
1031 QWhatsThis::whatsThisButton ( iconToolBar ); 1031 QWhatsThis::whatsThisButton ( iconToolBar );
1032 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1032 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1033 configureAgenda( p->mHourSize ); 1033 configureAgenda( p->mHourSize );
1034 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1034 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1035} 1035}
1036 1036
1037void MainWindow::exportToPhone( int mode ) 1037void MainWindow::exportToPhone( int mode )
1038{ 1038{
1039 1039
1040 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1040 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1041 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1041 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1042 KOex2phonePrefs ex2phone; 1042 KOex2phonePrefs ex2phone;
1043 1043
1044 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1044 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1045 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1045 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1046 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1046 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1047 if ( mode == 1 ) 1047 if ( mode == 1 )
1048 ex2phone.setCaption(i18n("Export complete calendar")); 1048 ex2phone.setCaption(i18n("Export complete calendar"));
1049 if ( mode == 2 ) 1049 if ( mode == 2 )
1050 ex2phone.setCaption(i18n("Export filtered calendar")); 1050 ex2phone.setCaption(i18n("Export filtered calendar"));
1051 1051
1052 if ( !ex2phone.exec() ) { 1052 if ( !ex2phone.exec() ) {
1053 return; 1053 return;
1054 } 1054 }
1055 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1055 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1056 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1056 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1057 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1057 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1058 1058
1059 int inFuture = 0; 1059 int inFuture = 0;
1060 if ( ex2phone.mWriteBackFuture->isChecked() ) 1060 if ( ex2phone.mWriteBackFuture->isChecked() )
1061 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1061 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1062 QPtrList<Incidence> delSel; 1062 QPtrList<Incidence> delSel;
1063 if ( mode == 1 ) 1063 if ( mode == 1 )
1064 delSel = mCalendar->rawIncidences(); 1064 delSel = mCalendar->rawIncidences();
1065 if ( mode == 2 ) 1065 if ( mode == 2 )
1066 delSel = mCalendar->incidences(); 1066 delSel = mCalendar->incidences();
1067 CalendarLocal* cal = new CalendarLocal(); 1067 CalendarLocal* cal = new CalendarLocal();
1068 cal->setLocalTime(); 1068 cal->setLocalTime();
1069 Incidence *incidence = delSel.first(); 1069 Incidence *incidence = delSel.first();
1070 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1070 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1071 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1071 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1072 while ( incidence ) { 1072 while ( incidence ) {
1073 if ( incidence->type() != "Journal" ) { 1073 if ( incidence->type() != "Journal" ) {
1074 bool add = true; 1074 bool add = true;
1075 if ( inFuture ) { 1075 if ( inFuture ) {
1076 QDateTime dt; 1076 QDateTime dt;
1077 if ( incidence->type() == "Todo" ) { 1077 if ( incidence->type() == "Todo" ) {
1078 Todo * t = (Todo*)incidence; 1078 Todo * t = (Todo*)incidence;
1079 if ( t->hasDueDate() ) 1079 if ( t->hasDueDate() )
1080 dt = t->dtDue(); 1080 dt = t->dtDue();
1081 else 1081 else
1082 dt = cur.addSecs( 62 ); 1082 dt = cur.addSecs( 62 );
1083 } 1083 }
1084 else { 1084 else {
1085 bool ok; 1085 bool ok;
1086 dt = incidence->getNextOccurence( cur, &ok ); 1086 dt = incidence->getNextOccurence( cur, &ok );
1087 if ( !ok ) 1087 if ( !ok )
1088 dt = cur.addSecs( -62 ); 1088 dt = cur.addSecs( -62 );
1089 } 1089 }
1090 if ( dt < cur || dt > end ) { 1090 if ( dt < cur || dt > end ) {
1091 add = false; 1091 add = false;
1092 } 1092 }
1093 } 1093 }
1094 if ( add ) { 1094 if ( add ) {
1095 Incidence *in = incidence->clone(); 1095 Incidence *in = incidence->clone();
1096 cal->addIncidence( in ); 1096 cal->addIncidence( in );
1097 } 1097 }
1098 } 1098 }
1099 incidence = delSel.next(); 1099 incidence = delSel.next();
1100 } 1100 }
1101 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1101 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1102 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1102 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1103 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1103 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1104 1104
1105 setCaption( i18n("Writing to phone...")); 1105 setCaption( i18n("Writing to phone..."));
1106 if ( PhoneFormat::writeToPhone( cal ) ) 1106 if ( PhoneFormat::writeToPhone( cal ) )
1107 setCaption( i18n("Export to phone successful!")); 1107 setCaption( i18n("Export to phone successful!"));
1108 else 1108 else
1109 setCaption( i18n("Error exporting to phone!")); 1109 setCaption( i18n("Error exporting to phone!"));
1110 delete cal; 1110 delete cal;
1111} 1111}
1112 1112
1113 1113
1114void MainWindow::setDefaultPreferences() 1114void MainWindow::setDefaultPreferences()
1115{ 1115{
1116 KOPrefs *p = KOPrefs::instance(); 1116 KOPrefs *p = KOPrefs::instance();
1117 1117
1118 p->mCompactDialogs = true; 1118 p->mCompactDialogs = true;
1119 p->mConfirm = true; 1119 p->mConfirm = true;
1120 // p->mEnableQuickTodo = false; 1120 // p->mEnableQuickTodo = false;
1121 1121
1122} 1122}
1123 1123
1124QString MainWindow::resourcePath() 1124QString MainWindow::resourcePath()
1125{ 1125{
1126 return KGlobal::iconLoader()->iconPath(); 1126 return KGlobal::iconLoader()->iconPath();
1127} 1127}
1128 1128
1129void MainWindow::displayText( QString text ,QString cap ) 1129void MainWindow::displayText( QString text ,QString cap )
1130{ 1130{
1131 QDialog dia( this, "name", true ); ; 1131 QDialog dia( this, "name", true ); ;
1132 dia.setCaption( cap ); 1132 dia.setCaption( cap );
1133 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1133 QVBoxLayout* lay = new QVBoxLayout( &dia );
1134 lay->setSpacing( 3 ); 1134 lay->setSpacing( 3 );
1135 lay->setMargin( 3 ); 1135 lay->setMargin( 3 );
1136 QTextBrowser tb ( &dia ); 1136 QTextBrowser tb ( &dia );
1137 lay->addWidget( &tb ); 1137 lay->addWidget( &tb );
1138 tb.setText( text ); 1138 tb.setText( text );
1139#ifdef DESKTOP_VERSION 1139#ifdef DESKTOP_VERSION
1140 dia.resize( 640, 480); 1140 dia.resize( 640, 480);
1141#else 1141#else
1142 dia.showMaximized(); 1142 dia.showMaximized();
1143#endif 1143#endif
1144 dia.exec(); 1144 dia.exec();
1145} 1145}
1146 1146
1147void MainWindow::features() 1147void MainWindow::features()
1148{ 1148{
1149 1149
1150 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1150 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1151} 1151}
1152 1152
1153void MainWindow::usertrans() 1153void MainWindow::usertrans()
1154{ 1154{
1155 1155
1156 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1156 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1157} 1157}
1158 1158
1159void MainWindow::kdesynchowto() 1159void MainWindow::kdesynchowto()
1160{ 1160{
1161 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1161 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1162} 1162}
1163void MainWindow::multisynchowto() 1163void MainWindow::multisynchowto()
1164{ 1164{
1165 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1165 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1166} 1166}
1167void MainWindow::synchowto() 1167void MainWindow::synchowto()
1168{ 1168{
1169 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1169 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1170} 1170}
1171void MainWindow::faq() 1171void MainWindow::faq()
1172{ 1172{
1173 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1173 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1174 1174
1175} 1175}
1176void MainWindow::whatsNew() 1176void MainWindow::whatsNew()
1177{ 1177{
1178 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1178 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1179 1179
1180} 1180}
1181void MainWindow::licence() 1181void MainWindow::licence()
1182{ 1182{
1183 KApplication::showLicence(); 1183 KApplication::showLicence();
1184 1184
1185} 1185}
1186void MainWindow::about() 1186void MainWindow::about()
1187{ 1187{
1188 QString version; 1188 QString version;
1189#include <../version> 1189#include <../version>
1190 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1190 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1191 i18n("KOrganizer/Platform-independent\n") + 1191 i18n("KOrganizer/Platform-independent\n") +
1192 "(KO/Pi) " + version + " - " + 1192 "(KO/Pi) " + version + " - " +
1193 1193
1194#ifdef DESKTOP_VERSION 1194#ifdef DESKTOP_VERSION
1195 i18n("Desktop Edition\n") + 1195 i18n("Desktop Edition\n") +
1196#else 1196#else
1197 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + 1197 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") +
1198#endif 1198#endif
1199 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); 1199 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") );
1200} 1200}
1201void MainWindow::keyBindings() 1201void MainWindow::keyBindings()
1202{ 1202{
1203 QString cap = i18n("KO/Pi Keys + Colors"); 1203 QString cap = i18n("KO/Pi Keys + Colors");
1204 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1204 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1205 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1205 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1206 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1206 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1207 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1207 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1208 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1208 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1209 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1209 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1210 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1210 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1211 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1211 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1212 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1212 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1213 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1213 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1214 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1214 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1215 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1215 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1216 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1216 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1217 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1217 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+
1218 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1218 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1219 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1219 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1220 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1220 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1221 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1221 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1222 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1222 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1223 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1223 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1224 i18n("<p><h3>In agenda view:</h3></p>\n") + 1224 i18n("<p><h3>In agenda view:</h3></p>\n") +
1225 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1225 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1226 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1226 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1227 i18n("<p><h3>In todo view:</h3></p>\n") + 1227 i18n("<p><h3>In todo view:</h3></p>\n") +
1228 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1228 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1229 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1229 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1230 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1230 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1231 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1231 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1232 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1232 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1233 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1233 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1234 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1234 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1235 i18n("<p><h3>In list view:</h3></p>\n") + 1235 i18n("<p><h3>In list view:</h3></p>\n") +
1236 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1236 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1237 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1237 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1238 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1238 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1239 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1239 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1240 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1240 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1241 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1241 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1242 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1242 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1243 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1243 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1244 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1244 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1245 i18n("<p><b>E</b>: Edit item</p>\n") + 1245 i18n("<p><b>E</b>: Edit item</p>\n") +
1246 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1246 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1247 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1247 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1248 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1248 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1249 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1249 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1250 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1250 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1251 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1251 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1252 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1252 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1253 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1253 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1254 i18n("<p><b>White</b>: Item readonly</p>\n"); 1254 i18n("<p><b>White</b>: Item readonly</p>\n");
1255 displayText( text, cap); 1255 displayText( text, cap);
1256} 1256}
1257void MainWindow::aboutAutoSaving() 1257void MainWindow::aboutAutoSaving()
1258{ 1258{
1259 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"); 1259 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");
1260 1260
1261 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1261 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1262 1262
1263} 1263}
1264void MainWindow::aboutKnownBugs() 1264void MainWindow::aboutKnownBugs()
1265{ 1265{
1266 QMessageBox* msg; 1266 QMessageBox* msg;
1267 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1267 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1268 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")+ 1268 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")+
1269 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1269 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1270 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + 1270 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") +
1271 i18n("\nor report them in the bugtracker on\n") + 1271 i18n("\nor report them in the bugtracker on\n") +
1272 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1272 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1273 QMessageBox::NoIcon, 1273 QMessageBox::NoIcon,
1274 QMessageBox::Ok, 1274 QMessageBox::Ok,
1275 QMessageBox::NoButton, 1275 QMessageBox::NoButton,
1276 QMessageBox::NoButton); 1276 QMessageBox::NoButton);
1277 msg->exec(); 1277 msg->exec();
1278 delete msg; 1278 delete msg;
1279 1279
1280} 1280}
1281 1281
1282QString MainWindow::defaultFileName() 1282QString MainWindow::defaultFileName()
1283{ 1283{
1284 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1284 return locateLocal( "data", "korganizer/mycalendar.ics" );
1285} 1285}
1286QString MainWindow::syncFileName() 1286QString MainWindow::syncFileName()
1287{ 1287{
1288#ifdef DESKTOP_VERSION 1288#ifdef DESKTOP_VERSION
1289 return locateLocal( "tmp", "synccalendar.ics" ); 1289 return locateLocal( "tmp", "synccalendar.ics" );
1290#else 1290#else
1291 return QString( "/tmp/synccalendar.ics" ); 1291 return QString( "/tmp/synccalendar.ics" );
1292#endif 1292#endif
1293} 1293}
1294 1294
1295void MainWindow::processIncidenceSelection( Incidence *incidence ) 1295void MainWindow::processIncidenceSelection( Incidence *incidence )
1296{ 1296{
1297 if ( !incidence ) { 1297 if ( !incidence ) {
1298 enableIncidenceActions( false ); 1298 enableIncidenceActions( false );
1299 1299
1300 mNewSubTodoAction->setEnabled( false ); 1300 mNewSubTodoAction->setEnabled( false );
1301 setCaptionToDates(); 1301 setCaptionToDates();
1302 return; 1302 return;
1303 1303
1304 } 1304 }
1305 1305
1306 //KGlobal::locale()->formatDateTime(nextA, true); 1306 //KGlobal::locale()->formatDateTime(nextA, true);
1307 QString startString = ""; 1307 QString startString = "";
1308 if ( incidence->type() != "Todo" ) { 1308 if ( incidence->type() != "Todo" ) {
1309 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1309 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1310 if ( incidence->doesFloat() ) { 1310 if ( incidence->doesFloat() ) {
1311 startString += ": "+incidence->dtStartDateStr( true ); 1311 startString += ": "+incidence->dtStartDateStr( true );
1312 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1312 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1313 1313
1314 } else { 1314 } else {
1315 startString = ": "+incidence->dtStartStr(true); 1315 startString = ": "+incidence->dtStartStr(true);
1316 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1316 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1317 1317
1318 } 1318 }
1319 1319
1320 } else { 1320 } else {
1321 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1321 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1322 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1322 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1323 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1323 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1324 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1324 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1325 } 1325 }
1326 1326
1327 } 1327 }
1328 else 1328 else
1329 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1329 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1330 if ( !incidence->location().isEmpty() ) 1330 if ( !incidence->location().isEmpty() )
1331 startString += " (" +incidence->location()+")"; 1331 startString += " (" +incidence->location()+")";
1332 setCaption( incidence->summary()+startString); 1332 setCaption( incidence->summary()+startString);
1333 1333
1334 enableIncidenceActions( true ); 1334 enableIncidenceActions( true );
1335 1335
1336 if ( incidence->type() == "Event" ) { 1336 if ( incidence->type() == "Event" ) {
1337 mShowAction->setText( i18n("Show Event...") ); 1337 mShowAction->setText( i18n("Show Event...") );
1338 mEditAction->setText( i18n("Edit Event...") ); 1338 mEditAction->setText( i18n("Edit Event...") );
1339 mDeleteAction->setText( i18n("Delete Event...") ); 1339 mDeleteAction->setText( i18n("Delete Event...") );
1340 1340
1341 mNewSubTodoAction->setEnabled( false ); 1341 mNewSubTodoAction->setEnabled( false );
1342 } else if ( incidence->type() == "Todo" ) { 1342 } else if ( incidence->type() == "Todo" ) {
1343 mShowAction->setText( i18n("Show Todo...") ); 1343 mShowAction->setText( i18n("Show Todo...") );
1344 mEditAction->setText( i18n("Edit Todo...") ); 1344 mEditAction->setText( i18n("Edit Todo...") );
1345 mDeleteAction->setText( i18n("Delete Todo...") ); 1345 mDeleteAction->setText( i18n("Delete Todo...") );
1346 1346
1347 mNewSubTodoAction->setEnabled( true ); 1347 mNewSubTodoAction->setEnabled( true );
1348 } else { 1348 } else {
1349 mShowAction->setText( i18n("Show...") ); 1349 mShowAction->setText( i18n("Show...") );
1350 mShowAction->setText( i18n("Edit...") ); 1350 mShowAction->setText( i18n("Edit...") );
1351 mShowAction->setText( i18n("Delete...") ); 1351 mShowAction->setText( i18n("Delete...") );
1352 1352
1353 mNewSubTodoAction->setEnabled( false ); 1353 mNewSubTodoAction->setEnabled( false );
1354 } 1354 }
1355} 1355}
1356 1356
1357void MainWindow::enableIncidenceActions( bool enabled ) 1357void MainWindow::enableIncidenceActions( bool enabled )
1358{ 1358{
1359 mShowAction->setEnabled( enabled ); 1359 mShowAction->setEnabled( enabled );
1360 mEditAction->setEnabled( enabled ); 1360 mEditAction->setEnabled( enabled );
1361 mDeleteAction->setEnabled( enabled ); 1361 mDeleteAction->setEnabled( enabled );
1362 1362
1363 mCloneAction->setEnabled( enabled ); 1363 mCloneAction->setEnabled( enabled );
1364 mMoveAction->setEnabled( enabled ); 1364 mMoveAction->setEnabled( enabled );
1365 mBeamAction->setEnabled( enabled ); 1365 mBeamAction->setEnabled( enabled );
1366 mCancelAction->setEnabled( enabled ); 1366 mCancelAction->setEnabled( enabled );
1367} 1367}
1368 1368
1369void MainWindow::importOL() 1369void MainWindow::importOL()
1370{ 1370{
1371#ifdef _WIN32_ 1371#ifdef _WIN32_
1372 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1372 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1373 id->exec(); 1373 id->exec();
1374 delete id; 1374 delete id;
1375 mView->updateView(); 1375 mView->updateView();
1376#endif 1376#endif
1377} 1377}
1378void MainWindow::importBday() 1378void MainWindow::importBday()
1379{ 1379{
1380 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1380 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1381 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1381 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1382 i18n("Import!"), i18n("Cancel"), 0, 1382 i18n("Import!"), i18n("Cancel"), 0,
1383 0, 1 ); 1383 0, 1 );
1384 if ( result == 0 ) { 1384 if ( result == 0 ) {
1385 mView->importBday(); 1385 mView->importBday();
1386 1386
1387 } 1387 }
1388 1388
1389 1389
1390} 1390}
1391void MainWindow::importQtopia() 1391void MainWindow::importQtopia()
1392{ 1392{
1393#ifndef DESKTOP_VERSION 1393#ifndef DESKTOP_VERSION
1394 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1394 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1395 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"), 1395 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"),
1396 i18n("Import!"), i18n("Cancel"), 0, 1396 i18n("Import!"), i18n("Cancel"), 0,
1397 0, 1 ); 1397 0, 1 );
1398 if ( result == 0 ) { 1398 if ( result == 0 ) {
1399 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1399 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1400 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1400 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1401 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1401 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1402 mView->importQtopia( categories, datebook, todolist ); 1402 mView->importQtopia( categories, datebook, todolist );
1403 } 1403 }
1404#else 1404#else
1405 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1405 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1406 i18n("Not supported \non desktop!\n"), 1406 i18n("Not supported \non desktop!\n"),
1407 i18n("Ok"), i18n("Cancel"), 0, 1407 i18n("Ok"), i18n("Cancel"), 0,
1408 0, 1 ); 1408 0, 1 );
1409 1409
1410#endif 1410#endif
1411} 1411}
1412 1412
1413void MainWindow::saveOnClose() 1413void MainWindow::saveOnClose()
1414{ 1414{
1415 KOPrefs *p = KOPrefs::instance(); 1415 KOPrefs *p = KOPrefs::instance();
1416 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1416 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1417 p->mToolBarUp = iconToolBar->x() > width()/2 || 1417 p->mToolBarUp = iconToolBar->x() > width()/2 ||
1418 iconToolBar->y() > height()/2; 1418 iconToolBar->y() > height()/2;
1419 mView->writeSettings(); 1419 mView->writeSettings();
1420 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1420 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1421 save(); 1421 save();
1422} 1422}
1423void MainWindow::slotModifiedChanged( bool changed ) 1423void MainWindow::slotModifiedChanged( bool changed )
1424{ 1424{
1425 if ( mBlockAtStartup ) 1425 if ( mBlockAtStartup )
1426 return; 1426 return;
1427 int msec; 1427 int msec;
1428 // we store the changes after 1 minute, 1428 // we store the changes after 1 minute,
1429 // and for safety reasons after 10 minutes again 1429 // and for safety reasons after 10 minutes again
1430 if ( !mSyncManager->blockSave() ) 1430 if ( !mSyncManager->blockSave() )
1431 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1431 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1432 else 1432 else
1433 msec = 1000 * 600; 1433 msec = 1000 * 600;
1434 mSaveTimer.start( msec, true ); // 1 minute 1434 mSaveTimer.start( msec, true ); // 1 minute
1435 qDebug("KO: Saving File in %d secs!", msec/1000); 1435 qDebug("KO: Saving File in %d secs!", msec/1000);
1436 mCalendarModifiedFlag = true; 1436 mCalendarModifiedFlag = true;
1437} 1437}
1438void MainWindow::save() 1438void MainWindow::save()
1439{ 1439{
1440 if ( mSyncManager->blockSave() ) 1440 if ( mSyncManager->blockSave() )
1441 return; 1441 return;
1442 mSyncManager->setBlockSave(true); 1442 mSyncManager->setBlockSave(true);
1443 if ( mView->checkFileVersion( defaultFileName()) ) { 1443 if ( mView->checkFileVersion( defaultFileName()) ) {
1444 1444
1445 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1445 QTime neededSaveTime = QDateTime::currentDateTime().time();
1446 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1446 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1447 qDebug("KO: Start saving data to file!"); 1447 qDebug("KO: Start saving data to file!");
1448 mView->saveCalendar( defaultFileName() ); 1448 mView->saveCalendar( defaultFileName() );
1449 1449
1450 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1450 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1451 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1451 qDebug("KO: Needed %d ms for saving.",msNeeded );
1452 QString savemes; 1452 QString savemes;
1453 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1453 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1454 setCaption(savemes); 1454 setCaption(savemes);
1455 } else 1455 } else
1456 setCaption(i18n("Saving cancelled!")); 1456 setCaption(i18n("Saving cancelled!"));
1457 mCalendarModifiedFlag = false; 1457 mCalendarModifiedFlag = false;
1458 mSyncManager->setBlockSave( false ); 1458 mSyncManager->setBlockSave( false );
1459} 1459}
1460 1460
1461void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1461void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1462{ 1462{
1463 if ( !e->isAutoRepeat() ) { 1463 if ( !e->isAutoRepeat() ) {
1464 mFlagKeyPressed = false; 1464 mFlagKeyPressed = false;
1465 } 1465 }
1466} 1466}
1467void MainWindow::keyPressEvent ( QKeyEvent * e ) 1467void MainWindow::keyPressEvent ( QKeyEvent * e )
1468{ 1468{
1469 qApp->processEvents(); 1469 qApp->processEvents();
1470 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1470 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1471 e->ignore(); 1471 e->ignore();
1472 // qDebug(" ignore %d",e->isAutoRepeat() ); 1472 // qDebug(" ignore %d",e->isAutoRepeat() );
1473 return; 1473 return;
1474 } 1474 }
1475 if (! e->isAutoRepeat() ) 1475 if (! e->isAutoRepeat() )
1476 mFlagKeyPressed = true; 1476 mFlagKeyPressed = true;
1477 KOPrefs *p = KOPrefs::instance(); 1477 KOPrefs *p = KOPrefs::instance();
1478 bool showSelectedDates = false; 1478 bool showSelectedDates = false;
1479 int size; 1479 int size;
1480 int pro = 0; 1480 int pro = 0;
1481 //qDebug("MainWindow::keyPressEvent "); 1481 //qDebug("MainWindow::keyPressEvent ");
1482 switch ( e->key() ) { 1482 switch ( e->key() ) {
1483 case Qt::Key_Right: 1483 case Qt::Key_Right:
1484 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1484 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1485 mView->goNextMonth(); 1485 mView->goNextMonth();
1486 else 1486 else
1487 mView->goNext(); 1487 mView->goNext();
1488 showSelectedDates = true; 1488 showSelectedDates = true;
1489 break; 1489 break;
1490 case Qt::Key_Left: 1490 case Qt::Key_Left:
1491 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1491 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1492 mView->goPreviousMonth(); 1492 mView->goPreviousMonth();
1493 else 1493 else
1494 mView->goPrevious(); 1494 mView->goPrevious();
1495 showSelectedDates = true; 1495 showSelectedDates = true;
1496 break; 1496 break;
1497 case Qt::Key_Down: 1497 case Qt::Key_Down:
1498 mView->viewManager()->agendaView()->scrollOneHourDown(); 1498 mView->viewManager()->agendaView()->scrollOneHourDown();
1499 break; 1499 break;
1500 case Qt::Key_Up: 1500 case Qt::Key_Up:
1501 mView->viewManager()->agendaView()->scrollOneHourUp(); 1501 mView->viewManager()->agendaView()->scrollOneHourUp();
1502 break; 1502 break;
1503 case Qt::Key_I: 1503 case Qt::Key_I:
1504 mView->showIncidence(); 1504 mView->showIncidence();
1505 break; 1505 break;
1506 case Qt::Key_Delete: 1506 case Qt::Key_Delete:
1507 case Qt::Key_Backspace: 1507 case Qt::Key_Backspace:
1508 mView->deleteIncidence(); 1508 mView->deleteIncidence();
1509 break; 1509 break;
1510 case Qt::Key_D: 1510 case Qt::Key_D:
1511 mView->viewManager()->showDayView(); 1511 mView->viewManager()->showDayView();
1512 showSelectedDates = true; 1512 showSelectedDates = true;
1513 break; 1513 break;
1514 case Qt::Key_O: 1514 case Qt::Key_O:
1515 mView->toggleFilerEnabled( ); 1515 mView->toggleFilerEnabled( );
1516 break; 1516 break;
1517 case Qt::Key_0: 1517 case Qt::Key_0:
1518 case Qt::Key_1: 1518 case Qt::Key_1:
1519 case Qt::Key_2: 1519 case Qt::Key_2:
1520 case Qt::Key_3: 1520 case Qt::Key_3:
1521 case Qt::Key_4: 1521 case Qt::Key_4:
1522 case Qt::Key_5: 1522 case Qt::Key_5:
1523 case Qt::Key_6: 1523 case Qt::Key_6:
1524 case Qt::Key_7: 1524 case Qt::Key_7:
1525 case Qt::Key_8: 1525 case Qt::Key_8:
1526 case Qt::Key_9: 1526 case Qt::Key_9:
1527 pro = e->key()-48; 1527 pro = e->key()-48;
1528 if ( pro == 0 ) 1528 if ( pro == 0 )
1529 pro = 10; 1529 pro = 10;
1530 if ( e->state() == Qt::ControlButton) 1530 if ( e->state() == Qt::ControlButton)
1531 pro += 10; 1531 pro += 10;
1532 break; 1532 break;
1533 case Qt::Key_M: 1533 case Qt::Key_M:
1534 mView->viewManager()->showMonthView(); 1534 mView->viewManager()->showMonthView();
1535 showSelectedDates = true; 1535 showSelectedDates = true;
1536 break; 1536 break;
1537 case Qt::Key_Insert: 1537 case Qt::Key_Insert:
1538 mView->newEvent(); 1538 mView->newEvent();
1539 break; 1539 break;
1540 case Qt::Key_S : 1540 case Qt::Key_S :
1541 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1541 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1542 mView->newSubTodo(); 1542 mView->newSubTodo();
1543 else 1543 else
1544 mView->dialogManager()->showSearchDialog(); 1544 mView->dialogManager()->showSearchDialog();
1545 break; 1545 break;
1546 case Qt::Key_Y : 1546 case Qt::Key_Y :
1547 case Qt::Key_Z : 1547 case Qt::Key_Z :
1548 mView->viewManager()->showWorkWeekView(); 1548 mView->viewManager()->showWorkWeekView();
1549 showSelectedDates = true; 1549 showSelectedDates = true;
1550 break; 1550 break;
1551 case Qt::Key_U : 1551 case Qt::Key_U :
1552 mView->viewManager()->showWeekView(); 1552 mView->viewManager()->showWeekView();
1553 showSelectedDates = true; 1553 showSelectedDates = true;
1554 break; 1554 break;
1555 case Qt::Key_H : 1555 case Qt::Key_H :
1556 keyBindings(); 1556 keyBindings();
1557 break; 1557 break;
1558 case Qt::Key_W: 1558 case Qt::Key_W:
1559 mView->viewManager()->showWhatsNextView(); 1559 mView->viewManager()->showWhatsNextView();
1560 break; 1560 break;
1561 case Qt::Key_L: 1561 case Qt::Key_L:
1562 mView->viewManager()->showListView(); 1562 mView->viewManager()->showListView();
1563 break; 1563 break;
1564 case Qt::Key_N: 1564 case Qt::Key_N:
1565 mView->viewManager()->showNextXView(); 1565 mView->viewManager()->showNextXView();
1566 showSelectedDates = true; 1566 showSelectedDates = true;
1567 break; 1567 break;
1568 case Qt::Key_V: 1568 case Qt::Key_V:
1569 mView->viewManager()->showTodoView(); 1569 mView->viewManager()->showTodoView();
1570 break; 1570 break;
1571 case Qt::Key_C: 1571 case Qt::Key_C:
1572 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1572 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1573 break; 1573 break;
1574 case Qt::Key_P: 1574 case Qt::Key_P:
1575 mView->showDatePicker( ); 1575 mView->showDatePicker( );
1576 break; 1576 break;
1577 case Qt::Key_F: 1577 case Qt::Key_F:
1578 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1578 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1579 mView->editFilters(); 1579 mView->editFilters();
1580 else 1580 else
1581 mView->toggleFilter(); 1581 mView->toggleFilter();
1582 break; 1582 break;
1583 case Qt::Key_X: 1583 case Qt::Key_X:
1584 mView->toggleDateNavigatorWidget(); 1584 mView->toggleDateNavigatorWidget();
1585 break; 1585 break;
1586 case Qt::Key_Space: 1586 case Qt::Key_Space:
1587 mView->toggleExpand(); 1587 mView->toggleExpand();
1588 break; 1588 break;
1589 case Qt::Key_A: 1589 case Qt::Key_A:
1590 mView->toggleAllDaySize(); 1590 mView->toggleAllDaySize();
1591 break; 1591 break;
1592 case Qt::Key_T: 1592 case Qt::Key_T:
1593 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1593 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1594 mView->newTodo(); 1594 mView->newTodo();
1595 else { 1595 else {
1596 mView->goToday(); 1596 mView->goToday();
1597 showSelectedDates = true; 1597 showSelectedDates = true;
1598 } 1598 }
1599 break; 1599 break;
1600 case Qt::Key_J: 1600 case Qt::Key_J:
1601 mView->viewManager()->showJournalView(); 1601 mView->viewManager()->showJournalView();
1602 break; 1602 break;
1603 case Qt::Key_B: 1603 case Qt::Key_B:
1604 mView->editIncidenceDescription();; 1604 mView->editIncidenceDescription();;
1605 break; 1605 break;
1606 // case Qt::Key_Return: 1606 // case Qt::Key_Return:
1607 case Qt::Key_E: 1607 case Qt::Key_E:
1608 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1608 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1609 mView->newEvent(); 1609 mView->newEvent();
1610 else 1610 else
1611 mView->editIncidence(); 1611 mView->editIncidence();
1612 break; 1612 break;
1613 case Qt::Key_Plus: 1613 case Qt::Key_Plus:
1614 size = p->mHourSize +2; 1614 size = p->mHourSize +2;
1615 if ( size <= 18 ) 1615 if ( size <= 18 )
1616 configureAgenda( size ); 1616 configureAgenda( size );
1617 break; 1617 break;
1618 case Qt::Key_Minus: 1618 case Qt::Key_Minus:
1619 size = p->mHourSize - 2; 1619 size = p->mHourSize - 2;
1620 if ( size >= 4 ) 1620 if ( size >= 4 )
1621 configureAgenda( size ); 1621 configureAgenda( size );
1622 break; 1622 break;
1623 1623
1624 1624
1625 default: 1625 default:
1626 e->ignore(); 1626 e->ignore();
1627 } 1627 }
1628 if ( pro > 0 ) { 1628 if ( pro > 0 ) {
1629 mView->selectFilter( pro-1 ); 1629 mView->selectFilter( pro-1 );
1630 } 1630 }
1631 if ( showSelectedDates ) { 1631 if ( showSelectedDates ) {
1632 ;// setCaptionToDates(); 1632 ;// setCaptionToDates();
1633 } 1633 }
1634 1634
1635} 1635}
1636 1636
1637void MainWindow::fillFilterMenu() 1637void MainWindow::fillFilterMenu()
1638{ 1638{
1639 selectFilterMenu->clear(); 1639 selectFilterMenu->clear();
1640 bool disable = false; 1640 bool disable = false;
1641 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1642 selectFilterMenu->insertSeparator();
1641 if ( mView->filterView()->filtersEnabled() ) { 1643 if ( mView->filterView()->filtersEnabled() ) {
1642 selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 0 ); 1644 selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 );
1643 } 1645 }
1644 else { 1646 else {
1645 selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 0 ); 1647 selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 );
1646 disable = true; 1648 disable = true;
1647 } 1649 }
1648 selectFilterMenu->insertSeparator(); 1650 selectFilterMenu->insertSeparator();
1649 QPtrList<CalFilter> fili = mView->filters(); 1651 QPtrList<CalFilter> fili = mView->filters();
1650 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1652 CalFilter *curfilter = mView->filterView()->selectedFilter();
1651 CalFilter *filter = fili.first(); 1653 CalFilter *filter = fili.first();
1652 int iii = 1; 1654 int iii = 2;
1653 while(filter) { 1655 while(filter) {
1654 selectFilterMenu->insertItem( filter->name(), iii ); 1656 selectFilterMenu->insertItem( filter->name(), iii );
1655 if ( filter == curfilter) 1657 if ( filter == curfilter)
1656 selectFilterMenu->setItemChecked( iii, true ); 1658 selectFilterMenu->setItemChecked( iii, true );
1657 if ( disable ) 1659 if ( disable )
1658 selectFilterMenu->setItemEnabled( iii, false ); 1660 selectFilterMenu->setItemEnabled( iii, false );
1659 filter = fili.next(); 1661 filter = fili.next();
1660 ++iii; 1662 ++iii;
1661 } 1663 }
1662} 1664}
1663void MainWindow::selectFilter( int fil ) 1665void MainWindow::selectFilter( int fil )
1664{ 1666{
1665 if ( fil == 0 ) { 1667 if ( fil == 0 ) {
1668 mView->editFilters( );
1669 } else if ( fil == 1 ){
1666 mView->toggleFilerEnabled( ); 1670 mView->toggleFilerEnabled( );
1667 } else { 1671 } else {
1668 mView->selectFilter( fil-1 ); 1672 mView->selectFilter( fil-2 );
1669 } 1673 }
1670} 1674}
1671void MainWindow::configureToolBar( int item ) 1675void MainWindow::configureToolBar( int item )
1672{ 1676{
1673 1677
1674 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1678 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1675 KOPrefs *p = KOPrefs::instance(); 1679 KOPrefs *p = KOPrefs::instance();
1676 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1680 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1677 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1681 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1678 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1682 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1679 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1683 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1680 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 1684 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1681 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 1685 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1682 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 1686 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1683 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 1687 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1684 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 1688 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1685 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 1689 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1686 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 1690 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1687 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 1691 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1688 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 1692 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
1689 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 1693 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
1690 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 1694 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
1691 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 1695 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
1692 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 1696 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
1693 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 1697 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
1694 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 1698 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
1695 // initActions(); 1699 // initActions();
1696} 1700}
1697 1701
1698void MainWindow::setCaptionToDates() 1702void MainWindow::setCaptionToDates()
1699{ 1703{
1700 QString selDates; 1704 QString selDates;
1701 selDates = KGlobal::locale()->formatDate(mView->startDate(), true); 1705 selDates = KGlobal::locale()->formatDate(mView->startDate(), true);
1702 if (mView->startDate() < mView->endDate() ) 1706 if (mView->startDate() < mView->endDate() )
1703 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 1707 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
1704 setCaption( i18n("Dates: ") + selDates ); 1708 setCaption( i18n("Dates: ") + selDates );
1705 1709
1706} 1710}
1707// parameter item == 0: reinit 1711// parameter item == 0: reinit
1708void MainWindow::configureAgenda( int item ) 1712void MainWindow::configureAgenda( int item )
1709{ 1713{
1710 1714
1711 KOPrefs *p = KOPrefs::instance(); 1715 KOPrefs *p = KOPrefs::instance();
1712 1716
1713 int i; 1717 int i;
1714 // do not allow 4 for widgets higher than 480 1718 // do not allow 4 for widgets higher than 480
1715 // if ( QApplication::desktop()->height() > 480 ) { 1719 // if ( QApplication::desktop()->height() > 480 ) {
1716// if ( item == 4 ) 1720// if ( item == 4 )
1717// item = 6; 1721// item = 6;
1718// } 1722// }
1719 for ( i = 4; i <= 18; i= i+2 ) 1723 for ( i = 4; i <= 18; i= i+2 )
1720 configureAgendaMenu->setItemChecked( i, false ); 1724 configureAgendaMenu->setItemChecked( i, false );
1721 configureAgendaMenu->setItemChecked( item, true ); 1725 configureAgendaMenu->setItemChecked( item, true );
1722 if ( p->mHourSize == item ) 1726 if ( p->mHourSize == item )
1723 return; 1727 return;
1724 p->mHourSize=item; 1728 p->mHourSize=item;
1725 mView->viewManager()->agendaView()->updateConfig(); 1729 mView->viewManager()->agendaView()->updateConfig();
1726} 1730}
1727 1731
1728void MainWindow::saveCalendar() 1732void MainWindow::saveCalendar()
1729{ 1733{
1730 QString fn = KOPrefs::instance()->mLastSaveFile; 1734 QString fn = KOPrefs::instance()->mLastSaveFile;
1731 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); 1735 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this );
1732 1736
1733 if ( fn == "" ) 1737 if ( fn == "" )
1734 return; 1738 return;
1735 QFileInfo info; 1739 QFileInfo info;
1736 info.setFile( fn ); 1740 info.setFile( fn );
1737 QString mes; 1741 QString mes;
1738 bool createbup = true; 1742 bool createbup = true;
1739 if ( info. exists() ) { 1743 if ( info. exists() ) {
1740 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; 1744 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ;
1741 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 1745 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
1742 i18n("Overwrite!"), i18n("Cancel"), 0, 1746 i18n("Overwrite!"), i18n("Cancel"), 0,
1743 0, 1 ); 1747 0, 1 );
1744 if ( result != 0 ) { 1748 if ( result != 0 ) {
1745 createbup = false; 1749 createbup = false;
1746 } 1750 }
1747 } 1751 }
1748 if ( createbup ) { 1752 if ( createbup ) {
1749 mView->saveCalendar( fn ); 1753 mView->saveCalendar( fn );
1750 mes = i18n("KO/Pi:Saved %1").arg(fn); 1754 mes = i18n("KO/Pi:Saved %1").arg(fn);
1751 KOPrefs::instance()->mLastSaveFile = fn; 1755 KOPrefs::instance()->mLastSaveFile = fn;
1752 setCaption(mes); 1756 setCaption(mes);
1753 } 1757 }
1754} 1758}
1755void MainWindow::loadCalendar() 1759void MainWindow::loadCalendar()
1756{ 1760{
1757 1761
1758 QString fn = KOPrefs::instance()->mLastLoadFile; 1762 QString fn = KOPrefs::instance()->mLastLoadFile;
1759 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 1763 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
1760 1764
1761 if ( fn == "" ) 1765 if ( fn == "" )
1762 return; 1766 return;
1763 QFileInfo info; 1767 QFileInfo info;
1764 info.setFile( fn ); 1768 info.setFile( fn );
1765 QString mess; 1769 QString mess;
1766 bool loadbup = true; 1770 bool loadbup = true;
1767 if ( info. exists() ) { 1771 if ( info. exists() ) {
1768 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 1772 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
1769 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 1773 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
1770 mess, 1774 mess,
1771 i18n("Load!"), i18n("Cancel"), 0, 1775 i18n("Load!"), i18n("Cancel"), 0,
1772 0, 1 ); 1776 0, 1 );
1773 if ( result != 0 ) { 1777 if ( result != 0 ) {
1774 loadbup = false; 1778 loadbup = false;
1775 } 1779 }
1776 } else { 1780 } else {
1777 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1781 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1778 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 1782 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
1779 0, 1 ); 1783 0, 1 );
1780 1784
1781 return; 1785 return;
1782 } 1786 }
1783 if ( loadbup ) { 1787 if ( loadbup ) {
1784 mView->openCalendar( fn ); 1788 mView->openCalendar( fn );
1785 KOPrefs::instance()->mLastLoadFile = fn; 1789 KOPrefs::instance()->mLastLoadFile = fn;
1786 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 1790 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
1787 setCaption(mess); 1791 setCaption(mess);
1788 } 1792 }
1789 1793
1790} 1794}
1791void MainWindow::quickImportIcal() 1795void MainWindow::quickImportIcal()
1792{ 1796{
1793 importFile( KOPrefs::instance()->mLastImportFile, false ); 1797 importFile( KOPrefs::instance()->mLastImportFile, false );
1794} 1798}
1795void MainWindow::importFile( QString fn, bool quick ) 1799void MainWindow::importFile( QString fn, bool quick )
1796{ 1800{
1797 QFileInfo info; 1801 QFileInfo info;
1798 info.setFile( fn ); 1802 info.setFile( fn );
1799 QString mess; 1803 QString mess;
1800 bool loadbup = true; 1804 bool loadbup = true;
1801 if ( !info. exists() ) { 1805 if ( !info. exists() ) {
1802 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 1806 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
1803 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1807 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1804 mess ); 1808 mess );
1805 return; 1809 return;
1806 } 1810 }
1807 int result = 0; 1811 int result = 0;
1808 if ( !quick ) { 1812 if ( !quick ) {
1809 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 )); 1813 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 ));
1810 result = QMessageBox::warning( this, "KO/Pi: Warning!", 1814 result = QMessageBox::warning( this, "KO/Pi: Warning!",
1811 mess, 1815 mess,
1812 "Import", "Cancel", 0, 1816 "Import", "Cancel", 0,
1813 0, 1 ); 1817 0, 1 );
1814 } 1818 }
1815 if ( result == 0 ) { 1819 if ( result == 0 ) {
1816 if ( mView->openCalendar( fn, true )) { 1820 if ( mView->openCalendar( fn, true )) {
1817 KOPrefs::instance()->mLastImportFile = fn; 1821 KOPrefs::instance()->mLastImportFile = fn;
1818 setCaption(i18n("Imported file successfully")); 1822 setCaption(i18n("Imported file successfully"));
1819 } else { 1823 } else {
1820 setCaption(i18n("Error importing file")); 1824 setCaption(i18n("Error importing file"));
1821 } 1825 }
1822 } 1826 }
1823} 1827}
1824 1828
1825void MainWindow::importIcal() 1829void MainWindow::importIcal()
1826{ 1830{
1827 1831
1828 QString fn =KOPrefs::instance()->mLastImportFile; 1832 QString fn =KOPrefs::instance()->mLastImportFile;
1829 1833
1830 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 1834 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
1831 if ( fn == "" ) 1835 if ( fn == "" )
1832 return; 1836 return;
1833 importFile( fn, true ); 1837 importFile( fn, true );
1834 1838
1835} 1839}
1836 1840
1837void MainWindow::exportVCalendar() 1841void MainWindow::exportVCalendar()
1838{ 1842{
1839 QString fn = KOPrefs::instance()->mLastVcalFile; 1843 QString fn = KOPrefs::instance()->mLastVcalFile;
1840 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 1844 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
1841 if ( fn == "" ) 1845 if ( fn == "" )
1842 return; 1846 return;
1843 QFileInfo info; 1847 QFileInfo info;
1844 info.setFile( fn ); 1848 info.setFile( fn );
1845 QString mes; 1849 QString mes;
1846 bool createbup = true; 1850 bool createbup = true;
1847 if ( info. exists() ) { 1851 if ( info. exists() ) {
1848 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 1852 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
1849 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 1853 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
1850 i18n("Overwrite!"), i18n("Cancel"), 0, 1854 i18n("Overwrite!"), i18n("Cancel"), 0,
1851 0, 1 ); 1855 0, 1 );
1852 if ( result != 0 ) { 1856 if ( result != 0 ) {
1853 createbup = false; 1857 createbup = false;
1854 } 1858 }
1855 } 1859 }
1856 if ( createbup ) { 1860 if ( createbup ) {
1857 if ( mView->exportVCalendar( fn ) ) { 1861 if ( mView->exportVCalendar( fn ) ) {
1858 KOPrefs::instance()->mLastVcalFile = fn; 1862 KOPrefs::instance()->mLastVcalFile = fn;
1859 if ( fn.length() > 20 ) 1863 if ( fn.length() > 20 )
1860 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 1864 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
1861 else 1865 else
1862 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 1866 mes = i18n("KO/Pi:Exported to %1").arg(fn );
1863 setCaption(mes); 1867 setCaption(mes);
1864 } 1868 }
1865 } 1869 }
1866 1870
1867} 1871}
1868 1872
1869void MainWindow::syncFileRequest() 1873void MainWindow::syncFileRequest()
1870{ 1874{
1871 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 1875 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
1872 mSyncManager->slotSyncMenu( 999 ); 1876 mSyncManager->slotSyncMenu( 999 );
1873 } 1877 }
1874 save(); 1878 save();
1875} 1879}
1876void MainWindow::getFile( bool success ) 1880void MainWindow::getFile( bool success )
1877{ 1881{
1878 if ( ! success ) { 1882 if ( ! success ) {
1879 setCaption( i18n("Error receiving file. Nothing changed!") ); 1883 setCaption( i18n("Error receiving file. Nothing changed!") );
1880 return; 1884 return;
1881 } 1885 }
1882 mView->openCalendar( defaultFileName() ); 1886 mView->openCalendar( defaultFileName() );
1883 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 1887 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
1884 mSyncManager->slotSyncMenu( 999 ); 1888 mSyncManager->slotSyncMenu( 999 );
1885 } 1889 }
1886 setCaption( i18n("Pi-Sync successful!") ); 1890 setCaption( i18n("Pi-Sync successful!") );
1887} 1891}
1888 1892
1889void MainWindow::printSel( ) 1893void MainWindow::printSel( )
1890{ 1894{
1891 mView->viewManager()->agendaView()->agenda()->printSelection(); 1895 mView->viewManager()->agendaView()->agenda()->printSelection();
1892} 1896}
1893 1897
1894void MainWindow::printCal() 1898void MainWindow::printCal()
1895{ 1899{
1896 mView->print();//mCp->showDialog(); 1900 mView->print();//mCp->showDialog();
1897} 1901}
1898 1902