summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-15 00:20:28 (UTC)
committer zautrix <zautrix>2005-01-15 00:20:28 (UTC)
commit80da9080c1c33c4704806c442179522edce06bd2 (patch) (unidiff)
treef17bfb786b7c85d4d3bf93545494dafdf9ec5184
parentd937154e5ae3691dda55fac9114142f92e29e37b (diff)
downloadkdepimpi-80da9080c1c33c4704806c442179522edce06bd2.zip
kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.gz
kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.bz2
completed todo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koeventviewerdialog.cpp20
-rw-r--r--korganizer/koeventviewerdialog.h1
-rw-r--r--korganizer/koviewmanager.h2
5 files changed, 25 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 5be1d28..da33d12 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,710 +1,713 @@
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.17 ************ 3********** VERSION 1.9.17 ************
4 4
5KO/Pi: 5KO/Pi:
6Fixed that tooltips were not updated after moving an item in agenda view. 6Fixed that tooltips were not updated after moving an item in agenda view.
7Fixed a bug in sorting start date for recurring events in list view. 7Fixed a bug in sorting start date for recurring events in list view.
8Changed the left button in todo viewer from "Agenda" to "Set completed".
9This 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.
10
8 11
9KA/Pi: 12KA/Pi:
10All fields search does now actually search all the (possible) fields, 13All fields search does now actually search all the (possible) fields,
11not only those listed in the contact list. 14not only those listed in the contact list.
12Made is possible to inline a picture in a vcard on the Z. 15Made is possible to inline a picture in a vcard on the Z.
13This was only possible on the desktop, now is it possible on the Z as well. 16This was only possible on the desktop, now is it possible on the Z as well.
14Fixed of missing save settings after filter configuration. 17Fixed of missing save settings after filter configuration.
15Made saving of addressbook much faster. 18Made saving of addressbook much faster.
16Fixed extension widget layout problem. 19Fixed extension widget layout problem.
17Fixed saving of default formatted name settings. 20Fixed saving of default formatted name settings.
18Fixed formatted name handling in edit dialog. 21Fixed formatted name handling in edit dialog.
19Added an option for changing formatted names of many contacts 22Added an option for changing formatted names of many contacts
20(menu: File - Change - Set formatted name). 23(menu: File - Change - Set formatted name).
21 24
22QWhatsThis was not working on the Z ( only black rectangle was shown). 25QWhatsThis was not working on the Z ( only black rectangle was shown).
23This is Fixed. 26This is Fixed.
24 27
25KDE-Sync: 28KDE-Sync:
26Now readonly KDE resources are synced as well. 29Now readonly KDE resources are synced as well.
27(They are not changed in KDE itself, of course). 30(They are not changed in KDE itself, of course).
28 31
29 32
30 33
31********** VERSION 1.9.16 ************ 34********** VERSION 1.9.16 ************
32 35
33KO/Pi: 36KO/Pi:
34Fixed search dialog size on Z 6000 (480x640 display). 37Fixed search dialog size on Z 6000 (480x640 display).
35Added setting to hide/show time in agenda items. 38Added setting to hide/show time in agenda items.
36Added setting to hide not running todos in todo view. 39Added setting to hide not running todos in todo view.
37Added columns for start date/time in todo view. 40Added columns for start date/time in todo view.
38Replaced the solid half-hour lines in agenda view by dot lines. 41Replaced the solid half-hour lines in agenda view by dot lines.
39Added possibility of printing the What's Next View on the desktop 42Added possibility of printing the What's Next View on the desktop
40(i.e. Windows and Linux). 43(i.e. Windows and Linux).
41Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 44Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
42Added tooltips in month view.(Tooltips only available on desktop) 45Added tooltips in month view.(Tooltips only available on desktop)
43 46
44Fixed a strange problem in KO/Pi alarm applet. 47Fixed a strange problem in KO/Pi alarm applet.
45Did not find the actual problem, 48Did not find the actual problem,
46such that now Qtopia reboots again if deinstalling the alarm applet. 49such that now Qtopia reboots again if deinstalling the alarm applet.
47But the alarm applet should work again. 50But the alarm applet should work again.
48 51
49KA/Pi: 52KA/Pi:
50Fixed the problem, that internal pictures were not saved. 53Fixed the problem, that internal pictures were not saved.
51 54
52Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 55Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
53 56
54Fixed some minor problems. (Like word wrap in help text windows). 57Fixed some minor problems. (Like word wrap in help text windows).
55 58
56Fixed a compiling problem in microkde/kresources. 59Fixed a compiling problem in microkde/kresources.
57 60
58KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 61KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
59This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 62This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
60such that now syncing KO/Pi with Sharp DTM should work on the 63such that now syncing KO/Pi with Sharp DTM should work on the
61Zaurus C 3000 model. 64Zaurus C 3000 model.
62 65
63********** VERSION 1.9.15 ************ 66********** VERSION 1.9.15 ************
64 67
65Usebilty enhancements in KO/Pi: 68Usebilty enhancements in KO/Pi:
66When clicking on the date in a month view cell, the day view is shown. 69When clicking on the date in a month view cell, the day view is shown.
67Old behaviour was, that the "new event" dialog popped up. 70Old behaviour was, that the "new event" dialog popped up.
68 71
69Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 72Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
70That means, you can restore the latest 73That means, you can restore the latest
71event/todo/journal you have deleted. 74event/todo/journal you have deleted.
72A journal is deleted, if you clear all the text of the journal. 75A journal is deleted, if you clear all the text of the journal.
73 76
74Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 77Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
75 78
76KA/Pi starting in 480x640 resolution: 79KA/Pi starting in 480x640 resolution:
77Hide the filter action in toolbar 80Hide the filter action in toolbar
78and added icons for undo/delete/redo in toolbar. 81and added icons for undo/delete/redo in toolbar.
79 82
80Change in OM/Pi ViewMail dialog: 83Change in OM/Pi ViewMail dialog:
81When clicking on the "delete" icon the mail is deleted after confirmation as usual. 84When clicking on the "delete" icon the mail is deleted after confirmation as usual.
82But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 85But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
83 86
84Fixed a crash when deleting mail-accounts in OM/Pi. 87Fixed a crash when deleting mail-accounts in OM/Pi.
85 88
86 89
87********** VERSION 1.9.14 ************ 90********** VERSION 1.9.14 ************
88 91
89Fixed some problems with the dialog sizes when switching 92Fixed some problems with the dialog sizes when switching
90portrait/landscape mode on 640x480 PDA display. 93portrait/landscape mode on 640x480 PDA display.
91 94
92Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 95Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
93 96
94Fixed an ugly bug in KOpieMail: 97Fixed an ugly bug in KOpieMail:
95KOpieMail was not able to write files (mails) to MSDOS file system, 98KOpieMail was not able to write files (mails) to MSDOS file system,
96like on an usual preformatted SD card. That should work now. 99like on an usual preformatted SD card. That should work now.
97To save your mail data on the Sd card do the following: 100To save your mail data on the Sd card do the following:
98Create a dir on the SD card: 101Create a dir on the SD card:
99mkdir /mnt/card/localmail 102mkdir /mnt/card/localmail
100Go to your home dir: 103Go to your home dir:
101cd 104cd
102Go to kopiemail data storage dir: 105Go to kopiemail data storage dir:
103cd kdepim/apps/kopiemail 106cd kdepim/apps/kopiemail
104Create a symlink to the SD card: 107Create a symlink to the SD card:
105ls -s /mnt/card/localmail 108ls -s /mnt/card/localmail
106Now KOpieMail will store all mails on the SD card. 109Now KOpieMail will store all mails on the SD card.
107 110
108KO/Pi Monthview: 111KO/Pi Monthview:
109Now "Go to Today" selects the current month from day 1-end, 112Now "Go to Today" selects the current month from day 1-end,
110not the current date + some days. 113not the current date + some days.
111I.e. "Go to Today" shows now always 114I.e. "Go to Today" shows now always
112the current month with first day of month in the first row. 115the current month with first day of month in the first row.
113 116
114Added missing German translation. 117Added missing German translation.
115 118
116Fixed icons of executeable on Wintendo. 119Fixed icons of executeable on Wintendo.
117 120
118Added a "Show next Mail" button to the OM/Pi 121Added a "Show next Mail" button to the OM/Pi
119mail viewer such that the mail below the current mail 122mail viewer such that the mail below the current mail
120in the mail list view of the current folder 123in the mail list view of the current folder
121can be read with a single click. 124can be read with a single click.
122 125
123 126
124********** VERSION 1.9.13 ************ 127********** VERSION 1.9.13 ************
125 128
126Fixed nasty PwM/Pi file reading bug, when 129Fixed nasty PwM/Pi file reading bug, when
127the used hash algo of file is different then the global 130the used hash algo of file is different then the global
128hash algo. 131hash algo.
129 132
130Added KA/Pi support for opie mailit mailapplication. 133Added KA/Pi support for opie mailit mailapplication.
131 134
132Fixed some bugs in OM/Pi. 135Fixed some bugs in OM/Pi.
133Now character conversion tables are available for the Zaurus 136Now character conversion tables are available for the Zaurus
134to make OM/Pi working properly. 137to make OM/Pi working properly.
135To get the character conversion in OM/Pi working, please download 138To get the character conversion in OM/Pi working, please download
136at the sourceforge project site the package 139at the sourceforge project site the package
137sr-character-conversion_SharpROM_arm.ipk.zip 140sr-character-conversion_SharpROM_arm.ipk.zip
138(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 141(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
139from the section "general files for KDE/Pim" 142from the section "general files for KDE/Pim"
140Instructions how to install this package are in a ReadMe in this file. 143Instructions how to install this package are in a ReadMe in this file.
141 144
142 145
143Fixed the orientation change problem in KA/Pi when switching 146Fixed the orientation change problem in KA/Pi when switching
144portrait/landscape mode. 147portrait/landscape mode.
145 148
146French translation available for KA/Pi and OM/Pi. 149French translation available for KA/Pi and OM/Pi.
147 150
148Fixed some problems with categories in KO/Pi in DTM sync. 151Fixed some problems with categories in KO/Pi in DTM sync.
149 152
150Added selection dialog for export to phone in KA/Pi. 153Added selection dialog for export to phone in KA/Pi.
151 154
152If in KO/Pi is an attendee selected to add to a meeting and this 155If in KO/Pi is an attendee selected to add to a meeting and this
153attendee is already in the list of attendees, this person is not added 156attendee is already in the list of attendees, this person is not added
154again. 157again.
155 158
156Some menu cleanup in KA/Pi. 159Some menu cleanup in KA/Pi.
157 160
158********** VERSION 1.9.12 ************ 161********** VERSION 1.9.12 ************
159 162
160Fix for the bug in KO/Pi What's Next view of version 1.9.11. 163Fix for the bug in KO/Pi What's Next view of version 1.9.11.
161 164
162Bugfix: Licence file is now shown again. 165Bugfix: Licence file is now shown again.
163 166
164OM/Pi now supports Unicode (utf8 charset). 167OM/Pi now supports Unicode (utf8 charset).
165Fixed some bugs in OM/Pi. 168Fixed some bugs in OM/Pi.
166 169
167KA/Pi has more German translation. 170KA/Pi has more German translation.
168 171
169 172
170********** VERSION 1.9.11 ************ 173********** VERSION 1.9.11 ************
171 174
172Fixed several problems in PWM/Pi, like 175Fixed several problems in PWM/Pi, like
173asking the user, if unsaved changed are pending 176asking the user, if unsaved changed are pending
174when closing the app. 177when closing the app.
175And PwM/Pi handles now different texts for the 178And PwM/Pi handles now different texts for the
176fields Description, Username, Password, configurable per category. 179fields Description, Username, Password, configurable per category.
177 180
178Fixed a crash in KO/Pi , when importing/loading vcs files 181Fixed a crash in KO/Pi , when importing/loading vcs files
179which have an entry with an attendee with state: 182which have an entry with an attendee with state:
180NEEDS ACTION 183NEEDS ACTION
181 184
182Fixed some problems in the German translation of OM/Pi, 185Fixed some problems in the German translation of OM/Pi,
183which makes some dialogs not fitting on the screen 186which makes some dialogs not fitting on the screen
184of the Z 5500. 187of the Z 5500.
185 188
186Fixed Qtopia crash, when disabling/deinstalling 189Fixed Qtopia crash, when disabling/deinstalling
187KO/Pi alarm applet. 190KO/Pi alarm applet.
188 191
189Implemented direct KDE<->KA/Pi sync for KA/Pi running 192Implemented direct KDE<->KA/Pi sync for KA/Pi running
190on Linux desktop. 193on Linux desktop.
191 194
192Added feature "remove sync info" to sync menu. 195Added feature "remove sync info" to sync menu.
193 196
194Tweaked the KO/Pi What's next view a bit, added 197Tweaked the KO/Pi What's next view a bit, added
195setting to hide events that are done. 198setting to hide events that are done.
196 199
197Disabled "beam receive enabled" on startup to 200Disabled "beam receive enabled" on startup to
198avoid problems if Fastload is enabled. 201avoid problems if Fastload is enabled.
199Please set "beam receive enabled", 202Please set "beam receive enabled",
200if you want to receive data via IR. 203if you want to receive data via IR.
201 204
202Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 205Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
203on Linux desktop. 206on Linux desktop.
204 207
205Made in KA/Pi scrolling possible, if details view is selected. 208Made in KA/Pi scrolling possible, if details view is selected.
206(The keyboard focus is set automatically to the search line) 209(The keyboard focus is set automatically to the search line)
207 210
208Fixed a bug in DMT sync, that a new entry in DTM was added 211Fixed a bug in DMT sync, that a new entry in DTM was added
209on every sync to Kx/Pi. 212on every sync to Kx/Pi.
210 213
211Fixed missing writing of KA/Pi categories to DMT entries when syncing. 214Fixed missing writing of KA/Pi categories to DMT entries when syncing.
212 215
213Fixed a bug in DMT sync with todos created in KO/Pi containing 216Fixed a bug in DMT sync with todos created in KO/Pi containing
214non-latin1 characters. 217non-latin1 characters.
215 218
216Rearranged package contents of Sharp-ipks and made all 219Rearranged package contents of Sharp-ipks and made all
217packages installable on SD again. 220packages installable on SD again.
218 221
219Fixed the writing of addressbook data in DTM sync. 222Fixed the writing of addressbook data in DTM sync.
220Empty fields in KA/Pi were not removed. 223Empty fields in KA/Pi were not removed.
221 224
222Added better category handling in KA/Pi: 225Added better category handling in KA/Pi:
223Added item 226Added item
224Edit Categories and 227Edit Categories and
225Manage new categories 228Manage new categories
226to the settings menu. 229to the settings menu.
227Possible to configure a view to display categories. 230Possible to configure a view to display categories.
228 231
229Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. 232Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
230 233
231Fixed displaying of "free" days and time in KO Monthview and Agendaview. 234Fixed displaying of "free" days and time in KO Monthview and Agendaview.
232 235
233... and many other bugfixes. 236... and many other bugfixes.
234 237
235********** VERSION 1.9.10 ************ 238********** VERSION 1.9.10 ************
236 239
237Many internal small bugfixes. 240Many internal small bugfixes.
238And fix of the "big" bug in KO/Pi, 241And fix of the "big" bug in KO/Pi,
239that after Syncing the appointments had an offset by several hours. 242that after Syncing the appointments had an offset by several hours.
240That was a problem with the internal timezone setting, 243That was a problem with the internal timezone setting,
241introduced by the changed timezone configuration settings. 244introduced by the changed timezone configuration settings.
242 245
243German translation for OM/Pi is now available. 246German translation for OM/Pi is now available.
244 247
245 248
246********** VERSION 1.9.9 ************ 249********** VERSION 1.9.9 ************
247 250
248KDE-Pim/Pi has a new Member! 251KDE-Pim/Pi has a new Member!
249It is called PWM/Pi (Passwordmanager/platform-independent) 252It is called PWM/Pi (Passwordmanager/platform-independent)
250and it is available for the Zaurus. 253and it is available for the Zaurus.
251It is planned, that it will be available later for Windows. 254It is planned, that it will be available later for Windows.
252(And for Linux, of course). 255(And for Linux, of course).
253It is a port of the Passwordmanager of KDE. 256It is a port of the Passwordmanager of KDE.
254It will need the MicroKDElibs to run. 257It will need the MicroKDElibs to run.
255 258
256Made loading of addressbooks in KA/Pi up to 7 times faster! 259Made loading of addressbooks in KA/Pi up to 7 times faster!
257The bigger your addressbook file, the more starting speed 260The bigger your addressbook file, the more starting speed
258will you gain. (relatively) 261will you gain. (relatively)
259 262
260The Qtopia addressbook connector is now platform independend 263The Qtopia addressbook connector is now platform independend
261as well and should work on any platform for importing/exporting 264as well and should work on any platform for importing/exporting
262Qtopia and Opie XML files. 265Qtopia and Opie XML files.
263 266
264Added a +30min feature to the timezone settings to make 267Added a +30min feature to the timezone settings to make
265KDE-Pim/Pi useable in Australia and other parts on the 268KDE-Pim/Pi useable in Australia and other parts on the
266world with strange timezones ;-) 269world with strange timezones ;-)
267 270
268German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 271German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
269 272
270It is now possible to disable the 273It is now possible to disable the
271"receive data via infrared" feature, such that syncing with 274"receive data via infrared" feature, such that syncing with
272Outlook is now possible again with Kx/Pi runing. 275Outlook is now possible again with Kx/Pi runing.
273Please disable it, before syncing Sharp DTM with Outlook. 276Please disable it, before syncing Sharp DTM with Outlook.
274For your convenience, the "receive data via infrared" feature 277For your convenience, the "receive data via infrared" feature
275is disabled automatically, if you sync Kx/Pi with DTM. 278is disabled automatically, if you sync Kx/Pi with DTM.
276You have to enable it again manually after syncing. 279You have to enable it again manually after syncing.
277Enabling this feature makes it impossible to start the 280Enabling this feature makes it impossible to start the
278Sharp DTM apps. If this feature is enabled, you will only get the 281Sharp DTM apps. If this feature is enabled, you will only get the
279alarm notification from KO/Pi and not from the Sharp calendar. 282alarm notification from KO/Pi and not from the Sharp calendar.
280This is very useful if you sync KO/Pi with Sharp DTM, 283This is very useful if you sync KO/Pi with Sharp DTM,
281because after syncing you usually would get notified about 284because after syncing you usually would get notified about
282an alarm by KO/Pi and the Sharp Calendar. 285an alarm by KO/Pi and the Sharp Calendar.
283 286
284Together with the Linux desktop version of KO/Pi 287Together with the Linux desktop version of KO/Pi
285it is now possible to sync KO/Pi on the Zaurus 288it is now possible to sync KO/Pi on the Zaurus
286with the complete KDE-desktop (3.3 or later) 289with the complete KDE-desktop (3.3 or later)
287calendar data easily. 290calendar data easily.
288That makes it possible to sync the Z with one 291That makes it possible to sync the Z with one
289click of a mouse with the KDE-Desktop. 292click of a mouse with the KDE-Desktop.
290This feature it available for all Zaurus platforms KO/Pi 293This feature it available for all Zaurus platforms KO/Pi
291is running on. 294is running on.
292The only thing needed is a running KO/Pi on Linux and 295The only thing needed is a running KO/Pi on Linux and
293a compiled version of the small 296a compiled version of the small
294KDE-Pim/Pi<->KDE-Desktop access command line program, 297KDE-Pim/Pi<->KDE-Desktop access command line program,
295which is in the KDE-Pim/Pi sources available. 298which is in the KDE-Pim/Pi sources available.
296 299
297The "KDE-desktop" syncing feature for KA/Pi will follow 300The "KDE-desktop" syncing feature for KA/Pi will follow
298in the next releases. 301in the next releases.
299 302
300Fixed the vcard export bug, which had the version 1.9.8. 303Fixed the vcard export bug, which had the version 1.9.8.
301 304
302Added missing GERMAN translation to KO/Pi. 305Added missing GERMAN translation to KO/Pi.
303Hi PsionX, could you add the missing french translation?Thx! 306Hi PsionX, could you add the missing french translation?Thx!
304 307
305Translation files for KA/Pi are available as well. 308Translation files for KA/Pi are available as well.
306GERMAN translation will be available in the next release. 309GERMAN translation will be available in the next release.
307PsionX ( yres, you again ;-) ), could you start translating 310PsionX ( yres, you again ;-) ), could you start translating
308KA/Pi? Thx! 311KA/Pi? Thx!
309 312
310You can download the version 1.9.9 at 313You can download the version 1.9.9 at
311 314
312http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 315http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
313 316
314Note: 317Note:
315To run the mail program OM/Pi you need libopenssl. 318To run the mail program OM/Pi you need libopenssl.
316A link to a download loaction is available at 319A link to a download loaction is available at
317ZSI at www.killefiz.de 320ZSI at www.killefiz.de
318 321
319 322
320********** VERSION 1.9.8 ************ 323********** VERSION 1.9.8 ************
321 324
322Fixed character decoding in OM/Pi. 325Fixed character decoding in OM/Pi.
323(e.g. German "Umlaute" were not displayed properly.) 326(e.g. German "Umlaute" were not displayed properly.)
324 327
325Made is possible to reparent todos in KO/Pi. 328Made is possible to reparent todos in KO/Pi.
326Use contextmenu or keys (look at Help-Keys + Colors) for that. 329Use contextmenu or keys (look at Help-Keys + Colors) for that.
327 330
328Added the missing Sync-Howto and WhatsNew to the packages. 331Added the missing Sync-Howto and WhatsNew to the packages.
329 332
330KO/Pi on Linux desktop can now sync with KDE desktop. 333KO/Pi on Linux desktop can now sync with KDE desktop.
331That means: When using KO/Pi on Linux desktop for syncing with 334That means: When using KO/Pi on Linux desktop for syncing with
332KDE desktop and the Zaurus, the Zaurus can be synced now 335KDE desktop and the Zaurus, the Zaurus can be synced now
333with all KDE-Calendar resources, not only with one local file. 336with all KDE-Calendar resources, not only with one local file.
334(That makes it possible to sync the Zaurus with the 337(That makes it possible to sync the Zaurus with the
335calendar data on a Kolab server) 338calendar data on a Kolab server)
336 339
337KA/Pi syncing with KDE desktop will be available in the next version. 340KA/Pi syncing with KDE desktop will be available in the next version.
338 341
339 342
340********** VERSION 1.9.7 ************ 343********** VERSION 1.9.7 ************
341 344
342KO/Pi - KA/Pi on Windows: 345KO/Pi - KA/Pi on Windows:
343Now a directory can be defined by the user, where the 346Now a directory can be defined by the user, where the
344application/config data should be saved. 347application/config data should be saved.
345 Define your desired path in the evironment variable 348 Define your desired path in the evironment variable
346 MICROKDEHOME 349 MICROKDEHOME
347 before starting KO/Pi or KA/Pi. 350 before starting KO/Pi or KA/Pi.
348 351
349An easy Kx/Pi to Kx/Pi syncing is now possible 352An easy Kx/Pi to Kx/Pi syncing is now possible
350(it is called Pi-Sync) via network. 353(it is called Pi-Sync) via network.
351Please look at the Sync Howto. 354Please look at the Sync Howto.
352 355
353Exporting of calendar data and contacts to mobile phones is now possible. 356Exporting of calendar data and contacts to mobile phones is now possible.
354The SyncHowto is updated with information howto 357The SyncHowto is updated with information howto
355access/sync mobile phones. 358access/sync mobile phones.
356Please look at the Sync Howto. 359Please look at the Sync Howto.
357 360
358Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 361Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
359Please disable Fastload for the original contact/calendar applications 362Please disable Fastload for the original contact/calendar applications
360and close them. 363and close them.
361KO/Pi and KA/Pi must be running in order to receive the data. 364KO/Pi and KA/Pi must be running in order to receive the data.
362(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 365(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
363 366
364In the KA/Pi details view are now the preferred tel. numbers displayed on top 367In the KA/Pi details view are now the preferred tel. numbers displayed on top
365of the other data ( emails/tel.numbers/addresses) 368of the other data ( emails/tel.numbers/addresses)
366 369
367Fixed some syncing problems in KA/Pi. 370Fixed some syncing problems in KA/Pi.
368 371
369Added font settings for the KA/Pi details view. 372Added font settings for the KA/Pi details view.
370Added fields "children's name" and "gender" to KA/Pi. 373Added fields "children's name" and "gender" to KA/Pi.
371 374
372Made searching in KA/Pi better: 375Made searching in KA/Pi better:
373Now the first item in a view is selected after a search automatically and 376Now the first item in a view is selected after a search automatically and
374the views can be scrolled up/down when the search input field has the keyboard focus. 377the views can be scrolled up/down when the search input field has the keyboard focus.
375 378
376And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 379And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
377 380
378 381
379********** VERSION 1.9.6 ************ 382********** VERSION 1.9.6 ************
380 383
381Changes in the external application communication on the Zaurus 384Changes in the external application communication on the Zaurus
382in order to use less RAM when the apps are running. 385in order to use less RAM when the apps are running.
383First syncing of addressbooks (KA/Pi) is possible. 386First syncing of addressbooks (KA/Pi) is possible.
384 387
385 388
386********** VERSION 1.9.5a ************ 389********** VERSION 1.9.5a ************
387 390
388Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 391Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
389Fixed some small bugs. 392Fixed some small bugs.
390KA/Pi shows now the birthday in summary view. 393KA/Pi shows now the birthday in summary view.
391Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 394Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
392for displaying dates. 395for displaying dates.
393 396
394 397
395********** VERSION 1.9.5 ************ 398********** VERSION 1.9.5 ************
396 399
397There is still no Addressbook syncing! 400There is still no Addressbook syncing!
398 401
399New in 1.9.5: 402New in 1.9.5:
400 403
401Many bugfixes. 404Many bugfixes.
402Better searching in KA/Pi. 405Better searching in KA/Pi.
403You can configure in KA/Pi if you want to search only after 406You can configure in KA/Pi if you want to search only after
404<return> key pressed. 407<return> key pressed.
405 408
406Better mail downloading in OM/Pi. 409Better mail downloading in OM/Pi.
407 410
408First experimental alpha version of sync of KO/Pi with mobile phones. 411First experimental alpha version of sync of KO/Pi with mobile phones.
409See gammu documentation for supported phones. 412See gammu documentation for supported phones.
410You 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. 413You 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.
411Quick hint how to use: 414Quick hint how to use:
412NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 415NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
413Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 416Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
414Create syncprofile - mobile device 417Create syncprofile - mobile device
415Remove entry for model. (Leave empty ). 418Remove entry for model. (Leave empty ).
416Enable infrared on Zaurus and your Phone. 419Enable infrared on Zaurus and your Phone.
417Sync. 420Sync.
418To get a more detailed log, start kopi from konsole. 421To get a more detailed log, start kopi from konsole.
419 422
420********** VERSION 1.9.4 ************ 423********** VERSION 1.9.4 ************
421 424
422This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 425This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
423 426
424WARNING: 427WARNING:
425PLEASE BACKUP ALL YOUR DATA! 428PLEASE BACKUP ALL YOUR DATA!
426We have changed a lot and maybe there are some unknown problems. 429We have changed a lot and maybe there are some unknown problems.
427 430
428SYNC HANDLING HAS CHANGED! 431SYNC HANDLING HAS CHANGED!
429Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 432Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
430(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 433(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
431 434
432You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 435You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
433If 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. 436If 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.
434 437
435As programs are available: 438As programs are available:
436KO/Pi (korganizer ipk) - a calendar program. 439KO/Pi (korganizer ipk) - a calendar program.
437KA/Pi (kaddressbook ipk ) - an addressbook 440KA/Pi (kaddressbook ipk ) - an addressbook
438OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 441OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
439 442
440An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 443An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
441(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 444(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
442 445
443All the applications are installed in a "Pim" TAB. 446All the applications are installed in a "Pim" TAB.
444If 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 447If 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
445 448
446All the application are integrated. 449All the application are integrated.
447Such 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. 450Such 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.
448 451
449HINT: 452HINT:
450If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 453If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
451 454
452What's new? 455What's new?
453 456
454SYNC HANDLING HAS CHANGED! 457SYNC HANDLING HAS CHANGED!
455Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 458Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
456(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 459(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
457 460
458New in OM/Pi: 461New in OM/Pi:
459When 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. 462When 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.
460 463
461New in KO/Pi: 464New in KO/Pi:
462French is now available for KO/Pi. 465French is now available for KO/Pi.
463Choose menu:Actions - Configure:TAB locale 466Choose menu:Actions - Configure:TAB locale
464Syncing has changed. 467Syncing has changed.
465Phone sync available soon. 468Phone sync available soon.
466Not much changes, I cannot remember them ... 469Not much changes, I cannot remember them ...
467 470
468New in KA/Pi: 471New in KA/Pi:
469Beaming possible. 472Beaming possible.
470Sharp DTM readonly access possible( create a new DTM resource ); 473Sharp DTM readonly access possible( create a new DTM resource );
471Better searching possible. 474Better searching possible.
472Search is performed only after pressing the return key. 475Search is performed only after pressing the return key.
473Use wildcard * to specify parts of a name. 476Use wildcard * to specify parts of a name.
474 477
475Better 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 * . 478Better 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 * .
476 479
477A big improvement is the new management of the contact access. 480A big improvement is the new management of the contact access.
478In version 1.9.3, every application was using their own addressbook access data. 481In version 1.9.3, every application was using their own addressbook access data.
479That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 482That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
480That was wasting of memory, if you had several hundreds of contacts. 483That was wasting of memory, if you had several hundreds of contacts.
481 484
482Now only KA/Pi accesses the addressbook. 485Now only KA/Pi accesses the addressbook.
483If 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. 486If 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.
484If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 487If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
485That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 488That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
486 489
487New in the KO/Pi alarm applet: 490New in the KO/Pi alarm applet:
488Configure your own timer popup menu! 491Configure your own timer popup menu!
489(Text and minutes for timer countdown) 492(Text and minutes for timer countdown)
490Just edit the file 493Just edit the file
491(yourhomedir)/.kopialarmtimerrc 494(yourhomedir)/.kopialarmtimerrc
492and start/stop a timer to get a new menu with the data of this file. 495and start/stop a timer to get a new menu with the data of this file.
493 496
494********** VERSION 1.9.3 ************ 497********** VERSION 1.9.3 ************
4951) 4981)
496Now KO/Pi on Windows imports directly the calendar data of 499Now KO/Pi on Windows imports directly the calendar data of
497an installed Outlook. Should work with OL version >= 2000. 500an installed Outlook. Should work with OL version >= 2000.
498 501
499********** VERSION 1.9.2 ************ 502********** VERSION 1.9.2 ************
5001) 5031)
501KDE-Pim/Pi has got a new member: 504KDE-Pim/Pi has got a new member:
502KmicroMail (KM/Pi) is a mail program, 505KmicroMail (KM/Pi) is a mail program,
503which can handle IMAP and POP mail access. 506which can handle IMAP and POP mail access.
504It is based on Opie-Mail v3. 507It is based on Opie-Mail v3.
505All dependencies to the Opie libraries ar removed, 508All dependencies to the Opie libraries ar removed,
506such that no additional Opie lib is needed. 509such that no additional Opie lib is needed.
507It is already integrated in KO/Pi and KA/Pi. 510It is already integrated in KO/Pi and KA/Pi.
508It it now available for the Zaurus,probably it 511It it now available for the Zaurus,probably it
509will be available for other platforms later. 512will be available for other platforms later.
510Hint: 513Hint:
511Create your own contact (name + email) 514Create your own contact (name + email)
512in KA/Pi, select this contact and choose menu: 515in KA/Pi, select this contact and choose menu:
513Settings - Set Who Am I. 516Settings - Set Who Am I.
514Now the settings of this contact are used as 517Now the settings of this contact are used as
515the sender data in KM/Pi. 518the sender data in KM/Pi.
5162) 5192)
517KDE-Pim/Pi is split up in five different 520KDE-Pim/Pi is split up in five different
518packages now precompiled for Sharp Zaurus: 521packages now precompiled for Sharp Zaurus:
519--kmicrokdelibs_1.9.2_arm.ipk 522--kmicrokdelibs_1.9.2_arm.ipk
520The libs are needed for any 523The libs are needed for any
521of the following programs: 524of the following programs:
522--kaddressbook_1.9.2_arm.ipk 525--kaddressbook_1.9.2_arm.ipk
523--kmicromail_1.9.2_arm.ipk 526--kmicromail_1.9.2_arm.ipk
524--korganizer_1.9.2_arm.ipk 527--korganizer_1.9.2_arm.ipk
525Independ from that, there is the alarm applet 528Independ from that, there is the alarm applet
526available for KO/Pi, which also offers 529available for KO/Pi, which also offers
527quick access for a new mail or 530quick access for a new mail or
528showing the addressbook.: 531showing the addressbook.:
529--korganizer-alarm_1.9.2_arm.ipk 532--korganizer-alarm_1.9.2_arm.ipk
530Independend means, that the alarm applet 533Independend means, that the alarm applet
531does not need any of the libs or programs above to run. 534does not need any of the libs or programs above to run.
532But it would be quite useless without these programs. 535But it would be quite useless without these programs.
533NOTE: 536NOTE:
534If you get a 537If you get a
535"This application depends on other programs" 538"This application depends on other programs"
536during installation of 539during installation of
537--kmicrokdelibs_1.9.2_arm.ipk 540--kmicrokdelibs_1.9.2_arm.ipk
538you probably do not have to care about that. 541you probably do not have to care about that.
539kmicrokdelibs_1.9.2 will come with some 542kmicrokdelibs_1.9.2 will come with some
540resource plugins, which needs additional libraries. 543resource plugins, which needs additional libraries.
541(E.g. libopie1, if you want to use the 544(E.g. libopie1, if you want to use the
542opie resource connector in KA/Pi). 545opie resource connector in KA/Pi).
543If you do not have this libraries installed, 546If you do not have this libraries installed,
544you simply cannot use the resource. 547you simply cannot use the resource.
545To make it clear: 548To make it clear:
546If the libraries are missing, the applications 549If the libraries are missing, the applications
547using kmicrokdelibs will start, 550using kmicrokdelibs will start,
548because the resources are plugins. 551because the resources are plugins.
5493) 5523)
550KO/Pi and friends are now installable on SD-Card! 553KO/Pi and friends are now installable on SD-Card!
551It is recommended to install all libs and apps 554It is recommended to install all libs and apps
552on the SD card or all in the internal storage. 555on the SD card or all in the internal storage.
553There may be problems, if this is mixed. 556There may be problems, if this is mixed.
5544) 5574)
555Fixed two bugs in the alarm notification on Windows. 558Fixed two bugs in the alarm notification on Windows.
5565) 5595)
557Great improvement! 560Great improvement!
558KO/Pi uses now the latest version of libical. 561KO/Pi uses now the latest version of libical.
559Libical is the library which actually reads 562Libical is the library which actually reads
560the calendar files and extract the data from it. 563the calendar files and extract the data from it.
561With the old version, there were problems 564With the old version, there were problems
562(crashes or program hangs) when licical did read 565(crashes or program hangs) when licical did read
563files, which were not stored from KO/Pi. 566files, which were not stored from KO/Pi.
564I do not know, if the new libical works perfect, 567I do not know, if the new libical works perfect,
565but actually it works much better than 568but actually it works much better than
566the old version. 569the old version.
567There are no problems with compatibility with 570There are no problems with compatibility with
568old calendar files of KO/Pi, of course! 571old calendar files of KO/Pi, of course!
5696) 5726)
570New in KA/Pi: 573New in KA/Pi:
571Opie addressbook resource connector available! 574Opie addressbook resource connector available!
572You will need libopie1 and the opie addressbook, 575You will need libopie1 and the opie addressbook,
573of course. 576of course.
574With the Opie addressbook resource connector, 577With the Opie addressbook resource connector,
575you can access the Opie addressbook readonly in KA/Pi. 578you can access the Opie addressbook readonly in KA/Pi.
576If you want to edit or import the data into KA/Pi, 579If you want to edit or import the data into KA/Pi,
577do this: 580do this:
578a) Create an Opie resource. 581a) Create an Opie resource.
579 (Menu: Settings-Configure Resources). 582 (Menu: Settings-Configure Resources).
580After configuration and restarting KA/Pi you should see 583After configuration and restarting KA/Pi you should see
581the Opie contacts in KA/Pi. 584the Opie contacts in KA/Pi.
582b) Select some or all Opie contacts. 585b) Select some or all Opie contacts.
583(NOTE: +++++ 586(NOTE: +++++
584To know exactly, what contacts are Opie contacts, 587To know exactly, what contacts are Opie contacts,
585do this: Choose menu: 588do this: Choose menu:
586View-Modify View - TAB Fields. 589View-Modify View - TAB Fields.
587Select in the above list "Resource" and click 590Select in the above list "Resource" and click
588down arrow to add it to the "Selected fields". 591down arrow to add it to the "Selected fields".
589Click OK. 592Click OK.
590Now you have a new column "Resource" in your list, 593Now you have a new column "Resource" in your list,
591where you can see, what an Opie resource is. 594where you can see, what an Opie resource is.
592++++ NOTE end.) 595++++ NOTE end.)
593Ok, we do have now some Opie contacts seleted. 596Ok, we do have now some Opie contacts seleted.
594(Use SHIFT or CTRL key in order to multiple select). 597(Use SHIFT or CTRL key in order to multiple select).
595c) Choose menu: Edit-Copy. 598c) Choose menu: Edit-Copy.
596d) Choose menu: Edit-Paste. 599d) Choose menu: Edit-Paste.
597e) Select the resource, you want to add the contacts to. 600e) Select the resource, you want to add the contacts to.
598Congrats! Now you have read/write access to the copied 601Congrats! Now you have read/write access to the copied
599opie contacts as "real" KA/Pi contacts. 602opie contacts as "real" KA/Pi contacts.
600 603
601 604
602********** VERSION 1.9.1 ************ 605********** VERSION 1.9.1 ************
6031) 6061)
604 +++ IMPORTANT 1 +++ 607 +++ IMPORTANT 1 +++
605 608
606The storing place of the default calendar 609The storing place of the default calendar
607file has changed! 610file has changed!
608The default calendar file was 611The default calendar file was
609Applications/korganizer/mycalendar.ics 612Applications/korganizer/mycalendar.ics
610on Zaurus and 613on Zaurus and
611(yourHomeDir)/korganizer/mycalendar.ics 614(yourHomeDir)/korganizer/mycalendar.ics
612on Windows/Linux desktop. Now it is 615on Windows/Linux desktop. Now it is
613(yourHomeDir)/kdepim/korganizer/mycalendar.ics 616(yourHomeDir)/kdepim/korganizer/mycalendar.ics
614on Zaurus, Windows and Linux. 617on Zaurus, Windows and Linux.
615To load the old file, choose menu 618To load the old file, choose menu
616File-Load calendar backup. 619File-Load calendar backup.
617(It should be loaded automatically 620(It should be loaded automatically
618at startup with a warning message displayed). 621at startup with a warning message displayed).
619The place of the configuration file has changed too. 622The place of the configuration file has changed too.
620If you want to use your old KO/Pi config, 623If you want to use your old KO/Pi config,
621copy it to 624copy it to
622(yourHomeDir)/kdepim/config/korganizerrc 625(yourHomeDir)/kdepim/config/korganizerrc
623Please read VERSION 1.9.0 - topic 3) as well! 626Please read VERSION 1.9.0 - topic 3) as well!
624 627
625 +++ IMPORTANT 2 +++ 628 +++ IMPORTANT 2 +++
626 629
627Because of the new paths, you will need 630Because of the new paths, you will need
628a new version of the KO/Pi alarm applet 631a new version of the KO/Pi alarm applet
629for Zaurus. 632for Zaurus.
630Use version >= 1.9.1 633Use version >= 1.9.1
631 634
6322) 6352)
633Now the QWhat'sThis Icon works for items 636Now the QWhat'sThis Icon works for items
634in the month view as well. 637in the month view as well.
635(See VERSION 1.7.8 Topic 1) ). 638(See VERSION 1.7.8 Topic 1) ).
6363) 6393)
637You can import birtsdays/anniversaries 640You can import birtsdays/anniversaries
638from KA/Pi into KO/Pi. 641from KA/Pi into KO/Pi.
639Choose menu File-Import birthdays. 642Choose menu File-Import birthdays.
640If you import twice, already imported items 643If you import twice, already imported items
641will not be imported again, if they 644will not be imported again, if they
642have not been changed in KO/Pi. 645have not been changed in KO/Pi.
6434) 6464)
644When syncing with sharp DTM, now a progress 647When syncing with sharp DTM, now a progress
645is shown, when the data is written back. 648is shown, when the data is written back.
646If there is much data in KO/Pi and no data 649If there is much data in KO/Pi and no data
647in DTM, that can take a long time. 650in DTM, that can take a long time.
648(But only for the first time ). 651(But only for the first time ).
6495) 6525)
650In the search dialog, you can search 653In the search dialog, you can search
651now for the name/email of an attendee 654now for the name/email of an attendee
652of an event/todo. 655of an event/todo.
653To get more space for displaying 656To get more space for displaying
654search results, the buttons 657search results, the buttons
655for "search" and "close" on the 658for "search" and "close" on the
656bottom are removed in the PDA version. 659bottom are removed in the PDA version.
657You have to click OK in the top right 660You have to click OK in the top right
658corner to do a search. 661corner to do a search.
6596) 6626)
660Now it is possible to disable the displaying 663Now it is possible to disable the displaying
661of todo items in the Allday part of the Agenda. 664of todo items in the Allday part of the Agenda.
662Choose Menu Action-Configure, 665Choose Menu Action-Configure,
663TAB Todo View, checkbox 666TAB Todo View, checkbox
664"Allday Agenda view shows todos" 667"Allday Agenda view shows todos"
6657) 6687)
666If FastLoad is enabled, now the settings and the 669If FastLoad is enabled, now the settings and the
667calendar data are saved, when KO/Pi is closed. 670calendar data are saved, when KO/Pi is closed.
668(If no Fastload is enabled, KO/Pi saves 671(If no Fastload is enabled, KO/Pi saves
669the data as well, of course) 672the data as well, of course)
6708) 6738)
671The Agenda View has a minimize-splitter now, 674The Agenda View has a minimize-splitter now,
672such that the height of the allday part can be 675such that the height of the allday part can be
673changed quickly. 676changed quickly.
674 677
675********** VERSION 1.9.0 ************ 678********** VERSION 1.9.0 ************
6761) 6791)
677KO/Pi is now merged with the new microKDE from KA/Pi. 680KO/Pi is now merged with the new microKDE from KA/Pi.
678KO/Pi accesses now KA/Pi as the addressbook. 681KO/Pi accesses now KA/Pi as the addressbook.
679The other ddressbook-plugins are not working any longer. 682The other ddressbook-plugins are not working any longer.
680(It is planned, that later KA/Pi itself uses these plugins) 683(It is planned, that later KA/Pi itself uses these plugins)
681New versions of KO/Pi are only available 684New versions of KO/Pi are only available
682together with KA/Pi as the KDE-Pim/Pi package. 685together with KA/Pi as the KDE-Pim/Pi package.
6832) 6862)
684If you click on an attendee of a meeting in the 687If you click on an attendee of a meeting in the
685event viewer, a detailed summary of the 688event viewer, a detailed summary of the
686attendee is shown. 689attendee is shown.
6873) 6903)
688The place of the configuration file has changed. 691The place of the configuration file has changed.
689If you want to use your old KO/Pi config, copy 692If you want to use your old KO/Pi config, copy
690Applications/korganizer/config_korganizerrc 693Applications/korganizer/config_korganizerrc
691to 694to
692Applications/korganizer/config/korganizerrc 695Applications/korganizer/config/korganizerrc
693 696
694********** VERSION 1.7.8 ************ 697********** VERSION 1.7.8 ************
6951) 6981)
696Now the QWhat'sThis ist working. 699Now the QWhat'sThis ist working.
697Enable the QWhat'sThis icon in the toolbar. 700Enable the QWhat'sThis icon in the toolbar.
698(You have to restart to reload the changed toolbar config). 701(You have to restart to reload the changed toolbar config).
699Now click on the QWhat'sThis Icon 702Now click on the QWhat'sThis Icon
700in the top right corner of KO/Pi. 703in the top right corner of KO/Pi.
701Then click on an item in the Agenda View: 704Then click on an item in the Agenda View:
702You will get a detailed display of the items content. 705You will get a detailed display of the items content.
7032) 7062)
704Some other very minor changes. 707Some other very minor changes.
705But I have forgotten the details ... 708But I have forgotten the details ...
706For that reason I start this log here: 709For that reason I start this log here:
707To document my changes, when I am doing it. 710To document my changes, when I am doing it.
708 711
709********** VERSION 1.7.7 ************ 712********** VERSION 1.7.7 ************
710Stable Version of KO/Pi 713Stable Version of KO/Pi
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 363dc32..378c7d4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1193,2655 +1193,2657 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1193 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1193 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1194 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1194 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1195 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1195 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1196 eventLSync->setReadOnly( true ); 1196 eventLSync->setReadOnly( true );
1197 qDebug("********** %d %d ", mGlobalSyncMode == SYNC_MODE_NORMAL, mSyncManager->syncWithDesktop() ); 1197 qDebug("********** %d %d ", mGlobalSyncMode == SYNC_MODE_NORMAL, mSyncManager->syncWithDesktop() );
1198 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1198 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1199 remote->addEvent( eventRSync ); 1199 remote->addEvent( eventRSync );
1200 else 1200 else
1201 delete eventRSync; 1201 delete eventRSync;
1202 QString mes; 1202 QString mes;
1203 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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); 1203 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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR );
1204 QString delmess; 1204 QString delmess;
1205 if ( delFut ) { 1205 if ( delFut ) {
1206 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); 1206 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);
1207 mes += delmess; 1207 mes += delmess;
1208 } 1208 }
1209 mes = i18n("Local calendar changed!\n") +mes; 1209 mes = i18n("Local calendar changed!\n") +mes;
1210 mCalendar->checkAlarmForIncidence( 0, true ); 1210 mCalendar->checkAlarmForIncidence( 0, true );
1211 qDebug( mes ); 1211 qDebug( mes );
1212 if ( mSyncManager->mShowSyncSummary ) { 1212 if ( mSyncManager->mShowSyncSummary ) {
1213 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1213 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1214 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1214 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1215 qDebug("cancelled "); 1215 qDebug("cancelled ");
1216 return false; 1216 return false;
1217 } 1217 }
1218 } 1218 }
1219 return syncOK; 1219 return syncOK;
1220} 1220}
1221 1221
1222void CalendarView::setSyncDevice( QString s ) 1222void CalendarView::setSyncDevice( QString s )
1223{ 1223{
1224 mCurrentSyncDevice= s; 1224 mCurrentSyncDevice= s;
1225} 1225}
1226void CalendarView::setSyncName( QString s ) 1226void CalendarView::setSyncName( QString s )
1227{ 1227{
1228 mCurrentSyncName= s; 1228 mCurrentSyncName= s;
1229} 1229}
1230bool CalendarView::syncCalendar(QString filename, int mode) 1230bool CalendarView::syncCalendar(QString filename, int mode)
1231{ 1231{
1232 //qDebug("syncCalendar %s ", filename.latin1()); 1232 //qDebug("syncCalendar %s ", filename.latin1());
1233 mGlobalSyncMode = SYNC_MODE_NORMAL; 1233 mGlobalSyncMode = SYNC_MODE_NORMAL;
1234 CalendarLocal* calendar = new CalendarLocal(); 1234 CalendarLocal* calendar = new CalendarLocal();
1235 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1235 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1236 FileStorage* storage = new FileStorage( calendar ); 1236 FileStorage* storage = new FileStorage( calendar );
1237 bool syncOK = false; 1237 bool syncOK = false;
1238 storage->setFileName( filename ); 1238 storage->setFileName( filename );
1239 // qDebug("loading ... "); 1239 // qDebug("loading ... ");
1240 if ( storage->load() ) { 1240 if ( storage->load() ) {
1241 getEventViewerDialog()->setSyncMode( true ); 1241 getEventViewerDialog()->setSyncMode( true );
1242 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1242 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1243 getEventViewerDialog()->setSyncMode( false ); 1243 getEventViewerDialog()->setSyncMode( false );
1244 if ( syncOK ) { 1244 if ( syncOK ) {
1245 if ( mSyncManager->mWriteBackFile ) 1245 if ( mSyncManager->mWriteBackFile )
1246 { 1246 {
1247 storage->setSaveFormat( new ICalFormat() ); 1247 storage->setSaveFormat( new ICalFormat() );
1248 storage->save(); 1248 storage->save();
1249 } 1249 }
1250 } 1250 }
1251 setModified( true ); 1251 setModified( true );
1252 } 1252 }
1253 delete storage; 1253 delete storage;
1254 delete calendar; 1254 delete calendar;
1255 if ( syncOK ) 1255 if ( syncOK )
1256 updateView(); 1256 updateView();
1257 return syncOK; 1257 return syncOK;
1258} 1258}
1259 1259
1260void CalendarView::syncExternal( int mode ) 1260void CalendarView::syncExternal( int mode )
1261{ 1261{
1262 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1262 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1263 1263
1264 qApp->processEvents(); 1264 qApp->processEvents();
1265 CalendarLocal* calendar = new CalendarLocal(); 1265 CalendarLocal* calendar = new CalendarLocal();
1266 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1266 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1267 bool syncOK = false; 1267 bool syncOK = false;
1268 bool loadSuccess = false; 1268 bool loadSuccess = false;
1269 PhoneFormat* phoneFormat = 0; 1269 PhoneFormat* phoneFormat = 0;
1270 emit tempDisableBR(true); 1270 emit tempDisableBR(true);
1271#ifndef DESKTOP_VERSION 1271#ifndef DESKTOP_VERSION
1272 SharpFormat* sharpFormat = 0; 1272 SharpFormat* sharpFormat = 0;
1273 if ( mode == 0 ) { // sharp 1273 if ( mode == 0 ) { // sharp
1274 sharpFormat = new SharpFormat () ; 1274 sharpFormat = new SharpFormat () ;
1275 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1275 loadSuccess = sharpFormat->load( calendar, mCalendar );
1276 1276
1277 } else 1277 } else
1278#endif 1278#endif
1279 if ( mode == 1 ) { // phone 1279 if ( mode == 1 ) { // phone
1280 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1280 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1281 mSyncManager->mPhoneDevice, 1281 mSyncManager->mPhoneDevice,
1282 mSyncManager->mPhoneConnection, 1282 mSyncManager->mPhoneConnection,
1283 mSyncManager->mPhoneModel); 1283 mSyncManager->mPhoneModel);
1284 loadSuccess = phoneFormat->load( calendar,mCalendar); 1284 loadSuccess = phoneFormat->load( calendar,mCalendar);
1285 1285
1286 } else { 1286 } else {
1287 emit tempDisableBR(false); 1287 emit tempDisableBR(false);
1288 return; 1288 return;
1289 } 1289 }
1290 if ( loadSuccess ) { 1290 if ( loadSuccess ) {
1291 getEventViewerDialog()->setSyncMode( true ); 1291 getEventViewerDialog()->setSyncMode( true );
1292 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1292 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1293 getEventViewerDialog()->setSyncMode( false ); 1293 getEventViewerDialog()->setSyncMode( false );
1294 qApp->processEvents(); 1294 qApp->processEvents();
1295 if ( syncOK ) { 1295 if ( syncOK ) {
1296 if ( mSyncManager->mWriteBackFile ) 1296 if ( mSyncManager->mWriteBackFile )
1297 { 1297 {
1298 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1298 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1299 Incidence* inc = iL.first(); 1299 Incidence* inc = iL.first();
1300 if ( phoneFormat ) { 1300 if ( phoneFormat ) {
1301 while ( inc ) { 1301 while ( inc ) {
1302 inc->removeID(mCurrentSyncDevice); 1302 inc->removeID(mCurrentSyncDevice);
1303 inc = iL.next(); 1303 inc = iL.next();
1304 } 1304 }
1305 } 1305 }
1306#ifndef DESKTOP_VERSION 1306#ifndef DESKTOP_VERSION
1307 if ( sharpFormat ) 1307 if ( sharpFormat )
1308 sharpFormat->save(calendar); 1308 sharpFormat->save(calendar);
1309#endif 1309#endif
1310 if ( phoneFormat ) 1310 if ( phoneFormat )
1311 phoneFormat->save(calendar); 1311 phoneFormat->save(calendar);
1312 iL = calendar->rawIncidences(); 1312 iL = calendar->rawIncidences();
1313 inc = iL.first(); 1313 inc = iL.first();
1314 Incidence* loc; 1314 Incidence* loc;
1315 while ( inc ) { 1315 while ( inc ) {
1316 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1316 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1317 loc = mCalendar->incidence(inc->uid() ); 1317 loc = mCalendar->incidence(inc->uid() );
1318 if ( loc ) { 1318 if ( loc ) {
1319 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1319 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1320 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1320 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1321 } 1321 }
1322 } 1322 }
1323 inc = iL.next(); 1323 inc = iL.next();
1324 } 1324 }
1325 Incidence* lse = getLastSyncEvent(); 1325 Incidence* lse = getLastSyncEvent();
1326 if ( lse ) { 1326 if ( lse ) {
1327 lse->setReadOnly( false ); 1327 lse->setReadOnly( false );
1328 lse->setDescription( "" ); 1328 lse->setDescription( "" );
1329 lse->setReadOnly( true ); 1329 lse->setReadOnly( true );
1330 } 1330 }
1331 } 1331 }
1332 } else { 1332 } else {
1333 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1333 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1334 } 1334 }
1335 setModified( true ); 1335 setModified( true );
1336 } else { 1336 } else {
1337 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1337 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1338 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1338 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1339 question, i18n("Ok")) ; 1339 question, i18n("Ok")) ;
1340 1340
1341 } 1341 }
1342 delete calendar; 1342 delete calendar;
1343 updateView(); 1343 updateView();
1344 emit tempDisableBR(false); 1344 emit tempDisableBR(false);
1345 return ;//syncOK; 1345 return ;//syncOK;
1346 1346
1347} 1347}
1348 1348
1349bool CalendarView::importBday() 1349bool CalendarView::importBday()
1350{ 1350{
1351#ifndef KORG_NOKABC 1351#ifndef KORG_NOKABC
1352 1352
1353#ifdef DESKTOP_VERSION 1353#ifdef DESKTOP_VERSION
1354 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1354 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1355 KABC::AddressBook::Iterator it; 1355 KABC::AddressBook::Iterator it;
1356 int count = 0; 1356 int count = 0;
1357 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1357 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1358 ++count; 1358 ++count;
1359 } 1359 }
1360 QProgressBar bar(count,0 ); 1360 QProgressBar bar(count,0 );
1361 int w = 300; 1361 int w = 300;
1362 if ( QApplication::desktop()->width() < 320 ) 1362 if ( QApplication::desktop()->width() < 320 )
1363 w = 220; 1363 w = 220;
1364 int h = bar.sizeHint().height() ; 1364 int h = bar.sizeHint().height() ;
1365 int dw = QApplication::desktop()->width(); 1365 int dw = QApplication::desktop()->width();
1366 int dh = QApplication::desktop()->height(); 1366 int dh = QApplication::desktop()->height();
1367 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1367 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1368 bar.show(); 1368 bar.show();
1369 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1369 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1370 qApp->processEvents(); 1370 qApp->processEvents();
1371 count = 0; 1371 count = 0;
1372 int addCount = 0; 1372 int addCount = 0;
1373 KCal::Attendee* a = 0; 1373 KCal::Attendee* a = 0;
1374 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1374 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1375 if ( ! bar.isVisible() ) 1375 if ( ! bar.isVisible() )
1376 return false; 1376 return false;
1377 bar.setProgress( count++ ); 1377 bar.setProgress( count++ );
1378 qApp->processEvents(); 1378 qApp->processEvents();
1379 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1379 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1380 if ( (*it).birthday().date().isValid() ){ 1380 if ( (*it).birthday().date().isValid() ){
1381 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1381 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1382 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1382 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1383 ++addCount; 1383 ++addCount;
1384 } 1384 }
1385 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1385 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1386 if ( anni.isValid() ){ 1386 if ( anni.isValid() ){
1387 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1387 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1388 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1388 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1389 ++addCount; 1389 ++addCount;
1390 } 1390 }
1391 } 1391 }
1392 updateView(); 1392 updateView();
1393 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1393 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1394#else //DESKTOP_VERSION 1394#else //DESKTOP_VERSION
1395 1395
1396 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1396 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1397 // the result should now arrive through method insertBirthdays 1397 // the result should now arrive through method insertBirthdays
1398 1398
1399#endif //DESKTOP_VERSION 1399#endif //DESKTOP_VERSION
1400 1400
1401#endif //KORG_NOKABC 1401#endif //KORG_NOKABC
1402 1402
1403 1403
1404 return true; 1404 return true;
1405} 1405}
1406 1406
1407// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1407// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1408void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1408void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1409 const QStringList& anniversaryList, const QStringList& realNameList, 1409 const QStringList& anniversaryList, const QStringList& realNameList,
1410 const QStringList& emailList, const QStringList& assembledNameList, 1410 const QStringList& emailList, const QStringList& assembledNameList,
1411 const QStringList& uidList) 1411 const QStringList& uidList)
1412{ 1412{
1413 qDebug("CalendarView::insertBirthdays"); 1413 qDebug("CalendarView::insertBirthdays");
1414 if (uid == this->name()) 1414 if (uid == this->name())
1415 { 1415 {
1416 int count = birthdayList.count(); 1416 int count = birthdayList.count();
1417 int addCount = 0; 1417 int addCount = 0;
1418 KCal::Attendee* a = 0; 1418 KCal::Attendee* a = 0;
1419 1419
1420 qDebug("CalView 1 %i", count); 1420 qDebug("CalView 1 %i", count);
1421 1421
1422 QProgressBar bar(count,0 ); 1422 QProgressBar bar(count,0 );
1423 int w = 300; 1423 int w = 300;
1424 if ( QApplication::desktop()->width() < 320 ) 1424 if ( QApplication::desktop()->width() < 320 )
1425 w = 220; 1425 w = 220;
1426 int h = bar.sizeHint().height() ; 1426 int h = bar.sizeHint().height() ;
1427 int dw = QApplication::desktop()->width(); 1427 int dw = QApplication::desktop()->width();
1428 int dh = QApplication::desktop()->height(); 1428 int dh = QApplication::desktop()->height();
1429 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1429 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1430 bar.show(); 1430 bar.show();
1431 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1431 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1432 qApp->processEvents(); 1432 qApp->processEvents();
1433 1433
1434 QDate birthday; 1434 QDate birthday;
1435 QDate anniversary; 1435 QDate anniversary;
1436 QString realName; 1436 QString realName;
1437 QString email; 1437 QString email;
1438 QString assembledName; 1438 QString assembledName;
1439 QString uid; 1439 QString uid;
1440 bool ok = true; 1440 bool ok = true;
1441 for ( int i = 0; i < count; i++) 1441 for ( int i = 0; i < count; i++)
1442 { 1442 {
1443 if ( ! bar.isVisible() ) 1443 if ( ! bar.isVisible() )
1444 return; 1444 return;
1445 bar.setProgress( i ); 1445 bar.setProgress( i );
1446 qApp->processEvents(); 1446 qApp->processEvents();
1447 1447
1448 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1448 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1449 if (!ok) { 1449 if (!ok) {
1450 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1450 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1451 } 1451 }
1452 1452
1453 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1453 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1454 if (!ok) { 1454 if (!ok) {
1455 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1455 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1456 } 1456 }
1457 realName = realNameList[i]; 1457 realName = realNameList[i];
1458 email = emailList[i]; 1458 email = emailList[i];
1459 assembledName = assembledNameList[i]; 1459 assembledName = assembledNameList[i];
1460 uid = uidList[i]; 1460 uid = uidList[i];
1461 //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() ); 1461 //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() );
1462 1462
1463 if ( birthday.isValid() ){ 1463 if ( birthday.isValid() ){
1464 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1464 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1465 KCal::Attendee::ReqParticipant,uid) ; 1465 KCal::Attendee::ReqParticipant,uid) ;
1466 if ( addAnniversary( birthday, assembledName, a, true ) ) 1466 if ( addAnniversary( birthday, assembledName, a, true ) )
1467 ++addCount; 1467 ++addCount;
1468 } 1468 }
1469 1469
1470 if ( anniversary.isValid() ){ 1470 if ( anniversary.isValid() ){
1471 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1471 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1472 KCal::Attendee::ReqParticipant,uid) ; 1472 KCal::Attendee::ReqParticipant,uid) ;
1473 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1473 if ( addAnniversary( anniversary, assembledName, a, false ) )
1474 ++addCount; 1474 ++addCount;
1475 } 1475 }
1476 } 1476 }
1477 1477
1478 updateView(); 1478 updateView();
1479 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1479 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1480 1480
1481 } 1481 }
1482 1482
1483} 1483}
1484 1484
1485 1485
1486 1486
1487bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1487bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1488{ 1488{
1489 //qDebug("addAnni "); 1489 //qDebug("addAnni ");
1490 Event * ev = new Event(); 1490 Event * ev = new Event();
1491 if ( a ) { 1491 if ( a ) {
1492 ev->addAttendee( a ); 1492 ev->addAttendee( a );
1493 } 1493 }
1494 QString kind; 1494 QString kind;
1495 if ( birthday ) 1495 if ( birthday )
1496 kind = i18n( "Birthday" ); 1496 kind = i18n( "Birthday" );
1497 else 1497 else
1498 kind = i18n( "Anniversary" ); 1498 kind = i18n( "Anniversary" );
1499 ev->setSummary( name + " - " + kind ); 1499 ev->setSummary( name + " - " + kind );
1500 ev->setOrganizer(a->email()); 1500 ev->setOrganizer(a->email());
1501 ev->setCategories( kind ); 1501 ev->setCategories( kind );
1502 ev->setDtStart( QDateTime(date) ); 1502 ev->setDtStart( QDateTime(date) );
1503 ev->setDtEnd( QDateTime(date) ); 1503 ev->setDtEnd( QDateTime(date) );
1504 ev->setFloats( true ); 1504 ev->setFloats( true );
1505 Recurrence * rec = ev->recurrence(); 1505 Recurrence * rec = ev->recurrence();
1506 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1506 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1507 rec->addYearlyNum( date.month() ); 1507 rec->addYearlyNum( date.month() );
1508 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1508 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1509 delete ev; 1509 delete ev;
1510 return false; 1510 return false;
1511 } 1511 }
1512 return true; 1512 return true;
1513 1513
1514} 1514}
1515bool CalendarView::importQtopia( const QString &categories, 1515bool CalendarView::importQtopia( const QString &categories,
1516 const QString &datebook, 1516 const QString &datebook,
1517 const QString &todolist ) 1517 const QString &todolist )
1518{ 1518{
1519 1519
1520 QtopiaFormat qtopiaFormat; 1520 QtopiaFormat qtopiaFormat;
1521 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1521 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1522 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1522 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1523 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1523 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1524 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1524 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1525 1525
1526 updateView(); 1526 updateView();
1527 return true; 1527 return true;
1528 1528
1529#if 0 1529#if 0
1530 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1530 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1531 mCurrentSyncDevice = "qtopia-XML"; 1531 mCurrentSyncDevice = "qtopia-XML";
1532 if ( mSyncManager->mAskForPreferences ) 1532 if ( mSyncManager->mAskForPreferences )
1533 edit_sync_options(); 1533 edit_sync_options();
1534 qApp->processEvents(); 1534 qApp->processEvents();
1535 CalendarLocal* calendar = new CalendarLocal(); 1535 CalendarLocal* calendar = new CalendarLocal();
1536 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1536 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1537 bool syncOK = false; 1537 bool syncOK = false;
1538 QtopiaFormat qtopiaFormat; 1538 QtopiaFormat qtopiaFormat;
1539 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1539 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1540 bool loadOk = true; 1540 bool loadOk = true;
1541 if ( !categories.isEmpty() ) 1541 if ( !categories.isEmpty() )
1542 loadOk = qtopiaFormat.load( calendar, categories ); 1542 loadOk = qtopiaFormat.load( calendar, categories );
1543 if ( loadOk && !datebook.isEmpty() ) 1543 if ( loadOk && !datebook.isEmpty() )
1544 loadOk = qtopiaFormat.load( calendar, datebook ); 1544 loadOk = qtopiaFormat.load( calendar, datebook );
1545 if ( loadOk && !todolist.isEmpty() ) 1545 if ( loadOk && !todolist.isEmpty() )
1546 loadOk = qtopiaFormat.load( calendar, todolist ); 1546 loadOk = qtopiaFormat.load( calendar, todolist );
1547 1547
1548 if ( loadOk ) { 1548 if ( loadOk ) {
1549 getEventViewerDialog()->setSyncMode( true ); 1549 getEventViewerDialog()->setSyncMode( true );
1550 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1550 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1551 getEventViewerDialog()->setSyncMode( false ); 1551 getEventViewerDialog()->setSyncMode( false );
1552 qApp->processEvents(); 1552 qApp->processEvents();
1553 if ( syncOK ) { 1553 if ( syncOK ) {
1554 if ( mSyncManager->mWriteBackFile ) 1554 if ( mSyncManager->mWriteBackFile )
1555 { 1555 {
1556 // write back XML file 1556 // write back XML file
1557 1557
1558 } 1558 }
1559 setModified( true ); 1559 setModified( true );
1560 } 1560 }
1561 } else { 1561 } else {
1562 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1562 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1563 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1563 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1564 question, i18n("Ok")) ; 1564 question, i18n("Ok")) ;
1565 } 1565 }
1566 delete calendar; 1566 delete calendar;
1567 updateView(); 1567 updateView();
1568 return syncOK; 1568 return syncOK;
1569 1569
1570 1570
1571#endif 1571#endif
1572 1572
1573} 1573}
1574 1574
1575void CalendarView::setSyncEventsReadOnly() 1575void CalendarView::setSyncEventsReadOnly()
1576{ 1576{
1577 Event * ev; 1577 Event * ev;
1578 QPtrList<Event> eL = mCalendar->rawEvents(); 1578 QPtrList<Event> eL = mCalendar->rawEvents();
1579 ev = eL.first(); 1579 ev = eL.first();
1580 while ( ev ) { 1580 while ( ev ) {
1581 if ( ev->uid().left(15) == QString("last-syncEvent-") ) 1581 if ( ev->uid().left(15) == QString("last-syncEvent-") )
1582 ev->setReadOnly( true ); 1582 ev->setReadOnly( true );
1583 ev = eL.next(); 1583 ev = eL.next();
1584 } 1584 }
1585} 1585}
1586bool CalendarView::openCalendar(QString filename, bool merge) 1586bool CalendarView::openCalendar(QString filename, bool merge)
1587{ 1587{
1588 1588
1589 if (filename.isEmpty()) { 1589 if (filename.isEmpty()) {
1590 return false; 1590 return false;
1591 } 1591 }
1592 1592
1593 if (!QFile::exists(filename)) { 1593 if (!QFile::exists(filename)) {
1594 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1594 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1595 return false; 1595 return false;
1596 } 1596 }
1597 1597
1598 globalFlagBlockAgenda = 1; 1598 globalFlagBlockAgenda = 1;
1599 if (!merge) mCalendar->close(); 1599 if (!merge) mCalendar->close();
1600 1600
1601 mStorage->setFileName( filename ); 1601 mStorage->setFileName( filename );
1602 1602
1603 if ( mStorage->load() ) { 1603 if ( mStorage->load() ) {
1604 if ( merge ) ;//setModified( true ); 1604 if ( merge ) ;//setModified( true );
1605 else { 1605 else {
1606 //setModified( true ); 1606 //setModified( true );
1607 mViewManager->setDocumentId( filename ); 1607 mViewManager->setDocumentId( filename );
1608 mDialogManager->setDocumentId( filename ); 1608 mDialogManager->setDocumentId( filename );
1609 mTodoList->setDocumentId( filename ); 1609 mTodoList->setDocumentId( filename );
1610 } 1610 }
1611 globalFlagBlockAgenda = 2; 1611 globalFlagBlockAgenda = 2;
1612 // if ( getLastSyncEvent() ) 1612 // if ( getLastSyncEvent() )
1613 // getLastSyncEvent()->setReadOnly( true ); 1613 // getLastSyncEvent()->setReadOnly( true );
1614 mCalendar->reInitAlarmSettings(); 1614 mCalendar->reInitAlarmSettings();
1615 setSyncEventsReadOnly(); 1615 setSyncEventsReadOnly();
1616 updateUnmanagedViews(); 1616 updateUnmanagedViews();
1617 updateView(); 1617 updateView();
1618 if ( filename != MainWindow::defaultFileName() ) { 1618 if ( filename != MainWindow::defaultFileName() ) {
1619 saveCalendar( MainWindow::defaultFileName() ); 1619 saveCalendar( MainWindow::defaultFileName() );
1620 } else { 1620 } else {
1621 QFileInfo finf ( MainWindow::defaultFileName()); 1621 QFileInfo finf ( MainWindow::defaultFileName());
1622 if ( finf.exists() ) { 1622 if ( finf.exists() ) {
1623 setLoadedFileVersion( finf.lastModified () ); 1623 setLoadedFileVersion( finf.lastModified () );
1624 } 1624 }
1625 } 1625 }
1626 return true; 1626 return true;
1627 } else { 1627 } else {
1628 // while failing to load, the calendar object could 1628 // while failing to load, the calendar object could
1629 // have become partially populated. Clear it out. 1629 // have become partially populated. Clear it out.
1630 if ( !merge ) { 1630 if ( !merge ) {
1631 mCalendar->close(); 1631 mCalendar->close();
1632 mViewManager->setDocumentId( filename ); 1632 mViewManager->setDocumentId( filename );
1633 mDialogManager->setDocumentId( filename ); 1633 mDialogManager->setDocumentId( filename );
1634 mTodoList->setDocumentId( filename ); 1634 mTodoList->setDocumentId( filename );
1635 } 1635 }
1636 1636
1637 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 1637 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1638 1638
1639 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 1639 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
1640 globalFlagBlockAgenda = 2; 1640 globalFlagBlockAgenda = 2;
1641 mCalendar->reInitAlarmSettings(); 1641 mCalendar->reInitAlarmSettings();
1642 setSyncEventsReadOnly(); 1642 setSyncEventsReadOnly();
1643 updateUnmanagedViews(); 1643 updateUnmanagedViews();
1644 updateView(); 1644 updateView();
1645 } 1645 }
1646 return false; 1646 return false;
1647} 1647}
1648void CalendarView::showOpenError() 1648void CalendarView::showOpenError()
1649{ 1649{
1650 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 1650 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
1651} 1651}
1652void CalendarView::setLoadedFileVersion(QDateTime dt) 1652void CalendarView::setLoadedFileVersion(QDateTime dt)
1653{ 1653{
1654 loadedFileVersion = dt; 1654 loadedFileVersion = dt;
1655} 1655}
1656bool CalendarView::checkFileChanged(QString fn) 1656bool CalendarView::checkFileChanged(QString fn)
1657{ 1657{
1658 QFileInfo finf ( fn ); 1658 QFileInfo finf ( fn );
1659 if ( !finf.exists() ) 1659 if ( !finf.exists() )
1660 return true; 1660 return true;
1661 QDateTime dt = finf.lastModified (); 1661 QDateTime dt = finf.lastModified ();
1662 if ( dt <= loadedFileVersion ) 1662 if ( dt <= loadedFileVersion )
1663 return false; 1663 return false;
1664 return true; 1664 return true;
1665 1665
1666} 1666}
1667void CalendarView::watchSavedFile() 1667void CalendarView::watchSavedFile()
1668{ 1668{
1669 QFileInfo finf ( MainWindow::defaultFileName()); 1669 QFileInfo finf ( MainWindow::defaultFileName());
1670 if ( !finf.exists() ) 1670 if ( !finf.exists() )
1671 return; 1671 return;
1672 QDateTime dt = finf.lastModified (); 1672 QDateTime dt = finf.lastModified ();
1673 if ( dt < loadedFileVersion ) { 1673 if ( dt < loadedFileVersion ) {
1674 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 1674 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
1675 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 1675 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
1676 return; 1676 return;
1677 } 1677 }
1678 loadedFileVersion = dt; 1678 loadedFileVersion = dt;
1679} 1679}
1680 1680
1681bool CalendarView::checkFileVersion(QString fn) 1681bool CalendarView::checkFileVersion(QString fn)
1682{ 1682{
1683 QFileInfo finf ( fn ); 1683 QFileInfo finf ( fn );
1684 if ( !finf.exists() ) 1684 if ( !finf.exists() )
1685 return true; 1685 return true;
1686 QDateTime dt = finf.lastModified (); 1686 QDateTime dt = finf.lastModified ();
1687 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); 1687 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1());
1688 //qDebug("file on disk version %s",dt.toString().latin1()); 1688 //qDebug("file on disk version %s",dt.toString().latin1());
1689 if ( dt <= loadedFileVersion ) 1689 if ( dt <= loadedFileVersion )
1690 return true; 1690 return true;
1691 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)) , 1691 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)) ,
1692 i18n("KO/Pi Warning"),i18n("Overwrite"), 1692 i18n("KO/Pi Warning"),i18n("Overwrite"),
1693 i18n("Sync+save")); 1693 i18n("Sync+save"));
1694 1694
1695 if ( km == KMessageBox::Cancel ) 1695 if ( km == KMessageBox::Cancel )
1696 return false; 1696 return false;
1697 if ( km == KMessageBox::Yes ) 1697 if ( km == KMessageBox::Yes )
1698 return true; 1698 return true;
1699 1699
1700 setSyncDevice("deleteaftersync" ); 1700 setSyncDevice("deleteaftersync" );
1701 mSyncManager->mAskForPreferences = true; 1701 mSyncManager->mAskForPreferences = true;
1702 mSyncManager->mSyncAlgoPrefs = 3; 1702 mSyncManager->mSyncAlgoPrefs = 3;
1703 mSyncManager->mWriteBackFile = false; 1703 mSyncManager->mWriteBackFile = false;
1704 mSyncManager->mWriteBackExistingOnly = false; 1704 mSyncManager->mWriteBackExistingOnly = false;
1705 mSyncManager->mShowSyncSummary = false; 1705 mSyncManager->mShowSyncSummary = false;
1706 syncCalendar( fn, 3 ); 1706 syncCalendar( fn, 3 );
1707 Event * e = getLastSyncEvent(); 1707 Event * e = getLastSyncEvent();
1708 mCalendar->deleteEvent ( e ); 1708 mCalendar->deleteEvent ( e );
1709 updateView(); 1709 updateView();
1710 return true; 1710 return true;
1711} 1711}
1712 1712
1713bool CalendarView::saveCalendar( QString filename ) 1713bool CalendarView::saveCalendar( QString filename )
1714{ 1714{
1715 1715
1716 // Store back all unsaved data into calendar object 1716 // Store back all unsaved data into calendar object
1717 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 1717 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
1718 if ( mViewManager->currentView() ) 1718 if ( mViewManager->currentView() )
1719 mViewManager->currentView()->flushView(); 1719 mViewManager->currentView()->flushView();
1720 1720
1721 1721
1722 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 1722 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
1723 mStorage->setSaveFormat( new ICalFormat() ); 1723 mStorage->setSaveFormat( new ICalFormat() );
1724 mStorage->setFileName( filename ); 1724 mStorage->setFileName( filename );
1725 bool success; 1725 bool success;
1726 success = mStorage->save(); 1726 success = mStorage->save();
1727 if ( !success ) { 1727 if ( !success ) {
1728 return false; 1728 return false;
1729 } 1729 }
1730 if ( filename == MainWindow::defaultFileName() ) { 1730 if ( filename == MainWindow::defaultFileName() ) {
1731 setLoadedFileVersion( lfv ); 1731 setLoadedFileVersion( lfv );
1732 watchSavedFile(); 1732 watchSavedFile();
1733 } 1733 }
1734 return true; 1734 return true;
1735} 1735}
1736 1736
1737void CalendarView::closeCalendar() 1737void CalendarView::closeCalendar()
1738{ 1738{
1739 1739
1740 // child windows no longer valid 1740 // child windows no longer valid
1741 emit closingDown(); 1741 emit closingDown();
1742 1742
1743 mCalendar->close(); 1743 mCalendar->close();
1744 setModified(false); 1744 setModified(false);
1745 updateView(); 1745 updateView();
1746} 1746}
1747 1747
1748void CalendarView::archiveCalendar() 1748void CalendarView::archiveCalendar()
1749{ 1749{
1750 mDialogManager->showArchiveDialog(); 1750 mDialogManager->showArchiveDialog();
1751} 1751}
1752 1752
1753 1753
1754void CalendarView::readSettings() 1754void CalendarView::readSettings()
1755{ 1755{
1756 1756
1757 1757
1758 // mViewManager->showAgendaView(); 1758 // mViewManager->showAgendaView();
1759 QString str; 1759 QString str;
1760 //qDebug("CalendarView::readSettings() "); 1760 //qDebug("CalendarView::readSettings() ");
1761 // read settings from the KConfig, supplying reasonable 1761 // read settings from the KConfig, supplying reasonable
1762 // defaults where none are to be found 1762 // defaults where none are to be found
1763 KConfig *config = KOGlobals::config(); 1763 KConfig *config = KOGlobals::config();
1764#ifndef KORG_NOSPLITTER 1764#ifndef KORG_NOSPLITTER
1765 config->setGroup("KOrganizer Geometry"); 1765 config->setGroup("KOrganizer Geometry");
1766 1766
1767 QValueList<int> sizes = config->readIntListEntry("Separator1"); 1767 QValueList<int> sizes = config->readIntListEntry("Separator1");
1768 if (sizes.count() != 2) { 1768 if (sizes.count() != 2) {
1769 sizes << mDateNavigator->minimumSizeHint().width(); 1769 sizes << mDateNavigator->minimumSizeHint().width();
1770 sizes << 300; 1770 sizes << 300;
1771 } 1771 }
1772 mPanner->setSizes(sizes); 1772 mPanner->setSizes(sizes);
1773 1773
1774 sizes = config->readIntListEntry("Separator2"); 1774 sizes = config->readIntListEntry("Separator2");
1775 if ( ( mResourceView && sizes.count() == 4 ) || 1775 if ( ( mResourceView && sizes.count() == 4 ) ||
1776 ( !mResourceView && sizes.count() == 3 ) ) { 1776 ( !mResourceView && sizes.count() == 3 ) ) {
1777 mLeftSplitter->setSizes(sizes); 1777 mLeftSplitter->setSizes(sizes);
1778 } 1778 }
1779#endif 1779#endif
1780 globalFlagBlockAgenda = 1; 1780 globalFlagBlockAgenda = 1;
1781 mViewManager->showAgendaView(); 1781 mViewManager->showAgendaView();
1782 //mViewManager->readSettings( config ); 1782 //mViewManager->readSettings( config );
1783 mTodoList->restoreLayout(config,QString("Todo Layout")); 1783 mTodoList->restoreLayout(config,QString("Todo Layout"));
1784 readFilterSettings(config); 1784 readFilterSettings(config);
1785 config->setGroup( "Views" ); 1785 config->setGroup( "Views" );
1786 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1786 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1787 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1787 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1788 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1788 else if ( dateCount == 7 ) mNavigator->selectWeek();
1789 else mNavigator->selectDates( dateCount ); 1789 else mNavigator->selectDates( dateCount );
1790 // mViewManager->readSettings( config ); 1790 // mViewManager->readSettings( config );
1791 updateConfig(); 1791 updateConfig();
1792 globalFlagBlockAgenda = 2; 1792 globalFlagBlockAgenda = 2;
1793 mViewManager->readSettings( config ); 1793 mViewManager->readSettings( config );
1794#ifdef DESKTOP_VERSION 1794#ifdef DESKTOP_VERSION
1795 config->setGroup("WidgetLayout"); 1795 config->setGroup("WidgetLayout");
1796 QStringList list; 1796 QStringList list;
1797 list = config->readListEntry("MainLayout"); 1797 list = config->readListEntry("MainLayout");
1798 int x,y,w,h; 1798 int x,y,w,h;
1799 if ( ! list.isEmpty() ) { 1799 if ( ! list.isEmpty() ) {
1800 x = list[0].toInt(); 1800 x = list[0].toInt();
1801 y = list[1].toInt(); 1801 y = list[1].toInt();
1802 w = list[2].toInt(); 1802 w = list[2].toInt();
1803 h = list[3].toInt(); 1803 h = list[3].toInt();
1804 topLevelWidget()->setGeometry(x,y,w,h); 1804 topLevelWidget()->setGeometry(x,y,w,h);
1805 1805
1806 } else { 1806 } else {
1807 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1807 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1808 } 1808 }
1809 list = config->readListEntry("EditEventLayout"); 1809 list = config->readListEntry("EditEventLayout");
1810 if ( ! list.isEmpty() ) { 1810 if ( ! list.isEmpty() ) {
1811 x = list[0].toInt(); 1811 x = list[0].toInt();
1812 y = list[1].toInt(); 1812 y = list[1].toInt();
1813 w = list[2].toInt(); 1813 w = list[2].toInt();
1814 h = list[3].toInt(); 1814 h = list[3].toInt();
1815 mEventEditor->setGeometry(x,y,w,h); 1815 mEventEditor->setGeometry(x,y,w,h);
1816 1816
1817 } 1817 }
1818 list = config->readListEntry("EditTodoLayout"); 1818 list = config->readListEntry("EditTodoLayout");
1819 if ( ! list.isEmpty() ) { 1819 if ( ! list.isEmpty() ) {
1820 x = list[0].toInt(); 1820 x = list[0].toInt();
1821 y = list[1].toInt(); 1821 y = list[1].toInt();
1822 w = list[2].toInt(); 1822 w = list[2].toInt();
1823 h = list[3].toInt(); 1823 h = list[3].toInt();
1824 mTodoEditor->setGeometry(x,y,w,h); 1824 mTodoEditor->setGeometry(x,y,w,h);
1825 1825
1826 } 1826 }
1827 list = config->readListEntry("ViewerLayout"); 1827 list = config->readListEntry("ViewerLayout");
1828 if ( ! list.isEmpty() ) { 1828 if ( ! list.isEmpty() ) {
1829 x = list[0].toInt(); 1829 x = list[0].toInt();
1830 y = list[1].toInt(); 1830 y = list[1].toInt();
1831 w = list[2].toInt(); 1831 w = list[2].toInt();
1832 h = list[3].toInt(); 1832 h = list[3].toInt();
1833 getEventViewerDialog()->setGeometry(x,y,w,h); 1833 getEventViewerDialog()->setGeometry(x,y,w,h);
1834 } 1834 }
1835#endif 1835#endif
1836 1836
1837} 1837}
1838 1838
1839 1839
1840void CalendarView::writeSettings() 1840void CalendarView::writeSettings()
1841{ 1841{
1842 // kdDebug() << "CalendarView::writeSettings" << endl; 1842 // kdDebug() << "CalendarView::writeSettings" << endl;
1843 1843
1844 KConfig *config = KOGlobals::config(); 1844 KConfig *config = KOGlobals::config();
1845 1845
1846#ifndef KORG_NOSPLITTER 1846#ifndef KORG_NOSPLITTER
1847 config->setGroup("KOrganizer Geometry"); 1847 config->setGroup("KOrganizer Geometry");
1848 1848
1849 QValueList<int> list = mPanner->sizes(); 1849 QValueList<int> list = mPanner->sizes();
1850 config->writeEntry("Separator1",list); 1850 config->writeEntry("Separator1",list);
1851 1851
1852 list = mLeftSplitter->sizes(); 1852 list = mLeftSplitter->sizes();
1853 config->writeEntry("Separator2",list); 1853 config->writeEntry("Separator2",list);
1854#endif 1854#endif
1855 1855
1856 mViewManager->writeSettings( config ); 1856 mViewManager->writeSettings( config );
1857 mTodoList->saveLayout(config,QString("Todo Layout")); 1857 mTodoList->saveLayout(config,QString("Todo Layout"));
1858 mDialogManager->writeSettings( config ); 1858 mDialogManager->writeSettings( config );
1859 //KOPrefs::instance()->usrWriteConfig(); 1859 //KOPrefs::instance()->usrWriteConfig();
1860 KOPrefs::instance()->writeConfig(); 1860 KOPrefs::instance()->writeConfig();
1861 1861
1862 writeFilterSettings(config); 1862 writeFilterSettings(config);
1863 1863
1864 config->setGroup( "Views" ); 1864 config->setGroup( "Views" );
1865 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1865 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1866 1866
1867#ifdef DESKTOP_VERSION 1867#ifdef DESKTOP_VERSION
1868 config->setGroup("WidgetLayout"); 1868 config->setGroup("WidgetLayout");
1869 QStringList list ;//= config->readListEntry("MainLayout"); 1869 QStringList list ;//= config->readListEntry("MainLayout");
1870 int x,y,w,h; 1870 int x,y,w,h;
1871 QWidget* wid; 1871 QWidget* wid;
1872 wid = topLevelWidget(); 1872 wid = topLevelWidget();
1873 x = wid->geometry().x(); 1873 x = wid->geometry().x();
1874 y = wid->geometry().y(); 1874 y = wid->geometry().y();
1875 w = wid->width(); 1875 w = wid->width();
1876 h = wid->height(); 1876 h = wid->height();
1877 list.clear(); 1877 list.clear();
1878 list << QString::number( x ); 1878 list << QString::number( x );
1879 list << QString::number( y ); 1879 list << QString::number( y );
1880 list << QString::number( w ); 1880 list << QString::number( w );
1881 list << QString::number( h ); 1881 list << QString::number( h );
1882 config->writeEntry("MainLayout",list ); 1882 config->writeEntry("MainLayout",list );
1883 1883
1884 wid = mEventEditor; 1884 wid = mEventEditor;
1885 x = wid->geometry().x(); 1885 x = wid->geometry().x();
1886 y = wid->geometry().y(); 1886 y = wid->geometry().y();
1887 w = wid->width(); 1887 w = wid->width();
1888 h = wid->height(); 1888 h = wid->height();
1889 list.clear(); 1889 list.clear();
1890 list << QString::number( x ); 1890 list << QString::number( x );
1891 list << QString::number( y ); 1891 list << QString::number( y );
1892 list << QString::number( w ); 1892 list << QString::number( w );
1893 list << QString::number( h ); 1893 list << QString::number( h );
1894 config->writeEntry("EditEventLayout",list ); 1894 config->writeEntry("EditEventLayout",list );
1895 1895
1896 wid = mTodoEditor; 1896 wid = mTodoEditor;
1897 x = wid->geometry().x(); 1897 x = wid->geometry().x();
1898 y = wid->geometry().y(); 1898 y = wid->geometry().y();
1899 w = wid->width(); 1899 w = wid->width();
1900 h = wid->height(); 1900 h = wid->height();
1901 list.clear(); 1901 list.clear();
1902 list << QString::number( x ); 1902 list << QString::number( x );
1903 list << QString::number( y ); 1903 list << QString::number( y );
1904 list << QString::number( w ); 1904 list << QString::number( w );
1905 list << QString::number( h ); 1905 list << QString::number( h );
1906 config->writeEntry("EditTodoLayout",list ); 1906 config->writeEntry("EditTodoLayout",list );
1907 wid = getEventViewerDialog(); 1907 wid = getEventViewerDialog();
1908 x = wid->geometry().x(); 1908 x = wid->geometry().x();
1909 y = wid->geometry().y(); 1909 y = wid->geometry().y();
1910 w = wid->width(); 1910 w = wid->width();
1911 h = wid->height(); 1911 h = wid->height();
1912 list.clear(); 1912 list.clear();
1913 list << QString::number( x ); 1913 list << QString::number( x );
1914 list << QString::number( y ); 1914 list << QString::number( y );
1915 list << QString::number( w ); 1915 list << QString::number( w );
1916 list << QString::number( h ); 1916 list << QString::number( h );
1917 config->writeEntry("ViewerLayout",list ); 1917 config->writeEntry("ViewerLayout",list );
1918 wid = mDialogManager->getSearchDialog(); 1918 wid = mDialogManager->getSearchDialog();
1919 if ( wid ) { 1919 if ( wid ) {
1920 x = wid->geometry().x(); 1920 x = wid->geometry().x();
1921 y = wid->geometry().y(); 1921 y = wid->geometry().y();
1922 w = wid->width(); 1922 w = wid->width();
1923 h = wid->height(); 1923 h = wid->height();
1924 list.clear(); 1924 list.clear();
1925 list << QString::number( x ); 1925 list << QString::number( x );
1926 list << QString::number( y ); 1926 list << QString::number( y );
1927 list << QString::number( w ); 1927 list << QString::number( w );
1928 list << QString::number( h ); 1928 list << QString::number( h );
1929 config->writeEntry("SearchLayout",list ); 1929 config->writeEntry("SearchLayout",list );
1930 } 1930 }
1931#endif 1931#endif
1932 1932
1933 1933
1934 config->sync(); 1934 config->sync();
1935} 1935}
1936 1936
1937void CalendarView::readFilterSettings(KConfig *config) 1937void CalendarView::readFilterSettings(KConfig *config)
1938{ 1938{
1939 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 1939 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
1940 1940
1941 mFilters.clear(); 1941 mFilters.clear();
1942 1942
1943 config->setGroup("General"); 1943 config->setGroup("General");
1944 QStringList filterList = config->readListEntry("CalendarFilters"); 1944 QStringList filterList = config->readListEntry("CalendarFilters");
1945 1945
1946 QStringList::ConstIterator it = filterList.begin(); 1946 QStringList::ConstIterator it = filterList.begin();
1947 QStringList::ConstIterator end = filterList.end(); 1947 QStringList::ConstIterator end = filterList.end();
1948 while(it != end) { 1948 while(it != end) {
1949 // kdDebug() << " filter: " << (*it) << endl; 1949 // kdDebug() << " filter: " << (*it) << endl;
1950 1950
1951 CalFilter *filter; 1951 CalFilter *filter;
1952 filter = new CalFilter(*it); 1952 filter = new CalFilter(*it);
1953 config->setGroup("Filter_" + (*it)); 1953 config->setGroup("Filter_" + (*it));
1954 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 1954 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
1955 filter->setCriteria(config->readNumEntry("Criteria",0)); 1955 filter->setCriteria(config->readNumEntry("Criteria",0));
1956 filter->setCategoryList(config->readListEntry("CategoryList")); 1956 filter->setCategoryList(config->readListEntry("CategoryList"));
1957 mFilters.append(filter); 1957 mFilters.append(filter);
1958 1958
1959 ++it; 1959 ++it;
1960 } 1960 }
1961 1961
1962 if (mFilters.count() == 0) { 1962 if (mFilters.count() == 0) {
1963 CalFilter *filter = new CalFilter(i18n("Default")); 1963 CalFilter *filter = new CalFilter(i18n("Default"));
1964 mFilters.append(filter); 1964 mFilters.append(filter);
1965 } 1965 }
1966 mFilterView->updateFilters(); 1966 mFilterView->updateFilters();
1967 config->setGroup("FilterView"); 1967 config->setGroup("FilterView");
1968 1968
1969 mFilterView->blockSignals(true); 1969 mFilterView->blockSignals(true);
1970 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 1970 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
1971 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 1971 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
1972 mFilterView->blockSignals(false); 1972 mFilterView->blockSignals(false);
1973 // We do it manually to avoid it being done twice by the above calls 1973 // We do it manually to avoid it being done twice by the above calls
1974 updateFilter(); 1974 updateFilter();
1975} 1975}
1976 1976
1977void CalendarView::writeFilterSettings(KConfig *config) 1977void CalendarView::writeFilterSettings(KConfig *config)
1978{ 1978{
1979 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 1979 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
1980 1980
1981 QStringList filterList; 1981 QStringList filterList;
1982 1982
1983 CalFilter *filter = mFilters.first(); 1983 CalFilter *filter = mFilters.first();
1984 while(filter) { 1984 while(filter) {
1985 // kdDebug() << " fn: " << filter->name() << endl; 1985 // kdDebug() << " fn: " << filter->name() << endl;
1986 filterList << filter->name(); 1986 filterList << filter->name();
1987 config->setGroup("Filter_" + filter->name()); 1987 config->setGroup("Filter_" + filter->name());
1988 config->writeEntry("Criteria",filter->criteria()); 1988 config->writeEntry("Criteria",filter->criteria());
1989 config->writeEntry("CategoryList",filter->categoryList()); 1989 config->writeEntry("CategoryList",filter->categoryList());
1990 filter = mFilters.next(); 1990 filter = mFilters.next();
1991 } 1991 }
1992 config->setGroup("General"); 1992 config->setGroup("General");
1993 config->writeEntry("CalendarFilters",filterList); 1993 config->writeEntry("CalendarFilters",filterList);
1994 1994
1995 config->setGroup("FilterView"); 1995 config->setGroup("FilterView");
1996 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 1996 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
1997 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 1997 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
1998} 1998}
1999 1999
2000 2000
2001void CalendarView::goToday() 2001void CalendarView::goToday()
2002{ 2002{
2003 if ( mViewManager->currentView()->isMonthView() ) 2003 if ( mViewManager->currentView()->isMonthView() )
2004 mNavigator->selectTodayMonth(); 2004 mNavigator->selectTodayMonth();
2005 else 2005 else
2006 mNavigator->selectToday(); 2006 mNavigator->selectToday();
2007} 2007}
2008 2008
2009void CalendarView::goNext() 2009void CalendarView::goNext()
2010{ 2010{
2011 mNavigator->selectNext(); 2011 mNavigator->selectNext();
2012} 2012}
2013 2013
2014void CalendarView::goPrevious() 2014void CalendarView::goPrevious()
2015{ 2015{
2016 mNavigator->selectPrevious(); 2016 mNavigator->selectPrevious();
2017} 2017}
2018void CalendarView::goNextMonth() 2018void CalendarView::goNextMonth()
2019{ 2019{
2020 mNavigator->selectNextMonth(); 2020 mNavigator->selectNextMonth();
2021} 2021}
2022 2022
2023void CalendarView::goPreviousMonth() 2023void CalendarView::goPreviousMonth()
2024{ 2024{
2025 mNavigator->selectPreviousMonth(); 2025 mNavigator->selectPreviousMonth();
2026} 2026}
2027void CalendarView::writeLocale() 2027void CalendarView::writeLocale()
2028{ 2028{
2029 //KPimGlobalPrefs::instance()->setGlobalConfig(); 2029 //KPimGlobalPrefs::instance()->setGlobalConfig();
2030#if 0 2030#if 0
2031 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 2031 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
2032 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 2032 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
2033 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 2033 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
2034 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 2034 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
2035 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 2035 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
2036 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 2036 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
2037 dummy = KOPrefs::instance()->mUserDateFormatShort; 2037 dummy = KOPrefs::instance()->mUserDateFormatShort;
2038 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 2038 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
2039 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 2039 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
2040 KOPrefs::instance()->mDaylightsavingStart, 2040 KOPrefs::instance()->mDaylightsavingStart,
2041 KOPrefs::instance()->mDaylightsavingEnd ); 2041 KOPrefs::instance()->mDaylightsavingEnd );
2042 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); 2042 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
2043#endif 2043#endif
2044} 2044}
2045void CalendarView::updateConfig() 2045void CalendarView::updateConfig()
2046{ 2046{
2047 writeLocale(); 2047 writeLocale();
2048 if ( KOPrefs::instance()->mUseAppColors ) 2048 if ( KOPrefs::instance()->mUseAppColors )
2049 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2049 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2050 emit configChanged(); 2050 emit configChanged();
2051 mTodoList->updateConfig(); 2051 mTodoList->updateConfig();
2052 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2052 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2053 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2053 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2054 // To make the "fill window" configurations work 2054 // To make the "fill window" configurations work
2055 //mViewManager->raiseCurrentView(); 2055 //mViewManager->raiseCurrentView();
2056} 2056}
2057 2057
2058 2058
2059void CalendarView::eventChanged(Event *event) 2059void CalendarView::eventChanged(Event *event)
2060{ 2060{
2061 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2061 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2062 //updateUnmanagedViews(); 2062 //updateUnmanagedViews();
2063} 2063}
2064 2064
2065void CalendarView::eventAdded(Event *event) 2065void CalendarView::eventAdded(Event *event)
2066{ 2066{
2067 changeEventDisplay(event,KOGlobals::EVENTADDED); 2067 changeEventDisplay(event,KOGlobals::EVENTADDED);
2068} 2068}
2069 2069
2070void CalendarView::eventToBeDeleted(Event *) 2070void CalendarView::eventToBeDeleted(Event *)
2071{ 2071{
2072 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2072 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2073} 2073}
2074 2074
2075void CalendarView::eventDeleted() 2075void CalendarView::eventDeleted()
2076{ 2076{
2077 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2077 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2078} 2078}
2079void CalendarView::changeTodoDisplay(Todo *which, int action) 2079void CalendarView::changeTodoDisplay(Todo *which, int action)
2080{ 2080{
2081 changeIncidenceDisplay((Incidence *)which, action); 2081 changeIncidenceDisplay((Incidence *)which, action);
2082 mDateNavigator->updateView(); //LR 2082 mDateNavigator->updateView(); //LR
2083 //mDialogManager->updateSearchDialog(); 2083 //mDialogManager->updateSearchDialog();
2084 2084
2085 if (which) { 2085 if (which) {
2086 mViewManager->updateWNview(); 2086 mViewManager->updateWNview();
2087 //mTodoList->updateView(); 2087 //mTodoList->updateView();
2088 } 2088 }
2089 2089
2090} 2090}
2091 2091
2092void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2092void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2093{ 2093{
2094 updateUnmanagedViews(); 2094 updateUnmanagedViews();
2095 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2095 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2096 if ( action == KOGlobals::EVENTDELETED ) { //delete 2096 if ( action == KOGlobals::EVENTDELETED ) { //delete
2097 mCalendar->checkAlarmForIncidence( 0, true ); 2097 mCalendar->checkAlarmForIncidence( 0, true );
2098 if ( mEventViewerDialog ) 2098 if ( mEventViewerDialog )
2099 mEventViewerDialog->hide(); 2099 mEventViewerDialog->hide();
2100 } 2100 }
2101 else 2101 else
2102 mCalendar->checkAlarmForIncidence( which , false ); 2102 mCalendar->checkAlarmForIncidence( which , false );
2103} 2103}
2104 2104
2105// most of the changeEventDisplays() right now just call the view's 2105// most of the changeEventDisplays() right now just call the view's
2106// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2106// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2107void CalendarView::changeEventDisplay(Event *which, int action) 2107void CalendarView::changeEventDisplay(Event *which, int action)
2108{ 2108{
2109 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2109 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2110 changeIncidenceDisplay((Incidence *)which, action); 2110 changeIncidenceDisplay((Incidence *)which, action);
2111 mDateNavigator->updateView(); 2111 mDateNavigator->updateView();
2112 //mDialogManager->updateSearchDialog(); 2112 //mDialogManager->updateSearchDialog();
2113 2113
2114 if (which) { 2114 if (which) {
2115 // If there is an event view visible update the display 2115 // If there is an event view visible update the display
2116 mViewManager->currentView()->changeEventDisplay(which,action); 2116 mViewManager->currentView()->changeEventDisplay(which,action);
2117 // TODO: check, if update needed 2117 // TODO: check, if update needed
2118 // if (which->getTodoStatus()) { 2118 // if (which->getTodoStatus()) {
2119 mTodoList->updateView(); 2119 mTodoList->updateView();
2120 // } 2120 // }
2121 } else { 2121 } else {
2122 mViewManager->currentView()->updateView(); 2122 mViewManager->currentView()->updateView();
2123 } 2123 }
2124} 2124}
2125 2125
2126 2126
2127void CalendarView::updateTodoViews() 2127void CalendarView::updateTodoViews()
2128{ 2128{
2129 2129
2130 mTodoList->updateView(); 2130 mTodoList->updateView();
2131 mViewManager->currentView()->updateView(); 2131 mViewManager->currentView()->updateView();
2132 2132
2133} 2133}
2134 2134
2135 2135
2136void CalendarView::updateView(const QDate &start, const QDate &end) 2136void CalendarView::updateView(const QDate &start, const QDate &end)
2137{ 2137{
2138 mTodoList->updateView(); 2138 mTodoList->updateView();
2139 mViewManager->updateView(start, end); 2139 mViewManager->updateView(start, end);
2140 //mDateNavigator->updateView(); 2140 //mDateNavigator->updateView();
2141} 2141}
2142 2142
2143void CalendarView::updateView() 2143void CalendarView::updateView()
2144{ 2144{
2145 DateList tmpList = mNavigator->selectedDates(); 2145 DateList tmpList = mNavigator->selectedDates();
2146 2146
2147 // We assume that the navigator only selects consecutive days. 2147 // We assume that the navigator only selects consecutive days.
2148 updateView( tmpList.first(), tmpList.last() ); 2148 updateView( tmpList.first(), tmpList.last() );
2149 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2149 if ( KOPrefs::instance()->mHideNonStartedTodos )
2150 mTodoList->updateView(); 2150 mTodoList->updateView();
2151} 2151}
2152 2152
2153void CalendarView::updateUnmanagedViews() 2153void CalendarView::updateUnmanagedViews()
2154{ 2154{
2155 mDateNavigator->updateDayMatrix(); 2155 mDateNavigator->updateDayMatrix();
2156} 2156}
2157 2157
2158int CalendarView::msgItemDelete() 2158int CalendarView::msgItemDelete()
2159{ 2159{
2160 return KMessageBox::warningContinueCancel(this, 2160 return KMessageBox::warningContinueCancel(this,
2161 i18n("This item will be\npermanently deleted."), 2161 i18n("This item will be\npermanently deleted."),
2162 i18n("KO/Pi Confirmation"),i18n("Delete")); 2162 i18n("KO/Pi Confirmation"),i18n("Delete"));
2163} 2163}
2164 2164
2165 2165
2166void CalendarView::edit_cut() 2166void CalendarView::edit_cut()
2167{ 2167{
2168 Event *anEvent=0; 2168 Event *anEvent=0;
2169 2169
2170 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2170 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2171 2171
2172 if (mViewManager->currentView()->isEventView()) { 2172 if (mViewManager->currentView()->isEventView()) {
2173 if ( incidence && incidence->type() == "Event" ) { 2173 if ( incidence && incidence->type() == "Event" ) {
2174 anEvent = static_cast<Event *>(incidence); 2174 anEvent = static_cast<Event *>(incidence);
2175 } 2175 }
2176 } 2176 }
2177 2177
2178 if (!anEvent) { 2178 if (!anEvent) {
2179 KNotifyClient::beep(); 2179 KNotifyClient::beep();
2180 return; 2180 return;
2181 } 2181 }
2182 DndFactory factory( mCalendar ); 2182 DndFactory factory( mCalendar );
2183 factory.cutEvent(anEvent); 2183 factory.cutEvent(anEvent);
2184 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2184 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2185} 2185}
2186 2186
2187void CalendarView::edit_copy() 2187void CalendarView::edit_copy()
2188{ 2188{
2189 Event *anEvent=0; 2189 Event *anEvent=0;
2190 2190
2191 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2191 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2192 2192
2193 if (mViewManager->currentView()->isEventView()) { 2193 if (mViewManager->currentView()->isEventView()) {
2194 if ( incidence && incidence->type() == "Event" ) { 2194 if ( incidence && incidence->type() == "Event" ) {
2195 anEvent = static_cast<Event *>(incidence); 2195 anEvent = static_cast<Event *>(incidence);
2196 } 2196 }
2197 } 2197 }
2198 2198
2199 if (!anEvent) { 2199 if (!anEvent) {
2200 KNotifyClient::beep(); 2200 KNotifyClient::beep();
2201 return; 2201 return;
2202 } 2202 }
2203 DndFactory factory( mCalendar ); 2203 DndFactory factory( mCalendar );
2204 factory.copyEvent(anEvent); 2204 factory.copyEvent(anEvent);
2205} 2205}
2206 2206
2207void CalendarView::edit_paste() 2207void CalendarView::edit_paste()
2208{ 2208{
2209 QDate date = mNavigator->selectedDates().first(); 2209 QDate date = mNavigator->selectedDates().first();
2210 2210
2211 DndFactory factory( mCalendar ); 2211 DndFactory factory( mCalendar );
2212 Event *pastedEvent = factory.pasteEvent( date ); 2212 Event *pastedEvent = factory.pasteEvent( date );
2213 2213
2214 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2214 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2215} 2215}
2216 2216
2217void CalendarView::edit_options() 2217void CalendarView::edit_options()
2218{ 2218{
2219 mDialogManager->showOptionsDialog(); 2219 mDialogManager->showOptionsDialog();
2220 //writeSettings(); 2220 //writeSettings();
2221} 2221}
2222 2222
2223 2223
2224void CalendarView::slotSelectPickerDate( QDate d) 2224void CalendarView::slotSelectPickerDate( QDate d)
2225{ 2225{
2226 mDateFrame->hide(); 2226 mDateFrame->hide();
2227 if ( mDatePickerMode == 1 ) { 2227 if ( mDatePickerMode == 1 ) {
2228 mNavigator->slotDaySelect( d ); 2228 mNavigator->slotDaySelect( d );
2229 } else if ( mDatePickerMode == 2 ) { 2229 } else if ( mDatePickerMode == 2 ) {
2230 if ( mMoveIncidence->type() == "Todo" ) { 2230 if ( mMoveIncidence->type() == "Todo" ) {
2231 Todo * to = (Todo *) mMoveIncidence; 2231 Todo * to = (Todo *) mMoveIncidence;
2232 QTime tim; 2232 QTime tim;
2233 if ( to->hasDueDate() ) 2233 if ( to->hasDueDate() )
2234 tim = to->dtDue().time(); 2234 tim = to->dtDue().time();
2235 else { 2235 else {
2236 tim = QTime ( 0,0,0 ); 2236 tim = QTime ( 0,0,0 );
2237 to->setFloats( true ); 2237 to->setFloats( true );
2238 to->setHasDueDate( true ); 2238 to->setHasDueDate( true );
2239 } 2239 }
2240 QDateTime dt ( d,tim ); 2240 QDateTime dt ( d,tim );
2241 to->setDtDue( dt ); 2241 to->setDtDue( dt );
2242 todoChanged( to ); 2242 todoChanged( to );
2243 } else { 2243 } else {
2244 if ( mMoveIncidence->doesRecur() ) { 2244 if ( mMoveIncidence->doesRecur() ) {
2245#if 0 2245#if 0
2246 // PENDING implement this 2246 // PENDING implement this
2247 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2247 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2248 mCalendar()->addIncidence( newInc ); 2248 mCalendar()->addIncidence( newInc );
2249 if ( mMoveIncidence->type() == "Todo" ) 2249 if ( mMoveIncidence->type() == "Todo" )
2250 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2250 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2251 else 2251 else
2252 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2252 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2253 mMoveIncidence = newInc; 2253 mMoveIncidence = newInc;
2254 2254
2255#endif 2255#endif
2256 } 2256 }
2257 QTime tim = mMoveIncidence->dtStart().time(); 2257 QTime tim = mMoveIncidence->dtStart().time();
2258 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2258 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2259 QDateTime dt ( d,tim ); 2259 QDateTime dt ( d,tim );
2260 mMoveIncidence->setDtStart( dt ); 2260 mMoveIncidence->setDtStart( dt );
2261 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2261 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2262 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2262 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2263 } 2263 }
2264 2264
2265 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2265 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2266 } 2266 }
2267} 2267}
2268 2268
2269void CalendarView::removeCategories() 2269void CalendarView::removeCategories()
2270{ 2270{
2271 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2271 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2272 QStringList catList = KOPrefs::instance()->mCustomCategories; 2272 QStringList catList = KOPrefs::instance()->mCustomCategories;
2273 QStringList catIncList; 2273 QStringList catIncList;
2274 QStringList newCatList; 2274 QStringList newCatList;
2275 Incidence* inc = incList.first(); 2275 Incidence* inc = incList.first();
2276 int i; 2276 int i;
2277 int count = 0; 2277 int count = 0;
2278 while ( inc ) { 2278 while ( inc ) {
2279 newCatList.clear(); 2279 newCatList.clear();
2280 catIncList = inc->categories() ; 2280 catIncList = inc->categories() ;
2281 for( i = 0; i< catIncList.count(); ++i ) { 2281 for( i = 0; i< catIncList.count(); ++i ) {
2282 if ( catList.contains (catIncList[i])) 2282 if ( catList.contains (catIncList[i]))
2283 newCatList.append( catIncList[i] ); 2283 newCatList.append( catIncList[i] );
2284 } 2284 }
2285 newCatList.sort(); 2285 newCatList.sort();
2286 inc->setCategories( newCatList.join(",") ); 2286 inc->setCategories( newCatList.join(",") );
2287 inc = incList.next(); 2287 inc = incList.next();
2288 } 2288 }
2289} 2289}
2290 2290
2291int CalendarView::addCategories() 2291int CalendarView::addCategories()
2292{ 2292{
2293 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2293 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2294 QStringList catList = KOPrefs::instance()->mCustomCategories; 2294 QStringList catList = KOPrefs::instance()->mCustomCategories;
2295 QStringList catIncList; 2295 QStringList catIncList;
2296 Incidence* inc = incList.first(); 2296 Incidence* inc = incList.first();
2297 int i; 2297 int i;
2298 int count = 0; 2298 int count = 0;
2299 while ( inc ) { 2299 while ( inc ) {
2300 catIncList = inc->categories() ; 2300 catIncList = inc->categories() ;
2301 for( i = 0; i< catIncList.count(); ++i ) { 2301 for( i = 0; i< catIncList.count(); ++i ) {
2302 if ( !catList.contains (catIncList[i])) { 2302 if ( !catList.contains (catIncList[i])) {
2303 catList.append( catIncList[i] ); 2303 catList.append( catIncList[i] );
2304 //qDebug("add cat %s ", catIncList[i].latin1()); 2304 //qDebug("add cat %s ", catIncList[i].latin1());
2305 ++count; 2305 ++count;
2306 } 2306 }
2307 } 2307 }
2308 inc = incList.next(); 2308 inc = incList.next();
2309 } 2309 }
2310 catList.sort(); 2310 catList.sort();
2311 KOPrefs::instance()->mCustomCategories = catList; 2311 KOPrefs::instance()->mCustomCategories = catList;
2312 return count; 2312 return count;
2313} 2313}
2314 2314
2315void CalendarView::manageCategories() 2315void CalendarView::manageCategories()
2316{ 2316{
2317 KOCatPrefs* cp = new KOCatPrefs(); 2317 KOCatPrefs* cp = new KOCatPrefs();
2318 cp->show(); 2318 cp->show();
2319 int w =cp->sizeHint().width() ; 2319 int w =cp->sizeHint().width() ;
2320 int h = cp->sizeHint().height() ; 2320 int h = cp->sizeHint().height() ;
2321 int dw = QApplication::desktop()->width(); 2321 int dw = QApplication::desktop()->width();
2322 int dh = QApplication::desktop()->height(); 2322 int dh = QApplication::desktop()->height();
2323 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2323 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2324 if ( !cp->exec() ) { 2324 if ( !cp->exec() ) {
2325 delete cp; 2325 delete cp;
2326 return; 2326 return;
2327 } 2327 }
2328 int count = 0; 2328 int count = 0;
2329 if ( cp->addCat() ) { 2329 if ( cp->addCat() ) {
2330 count = addCategories(); 2330 count = addCategories();
2331 if ( count ) { 2331 if ( count ) {
2332 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2332 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2333 writeSettings(); 2333 writeSettings();
2334 } else 2334 } else
2335 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2335 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2336 } else { 2336 } else {
2337 removeCategories(); 2337 removeCategories();
2338 updateView(); 2338 updateView();
2339 } 2339 }
2340 delete cp; 2340 delete cp;
2341} 2341}
2342 2342
2343void CalendarView::beamIncidence(Incidence * Inc) 2343void CalendarView::beamIncidence(Incidence * Inc)
2344{ 2344{
2345 QPtrList<Incidence> delSel ; 2345 QPtrList<Incidence> delSel ;
2346 delSel.append(Inc); 2346 delSel.append(Inc);
2347 beamIncidenceList( delSel ); 2347 beamIncidenceList( delSel );
2348} 2348}
2349void CalendarView::beamCalendar() 2349void CalendarView::beamCalendar()
2350{ 2350{
2351 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2351 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2352 //qDebug("beamCalendar() "); 2352 //qDebug("beamCalendar() ");
2353 beamIncidenceList( delSel ); 2353 beamIncidenceList( delSel );
2354} 2354}
2355void CalendarView::beamFilteredCalendar() 2355void CalendarView::beamFilteredCalendar()
2356{ 2356{
2357 QPtrList<Incidence> delSel = mCalendar->incidences(); 2357 QPtrList<Incidence> delSel = mCalendar->incidences();
2358 //qDebug("beamFilteredCalendar() "); 2358 //qDebug("beamFilteredCalendar() ");
2359 beamIncidenceList( delSel ); 2359 beamIncidenceList( delSel );
2360} 2360}
2361void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2361void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2362{ 2362{
2363 if ( beamDialog->exec () == QDialog::Rejected ) 2363 if ( beamDialog->exec () == QDialog::Rejected )
2364 return; 2364 return;
2365#ifdef DESKTOP_VERSION 2365#ifdef DESKTOP_VERSION
2366 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2366 QString fn = locateLocal( "tmp", "kopibeamfile" );
2367#else 2367#else
2368 QString fn = "/tmp/kopibeamfile"; 2368 QString fn = "/tmp/kopibeamfile";
2369#endif 2369#endif
2370 QString mes; 2370 QString mes;
2371 bool createbup = true; 2371 bool createbup = true;
2372 if ( createbup ) { 2372 if ( createbup ) {
2373 QString description = "\n"; 2373 QString description = "\n";
2374 CalendarLocal* cal = new CalendarLocal(); 2374 CalendarLocal* cal = new CalendarLocal();
2375 if ( beamDialog->beamLocal() ) 2375 if ( beamDialog->beamLocal() )
2376 cal->setLocalTime(); 2376 cal->setLocalTime();
2377 else 2377 else
2378 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2378 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2379 Incidence *incidence = delSel.first(); 2379 Incidence *incidence = delSel.first();
2380 bool addText = false; 2380 bool addText = false;
2381 if ( delSel.count() < 10 ) 2381 if ( delSel.count() < 10 )
2382 addText = true; 2382 addText = true;
2383 else { 2383 else {
2384 description.sprintf(i18n(" %d items?"),delSel.count() ); 2384 description.sprintf(i18n(" %d items?"),delSel.count() );
2385 } 2385 }
2386 while ( incidence ) { 2386 while ( incidence ) {
2387 Incidence *in = incidence->clone(); 2387 Incidence *in = incidence->clone();
2388 if ( ! in->summary().isEmpty() ) { 2388 if ( ! in->summary().isEmpty() ) {
2389 in->setDescription(""); 2389 in->setDescription("");
2390 } else { 2390 } else {
2391 in->setSummary( in->description().left(20)); 2391 in->setSummary( in->description().left(20));
2392 in->setDescription(""); 2392 in->setDescription("");
2393 } 2393 }
2394 if ( addText ) 2394 if ( addText )
2395 description += in->summary() + "\n"; 2395 description += in->summary() + "\n";
2396 cal->addIncidence( in ); 2396 cal->addIncidence( in );
2397 incidence = delSel.next(); 2397 incidence = delSel.next();
2398 } 2398 }
2399 if ( beamDialog->beamVcal() ) { 2399 if ( beamDialog->beamVcal() ) {
2400 fn += ".vcs"; 2400 fn += ".vcs";
2401 FileStorage storage( cal, fn, new VCalFormat ); 2401 FileStorage storage( cal, fn, new VCalFormat );
2402 storage.save(); 2402 storage.save();
2403 } else { 2403 } else {
2404 fn += ".ics"; 2404 fn += ".ics";
2405 FileStorage storage( cal, fn, new ICalFormat( ) ); 2405 FileStorage storage( cal, fn, new ICalFormat( ) );
2406 storage.save(); 2406 storage.save();
2407 } 2407 }
2408 delete cal; 2408 delete cal;
2409 mes = i18n("KO/Pi: Ready for beaming"); 2409 mes = i18n("KO/Pi: Ready for beaming");
2410 topLevelWidget()->setCaption(mes); 2410 topLevelWidget()->setCaption(mes);
2411 KApplication::convert2latin1( fn ); 2411 KApplication::convert2latin1( fn );
2412#ifndef DESKTOP_VERSION 2412#ifndef DESKTOP_VERSION
2413 Ir *ir = new Ir( this ); 2413 Ir *ir = new Ir( this );
2414 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2414 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2415 ir->send( fn, description, "text/x-vCalendar" ); 2415 ir->send( fn, description, "text/x-vCalendar" );
2416#endif 2416#endif
2417 } 2417 }
2418} 2418}
2419void CalendarView::beamDone( Ir *ir ) 2419void CalendarView::beamDone( Ir *ir )
2420{ 2420{
2421#ifndef DESKTOP_VERSION 2421#ifndef DESKTOP_VERSION
2422 delete ir; 2422 delete ir;
2423#endif 2423#endif
2424 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2424 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2425 topLevelWidget()->raise(); 2425 topLevelWidget()->raise();
2426} 2426}
2427 2427
2428void CalendarView::moveIncidence(Incidence * inc ) 2428void CalendarView::moveIncidence(Incidence * inc )
2429{ 2429{
2430 if ( !inc ) return; 2430 if ( !inc ) return;
2431 // qDebug("showDatePickerForIncidence( ) "); 2431 // qDebug("showDatePickerForIncidence( ) ");
2432 if ( mDateFrame->isVisible() ) 2432 if ( mDateFrame->isVisible() )
2433 mDateFrame->hide(); 2433 mDateFrame->hide();
2434 else { 2434 else {
2435 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; 2435 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2436 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; 2436 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2437 int dw = QApplication::desktop()->width(); 2437 int dw = QApplication::desktop()->width();
2438 int dh = QApplication::desktop()->height(); 2438 int dh = QApplication::desktop()->height();
2439 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2439 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2440 mDateFrame->show(); 2440 mDateFrame->show();
2441 } 2441 }
2442 mDatePickerMode = 2; 2442 mDatePickerMode = 2;
2443 mMoveIncidence = inc ; 2443 mMoveIncidence = inc ;
2444 QDate da; 2444 QDate da;
2445 if ( mMoveIncidence->type() == "Todo" ) { 2445 if ( mMoveIncidence->type() == "Todo" ) {
2446 Todo * to = (Todo *) mMoveIncidence; 2446 Todo * to = (Todo *) mMoveIncidence;
2447 if ( to->hasDueDate() ) 2447 if ( to->hasDueDate() )
2448 da = to->dtDue().date(); 2448 da = to->dtDue().date();
2449 else 2449 else
2450 da = QDate::currentDate(); 2450 da = QDate::currentDate();
2451 } else { 2451 } else {
2452 da = mMoveIncidence->dtStart().date(); 2452 da = mMoveIncidence->dtStart().date();
2453 } 2453 }
2454 //PENDING set date for recurring incidence to date of recurrence 2454 //PENDING set date for recurring incidence to date of recurrence
2455 //mMoveIncidenceOldDate; 2455 //mMoveIncidenceOldDate;
2456 mDatePicker->setDate( da ); 2456 mDatePicker->setDate( da );
2457} 2457}
2458void CalendarView::showDatePicker( ) 2458void CalendarView::showDatePicker( )
2459{ 2459{
2460 //qDebug("CalendarView::showDatePicker( ) "); 2460 //qDebug("CalendarView::showDatePicker( ) ");
2461 if ( mDateFrame->isVisible() ) 2461 if ( mDateFrame->isVisible() )
2462 mDateFrame->hide(); 2462 mDateFrame->hide();
2463 else { 2463 else {
2464 int w =mDatePicker->sizeHint().width() ; 2464 int w =mDatePicker->sizeHint().width() ;
2465 int h = mDatePicker->sizeHint().height() ; 2465 int h = mDatePicker->sizeHint().height() ;
2466 int dw = QApplication::desktop()->width(); 2466 int dw = QApplication::desktop()->width();
2467 int dh = QApplication::desktop()->height(); 2467 int dh = QApplication::desktop()->height();
2468 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2468 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2469 mDateFrame->show(); 2469 mDateFrame->show();
2470 } 2470 }
2471 mDatePickerMode = 1; 2471 mDatePickerMode = 1;
2472 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2472 mDatePicker->setDate( mNavigator->selectedDates().first() );
2473} 2473}
2474 2474
2475void CalendarView::showEventEditor() 2475void CalendarView::showEventEditor()
2476{ 2476{
2477#ifdef DESKTOP_VERSION 2477#ifdef DESKTOP_VERSION
2478 mEventEditor->show(); 2478 mEventEditor->show();
2479#else 2479#else
2480 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 2480 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
2481 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2481 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2482 qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 2482 qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
2483 delete mEventEditor; 2483 delete mEventEditor;
2484 mEventEditor = mDialogManager->getEventEditor(); 2484 mEventEditor = mDialogManager->getEventEditor();
2485 } 2485 }
2486 mEventEditor->showMaximized(); 2486 mEventEditor->showMaximized();
2487#endif 2487#endif
2488} 2488}
2489void CalendarView::showTodoEditor() 2489void CalendarView::showTodoEditor()
2490{ 2490{
2491#ifdef DESKTOP_VERSION 2491#ifdef DESKTOP_VERSION
2492 mTodoEditor->show(); 2492 mTodoEditor->show();
2493#else 2493#else
2494 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 2494 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
2495 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2495 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2496 qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 2496 qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
2497 delete mTodoEditor; 2497 delete mTodoEditor;
2498 mTodoEditor = mDialogManager->getTodoEditor(); 2498 mTodoEditor = mDialogManager->getTodoEditor();
2499 } 2499 }
2500 mTodoEditor->showMaximized(); 2500 mTodoEditor->showMaximized();
2501#endif 2501#endif
2502} 2502}
2503 2503
2504void CalendarView::cloneIncidence() 2504void CalendarView::cloneIncidence()
2505{ 2505{
2506 Incidence *incidence = currentSelection(); 2506 Incidence *incidence = currentSelection();
2507 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2507 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2508 if ( incidence ) { 2508 if ( incidence ) {
2509 cloneIncidence(incidence); 2509 cloneIncidence(incidence);
2510 } 2510 }
2511} 2511}
2512void CalendarView::moveIncidence() 2512void CalendarView::moveIncidence()
2513{ 2513{
2514 Incidence *incidence = currentSelection(); 2514 Incidence *incidence = currentSelection();
2515 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2515 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2516 if ( incidence ) { 2516 if ( incidence ) {
2517 moveIncidence(incidence); 2517 moveIncidence(incidence);
2518 } 2518 }
2519} 2519}
2520void CalendarView::beamIncidence() 2520void CalendarView::beamIncidence()
2521{ 2521{
2522 Incidence *incidence = currentSelection(); 2522 Incidence *incidence = currentSelection();
2523 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2523 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2524 if ( incidence ) { 2524 if ( incidence ) {
2525 beamIncidence(incidence); 2525 beamIncidence(incidence);
2526 } 2526 }
2527} 2527}
2528void CalendarView::toggleCancelIncidence() 2528void CalendarView::toggleCancelIncidence()
2529{ 2529{
2530 Incidence *incidence = currentSelection(); 2530 Incidence *incidence = currentSelection();
2531 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2531 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2532 if ( incidence ) { 2532 if ( incidence ) {
2533 cancelIncidence(incidence); 2533 cancelIncidence(incidence);
2534 } 2534 }
2535} 2535}
2536 2536
2537 2537
2538void CalendarView::cancelIncidence(Incidence * inc ) 2538void CalendarView::cancelIncidence(Incidence * inc )
2539{ 2539{
2540 inc->setCancelled( ! inc->cancelled() ); 2540 inc->setCancelled( ! inc->cancelled() );
2541 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2541 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2542 updateView(); 2542 updateView();
2543} 2543}
2544void CalendarView::cloneIncidence(Incidence * orgInc ) 2544void CalendarView::cloneIncidence(Incidence * orgInc )
2545{ 2545{
2546 Incidence * newInc = orgInc->clone(); 2546 Incidence * newInc = orgInc->clone();
2547 newInc->recreate(); 2547 newInc->recreate();
2548 2548
2549 if ( newInc->type() == "Todo" ) { 2549 if ( newInc->type() == "Todo" ) {
2550 Todo* t = (Todo*) newInc; 2550 Todo* t = (Todo*) newInc;
2551 showTodoEditor(); 2551 showTodoEditor();
2552 mTodoEditor->editTodo( t ); 2552 mTodoEditor->editTodo( t );
2553 if ( mTodoEditor->exec() ) { 2553 if ( mTodoEditor->exec() ) {
2554 mCalendar->addTodo( t ); 2554 mCalendar->addTodo( t );
2555 updateView(); 2555 updateView();
2556 } else { 2556 } else {
2557 delete t; 2557 delete t;
2558 } 2558 }
2559 } 2559 }
2560 else { 2560 else {
2561 Event* e = (Event*) newInc; 2561 Event* e = (Event*) newInc;
2562 showEventEditor(); 2562 showEventEditor();
2563 mEventEditor->editEvent( e ); 2563 mEventEditor->editEvent( e );
2564 if ( mEventEditor->exec() ) { 2564 if ( mEventEditor->exec() ) {
2565 mCalendar->addEvent( e ); 2565 mCalendar->addEvent( e );
2566 updateView(); 2566 updateView();
2567 } else { 2567 } else {
2568 delete e; 2568 delete e;
2569 } 2569 }
2570 } 2570 }
2571} 2571}
2572 2572
2573void CalendarView::newEvent() 2573void CalendarView::newEvent()
2574{ 2574{
2575 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2575 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2576 KOAgendaView *aView = mViewManager->agendaView(); 2576 KOAgendaView *aView = mViewManager->agendaView();
2577 if (aView) { 2577 if (aView) {
2578 if (aView->selectionStart().isValid()) { 2578 if (aView->selectionStart().isValid()) {
2579 if (aView->selectedIsAllDay()) { 2579 if (aView->selectedIsAllDay()) {
2580 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 2580 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
2581 } else { 2581 } else {
2582 newEvent(aView->selectionStart(),aView->selectionEnd()); 2582 newEvent(aView->selectionStart(),aView->selectionEnd());
2583 } 2583 }
2584 return; 2584 return;
2585 } 2585 }
2586 } 2586 }
2587 2587
2588 QDate date = mNavigator->selectedDates().first(); 2588 QDate date = mNavigator->selectedDates().first();
2589 QDateTime current = QDateTime::currentDateTime(); 2589 QDateTime current = QDateTime::currentDateTime();
2590 if ( date <= current.date() ) { 2590 if ( date <= current.date() ) {
2591 int hour = current.time().hour() +1; 2591 int hour = current.time().hour() +1;
2592 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2592 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2593 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2593 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2594 } else 2594 } else
2595 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2595 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2596 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2596 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2597 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2597 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2598} 2598}
2599 2599
2600void CalendarView::newEvent(QDateTime fh) 2600void CalendarView::newEvent(QDateTime fh)
2601{ 2601{
2602 newEvent(fh, 2602 newEvent(fh,
2603 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2603 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2604} 2604}
2605 2605
2606void CalendarView::newEvent(QDate dt) 2606void CalendarView::newEvent(QDate dt)
2607{ 2607{
2608 newEvent(QDateTime(dt, QTime(0,0,0)), 2608 newEvent(QDateTime(dt, QTime(0,0,0)),
2609 QDateTime(dt, QTime(0,0,0)), true); 2609 QDateTime(dt, QTime(0,0,0)), true);
2610} 2610}
2611 2611
2612void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2612void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2613{ 2613{
2614 2614
2615 showEventEditor(); 2615 showEventEditor();
2616 mEventEditor->newEvent(fromHint,toHint,allDay); 2616 mEventEditor->newEvent(fromHint,toHint,allDay);
2617 if ( mFilterView->filtersEnabled() ) { 2617 if ( mFilterView->filtersEnabled() ) {
2618 CalFilter *filter = mFilterView->selectedFilter(); 2618 CalFilter *filter = mFilterView->selectedFilter();
2619 if (filter && filter->showCategories()) { 2619 if (filter && filter->showCategories()) {
2620 mEventEditor->setCategories(filter->categoryList().join(",") ); 2620 mEventEditor->setCategories(filter->categoryList().join(",") );
2621 } 2621 }
2622 if ( filter ) 2622 if ( filter )
2623 mEventEditor->setSecrecy( filter->getSecrecy() ); 2623 mEventEditor->setSecrecy( filter->getSecrecy() );
2624 } 2624 }
2625} 2625}
2626void CalendarView::todoAdded(Todo * t) 2626void CalendarView::todoAdded(Todo * t)
2627{ 2627{
2628 2628
2629 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2629 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2630 updateTodoViews(); 2630 updateTodoViews();
2631} 2631}
2632void CalendarView::todoChanged(Todo * t) 2632void CalendarView::todoChanged(Todo * t)
2633{ 2633{
2634 emit todoModified( t, 4 ); 2634 emit todoModified( t, 4 );
2635 // updateTodoViews(); 2635 // updateTodoViews();
2636} 2636}
2637void CalendarView::todoToBeDeleted(Todo *) 2637void CalendarView::todoToBeDeleted(Todo *)
2638{ 2638{
2639 //qDebug("todoToBeDeleted(Todo *) "); 2639 //qDebug("todoToBeDeleted(Todo *) ");
2640 updateTodoViews(); 2640 updateTodoViews();
2641} 2641}
2642void CalendarView::todoDeleted() 2642void CalendarView::todoDeleted()
2643{ 2643{
2644 //qDebug(" todoDeleted()"); 2644 //qDebug(" todoDeleted()");
2645 updateTodoViews(); 2645 updateTodoViews();
2646} 2646}
2647 2647
2648 2648
2649 2649
2650void CalendarView::newTodo() 2650void CalendarView::newTodo()
2651{ 2651{
2652 2652
2653 showTodoEditor(); 2653 showTodoEditor();
2654 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); 2654 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true);
2655 if ( mFilterView->filtersEnabled() ) { 2655 if ( mFilterView->filtersEnabled() ) {
2656 CalFilter *filter = mFilterView->selectedFilter(); 2656 CalFilter *filter = mFilterView->selectedFilter();
2657 if (filter && filter->showCategories()) { 2657 if (filter && filter->showCategories()) {
2658 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2658 mTodoEditor->setCategories(filter->categoryList().join(",") );
2659 } 2659 }
2660 if ( filter ) 2660 if ( filter )
2661 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2661 mTodoEditor->setSecrecy( filter->getSecrecy() );
2662 } 2662 }
2663} 2663}
2664 2664
2665void CalendarView::newSubTodo() 2665void CalendarView::newSubTodo()
2666{ 2666{
2667 Todo *todo = selectedTodo(); 2667 Todo *todo = selectedTodo();
2668 if ( todo ) newSubTodo( todo ); 2668 if ( todo ) newSubTodo( todo );
2669} 2669}
2670 2670
2671void CalendarView::newSubTodo(Todo *parentEvent) 2671void CalendarView::newSubTodo(Todo *parentEvent)
2672{ 2672{
2673 2673
2674 showTodoEditor(); 2674 showTodoEditor();
2675 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); 2675 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2676} 2676}
2677 2677
2678void CalendarView::newFloatingEvent() 2678void CalendarView::newFloatingEvent()
2679{ 2679{
2680 DateList tmpList = mNavigator->selectedDates(); 2680 DateList tmpList = mNavigator->selectedDates();
2681 QDate date = tmpList.first(); 2681 QDate date = tmpList.first();
2682 2682
2683 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2683 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2684 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2684 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2685} 2685}
2686 2686
2687 2687
2688void CalendarView::editEvent( Event *event ) 2688void CalendarView::editEvent( Event *event )
2689{ 2689{
2690 2690
2691 if ( !event ) return; 2691 if ( !event ) return;
2692 if ( event->isReadOnly() ) { 2692 if ( event->isReadOnly() ) {
2693 showEvent( event ); 2693 showEvent( event );
2694 return; 2694 return;
2695 } 2695 }
2696 showEventEditor(); 2696 showEventEditor();
2697 mEventEditor->editEvent( event , mFlagEditDescription); 2697 mEventEditor->editEvent( event , mFlagEditDescription);
2698} 2698}
2699void CalendarView::editJournal( Journal *jour ) 2699void CalendarView::editJournal( Journal *jour )
2700{ 2700{
2701 if ( !jour ) return; 2701 if ( !jour ) return;
2702 mDialogManager->hideSearchDialog(); 2702 mDialogManager->hideSearchDialog();
2703 mViewManager->showJournalView(); 2703 mViewManager->showJournalView();
2704 mNavigator->slotDaySelect( jour->dtStart().date() ); 2704 mNavigator->slotDaySelect( jour->dtStart().date() );
2705} 2705}
2706void CalendarView::editTodo( Todo *todo ) 2706void CalendarView::editTodo( Todo *todo )
2707{ 2707{
2708 if ( !todo ) return; 2708 if ( !todo ) return;
2709 2709
2710 if ( todo->isReadOnly() ) { 2710 if ( todo->isReadOnly() ) {
2711 showTodo( todo ); 2711 showTodo( todo );
2712 return; 2712 return;
2713 } 2713 }
2714 showTodoEditor(); 2714 showTodoEditor();
2715 mTodoEditor->editTodo( todo ,mFlagEditDescription); 2715 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2716 2716
2717} 2717}
2718 2718
2719KOEventViewerDialog* CalendarView::getEventViewerDialog() 2719KOEventViewerDialog* CalendarView::getEventViewerDialog()
2720{ 2720{
2721 if ( !mEventViewerDialog ) { 2721 if ( !mEventViewerDialog ) {
2722 mEventViewerDialog = new KOEventViewerDialog(this); 2722 mEventViewerDialog = new KOEventViewerDialog(this);
2723 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2723 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2724 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2724 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2725 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2725 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2726 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2726 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2727 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2727 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2728 viewManager(), SLOT( showAgendaView( bool ) ) ); 2728 viewManager(), SLOT( showAgendaView( bool ) ) );
2729 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
2730 this, SLOT( todoChanged(Todo *) ) );
2729 mEventViewerDialog->resize( 640, 480 ); 2731 mEventViewerDialog->resize( 640, 480 );
2730 2732
2731 } 2733 }
2732 return mEventViewerDialog; 2734 return mEventViewerDialog;
2733} 2735}
2734void CalendarView::showEvent(Event *event) 2736void CalendarView::showEvent(Event *event)
2735{ 2737{
2736 getEventViewerDialog()->setEvent(event); 2738 getEventViewerDialog()->setEvent(event);
2737 getEventViewerDialog()->showMe(); 2739 getEventViewerDialog()->showMe();
2738} 2740}
2739 2741
2740void CalendarView::showTodo(Todo *event) 2742void CalendarView::showTodo(Todo *event)
2741{ 2743{
2742 getEventViewerDialog()->setTodo(event); 2744 getEventViewerDialog()->setTodo(event);
2743 getEventViewerDialog()->showMe(); 2745 getEventViewerDialog()->showMe();
2744} 2746}
2745void CalendarView::showJournal( Journal *jour ) 2747void CalendarView::showJournal( Journal *jour )
2746{ 2748{
2747 getEventViewerDialog()->setJournal(jour); 2749 getEventViewerDialog()->setJournal(jour);
2748 getEventViewerDialog()->showMe(); 2750 getEventViewerDialog()->showMe();
2749 2751
2750} 2752}
2751// void CalendarView::todoModified (Todo *event, int changed) 2753// void CalendarView::todoModified (Todo *event, int changed)
2752// { 2754// {
2753// // if (mDialogList.find (event) != mDialogList.end ()) { 2755// // if (mDialogList.find (event) != mDialogList.end ()) {
2754// // kdDebug() << "Todo modified and open" << endl; 2756// // kdDebug() << "Todo modified and open" << endl;
2755// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 2757// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
2756// // temp->modified (changed); 2758// // temp->modified (changed);
2757 2759
2758// // } 2760// // }
2759 2761
2760// mViewManager->updateView(); 2762// mViewManager->updateView();
2761// } 2763// }
2762 2764
2763void CalendarView::appointment_show() 2765void CalendarView::appointment_show()
2764{ 2766{
2765 Event *anEvent = 0; 2767 Event *anEvent = 0;
2766 2768
2767 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2769 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2768 2770
2769 if (mViewManager->currentView()->isEventView()) { 2771 if (mViewManager->currentView()->isEventView()) {
2770 if ( incidence && incidence->type() == "Event" ) { 2772 if ( incidence && incidence->type() == "Event" ) {
2771 anEvent = static_cast<Event *>(incidence); 2773 anEvent = static_cast<Event *>(incidence);
2772 } 2774 }
2773 } 2775 }
2774 2776
2775 if (!anEvent) { 2777 if (!anEvent) {
2776 KNotifyClient::beep(); 2778 KNotifyClient::beep();
2777 return; 2779 return;
2778 } 2780 }
2779 2781
2780 showEvent(anEvent); 2782 showEvent(anEvent);
2781} 2783}
2782 2784
2783void CalendarView::appointment_edit() 2785void CalendarView::appointment_edit()
2784{ 2786{
2785 Event *anEvent = 0; 2787 Event *anEvent = 0;
2786 2788
2787 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2789 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2788 2790
2789 if (mViewManager->currentView()->isEventView()) { 2791 if (mViewManager->currentView()->isEventView()) {
2790 if ( incidence && incidence->type() == "Event" ) { 2792 if ( incidence && incidence->type() == "Event" ) {
2791 anEvent = static_cast<Event *>(incidence); 2793 anEvent = static_cast<Event *>(incidence);
2792 } 2794 }
2793 } 2795 }
2794 2796
2795 if (!anEvent) { 2797 if (!anEvent) {
2796 KNotifyClient::beep(); 2798 KNotifyClient::beep();
2797 return; 2799 return;
2798 } 2800 }
2799 2801
2800 editEvent(anEvent); 2802 editEvent(anEvent);
2801} 2803}
2802 2804
2803void CalendarView::appointment_delete() 2805void CalendarView::appointment_delete()
2804{ 2806{
2805 Event *anEvent = 0; 2807 Event *anEvent = 0;
2806 2808
2807 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2809 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2808 2810
2809 if (mViewManager->currentView()->isEventView()) { 2811 if (mViewManager->currentView()->isEventView()) {
2810 if ( incidence && incidence->type() == "Event" ) { 2812 if ( incidence && incidence->type() == "Event" ) {
2811 anEvent = static_cast<Event *>(incidence); 2813 anEvent = static_cast<Event *>(incidence);
2812 } 2814 }
2813 } 2815 }
2814 2816
2815 if (!anEvent) { 2817 if (!anEvent) {
2816 KNotifyClient::beep(); 2818 KNotifyClient::beep();
2817 return; 2819 return;
2818 } 2820 }
2819 2821
2820 deleteEvent(anEvent); 2822 deleteEvent(anEvent);
2821} 2823}
2822 2824
2823void CalendarView::todo_resub( Todo * parent, Todo * sub ) 2825void CalendarView::todo_resub( Todo * parent, Todo * sub )
2824{ 2826{
2825 if (!sub) return; 2827 if (!sub) return;
2826 if (!parent) return; 2828 if (!parent) return;
2827 if ( sub->relatedTo() ) 2829 if ( sub->relatedTo() )
2828 sub->relatedTo()->removeRelation(sub); 2830 sub->relatedTo()->removeRelation(sub);
2829 sub->setRelatedTo(parent); 2831 sub->setRelatedTo(parent);
2830 sub->setRelatedToUid(parent->uid()); 2832 sub->setRelatedToUid(parent->uid());
2831 parent->addRelation(sub); 2833 parent->addRelation(sub);
2832 sub->updated(); 2834 sub->updated();
2833 parent->updated(); 2835 parent->updated();
2834 setModified(true); 2836 setModified(true);
2835 updateView(); 2837 updateView();
2836} 2838}
2837void CalendarView::todo_unsub(Todo *anTodo ) 2839void CalendarView::todo_unsub(Todo *anTodo )
2838{ 2840{
2839 // Todo *anTodo = selectedTodo(); 2841 // Todo *anTodo = selectedTodo();
2840 if (!anTodo) return; 2842 if (!anTodo) return;
2841 if (!anTodo->relatedTo()) return; 2843 if (!anTodo->relatedTo()) return;
2842 anTodo->relatedTo()->removeRelation(anTodo); 2844 anTodo->relatedTo()->removeRelation(anTodo);
2843 anTodo->setRelatedTo(0); 2845 anTodo->setRelatedTo(0);
2844 anTodo->updated(); 2846 anTodo->updated();
2845 anTodo->setRelatedToUid(""); 2847 anTodo->setRelatedToUid("");
2846 setModified(true); 2848 setModified(true);
2847 updateView(); 2849 updateView();
2848} 2850}
2849 2851
2850void CalendarView::deleteTodo(Todo *todo) 2852void CalendarView::deleteTodo(Todo *todo)
2851{ 2853{
2852 if (!todo) { 2854 if (!todo) {
2853 KNotifyClient::beep(); 2855 KNotifyClient::beep();
2854 return; 2856 return;
2855 } 2857 }
2856 if (KOPrefs::instance()->mConfirm) { 2858 if (KOPrefs::instance()->mConfirm) {
2857 switch (msgItemDelete()) { 2859 switch (msgItemDelete()) {
2858 case KMessageBox::Continue: // OK 2860 case KMessageBox::Continue: // OK
2859 if (!todo->relations().isEmpty()) { 2861 if (!todo->relations().isEmpty()) {
2860 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2862 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2861 i18n("Delete To-Do")); 2863 i18n("Delete To-Do"));
2862 } else { 2864 } else {
2863 checkExternalId( todo ); 2865 checkExternalId( todo );
2864 calendar()->deleteTodo(todo); 2866 calendar()->deleteTodo(todo);
2865 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2867 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2866 updateView(); 2868 updateView();
2867 } 2869 }
2868 break; 2870 break;
2869 } // switch 2871 } // switch
2870 } else { 2872 } else {
2871 if (!todo->relations().isEmpty()) { 2873 if (!todo->relations().isEmpty()) {
2872 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2874 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2873 i18n("Delete To-Do")); 2875 i18n("Delete To-Do"));
2874 } else { 2876 } else {
2875 checkExternalId( todo ); 2877 checkExternalId( todo );
2876 mCalendar->deleteTodo(todo); 2878 mCalendar->deleteTodo(todo);
2877 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2879 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2878 updateView(); 2880 updateView();
2879 } 2881 }
2880 } 2882 }
2881 emit updateSearchDialog(); 2883 emit updateSearchDialog();
2882} 2884}
2883void CalendarView::deleteJournal(Journal *jour) 2885void CalendarView::deleteJournal(Journal *jour)
2884{ 2886{
2885 if (!jour) { 2887 if (!jour) {
2886 KNotifyClient::beep(); 2888 KNotifyClient::beep();
2887 return; 2889 return;
2888 } 2890 }
2889 if (KOPrefs::instance()->mConfirm) { 2891 if (KOPrefs::instance()->mConfirm) {
2890 switch (msgItemDelete()) { 2892 switch (msgItemDelete()) {
2891 case KMessageBox::Continue: // OK 2893 case KMessageBox::Continue: // OK
2892 calendar()->deleteJournal(jour); 2894 calendar()->deleteJournal(jour);
2893 updateView(); 2895 updateView();
2894 break; 2896 break;
2895 } // switch 2897 } // switch
2896 } else { 2898 } else {
2897 calendar()->deleteJournal(jour);; 2899 calendar()->deleteJournal(jour);;
2898 updateView(); 2900 updateView();
2899 } 2901 }
2900 emit updateSearchDialog(); 2902 emit updateSearchDialog();
2901} 2903}
2902 2904
2903void CalendarView::deleteEvent(Event *anEvent) 2905void CalendarView::deleteEvent(Event *anEvent)
2904{ 2906{
2905 if (!anEvent) { 2907 if (!anEvent) {
2906 KNotifyClient::beep(); 2908 KNotifyClient::beep();
2907 return; 2909 return;
2908 } 2910 }
2909 2911
2910 if (anEvent->recurrence()->doesRecur()) { 2912 if (anEvent->recurrence()->doesRecur()) {
2911 QDate itemDate = mViewManager->currentSelectionDate(); 2913 QDate itemDate = mViewManager->currentSelectionDate();
2912 int km; 2914 int km;
2913 if (!itemDate.isValid()) { 2915 if (!itemDate.isValid()) {
2914 //kdDebug() << "Date Not Valid" << endl; 2916 //kdDebug() << "Date Not Valid" << endl;
2915 if (KOPrefs::instance()->mConfirm) { 2917 if (KOPrefs::instance()->mConfirm) {
2916 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 2918 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2917 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 2919 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
2918 i18n("KO/Pi Confirmation"),i18n("Delete All")); 2920 i18n("KO/Pi Confirmation"),i18n("Delete All"));
2919 if ( km == KMessageBox::Continue ) 2921 if ( km == KMessageBox::Continue )
2920 km = KMessageBox::No; // No = all below 2922 km = KMessageBox::No; // No = all below
2921 } else 2923 } else
2922 km = KMessageBox::No; 2924 km = KMessageBox::No;
2923 } else { 2925 } else {
2924 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + 2926 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
2925 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 2927 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
2926 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 2928 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
2927 i18n("KO/Pi Confirmation"),i18n("Current"), 2929 i18n("KO/Pi Confirmation"),i18n("Current"),
2928 i18n("All")); 2930 i18n("All"));
2929 } 2931 }
2930 switch(km) { 2932 switch(km) {
2931 2933
2932 case KMessageBox::No: // Continue // all 2934 case KMessageBox::No: // Continue // all
2933 //qDebug("KMessageBox::No "); 2935 //qDebug("KMessageBox::No ");
2934 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2936 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2935 schedule(Scheduler::Cancel,anEvent); 2937 schedule(Scheduler::Cancel,anEvent);
2936 2938
2937 checkExternalId( anEvent); 2939 checkExternalId( anEvent);
2938 mCalendar->deleteEvent(anEvent); 2940 mCalendar->deleteEvent(anEvent);
2939 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 2941 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
2940 break; 2942 break;
2941 2943
2942 // Disabled because it does not work 2944 // Disabled because it does not work
2943 //#if 0 2945 //#if 0
2944 case KMessageBox::Yes: // just this one 2946 case KMessageBox::Yes: // just this one
2945 //QDate qd = mNavigator->selectedDates().first(); 2947 //QDate qd = mNavigator->selectedDates().first();
2946 //if (!qd.isValid()) { 2948 //if (!qd.isValid()) {
2947 // kdDebug() << "no date selected, or invalid date" << endl; 2949 // kdDebug() << "no date selected, or invalid date" << endl;
2948 // KNotifyClient::beep(); 2950 // KNotifyClient::beep();
2949 // return; 2951 // return;
2950 //} 2952 //}
2951 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 2953 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
2952 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 2954 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
2953 anEvent->addExDate(itemDate); 2955 anEvent->addExDate(itemDate);
2954 int duration = anEvent->recurrence()->duration(); 2956 int duration = anEvent->recurrence()->duration();
2955 if ( duration > 0 ) { 2957 if ( duration > 0 ) {
2956 anEvent->recurrence()->setDuration( duration - 1 ); 2958 anEvent->recurrence()->setDuration( duration - 1 );
2957 } 2959 }
2958 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 2960 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
2959 } 2961 }
2960 break; 2962 break;
2961 //#endif 2963 //#endif
2962 } // switch 2964 } // switch
2963 } else { 2965 } else {
2964 if (KOPrefs::instance()->mConfirm) { 2966 if (KOPrefs::instance()->mConfirm) {
2965 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 2967 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2966 i18n("\nAre you sure you want\nto delete this event?"), 2968 i18n("\nAre you sure you want\nto delete this event?"),
2967 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 2969 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
2968 case KMessageBox::Continue: // OK 2970 case KMessageBox::Continue: // OK
2969 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2971 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2970 schedule(Scheduler::Cancel,anEvent); 2972 schedule(Scheduler::Cancel,anEvent);
2971 checkExternalId( anEvent); 2973 checkExternalId( anEvent);
2972 mCalendar->deleteEvent(anEvent); 2974 mCalendar->deleteEvent(anEvent);
2973 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2975 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2974 break; 2976 break;
2975 } // switch 2977 } // switch
2976 } else { 2978 } else {
2977 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2979 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2978 schedule(Scheduler::Cancel,anEvent); 2980 schedule(Scheduler::Cancel,anEvent);
2979 checkExternalId( anEvent); 2981 checkExternalId( anEvent);
2980 mCalendar->deleteEvent(anEvent); 2982 mCalendar->deleteEvent(anEvent);
2981 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2983 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2982 } 2984 }
2983 } // if-else 2985 } // if-else
2984 emit updateSearchDialog(); 2986 emit updateSearchDialog();
2985} 2987}
2986 2988
2987bool CalendarView::deleteEvent(const QString &uid) 2989bool CalendarView::deleteEvent(const QString &uid)
2988{ 2990{
2989 Event *ev = mCalendar->event(uid); 2991 Event *ev = mCalendar->event(uid);
2990 if (ev) { 2992 if (ev) {
2991 deleteEvent(ev); 2993 deleteEvent(ev);
2992 return true; 2994 return true;
2993 } else { 2995 } else {
2994 return false; 2996 return false;
2995 } 2997 }
2996} 2998}
2997 2999
2998/*****************************************************************************/ 3000/*****************************************************************************/
2999 3001
3000void CalendarView::action_mail() 3002void CalendarView::action_mail()
3001{ 3003{
3002#ifndef KORG_NOMAIL 3004#ifndef KORG_NOMAIL
3003 KOMailClient mailClient; 3005 KOMailClient mailClient;
3004 3006
3005 Incidence *incidence = currentSelection(); 3007 Incidence *incidence = currentSelection();
3006 3008
3007 if (!incidence) { 3009 if (!incidence) {
3008 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3010 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3009 return; 3011 return;
3010 } 3012 }
3011 if(incidence->attendeeCount() == 0 ) { 3013 if(incidence->attendeeCount() == 0 ) {
3012 KMessageBox::sorry(this, 3014 KMessageBox::sorry(this,
3013 i18n("Can't generate mail:\nNo attendees defined.\n")); 3015 i18n("Can't generate mail:\nNo attendees defined.\n"));
3014 return; 3016 return;
3015 } 3017 }
3016 3018
3017 CalendarLocal cal_tmp; 3019 CalendarLocal cal_tmp;
3018 Event *event = 0; 3020 Event *event = 0;
3019 Event *ev = 0; 3021 Event *ev = 0;
3020 if ( incidence && incidence->type() == "Event" ) { 3022 if ( incidence && incidence->type() == "Event" ) {
3021 event = static_cast<Event *>(incidence); 3023 event = static_cast<Event *>(incidence);
3022 ev = new Event(*event); 3024 ev = new Event(*event);
3023 cal_tmp.addEvent(ev); 3025 cal_tmp.addEvent(ev);
3024 } 3026 }
3025 ICalFormat mForm(); 3027 ICalFormat mForm();
3026 QString attachment = mForm.toString( &cal_tmp ); 3028 QString attachment = mForm.toString( &cal_tmp );
3027 if (ev) delete(ev); 3029 if (ev) delete(ev);
3028 3030
3029 mailClient.mailAttendees(currentSelection(), attachment); 3031 mailClient.mailAttendees(currentSelection(), attachment);
3030 3032
3031#endif 3033#endif
3032 3034
3033#if 0 3035#if 0
3034 Event *anEvent = 0; 3036 Event *anEvent = 0;
3035 if (mViewManager->currentView()->isEventView()) { 3037 if (mViewManager->currentView()->isEventView()) {
3036 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3038 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3037 } 3039 }
3038 3040
3039 if (!anEvent) { 3041 if (!anEvent) {
3040 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3042 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3041 return; 3043 return;
3042 } 3044 }
3043 if(anEvent->attendeeCount() == 0 ) { 3045 if(anEvent->attendeeCount() == 0 ) {
3044 KMessageBox::sorry(this, 3046 KMessageBox::sorry(this,
3045 i18n("Can't generate mail:\nNo attendees defined.\n")); 3047 i18n("Can't generate mail:\nNo attendees defined.\n"));
3046 return; 3048 return;
3047 } 3049 }
3048 3050
3049 mailobject.emailEvent(anEvent); 3051 mailobject.emailEvent(anEvent);
3050#endif 3052#endif
3051} 3053}
3052 3054
3053 3055
3054void CalendarView::schedule_publish(Incidence *incidence) 3056void CalendarView::schedule_publish(Incidence *incidence)
3055{ 3057{
3056 Event *event = 0; 3058 Event *event = 0;
3057 Todo *todo = 0; 3059 Todo *todo = 0;
3058 3060
3059 if (incidence == 0) { 3061 if (incidence == 0) {
3060 incidence = mViewManager->currentView()->selectedIncidences().first(); 3062 incidence = mViewManager->currentView()->selectedIncidences().first();
3061 if (incidence == 0) { 3063 if (incidence == 0) {
3062 incidence = mTodoList->selectedIncidences().first(); 3064 incidence = mTodoList->selectedIncidences().first();
3063 } 3065 }
3064 } 3066 }
3065 if ( incidence && incidence->type() == "Event" ) { 3067 if ( incidence && incidence->type() == "Event" ) {
3066 event = static_cast<Event *>(incidence); 3068 event = static_cast<Event *>(incidence);
3067 } else { 3069 } else {
3068 if ( incidence && incidence->type() == "Todo" ) { 3070 if ( incidence && incidence->type() == "Todo" ) {
3069 todo = static_cast<Todo *>(incidence); 3071 todo = static_cast<Todo *>(incidence);
3070 } 3072 }
3071 } 3073 }
3072 3074
3073 if (!event && !todo) { 3075 if (!event && !todo) {
3074 KMessageBox::sorry(this,i18n("No event selected.")); 3076 KMessageBox::sorry(this,i18n("No event selected."));
3075 return; 3077 return;
3076 } 3078 }
3077 3079
3078 PublishDialog *publishdlg = new PublishDialog(); 3080 PublishDialog *publishdlg = new PublishDialog();
3079 if (incidence->attendeeCount()>0) { 3081 if (incidence->attendeeCount()>0) {
3080 QPtrList<Attendee> attendees = incidence->attendees(); 3082 QPtrList<Attendee> attendees = incidence->attendees();
3081 attendees.first(); 3083 attendees.first();
3082 while ( attendees.current()!=0 ) { 3084 while ( attendees.current()!=0 ) {
3083 publishdlg->addAttendee(attendees.current()); 3085 publishdlg->addAttendee(attendees.current());
3084 attendees.next(); 3086 attendees.next();
3085 } 3087 }
3086 } 3088 }
3087 bool send = true; 3089 bool send = true;
3088 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3090 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3089 if ( publishdlg->exec() != QDialog::Accepted ) 3091 if ( publishdlg->exec() != QDialog::Accepted )
3090 send = false; 3092 send = false;
3091 } 3093 }
3092 if ( send ) { 3094 if ( send ) {
3093 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3095 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3094 if ( event ) { 3096 if ( event ) {
3095 Event *ev = new Event(*event); 3097 Event *ev = new Event(*event);
3096 ev->registerObserver(0); 3098 ev->registerObserver(0);
3097 ev->clearAttendees(); 3099 ev->clearAttendees();
3098 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3100 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3099 delete(ev); 3101 delete(ev);
3100 } 3102 }
3101 } else { 3103 } else {
3102 if ( todo ) { 3104 if ( todo ) {
3103 Todo *ev = new Todo(*todo); 3105 Todo *ev = new Todo(*todo);
3104 ev->registerObserver(0); 3106 ev->registerObserver(0);
3105 ev->clearAttendees(); 3107 ev->clearAttendees();
3106 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3108 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3107 delete(ev); 3109 delete(ev);
3108 } 3110 }
3109 } 3111 }
3110 } 3112 }
3111 } 3113 }
3112 delete publishdlg; 3114 delete publishdlg;
3113} 3115}
3114 3116
3115void CalendarView::schedule_request(Incidence *incidence) 3117void CalendarView::schedule_request(Incidence *incidence)
3116{ 3118{
3117 schedule(Scheduler::Request,incidence); 3119 schedule(Scheduler::Request,incidence);
3118} 3120}
3119 3121
3120void CalendarView::schedule_refresh(Incidence *incidence) 3122void CalendarView::schedule_refresh(Incidence *incidence)
3121{ 3123{
3122 schedule(Scheduler::Refresh,incidence); 3124 schedule(Scheduler::Refresh,incidence);
3123} 3125}
3124 3126
3125void CalendarView::schedule_cancel(Incidence *incidence) 3127void CalendarView::schedule_cancel(Incidence *incidence)
3126{ 3128{
3127 schedule(Scheduler::Cancel,incidence); 3129 schedule(Scheduler::Cancel,incidence);
3128} 3130}
3129 3131
3130void CalendarView::schedule_add(Incidence *incidence) 3132void CalendarView::schedule_add(Incidence *incidence)
3131{ 3133{
3132 schedule(Scheduler::Add,incidence); 3134 schedule(Scheduler::Add,incidence);
3133} 3135}
3134 3136
3135void CalendarView::schedule_reply(Incidence *incidence) 3137void CalendarView::schedule_reply(Incidence *incidence)
3136{ 3138{
3137 schedule(Scheduler::Reply,incidence); 3139 schedule(Scheduler::Reply,incidence);
3138} 3140}
3139 3141
3140void CalendarView::schedule_counter(Incidence *incidence) 3142void CalendarView::schedule_counter(Incidence *incidence)
3141{ 3143{
3142 schedule(Scheduler::Counter,incidence); 3144 schedule(Scheduler::Counter,incidence);
3143} 3145}
3144 3146
3145void CalendarView::schedule_declinecounter(Incidence *incidence) 3147void CalendarView::schedule_declinecounter(Incidence *incidence)
3146{ 3148{
3147 schedule(Scheduler::Declinecounter,incidence); 3149 schedule(Scheduler::Declinecounter,incidence);
3148} 3150}
3149 3151
3150void CalendarView::schedule_publish_freebusy(int daysToPublish) 3152void CalendarView::schedule_publish_freebusy(int daysToPublish)
3151{ 3153{
3152 QDateTime start = QDateTime::currentDateTime(); 3154 QDateTime start = QDateTime::currentDateTime();
3153 QDateTime end = start.addDays(daysToPublish); 3155 QDateTime end = start.addDays(daysToPublish);
3154 3156
3155 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3157 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3156 freebusy->setOrganizer(KOPrefs::instance()->email()); 3158 freebusy->setOrganizer(KOPrefs::instance()->email());
3157 3159
3158 3160
3159 PublishDialog *publishdlg = new PublishDialog(); 3161 PublishDialog *publishdlg = new PublishDialog();
3160 if ( publishdlg->exec() == QDialog::Accepted ) { 3162 if ( publishdlg->exec() == QDialog::Accepted ) {
3161 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3163 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3162 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3164 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3163 delete(freebusy); 3165 delete(freebusy);
3164 } 3166 }
3165 } 3167 }
3166 delete publishdlg; 3168 delete publishdlg;
3167} 3169}
3168 3170
3169void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 3171void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3170{ 3172{
3171 Event *event = 0; 3173 Event *event = 0;
3172 Todo *todo = 0; 3174 Todo *todo = 0;
3173 3175
3174 if (incidence == 0) { 3176 if (incidence == 0) {
3175 incidence = mViewManager->currentView()->selectedIncidences().first(); 3177 incidence = mViewManager->currentView()->selectedIncidences().first();
3176 if (incidence == 0) { 3178 if (incidence == 0) {
3177 incidence = mTodoList->selectedIncidences().first(); 3179 incidence = mTodoList->selectedIncidences().first();
3178 } 3180 }
3179 } 3181 }
3180 if ( incidence && incidence->type() == "Event" ) { 3182 if ( incidence && incidence->type() == "Event" ) {
3181 event = static_cast<Event *>(incidence); 3183 event = static_cast<Event *>(incidence);
3182 } 3184 }
3183 if ( incidence && incidence->type() == "Todo" ) { 3185 if ( incidence && incidence->type() == "Todo" ) {
3184 todo = static_cast<Todo *>(incidence); 3186 todo = static_cast<Todo *>(incidence);
3185 } 3187 }
3186 3188
3187 if (!event && !todo) { 3189 if (!event && !todo) {
3188 KMessageBox::sorry(this,i18n("No event selected.")); 3190 KMessageBox::sorry(this,i18n("No event selected."));
3189 return; 3191 return;
3190 } 3192 }
3191 3193
3192 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 3194 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
3193 KMessageBox::sorry(this,i18n("The event has no attendees.")); 3195 KMessageBox::sorry(this,i18n("The event has no attendees."));
3194 return; 3196 return;
3195 } 3197 }
3196 3198
3197 Event *ev = 0; 3199 Event *ev = 0;
3198 if (event) ev = new Event(*event); 3200 if (event) ev = new Event(*event);
3199 Todo *to = 0; 3201 Todo *to = 0;
3200 if (todo) to = new Todo(*todo); 3202 if (todo) to = new Todo(*todo);
3201 3203
3202 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 3204 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
3203 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 3205 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
3204 if (!me) { 3206 if (!me) {
3205 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 3207 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
3206 return; 3208 return;
3207 } 3209 }
3208 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 3210 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
3209 StatusDialog *statdlg = new StatusDialog(this); 3211 StatusDialog *statdlg = new StatusDialog(this);
3210 if (!statdlg->exec()==QDialog::Accepted) return; 3212 if (!statdlg->exec()==QDialog::Accepted) return;
3211 me->setStatus( statdlg->status() ); 3213 me->setStatus( statdlg->status() );
3212 delete(statdlg); 3214 delete(statdlg);
3213 } 3215 }
3214 Attendee *menew = new Attendee(*me); 3216 Attendee *menew = new Attendee(*me);
3215 if (ev) { 3217 if (ev) {
3216 ev->clearAttendees(); 3218 ev->clearAttendees();
3217 ev->addAttendee(menew,false); 3219 ev->addAttendee(menew,false);
3218 } else { 3220 } else {
3219 if (to) { 3221 if (to) {
3220 todo->clearAttendees(); 3222 todo->clearAttendees();
3221 todo->addAttendee(menew,false); 3223 todo->addAttendee(menew,false);
3222 } 3224 }
3223 } 3225 }
3224 } 3226 }
3225 3227
3226 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3228 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3227 if (ev) { 3229 if (ev) {
3228 if ( !dlg->addMessage(ev,method) ) delete(ev); 3230 if ( !dlg->addMessage(ev,method) ) delete(ev);
3229 } else { 3231 } else {
3230 if (to) { 3232 if (to) {
3231 if ( !dlg->addMessage(to,method) ) delete(to); 3233 if ( !dlg->addMessage(to,method) ) delete(to);
3232 } 3234 }
3233 } 3235 }
3234} 3236}
3235 3237
3236void CalendarView::openAddressbook() 3238void CalendarView::openAddressbook()
3237{ 3239{
3238 KRun::runCommand("kaddressbook"); 3240 KRun::runCommand("kaddressbook");
3239} 3241}
3240 3242
3241void CalendarView::setModified(bool modified) 3243void CalendarView::setModified(bool modified)
3242{ 3244{
3243 if ( modified ) 3245 if ( modified )
3244 emit signalmodified(); 3246 emit signalmodified();
3245 if (mModified != modified) { 3247 if (mModified != modified) {
3246 mModified = modified; 3248 mModified = modified;
3247 emit modifiedChanged(mModified); 3249 emit modifiedChanged(mModified);
3248 } 3250 }
3249} 3251}
3250 3252
3251bool CalendarView::isReadOnly() 3253bool CalendarView::isReadOnly()
3252{ 3254{
3253 return mReadOnly; 3255 return mReadOnly;
3254} 3256}
3255 3257
3256void CalendarView::setReadOnly(bool readOnly) 3258void CalendarView::setReadOnly(bool readOnly)
3257{ 3259{
3258 if (mReadOnly != readOnly) { 3260 if (mReadOnly != readOnly) {
3259 mReadOnly = readOnly; 3261 mReadOnly = readOnly;
3260 emit readOnlyChanged(mReadOnly); 3262 emit readOnlyChanged(mReadOnly);
3261 } 3263 }
3262} 3264}
3263 3265
3264bool CalendarView::isModified() 3266bool CalendarView::isModified()
3265{ 3267{
3266 return mModified; 3268 return mModified;
3267} 3269}
3268 3270
3269void CalendarView::printSetup() 3271void CalendarView::printSetup()
3270{ 3272{
3271#ifndef KORG_NOPRINTER 3273#ifndef KORG_NOPRINTER
3272 createPrinter(); 3274 createPrinter();
3273 3275
3274 mCalPrinter->setupPrinter(); 3276 mCalPrinter->setupPrinter();
3275#endif 3277#endif
3276} 3278}
3277 3279
3278void CalendarView::print() 3280void CalendarView::print()
3279{ 3281{
3280#ifndef KORG_NOPRINTER 3282#ifndef KORG_NOPRINTER
3281 createPrinter(); 3283 createPrinter();
3282 3284
3283 DateList tmpDateList = mNavigator->selectedDates(); 3285 DateList tmpDateList = mNavigator->selectedDates();
3284 mCalPrinter->print(CalPrinter::Month, 3286 mCalPrinter->print(CalPrinter::Month,
3285 tmpDateList.first(), tmpDateList.last()); 3287 tmpDateList.first(), tmpDateList.last());
3286#endif 3288#endif
3287} 3289}
3288 3290
3289void CalendarView::printPreview() 3291void CalendarView::printPreview()
3290{ 3292{
3291#ifndef KORG_NOPRINTER 3293#ifndef KORG_NOPRINTER
3292 kdDebug() << "CalendarView::printPreview()" << endl; 3294 kdDebug() << "CalendarView::printPreview()" << endl;
3293 3295
3294 createPrinter(); 3296 createPrinter();
3295 3297
3296 DateList tmpDateList = mNavigator->selectedDates(); 3298 DateList tmpDateList = mNavigator->selectedDates();
3297 3299
3298 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 3300 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
3299 tmpDateList.last()); 3301 tmpDateList.last());
3300#endif 3302#endif
3301} 3303}
3302 3304
3303void CalendarView::exportICalendar() 3305void CalendarView::exportICalendar()
3304{ 3306{
3305 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 3307 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
3306 3308
3307 // Force correct extension 3309 // Force correct extension
3308 if (filename.right(4) != ".ics") filename += ".ics"; 3310 if (filename.right(4) != ".ics") filename += ".ics";
3309 3311
3310 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3312 FileStorage storage( mCalendar, filename, new ICalFormat() );
3311 storage.save(); 3313 storage.save();
3312} 3314}
3313 3315
3314bool CalendarView::exportVCalendar( QString filename ) 3316bool CalendarView::exportVCalendar( QString filename )
3315{ 3317{
3316 if (mCalendar->journals().count() > 0) { 3318 if (mCalendar->journals().count() > 0) {
3317 int result = KMessageBox::warningContinueCancel(this, 3319 int result = KMessageBox::warningContinueCancel(this,
3318 i18n("The journal entries can not be\nexported to a vCalendar file."), 3320 i18n("The journal entries can not be\nexported to a vCalendar file."),
3319 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3321 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3320 true); 3322 true);
3321 if (result != KMessageBox::Continue) return false; 3323 if (result != KMessageBox::Continue) return false;
3322 } 3324 }
3323 3325
3324 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3326 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3325 3327
3326 // Force correct extension 3328 // Force correct extension
3327 if (filename.right(4) != ".vcs") filename += ".vcs"; 3329 if (filename.right(4) != ".vcs") filename += ".vcs";
3328 3330
3329 FileStorage storage( mCalendar, filename, new VCalFormat ); 3331 FileStorage storage( mCalendar, filename, new VCalFormat );
3330 return storage.save(); 3332 return storage.save();
3331 3333
3332} 3334}
3333 3335
3334void CalendarView::eventUpdated(Incidence *) 3336void CalendarView::eventUpdated(Incidence *)
3335{ 3337{
3336 setModified(); 3338 setModified();
3337 // Don't call updateView here. The code, which has caused the update of the 3339 // Don't call updateView here. The code, which has caused the update of the
3338 // event is responsible for updating the view. 3340 // event is responsible for updating the view.
3339 // updateView(); 3341 // updateView();
3340} 3342}
3341 3343
3342void CalendarView::adaptNavigationUnits() 3344void CalendarView::adaptNavigationUnits()
3343{ 3345{
3344 if (mViewManager->currentView()->isEventView()) { 3346 if (mViewManager->currentView()->isEventView()) {
3345 int days = mViewManager->currentView()->currentDateCount(); 3347 int days = mViewManager->currentView()->currentDateCount();
3346 if (days == 1) { 3348 if (days == 1) {
3347 emit changeNavStringPrev(i18n("&Previous Day")); 3349 emit changeNavStringPrev(i18n("&Previous Day"));
3348 emit changeNavStringNext(i18n("&Next Day")); 3350 emit changeNavStringNext(i18n("&Next Day"));
3349 } else { 3351 } else {
3350 emit changeNavStringPrev(i18n("&Previous Week")); 3352 emit changeNavStringPrev(i18n("&Previous Week"));
3351 emit changeNavStringNext(i18n("&Next Week")); 3353 emit changeNavStringNext(i18n("&Next Week"));
3352 } 3354 }
3353 } 3355 }
3354} 3356}
3355 3357
3356void CalendarView::processMainViewSelection( Incidence *incidence ) 3358void CalendarView::processMainViewSelection( Incidence *incidence )
3357{ 3359{
3358 if ( incidence ) mTodoList->clearSelection(); 3360 if ( incidence ) mTodoList->clearSelection();
3359 processIncidenceSelection( incidence ); 3361 processIncidenceSelection( incidence );
3360} 3362}
3361 3363
3362void CalendarView::processTodoListSelection( Incidence *incidence ) 3364void CalendarView::processTodoListSelection( Incidence *incidence )
3363{ 3365{
3364 if ( incidence && mViewManager->currentView() ) { 3366 if ( incidence && mViewManager->currentView() ) {
3365 mViewManager->currentView()->clearSelection(); 3367 mViewManager->currentView()->clearSelection();
3366 } 3368 }
3367 processIncidenceSelection( incidence ); 3369 processIncidenceSelection( incidence );
3368} 3370}
3369 3371
3370void CalendarView::processIncidenceSelection( Incidence *incidence ) 3372void CalendarView::processIncidenceSelection( Incidence *incidence )
3371{ 3373{
3372 if ( incidence == mSelectedIncidence ) return; 3374 if ( incidence == mSelectedIncidence ) return;
3373 3375
3374 mSelectedIncidence = incidence; 3376 mSelectedIncidence = incidence;
3375 3377
3376 emit incidenceSelected( mSelectedIncidence ); 3378 emit incidenceSelected( mSelectedIncidence );
3377 3379
3378 if ( incidence && incidence->type() == "Event" ) { 3380 if ( incidence && incidence->type() == "Event" ) {
3379 Event *event = static_cast<Event *>( incidence ); 3381 Event *event = static_cast<Event *>( incidence );
3380 if ( event->organizer() == KOPrefs::instance()->email() ) { 3382 if ( event->organizer() == KOPrefs::instance()->email() ) {
3381 emit organizerEventsSelected( true ); 3383 emit organizerEventsSelected( true );
3382 } else { 3384 } else {
3383 emit organizerEventsSelected(false); 3385 emit organizerEventsSelected(false);
3384 } 3386 }
3385 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3387 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3386 KOPrefs::instance()->email() ) ) { 3388 KOPrefs::instance()->email() ) ) {
3387 emit groupEventsSelected( true ); 3389 emit groupEventsSelected( true );
3388 } else { 3390 } else {
3389 emit groupEventsSelected(false); 3391 emit groupEventsSelected(false);
3390 } 3392 }
3391 return; 3393 return;
3392 } else { 3394 } else {
3393 if ( incidence && incidence->type() == "Todo" ) { 3395 if ( incidence && incidence->type() == "Todo" ) {
3394 emit todoSelected( true ); 3396 emit todoSelected( true );
3395 Todo *event = static_cast<Todo *>( incidence ); 3397 Todo *event = static_cast<Todo *>( incidence );
3396 if ( event->organizer() == KOPrefs::instance()->email() ) { 3398 if ( event->organizer() == KOPrefs::instance()->email() ) {
3397 emit organizerEventsSelected( true ); 3399 emit organizerEventsSelected( true );
3398 } else { 3400 } else {
3399 emit organizerEventsSelected(false); 3401 emit organizerEventsSelected(false);
3400 } 3402 }
3401 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3403 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3402 KOPrefs::instance()->email() ) ) { 3404 KOPrefs::instance()->email() ) ) {
3403 emit groupEventsSelected( true ); 3405 emit groupEventsSelected( true );
3404 } else { 3406 } else {
3405 emit groupEventsSelected(false); 3407 emit groupEventsSelected(false);
3406 } 3408 }
3407 return; 3409 return;
3408 } else { 3410 } else {
3409 emit todoSelected( false ); 3411 emit todoSelected( false );
3410 emit organizerEventsSelected(false); 3412 emit organizerEventsSelected(false);
3411 emit groupEventsSelected(false); 3413 emit groupEventsSelected(false);
3412 } 3414 }
3413 return; 3415 return;
3414 } 3416 }
3415 3417
3416 /* if ( incidence && incidence->type() == "Todo" ) { 3418 /* if ( incidence && incidence->type() == "Todo" ) {
3417 emit todoSelected( true ); 3419 emit todoSelected( true );
3418 } else { 3420 } else {
3419 emit todoSelected( false ); 3421 emit todoSelected( false );
3420 }*/ 3422 }*/
3421} 3423}
3422 3424
3423 3425
3424void CalendarView::checkClipboard() 3426void CalendarView::checkClipboard()
3425{ 3427{
3426#ifndef KORG_NODND 3428#ifndef KORG_NODND
3427 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 3429 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
3428 emit pasteEnabled(true); 3430 emit pasteEnabled(true);
3429 } else { 3431 } else {
3430 emit pasteEnabled(false); 3432 emit pasteEnabled(false);
3431 } 3433 }
3432#endif 3434#endif
3433} 3435}
3434 3436
3435void CalendarView::showDates(const DateList &selectedDates) 3437void CalendarView::showDates(const DateList &selectedDates)
3436{ 3438{
3437 // kdDebug() << "CalendarView::selectDates()" << endl; 3439 // kdDebug() << "CalendarView::selectDates()" << endl;
3438 3440
3439 if ( mViewManager->currentView() ) { 3441 if ( mViewManager->currentView() ) {
3440 updateView( selectedDates.first(), selectedDates.last() ); 3442 updateView( selectedDates.first(), selectedDates.last() );
3441 } else { 3443 } else {
3442 mViewManager->showAgendaView(); 3444 mViewManager->showAgendaView();
3443 } 3445 }
3444 3446
3445 QString selDates; 3447 QString selDates;
3446 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); 3448 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true);
3447 if (selectedDates.first() < selectedDates.last() ) 3449 if (selectedDates.first() < selectedDates.last() )
3448 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3450 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3449 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 3451 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
3450 3452
3451} 3453}
3452 3454
3453QPtrList<CalFilter> CalendarView::filters() 3455QPtrList<CalFilter> CalendarView::filters()
3454{ 3456{
3455 return mFilters; 3457 return mFilters;
3456 3458
3457} 3459}
3458void CalendarView::editFilters() 3460void CalendarView::editFilters()
3459{ 3461{
3460 // kdDebug() << "CalendarView::editFilters()" << endl; 3462 // kdDebug() << "CalendarView::editFilters()" << endl;
3461 3463
3462 CalFilter *filter = mFilters.first(); 3464 CalFilter *filter = mFilters.first();
3463 while(filter) { 3465 while(filter) {
3464 kdDebug() << " Filter: " << filter->name() << endl; 3466 kdDebug() << " Filter: " << filter->name() << endl;
3465 filter = mFilters.next(); 3467 filter = mFilters.next();
3466 } 3468 }
3467 3469
3468 mDialogManager->showFilterEditDialog(&mFilters); 3470 mDialogManager->showFilterEditDialog(&mFilters);
3469} 3471}
3470void CalendarView::toggleFilter() 3472void CalendarView::toggleFilter()
3471{ 3473{
3472 showFilter(! mFilterView->isVisible()); 3474 showFilter(! mFilterView->isVisible());
3473} 3475}
3474 3476
3475KOFilterView *CalendarView::filterView() 3477KOFilterView *CalendarView::filterView()
3476{ 3478{
3477 return mFilterView; 3479 return mFilterView;
3478} 3480}
3479void CalendarView::selectFilter( int fil ) 3481void CalendarView::selectFilter( int fil )
3480{ 3482{
3481 mFilterView->setSelectedFilter( fil ); 3483 mFilterView->setSelectedFilter( fil );
3482} 3484}
3483void CalendarView::showFilter(bool visible) 3485void CalendarView::showFilter(bool visible)
3484{ 3486{
3485 if (visible) mFilterView->show(); 3487 if (visible) mFilterView->show();
3486 else mFilterView->hide(); 3488 else mFilterView->hide();
3487} 3489}
3488void CalendarView::toggleFilerEnabled( ) 3490void CalendarView::toggleFilerEnabled( )
3489{ 3491{
3490 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3492 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3491 if ( !mFilterView->filtersEnabled() ) 3493 if ( !mFilterView->filtersEnabled() )
3492 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3494 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3493 3495
3494} 3496}
3495void CalendarView::updateFilter() 3497void CalendarView::updateFilter()
3496{ 3498{
3497 CalFilter *filter = mFilterView->selectedFilter(); 3499 CalFilter *filter = mFilterView->selectedFilter();
3498 if (filter) { 3500 if (filter) {
3499 if (mFilterView->filtersEnabled()) { 3501 if (mFilterView->filtersEnabled()) {
3500 topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() ); 3502 topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() );
3501 filter->setEnabled(true); 3503 filter->setEnabled(true);
3502 } 3504 }
3503 else filter->setEnabled(false); 3505 else filter->setEnabled(false);
3504 mCalendar->setFilter(filter); 3506 mCalendar->setFilter(filter);
3505 updateView(); 3507 updateView();
3506 } 3508 }
3507} 3509}
3508 3510
3509void CalendarView::filterEdited() 3511void CalendarView::filterEdited()
3510{ 3512{
3511 mFilterView->updateFilters(); 3513 mFilterView->updateFilters();
3512 updateFilter(); 3514 updateFilter();
3513 writeSettings(); 3515 writeSettings();
3514} 3516}
3515 3517
3516 3518
3517void CalendarView::takeOverEvent() 3519void CalendarView::takeOverEvent()
3518{ 3520{
3519 Incidence *incidence = currentSelection(); 3521 Incidence *incidence = currentSelection();
3520 3522
3521 if (!incidence) return; 3523 if (!incidence) return;
3522 3524
3523 incidence->setOrganizer(KOPrefs::instance()->email()); 3525 incidence->setOrganizer(KOPrefs::instance()->email());
3524 incidence->recreate(); 3526 incidence->recreate();
3525 incidence->setReadOnly(false); 3527 incidence->setReadOnly(false);
3526 3528
3527 updateView(); 3529 updateView();
3528} 3530}
3529 3531
3530void CalendarView::takeOverCalendar() 3532void CalendarView::takeOverCalendar()
3531{ 3533{
3532 // TODO: Create Calendar::allIncidences() function and use it here 3534 // TODO: Create Calendar::allIncidences() function and use it here
3533 3535
3534 QPtrList<Event> events = mCalendar->events(); 3536 QPtrList<Event> events = mCalendar->events();
3535 for(uint i=0; i<events.count(); ++i) { 3537 for(uint i=0; i<events.count(); ++i) {
3536 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 3538 events.at(i)->setOrganizer(KOPrefs::instance()->email());
3537 events.at(i)->recreate(); 3539 events.at(i)->recreate();
3538 events.at(i)->setReadOnly(false); 3540 events.at(i)->setReadOnly(false);
3539 } 3541 }
3540 3542
3541 QPtrList<Todo> todos = mCalendar->todos(); 3543 QPtrList<Todo> todos = mCalendar->todos();
3542 for(uint i=0; i<todos.count(); ++i) { 3544 for(uint i=0; i<todos.count(); ++i) {
3543 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 3545 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
3544 todos.at(i)->recreate(); 3546 todos.at(i)->recreate();
3545 todos.at(i)->setReadOnly(false); 3547 todos.at(i)->setReadOnly(false);
3546 } 3548 }
3547 3549
3548 QPtrList<Journal> journals = mCalendar->journals(); 3550 QPtrList<Journal> journals = mCalendar->journals();
3549 for(uint i=0; i<journals.count(); ++i) { 3551 for(uint i=0; i<journals.count(); ++i) {
3550 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 3552 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
3551 journals.at(i)->recreate(); 3553 journals.at(i)->recreate();
3552 journals.at(i)->setReadOnly(false); 3554 journals.at(i)->setReadOnly(false);
3553 } 3555 }
3554 3556
3555 updateView(); 3557 updateView();
3556} 3558}
3557 3559
3558void CalendarView::showIntro() 3560void CalendarView::showIntro()
3559{ 3561{
3560 kdDebug() << "To be implemented." << endl; 3562 kdDebug() << "To be implemented." << endl;
3561} 3563}
3562 3564
3563QWidgetStack *CalendarView::viewStack() 3565QWidgetStack *CalendarView::viewStack()
3564{ 3566{
3565 return mRightFrame; 3567 return mRightFrame;
3566} 3568}
3567 3569
3568QWidget *CalendarView::leftFrame() 3570QWidget *CalendarView::leftFrame()
3569{ 3571{
3570 return mLeftFrame; 3572 return mLeftFrame;
3571} 3573}
3572 3574
3573DateNavigator *CalendarView::dateNavigator() 3575DateNavigator *CalendarView::dateNavigator()
3574{ 3576{
3575 return mNavigator; 3577 return mNavigator;
3576} 3578}
3577 3579
3578KDateNavigator* CalendarView::dateNavigatorWidget() 3580KDateNavigator* CalendarView::dateNavigatorWidget()
3579{ 3581{
3580 return mDateNavigator; 3582 return mDateNavigator;
3581} 3583}
3582void CalendarView::toggleDateNavigatorWidget() 3584void CalendarView::toggleDateNavigatorWidget()
3583{ 3585{
3584 if (mDateNavigator->isVisible()) 3586 if (mDateNavigator->isVisible())
3585 mDateNavigator->hide(); 3587 mDateNavigator->hide();
3586 else 3588 else
3587 mDateNavigator->show(); 3589 mDateNavigator->show();
3588} 3590}
3589void CalendarView::addView(KOrg::BaseView *view) 3591void CalendarView::addView(KOrg::BaseView *view)
3590{ 3592{
3591 mViewManager->addView(view); 3593 mViewManager->addView(view);
3592} 3594}
3593 3595
3594void CalendarView::showView(KOrg::BaseView *view) 3596void CalendarView::showView(KOrg::BaseView *view)
3595{ 3597{
3596 mViewManager->showView(view, mLeftFrame->isVisible()); 3598 mViewManager->showView(view, mLeftFrame->isVisible());
3597} 3599}
3598 3600
3599Incidence *CalendarView::currentSelection() 3601Incidence *CalendarView::currentSelection()
3600{ 3602{
3601 return mViewManager->currentSelection(); 3603 return mViewManager->currentSelection();
3602} 3604}
3603void CalendarView::toggleAllDaySize() 3605void CalendarView::toggleAllDaySize()
3604{ 3606{
3605 /* 3607 /*
3606 if ( KOPrefs::instance()->mAllDaySize > 47 ) 3608 if ( KOPrefs::instance()->mAllDaySize > 47 )
3607 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 3609 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
3608 else 3610 else
3609 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 3611 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
3610 */ 3612 */
3611 viewManager()->agendaView()->toggleAllDay(); 3613 viewManager()->agendaView()->toggleAllDay();
3612} 3614}
3613void CalendarView::toggleExpand() 3615void CalendarView::toggleExpand()
3614{ 3616{
3615 // if ( mLeftFrame->isHidden() ) { 3617 // if ( mLeftFrame->isHidden() ) {
3616 // mLeftFrame->show(); 3618 // mLeftFrame->show();
3617 // emit calendarViewExpanded( false ); 3619 // emit calendarViewExpanded( false );
3618 // } else { 3620 // } else {
3619 // mLeftFrame->hide(); 3621 // mLeftFrame->hide();
3620 // emit calendarViewExpanded( true ); 3622 // emit calendarViewExpanded( true );
3621 // } 3623 // }
3622 3624
3623 globalFlagBlockAgenda = 1; 3625 globalFlagBlockAgenda = 1;
3624 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 3626 emit calendarViewExpanded( !mLeftFrame->isHidden() );
3625 globalFlagBlockAgenda = 5; 3627 globalFlagBlockAgenda = 5;
3626 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 3628 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
3627 //mViewManager->showView( 0, true ); 3629 //mViewManager->showView( 0, true );
3628} 3630}
3629 3631
3630void CalendarView::calendarModified( bool modified, Calendar * ) 3632void CalendarView::calendarModified( bool modified, Calendar * )
3631{ 3633{
3632 setModified( modified ); 3634 setModified( modified );
3633} 3635}
3634 3636
3635Todo *CalendarView::selectedTodo() 3637Todo *CalendarView::selectedTodo()
3636{ 3638{
3637 Incidence *incidence = currentSelection(); 3639 Incidence *incidence = currentSelection();
3638 if ( incidence && incidence->type() == "Todo" ) { 3640 if ( incidence && incidence->type() == "Todo" ) {
3639 return static_cast<Todo *>( incidence ); 3641 return static_cast<Todo *>( incidence );
3640 } 3642 }
3641 3643
3642 incidence = mTodoList->selectedIncidences().first(); 3644 incidence = mTodoList->selectedIncidences().first();
3643 if ( incidence && incidence->type() == "Todo" ) { 3645 if ( incidence && incidence->type() == "Todo" ) {
3644 return static_cast<Todo *>( incidence ); 3646 return static_cast<Todo *>( incidence );
3645 } 3647 }
3646 3648
3647 return 0; 3649 return 0;
3648} 3650}
3649 3651
3650void CalendarView::dialogClosing(Incidence *in) 3652void CalendarView::dialogClosing(Incidence *in)
3651{ 3653{
3652 // mDialogList.remove(in); 3654 // mDialogList.remove(in);
3653} 3655}
3654 3656
3655void CalendarView::showIncidence() 3657void CalendarView::showIncidence()
3656{ 3658{
3657 Incidence *incidence = currentSelection(); 3659 Incidence *incidence = currentSelection();
3658 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3660 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3659 if ( incidence ) { 3661 if ( incidence ) {
3660 ShowIncidenceVisitor v; 3662 ShowIncidenceVisitor v;
3661 v.act( incidence, this ); 3663 v.act( incidence, this );
3662 } 3664 }
3663} 3665}
3664void CalendarView::editIncidenceDescription() 3666void CalendarView::editIncidenceDescription()
3665{ 3667{
3666 mFlagEditDescription = true; 3668 mFlagEditDescription = true;
3667 editIncidence(); 3669 editIncidence();
3668 mFlagEditDescription = false; 3670 mFlagEditDescription = false;
3669} 3671}
3670void CalendarView::editIncidence() 3672void CalendarView::editIncidence()
3671{ 3673{
3672 // qDebug("editIncidence() "); 3674 // qDebug("editIncidence() ");
3673 Incidence *incidence = currentSelection(); 3675 Incidence *incidence = currentSelection();
3674 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3676 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3675 if ( incidence ) { 3677 if ( incidence ) {
3676 EditIncidenceVisitor v; 3678 EditIncidenceVisitor v;
3677 v.act( incidence, this ); 3679 v.act( incidence, this );
3678 } 3680 }
3679} 3681}
3680 3682
3681void CalendarView::deleteIncidence() 3683void CalendarView::deleteIncidence()
3682{ 3684{
3683 Incidence *incidence = currentSelection(); 3685 Incidence *incidence = currentSelection();
3684 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3686 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3685 if ( incidence ) { 3687 if ( incidence ) {
3686 deleteIncidence(incidence); 3688 deleteIncidence(incidence);
3687 } 3689 }
3688} 3690}
3689 3691
3690void CalendarView::showIncidence(Incidence *incidence) 3692void CalendarView::showIncidence(Incidence *incidence)
3691{ 3693{
3692 if ( incidence ) { 3694 if ( incidence ) {
3693 ShowIncidenceVisitor v; 3695 ShowIncidenceVisitor v;
3694 v.act( incidence, this ); 3696 v.act( incidence, this );
3695 } 3697 }
3696} 3698}
3697 3699
3698void CalendarView::editIncidence(Incidence *incidence) 3700void CalendarView::editIncidence(Incidence *incidence)
3699{ 3701{
3700 if ( incidence ) { 3702 if ( incidence ) {
3701 3703
3702 EditIncidenceVisitor v; 3704 EditIncidenceVisitor v;
3703 v.act( incidence, this ); 3705 v.act( incidence, this );
3704 3706
3705 } 3707 }
3706} 3708}
3707 3709
3708void CalendarView::deleteIncidence(Incidence *incidence) 3710void CalendarView::deleteIncidence(Incidence *incidence)
3709{ 3711{
3710 //qDebug(" CalendarView::deleteIncidence "); 3712 //qDebug(" CalendarView::deleteIncidence ");
3711 if ( incidence ) { 3713 if ( incidence ) {
3712 DeleteIncidenceVisitor v; 3714 DeleteIncidenceVisitor v;
3713 v.act( incidence, this ); 3715 v.act( incidence, this );
3714 } 3716 }
3715} 3717}
3716 3718
3717 3719
3718void CalendarView::lookForOutgoingMessages() 3720void CalendarView::lookForOutgoingMessages()
3719{ 3721{
3720 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 3722 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
3721 ogd->loadMessages(); 3723 ogd->loadMessages();
3722} 3724}
3723 3725
3724void CalendarView::lookForIncomingMessages() 3726void CalendarView::lookForIncomingMessages()
3725{ 3727{
3726 IncomingDialog *icd = mDialogManager->incomingDialog(); 3728 IncomingDialog *icd = mDialogManager->incomingDialog();
3727 icd->retrieve(); 3729 icd->retrieve();
3728} 3730}
3729 3731
3730bool CalendarView::removeCompletedSubTodos( Todo* t ) 3732bool CalendarView::removeCompletedSubTodos( Todo* t )
3731{ 3733{
3732 bool deleteTodo = true; 3734 bool deleteTodo = true;
3733 QPtrList<Incidence> subTodos; 3735 QPtrList<Incidence> subTodos;
3734 Incidence *aTodo; 3736 Incidence *aTodo;
3735 subTodos = t->relations(); 3737 subTodos = t->relations();
3736 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 3738 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
3737 if (! removeCompletedSubTodos( (Todo*) aTodo )) 3739 if (! removeCompletedSubTodos( (Todo*) aTodo ))
3738 deleteTodo = false; 3740 deleteTodo = false;
3739 } 3741 }
3740 if ( deleteTodo ) { 3742 if ( deleteTodo ) {
3741 if ( t->isCompleted() ) { 3743 if ( t->isCompleted() ) {
3742 checkExternalId( t ); 3744 checkExternalId( t );
3743 mCalendar->deleteTodo( t ); 3745 mCalendar->deleteTodo( t );
3744 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 3746 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
3745 } 3747 }
3746 else 3748 else
3747 deleteTodo = false; 3749 deleteTodo = false;
3748 } 3750 }
3749 return deleteTodo; 3751 return deleteTodo;
3750 3752
3751} 3753}
3752void CalendarView::purgeCompleted() 3754void CalendarView::purgeCompleted()
3753{ 3755{
3754 int result = KMessageBox::warningContinueCancel(this, 3756 int result = KMessageBox::warningContinueCancel(this,
3755 i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); 3757 i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge"));
3756 3758
3757 if (result == KMessageBox::Continue) { 3759 if (result == KMessageBox::Continue) {
3758 3760
3759 QPtrList<Todo> todoCal; 3761 QPtrList<Todo> todoCal;
3760 QPtrList<Todo> rootTodos; 3762 QPtrList<Todo> rootTodos;
3761 //QPtrList<Incidence> rel; 3763 //QPtrList<Incidence> rel;
3762 Todo *aTodo;//, *rTodo; 3764 Todo *aTodo;//, *rTodo;
3763 Incidence *rIncidence; 3765 Incidence *rIncidence;
3764 bool childDelete = false; 3766 bool childDelete = false;
3765 bool deletedOne = true; 3767 bool deletedOne = true;
3766 todoCal = calendar()->todos(); 3768 todoCal = calendar()->todos();
3767 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 3769 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
3768 if ( !aTodo->relatedTo() ) 3770 if ( !aTodo->relatedTo() )
3769 rootTodos.append( aTodo ); 3771 rootTodos.append( aTodo );
3770 } 3772 }
3771 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 3773 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
3772 removeCompletedSubTodos( aTodo ); 3774 removeCompletedSubTodos( aTodo );
3773 } 3775 }
3774 3776
3775 updateView(); 3777 updateView();
3776 } 3778 }
3777} 3779}
3778 3780
3779void CalendarView::slotCalendarChanged() 3781void CalendarView::slotCalendarChanged()
3780{ 3782{
3781 ; 3783 ;
3782} 3784}
3783 3785
3784NavigatorBar *CalendarView::navigatorBar() 3786NavigatorBar *CalendarView::navigatorBar()
3785{ 3787{
3786 return mNavigatorBar; 3788 return mNavigatorBar;
3787} 3789}
3788 3790
3789 3791
3790 3792
3791void CalendarView::keyPressEvent ( QKeyEvent *e) 3793void CalendarView::keyPressEvent ( QKeyEvent *e)
3792{ 3794{
3793 //qDebug(" alendarView::keyPressEvent "); 3795 //qDebug(" alendarView::keyPressEvent ");
3794 e->ignore(); 3796 e->ignore();
3795} 3797}
3796 3798
3797 3799
3798bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 3800bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
3799{ 3801{
3800 // mSyncManager = manager; 3802 // mSyncManager = manager;
3801 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 3803 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
3802 qDebug("SyncKDE request detected!"); 3804 qDebug("SyncKDE request detected!");
3803 } 3805 }
3804 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3806 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3805 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3807 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3806 return syncCalendar( filename, mode ); 3808 return syncCalendar( filename, mode );
3807} 3809}
3808bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 3810bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
3809{ 3811{
3810 //mSyncManager = manager; 3812 //mSyncManager = manager;
3811 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3813 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3812 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3814 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3813 if ( resource == "sharp" ) 3815 if ( resource == "sharp" )
3814 syncExternal( 0 ); 3816 syncExternal( 0 );
3815 if ( resource == "phone" ) 3817 if ( resource == "phone" )
3816 syncExternal( 1 ); 3818 syncExternal( 1 );
3817 // pending setmodified 3819 // pending setmodified
3818 return true; 3820 return true;
3819} 3821}
3820void CalendarView::setSyncManager(KSyncManager* manager) 3822void CalendarView::setSyncManager(KSyncManager* manager)
3821{ 3823{
3822 mSyncManager = manager; 3824 mSyncManager = manager;
3823} 3825}
3824 3826
3825void CalendarView::removeSyncInfo( QString syncProfile) 3827void CalendarView::removeSyncInfo( QString syncProfile)
3826{ 3828{
3827 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); 3829 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1());
3828 mCalendar->removeSyncInfo( syncProfile ); 3830 mCalendar->removeSyncInfo( syncProfile );
3829 3831
3830} 3832}
3831 3833
3832void CalendarView::undo_delete() 3834void CalendarView::undo_delete()
3833{ 3835{
3834 //qDebug("undo_delete() "); 3836 //qDebug("undo_delete() ");
3835 Incidence* undo = mCalendar->undoIncidence(); 3837 Incidence* undo = mCalendar->undoIncidence();
3836 if ( !undo ) { 3838 if ( !undo ) {
3837 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 3839 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
3838 i18n("KO/Pi")); 3840 i18n("KO/Pi"));
3839 return; 3841 return;
3840 } 3842 }
3841 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + 3843 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
3842 i18n("\nAre you sure you want\nto restore this?"), 3844 i18n("\nAre you sure you want\nto restore this?"),
3843 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 3845 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
3844 mCalendar->undoDeleteIncidence(); 3846 mCalendar->undoDeleteIncidence();
3845 updateView(); 3847 updateView();
3846 } 3848 }
3847} 3849}
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 68c0e1a..772fd95 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -1,240 +1,256 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24 24
25#include "koeventviewer.h" 25#include "koeventviewer.h"
26#include "koprefs.h" 26#include "koprefs.h"
27#include <libkcal/todo.h> 27#include <libkcal/todo.h>
28#include "qapp.h" 28#include "qapp.h"
29 29
30#include "koeventviewerdialog.h" 30#include "koeventviewerdialog.h"
31extern int globalFlagBlockAgenda; 31extern int globalFlagBlockAgenda;
32 32
33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
34 : KDialogBase(parent,name, 34 : KDialogBase(parent,name,
35#ifndef DESKTOP_VERSION 35#ifndef DESKTOP_VERSION
36 true , 36 true ,
37#else 37#else
38 false, 38 false,
39#endif 39#endif
40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
41{ 41{
42 42
43 mEventViewer = new KOEventViewer(this); 43 mEventViewer = new KOEventViewer(this);
44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
45 setMainWidget(mEventViewer); 45 setMainWidget(mEventViewer);
46 setButtonText(Ok, i18n("Edit") ); 46 setButtonText(Ok, i18n("Edit") );
47 47
48 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 48 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
49 SLOT(editIncidence())); 49 SLOT(editIncidence()));
50 QObject::connect(this,SIGNAL(user1Clicked()), 50 QObject::connect(this,SIGNAL(user1Clicked()),
51 SLOT(showIncidence())); 51 SLOT(showIncidence()));
52 mIncidence = 0; 52 mIncidence = 0;
53 // TODO: Set a sensible size (based on the content?). 53 // TODO: Set a sensible size (based on the content?).
54 //showMaximized(); 54 //showMaximized();
55 //qDebug("++++++++++++KOEventViewerDialog() "); 55 //qDebug("++++++++++++KOEventViewerDialog() ");
56 // if ( KOPrefs::instance()->mCompactDialogs ) { 56 // if ( KOPrefs::instance()->mCompactDialogs ) {
57// setFixedSize( 240,284 ); 57// setFixedSize( 240,284 );
58// move( 0, 15 ); 58// move( 0, 15 );
59// } else { 59// } else {
60// setMinimumSize(300,200); 60// setMinimumSize(300,200);
61// resize(320,300); 61// resize(320,300);
62// } 62// }
63 mSyncMode = false; 63 mSyncMode = false;
64 mSyncResult = 0; 64 mSyncResult = 0;
65 65
66} 66}
67 67
68KOEventViewerDialog::~KOEventViewerDialog() 68KOEventViewerDialog::~KOEventViewerDialog()
69{ 69{
70 //qDebug("-------~KOEventViewerDialog() "); 70 //qDebug("-------~KOEventViewerDialog() ");
71} 71}
72void KOEventViewerDialog::showMe() 72void KOEventViewerDialog::showMe()
73{ 73{
74 74
75#ifdef DESKTOP_VERSION 75#ifdef DESKTOP_VERSION
76 show(); 76 show();
77#else 77#else
78 showMaximized(); 78 showMaximized();
79#endif 79#endif
80 setFocus(); 80 setFocus();
81 setActiveWindow(); 81 setActiveWindow();
82 82
83} 83}
84void KOEventViewerDialog::setSyncMode( bool b ) 84void KOEventViewerDialog::setSyncMode( bool b )
85{ 85{
86 mSyncMode = b; 86 mSyncMode = b;
87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
88 if ( mSyncMode ) { 88 if ( mSyncMode ) {
89 findButton( Close )->setText( i18n("Cancel Sync")); 89 findButton( Close )->setText( i18n("Cancel Sync"));
90 findButton( Ok )->setText( i18n("Remote")); 90 findButton( Ok )->setText( i18n("Remote"));
91 findButton( User1 )->setText( i18n("Local")); 91 findButton( User1 )->setText( i18n("Local"));
92 } else { 92 } else {
93 findButton( Close )->setText( i18n("Close")); 93 findButton( Close )->setText( i18n("Close"));
94 findButton( Ok )->setText( i18n("Edit")); 94 findButton( Ok )->setText( i18n("Edit"));
95 findButton( User1 )->setText( i18n("Agenda")); 95 findButton( User1 )->setText( i18n("Agenda"));
96 } 96 }
97 mEventViewer->setSyncMode( b ); 97 mEventViewer->setSyncMode( b );
98} 98}
99void KOEventViewerDialog::setColorMode( int m ) 99void KOEventViewerDialog::setColorMode( int m )
100{ 100{
101 mEventViewer->setColorMode( m ); 101 mEventViewer->setColorMode( m );
102} 102}
103int KOEventViewerDialog::executeS( bool local ) 103int KOEventViewerDialog::executeS( bool local )
104{ 104{
105 mSyncResult = 3; 105 mSyncResult = 3;
106 if ( local ) 106 if ( local )
107 findButton( User1 )->setFocus(); 107 findButton( User1 )->setFocus();
108 else 108 else
109 findButton( Ok )->setFocus(); 109 findButton( Ok )->setFocus();
110 exec(); 110 exec();
111 return mSyncResult; 111 return mSyncResult;
112} 112}
113 113
114void KOEventViewerDialog::updateConfig() 114void KOEventViewerDialog::updateConfig()
115{ 115{
116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
117 117
118} 118}
119void KOEventViewerDialog::setEvent(Event *event) 119void KOEventViewerDialog::setEvent(Event *event)
120{ 120{
121 mEventViewer->setEvent(event); 121 mEventViewer->setEvent(event);
122 mIncidence = event; 122 mIncidence = event;
123 findButton( Close )->setFocus(); 123 findButton( Close )->setFocus();
124} 124}
125void KOEventViewerDialog::setIncidence(Incidence *in ) 125void KOEventViewerDialog::setIncidence(Incidence *in )
126{ 126{
127 if ( in->type() == "Event" ) 127 if ( in->type() == "Event" )
128 setEvent( (Event*) in ); 128 setEvent( (Event*) in );
129 else if ( in->type() =="Todo" ) 129 else if ( in->type() =="Todo" )
130 setTodo( (Todo*) in ); 130 setTodo( (Todo*) in );
131 else if ( in->type() =="Journal" ) 131 else if ( in->type() =="Journal" )
132 setJournal( (Journal*) in ); 132 setJournal( (Journal*) in );
133} 133}
134void KOEventViewerDialog::addIncidence(Incidence *in) 134void KOEventViewerDialog::addIncidence(Incidence *in)
135{ 135{
136 if ( in->type() == "Event" ) 136 if ( in->type() == "Event" )
137 addEvent( (Event*) in ); 137 addEvent( (Event*) in );
138 else if ( in->type() =="Todo" ) 138 else if ( in->type() =="Todo" )
139 mEventViewer->setTodo( (Todo*) in, false ); 139 mEventViewer->setTodo( (Todo*) in, false );
140 else if ( in->type() =="Journal" ) 140 else if ( in->type() =="Journal" )
141 mEventViewer->setJournal( (Journal*) in, false ); 141 mEventViewer->setJournal( (Journal*) in, false );
142 if ( mSyncMode ) { 142 if ( mSyncMode ) {
143 findButton( User1 )->setFocus(); 143 findButton( User1 )->setFocus();
144 setCaption(i18n("Conflict! Please choose entry")); 144 setCaption(i18n("Conflict! Please choose entry"));
145 } 145 }
146} 146}
147 147
148void KOEventViewerDialog::addEvent(Event *event) 148void KOEventViewerDialog::addEvent(Event *event)
149{ 149{
150 mEventViewer->addEvent(event); 150 mEventViewer->addEvent(event);
151 mIncidence = event; 151 mIncidence = event;
152 findButton( Close )->setFocus(); 152 findButton( Close )->setFocus();
153 if ( !mSyncMode ) {
154 findButton( User1 )->setText( i18n("Agenda"));
155 }
153} 156}
154 157
155void KOEventViewerDialog::setTodo(Todo *event) 158void KOEventViewerDialog::setTodo(Todo *event)
156{ 159{
157 mEventViewer->setTodo(event); 160 mEventViewer->setTodo(event);
158 mIncidence = (Incidence*)event; 161 mIncidence = (Incidence*)event;
159 findButton( Close )->setFocus(); 162 findButton( Close )->setFocus();
163 if ( !mSyncMode ) {
164 findButton( User1 )->setText( i18n("Set complete"));
165 }
160} 166}
161void KOEventViewerDialog::setJournal(Journal *j) 167void KOEventViewerDialog::setJournal(Journal *j)
162{ 168{
163 mEventViewer->setJournal(j); 169 mEventViewer->setJournal(j);
164 mIncidence = (Incidence*)j; 170 mIncidence = (Incidence*)j;
165 findButton( Close )->setFocus(); 171 findButton( Close )->setFocus();
172 if ( !mSyncMode ) {
173 findButton( User1 )->setText( i18n("Agenda"));
174 }
166} 175}
167 176
168void KOEventViewerDialog::addText(QString text) 177void KOEventViewerDialog::addText(QString text)
169{ 178{
170 mEventViewer->addText(text); 179 mEventViewer->addText(text);
171 findButton( Close )->setFocus(); 180 findButton( Close )->setFocus();
172} 181}
173void KOEventViewerDialog::editIncidence() 182void KOEventViewerDialog::editIncidence()
174{ 183{
175 if ( mSyncMode ) { 184 if ( mSyncMode ) {
176 mSyncResult = 2; 185 mSyncResult = 2;
177 accept(); 186 accept();
178 return; 187 return;
179 } 188 }
180 if ( mIncidence ){ 189 if ( mIncidence ){
181#ifndef DESKTOP_VERSION 190#ifndef DESKTOP_VERSION
182 hide(); 191 hide();
183#endif 192#endif
184 emit editIncidence( mIncidence ); 193 emit editIncidence( mIncidence );
185 } 194 }
186} 195}
187void KOEventViewerDialog::showIncidence() 196void KOEventViewerDialog::showIncidence()
188{ 197{
189 198
190 if ( mSyncMode ) { 199 if ( mSyncMode ) {
191 mSyncResult = 1; 200 mSyncResult = 1;
192 accept(); 201 accept();
193 return; 202 return;
194 } 203 }
195 204
196 if ( mIncidence ){ 205 if ( mIncidence ){
197#ifndef DESKTOP_VERSION 206#ifndef DESKTOP_VERSION
198 hide(); 207 hide();
199#endif 208#endif
200 QDate date; 209 QDate date;
201 if ( mIncidence->type() == "Todo" ) { 210 if ( mIncidence->type() == "Todo" ) {
211 /*
202 if ( ((Todo*)mIncidence)->hasDueDate() ) 212 if ( ((Todo*)mIncidence)->hasDueDate() )
203 date = ((Todo*)mIncidence)->dtDue().date(); 213 date = ((Todo*)mIncidence)->dtDue().date();
204 else { 214 else {
205 globalFlagBlockAgenda = 2; 215 globalFlagBlockAgenda = 2;
206 emit showAgendaView( false ); 216 emit showAgendaView( false );
207 return; 217 return;
208 } 218 }
219 */
220 ((Todo*)mIncidence)->setCompleted( true );
221 hide();
222 emit todoCompleted(((Todo*)mIncidence));
223 return;
224
209 } else 225 } else
210 date = mIncidence->dtStart().date(); 226 date = mIncidence->dtStart().date();
211 globalFlagBlockAgenda = 1; 227 globalFlagBlockAgenda = 1;
212 emit showAgendaView( false ); 228 emit showAgendaView( false );
213 globalFlagBlockAgenda = 2; 229 globalFlagBlockAgenda = 2;
214 emit jumpToTime( date ); 230 emit jumpToTime( date );
215 } 231 }
216} 232}
217void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 233void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
218{ 234{
219 switch ( e->key() ) { 235 switch ( e->key() ) {
220 236
221 case Qt::Key_A : 237 case Qt::Key_A :
222 case Qt::Key_L : 238 case Qt::Key_L :
223 showIncidence(); 239 showIncidence();
224 break; 240 break;
225 case Qt::Key_E : 241 case Qt::Key_E :
226 case Qt::Key_R : 242 case Qt::Key_R :
227 editIncidence(); 243 editIncidence();
228 break; 244 break;
229 case Qt::Key_C: 245 case Qt::Key_C:
230 case Qt::Key_Escape: 246 case Qt::Key_Escape:
231 close(); 247 close();
232 break; 248 break;
233 case Qt::Key_I: 249 case Qt::Key_I:
234 accept(); 250 accept();
235 break; 251 break;
236 default: 252 default:
237 break; 253 break;
238 } 254 }
239 255
240} 256}
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 21cb3ee..b6b4103 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -1,70 +1,71 @@
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#ifndef KOEVENTVIEWERDIALOG_H 19#ifndef KOEVENTVIEWERDIALOG_H
20#define KOEVENTVIEWERDIALOG_H 20#define KOEVENTVIEWERDIALOG_H
21// 21//
22// Viewer dialog for events. 22// Viewer dialog for events.
23// 23//
24 24
25#include <qtextview.h> 25#include <qtextview.h>
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28 28
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33class KOEventViewer; 33class KOEventViewer;
34 34
35class KOEventViewerDialog : public KDialogBase { 35class KOEventViewerDialog : public KDialogBase {
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 KOEventViewerDialog(QWidget *parent=0,const char *name=0); 38 KOEventViewerDialog(QWidget *parent=0,const char *name=0);
39 virtual ~KOEventViewerDialog(); 39 virtual ~KOEventViewerDialog();
40 40
41 void setEvent(Event *event); 41 void setEvent(Event *event);
42 void addEvent(Event *event); 42 void addEvent(Event *event);
43 void setTodo(Todo *event); 43 void setTodo(Todo *event);
44 void setJournal(Journal *journal); 44 void setJournal(Journal *journal);
45 void setIncidence(Incidence *inc); 45 void setIncidence(Incidence *inc);
46 void addIncidence(Incidence *inc); 46 void addIncidence(Incidence *inc);
47 void addText(QString text); 47 void addText(QString text);
48 void showMe(); 48 void showMe();
49 void setSyncMode( bool ); 49 void setSyncMode( bool );
50 void setColorMode( int m ); 50 void setColorMode( int m );
51 int executeS( bool ); 51 int executeS( bool );
52 public slots: 52 public slots:
53 void updateConfig(); 53 void updateConfig();
54 signals: 54 signals:
55 void editIncidence( Incidence* ); 55 void editIncidence( Incidence* );
56 void jumpToTime( const QDate &); 56 void jumpToTime( const QDate &);
57 void showAgendaView( bool ); 57 void showAgendaView( bool );
58 void todoCompleted(Todo*);
58private slots: 59private slots:
59 void editIncidence(); 60 void editIncidence();
60 void showIncidence(); 61 void showIncidence();
61 62
62 private: 63 private:
63 bool mSyncMode; 64 bool mSyncMode;
64 int mSyncResult; 65 int mSyncResult;
65 KOEventViewer *mEventViewer; 66 KOEventViewer *mEventViewer;
66 Incidence* mIncidence; 67 Incidence* mIncidence;
67 void keyPressEvent ( QKeyEvent * e ); 68 void keyPressEvent ( QKeyEvent * e );
68}; 69};
69 70
70#endif 71#endif
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 6f76e2c..3c251fb 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -1,115 +1,115 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 3 Copyright (c) 2001
4 Cornelius Schumacher <schumacher@kde.org> 4 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef KOVIEWMANAGER_H 24#ifndef KOVIEWMANAGER_H
25#define KOVIEWMANAGER_H 25#define KOVIEWMANAGER_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28 28
29#include <korganizer/baseview.h> 29#include <korganizer/baseview.h>
30 30
31class CalendarView; 31class CalendarView;
32 32
33class KOListView; 33class KOListView;
34class KOAgendaView; 34class KOAgendaView;
35class KOMonthView; 35class KOMonthView;
36class KOTimeSpanView; 36class KOTimeSpanView;
37class KOTodoView; 37class KOTodoView;
38class KOWhatsNextView; 38class KOWhatsNextView;
39class KOJournalView; 39class KOJournalView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43/** 43/**
44 This class manages the views of the calendar. It owns the objects and handles 44 This class manages the views of the calendar. It owns the objects and handles
45 creation and selection. 45 creation and selection.
46*/ 46*/
47class KOViewManager : public QObject 47class KOViewManager : public QObject
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 void updateWNview(); 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView();
70 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
71 70
72 void raiseCurrentView( bool fullScreen = false ); 71 void raiseCurrentView( bool fullScreen = false );
73 72
74 void addView(KOrg::BaseView *); 73 void addView(KOrg::BaseView *);
75 74
76 Incidence *currentSelection(); 75 Incidence *currentSelection();
77 QDate currentSelectionDate(); 76 QDate currentSelectionDate();
78 77
79 KOAgendaView *agendaView() const { return mAgendaView; } 78 KOAgendaView *agendaView() const { return mAgendaView; }
80 79
81 signals: 80 signals:
82 void printWNV(); 81 void printWNV();
83 public slots: 82 public slots:
83 void updateView();
84 void showWhatsNextView(); 84 void showWhatsNextView();
85 void showListView(); 85 void showListView();
86 void showAgendaView( bool fullScreen = false ); 86 void showAgendaView( bool fullScreen = false );
87 void showDayView(); 87 void showDayView();
88 void showWorkWeekView(); 88 void showWorkWeekView();
89 void showWeekView(); 89 void showWeekView();
90 void showNextXView(); 90 void showNextXView();
91 void showMonthView(); 91 void showMonthView();
92 void showTodoView(); 92 void showTodoView();
93 void showJournalView(); 93 void showJournalView();
94 void showTimeSpanView(); 94 void showTimeSpanView();
95 95
96 private: 96 private:
97 CalendarView *mMainView; 97 CalendarView *mMainView;
98 98
99 int mCurrentAgendaView; 99 int mCurrentAgendaView;
100 KOAgendaView *mAgendaView; 100 KOAgendaView *mAgendaView;
101 KOListView *mListView; 101 KOListView *mListView;
102 KOMonthView *mMonthView; 102 KOMonthView *mMonthView;
103 KOTodoView *mTodoView; 103 KOTodoView *mTodoView;
104 KOWhatsNextView *mWhatsNextView; 104 KOWhatsNextView *mWhatsNextView;
105 KOJournalView *mJournalView; 105 KOJournalView *mJournalView;
106 KOTimeSpanView *mTimeSpanView; 106 KOTimeSpanView *mTimeSpanView;
107 107
108 KOrg::BaseView *mCurrentView; // currently active event view 108 KOrg::BaseView *mCurrentView; // currently active event view
109 109
110 int mAgendaViewMode; 110 int mAgendaViewMode;
111 bool mFlagShowNextxDays; 111 bool mFlagShowNextxDays;
112 112
113}; 113};
114 114
115#endif 115#endif