summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--korganizer/komonthview.cpp207
-rw-r--r--korganizer/komonthview.h10
3 files changed, 168 insertions, 51 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index e24ee43..3ba0841 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,898 +1,900 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.3 ************ 3********** VERSION 2.0.3 ************
4 4
5KO/Pi: 5KO/Pi:
6Added feature for changing alarm settings for many items at once: 6Added feature for changing alarm settings for many items at once:
7Open list view (or search dialog), select the desired items and choose in 7Open list view (or search dialog), select the desired items and choose in
8the popup menu: Set alarm for selected... 8the popup menu: Set alarm for selected...
9 9
10Added to the event/todo viewer the option to send an email to 10Added to the event/todo viewer the option to send an email to
11all attendees or all selected (with RSVP) attendees. 11all attendees or all selected (with RSVP) attendees.
12 12
13Made the week-month mode changing in month view faster.
14
13********** VERSION 2.0.2 ************ 15********** VERSION 2.0.2 ************
14 16
15KO/Pi: 17KO/Pi:
16Fixed the layout problem of the day label buttons 18Fixed the layout problem of the day label buttons
17of the agenda view introduced in version 2.0.1. 19of the agenda view introduced in version 2.0.1.
18 20
19Added WhatsThis support for the todo view and the list view. 21Added WhatsThis support for the todo view and the list view.
20 22
21Added a quite useful feature to the montview. 23Added a quite useful feature to the montview.
22Just click on the week numbers on the left. 24Just click on the week numbers on the left.
23And in the top right corner of month view/agenda view 25And in the top right corner of month view/agenda view
24there is now a "week number quick selector". 26there is now a "week number quick selector".
25(Click on the black triangle). 27(Click on the black triangle).
26 28
27Made the quite difficult timezone change in KO/Pi easy. 29Made the quite difficult timezone change in KO/Pi easy.
28 30
29OM/Pi: 31OM/Pi:
30Fixed too small icons on desktop. 32Fixed too small icons on desktop.
31Fixed non visible icons in mainwindow on Z with fastload enabled. 33Fixed non visible icons in mainwindow on Z with fastload enabled.
32Added signature file setting to smtp account config. 34Added signature file setting to smtp account config.
33And the signature can be edited and saved in the edit mail dialog. 35And the signature can be edited and saved in the edit mail dialog.
34That does mean: 36That does mean:
35Simply edit the signature for the selected smtp account in the 37Simply edit the signature for the selected smtp account in the
36edit new mail dialog and press the "save signature" button there. 38edit new mail dialog and press the "save signature" button there.
37Then the signature is saved to the file specified in the smtp account settings. 39Then the signature is saved to the file specified in the smtp account settings.
38If there is no file specified, it is saved automatically to the file 40If there is no file specified, it is saved automatically to the file
39kdepim/apps/kopiemail/<accountname>.sig. 41kdepim/apps/kopiemail/<accountname>.sig.
40 42
41 43
42 44
43********** VERSION 2.0.1 ************ 45********** VERSION 2.0.1 ************
44 46
45Oooops ... I forgot to test on the Zaurus 5500 ... 47Oooops ... I forgot to test on the Zaurus 5500 ...
46 48
47Fixed many problems of new (english) strings (and german translations) 49Fixed many problems of new (english) strings (and german translations)
48introduced in the latest versions, where the text was not fitting on the 50introduced in the latest versions, where the text was not fitting on the
49240x320 display of the Zaurus 5500. 51240x320 display of the Zaurus 5500.
50 52
51KO/Pi: 53KO/Pi:
52Added a popup menu ( press pen and hold to get popup ) to the agenda view 54Added a popup menu ( press pen and hold to get popup ) to the agenda view
53with many useful items (add event/todo, show next week, two weeks, month, journal). 55with many useful items (add event/todo, show next week, two weeks, month, journal).
54 56
55Added items to the todolist popup menu for: 57Added items to the todolist popup menu for:
56Display all opened, all closed or all todos flat. 58Display all opened, all closed or all todos flat.
57The "flat" view makes is possible to sort all todos after ,e.g., prio or date. 59The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
58Made the reparenting of todos on the desktop possible via Drag&Drop. 60Made the reparenting of todos on the desktop possible via Drag&Drop.
59Fixed several bugs in setting the completed datetime for todos. 61Fixed several bugs in setting the completed datetime for todos.
60Added info about completed datetime of todos to the todo viewer. 62Added info about completed datetime of todos to the todo viewer.
61Now displaying a completed todo (with completed datetime set) in the agenda view 63Now displaying a completed todo (with completed datetime set) in the agenda view
62at the time of the completion. Such that now it is possible to see in the agenda view 64at the time of the completion. Such that now it is possible to see in the agenda view
63when what todo was completed. 65when what todo was completed.
64Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. 66Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
65Now the behaviour is: 67Now the behaviour is:
66Setting a parent to complete sets all (sub)childs to complete. 68Setting a parent to complete sets all (sub)childs to complete.
67Setting a parent to uncomplete does not change the childs. 69Setting a parent to uncomplete does not change the childs.
68Setting a child to uncomplete sets all parent to uncomplete. 70Setting a child to uncomplete sets all parent to uncomplete.
69Setting a child to complete does not change the parents. 71Setting a child to complete does not change the parents.
70 72
71Smart updating and double buffering of the daymatrix. 73Smart updating and double buffering of the daymatrix.
72Showing holidays in the day matrix. 74Showing holidays in the day matrix.
73Many other small performance updates. 75Many other small performance updates.
74 76
75Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. 77Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode.
76 78
77Now the translation file usertranslation.txt is supposed to be in utf8 format. 79Now the translation file usertranslation.txt is supposed to be in utf8 format.
78If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. 80If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu.
79 81
80 82
81********** VERSION 2.0.0 ************ 83********** VERSION 2.0.0 ************
82 84
83Stable release 2.0.0! 85Stable release 2.0.0!
84 86
85KO/Pi: 87KO/Pi:
86Fixed problem in edit dialog recreation at startup. 88Fixed problem in edit dialog recreation at startup.
87Made "toggle view*" menu items enabled context sensitive. 89Made "toggle view*" menu items enabled context sensitive.
88Changed agenda size menu to items 1-10. 90Changed agenda size menu to items 1-10.
89Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. 91Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down.
90Usebility enhancements in the KO/Pi menus. 92Usebility enhancements in the KO/Pi menus.
91Birthday import now adds year to summary. 93Birthday import now adds year to summary.
92What's Next view shows age in years for birthday. 94What's Next view shows age in years for birthday.
93 95
94OM/Pi: 96OM/Pi:
95Added three info lines to display subject, from and to of selected mails. 97Added three info lines to display subject, from and to of selected mails.
96 98
97KA/Pi: 99KA/Pi:
98Fixed jump bar behaviour on Zaurus. 100Fixed jump bar behaviour on Zaurus.
99Now KA/Pi search field supports searching for a range of starting characters. 101Now KA/Pi search field supports searching for a range of starting characters.
100E.g. to search for all contact beginning with b to n, type 102E.g. to search for all contact beginning with b to n, type
101b-n 103b-n
102in the search field. 104in the search field.
103 105
104********** VERSION 1.9.20 ************ 106********** VERSION 1.9.20 ************
105 107
106KO/Pi: 108KO/Pi:
107Added for the "dislplay one day" agenda mode 109Added for the "dislplay one day" agenda mode
108info in the caption and in the day lables: 110info in the caption and in the day lables:
109Now it is displayed, if the selected day is from "day before yesterday" 111Now it is displayed, if the selected day is from "day before yesterday"
110to "day after tomorrow". 112to "day after tomorrow".
111Made it possible to delete a Todo, which has sub-todos. 113Made it possible to delete a Todo, which has sub-todos.
112Fixed two small problems in the todo view. 114Fixed two small problems in the todo view.
113Added missing German translation for filter edit and print dialog. 115Added missing German translation for filter edit and print dialog.
114Made search dialog closeable by cancel key. 116Made search dialog closeable by cancel key.
115 117
116Made it possible to select in the date picker the (ligt grey ) 118Made it possible to select in the date picker the (ligt grey )
117dates of the prev./next month with the mouse. 119dates of the prev./next month with the mouse.
118 120
119OM/Pi: 121OM/Pi:
120"Delete mail" icon in main window now deletes all selected mails. 122"Delete mail" icon in main window now deletes all selected mails.
121Fixed the problem, that the state flag of imap mails was ignored. 123Fixed the problem, that the state flag of imap mails was ignored.
122Now mails with "FLAG_SEEN" on the imap server get no icon in the list view 124Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
123to indecate that they are already seen. 125to indecate that they are already seen.
124Fixed the problem that the body of some mails was not displayed in the 126Fixed the problem that the body of some mails was not displayed in the
125mail viewer when fetching them from the imap server directly to read them. 127mail viewer when fetching them from the imap server directly to read them.
126Made it (configurable) possible to show the "To:" field in the list view. 128Made it (configurable) possible to show the "To:" field in the list view.
127Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. 129Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
128Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the 130Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the
129local storage folder (specified in account settings) of the account of the mail. 131local storage folder (specified in account settings) of the account of the mail.
130Removed some memory leaks in OM/Pi. 132Removed some memory leaks in OM/Pi.
131 133
132 134
133********** VERSION 1.9.19 ************ 135********** VERSION 1.9.19 ************
134 136
135Added a lot of missing translations to KA/Pi, 137Added a lot of missing translations to KA/Pi,
136Added some missing translations to KO/Pi and OM/Pi. 138Added some missing translations to KO/Pi and OM/Pi.
137 139
138Fixed some minor problems in KA/Pi + KO/Pi. 140Fixed some minor problems in KA/Pi + KO/Pi.
139 141
140Fixed a crash when closing PwM/Pi. 142Fixed a crash when closing PwM/Pi.
141Added German translation for PwM/Pi. 143Added German translation for PwM/Pi.
142 144
143Made view change and Month View update faster in KO/Pi. 145Made view change and Month View update faster in KO/Pi.
144 146
145 147
146********** VERSION 1.9.18 ************ 148********** VERSION 1.9.18 ************
147 149
148FYI: The VERSION 1.9.17 was a testing release only. 150FYI: The VERSION 1.9.17 was a testing release only.
149Please read the changelog of VERSION 1.9.17 as well. 151Please read the changelog of VERSION 1.9.17 as well.
150 152
151Cleaned up the syncing config dialog. 153Cleaned up the syncing config dialog.
152Added sync config options for date range for events. 154Added sync config options for date range for events.
153Added sync config options for filters on incoming data. 155Added sync config options for filters on incoming data.
154Added sync config options for filters on outgoing data. 156Added sync config options for filters on outgoing data.
155Please read the updated SyncHowTo about the new filter settings. 157Please read the updated SyncHowTo about the new filter settings.
156These filter settings make it now possible to sync with shared 158These filter settings make it now possible to sync with shared
157calendars without writing back private or confidential data 159calendars without writing back private or confidential data
158(via the outgoing filters). 160(via the outgoing filters).
159To sync only with particular parts of a shared calendar, 161To sync only with particular parts of a shared calendar,
160the incoming filter settings can be used. 162the incoming filter settings can be used.
161An example can be found in the SyncHowTo. 163An example can be found in the SyncHowTo.
162Same for shared addressbooks. 164Same for shared addressbooks.
163 165
164Added a setting for the global kdepim data storage. 166Added a setting for the global kdepim data storage.
165Usually the data is stored in (yourhomedir/kdepim). 167Usually the data is stored in (yourhomedir/kdepim).
166Now you can set in the Global config dialog TAB, subTAB "Data storage path" 168Now you can set in the Global config dialog TAB, subTAB "Data storage path"
167a directory where all the kdepim data is stored. 169a directory where all the kdepim data is stored.
168That makes it easy to save all kdepim data on a SD card on the Z, for example. 170That makes it easy to save all kdepim data on a SD card on the Z, for example.
169 171
170KO/Pi: 172KO/Pi:
171The timeedit input has a pulldown list for times. 173The timeedit input has a pulldown list for times.
172If opened, this pulldown list should now has the right time highlighted. 174If opened, this pulldown list should now has the right time highlighted.
173Added the possibility to exclude events/todos/journals in a filter. 175Added the possibility to exclude events/todos/journals in a filter.
174You should exclude journals, if you do not want them to sync with a public calendar. 176You should exclude journals, if you do not want them to sync with a public calendar.
175 177
176KA/Pi: 178KA/Pi:
177Added the possibility to in/exclude public/private/confidential contacts to a filter. 179Added the possibility to in/exclude public/private/confidential contacts to a filter.
178If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... 180If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ...
179Added printing of card view and details view on desktop. 181Added printing of card view and details view on desktop.
180Printing of list view is not working... 182Printing of list view is not working...
181Added button for removing pictures in contact editor. 183Added button for removing pictures in contact editor.
182Parsing data fix of KA/Pi version 1.9.17. 184Parsing data fix of KA/Pi version 1.9.17.
183Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. 185Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
184Fixed some syncing merging problems. 186Fixed some syncing merging problems.
185 187
186 188
187********** VERSION 1.9.17 ************ 189********** VERSION 1.9.17 ************
188 190
189KO/Pi: 191KO/Pi:
190Fixed that tooltips were not updated after moving an item in agenda view. 192Fixed that tooltips were not updated after moving an item in agenda view.
191Fixed a bug in sorting start date for recurring events in list view. 193Fixed a bug in sorting start date for recurring events in list view.
192Changed the left button in todo viewer from "Agenda" to "Set completed". 194Changed the left button in todo viewer from "Agenda" to "Set completed".
193This 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. 195This 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.
194Added more info in the todo viewer: Startdate, parent/sub todos. 196Added more info in the todo viewer: Startdate, parent/sub todos.
195 197
196 198
197KA/Pi: 199KA/Pi:
198All fields search does now actually search all the (possible) fields, 200All fields search does now actually search all the (possible) fields,
199not only those listed in the contact list. 201not only those listed in the contact list.
200Made is possible to inline a picture in a vcard on the Z. 202Made is possible to inline a picture in a vcard on the Z.
201This was only possible on the desktop, now is it possible on the Z as well. 203This was only possible on the desktop, now is it possible on the Z as well.
202Fixed of missing save settings after filter configuration. 204Fixed of missing save settings after filter configuration.
203Made saving of addressbook much faster. 205Made saving of addressbook much faster.
204Fixed extension widget layout problem. 206Fixed extension widget layout problem.
205Fixed saving of default formatted name settings. 207Fixed saving of default formatted name settings.
206Fixed formatted name handling in edit dialog. 208Fixed formatted name handling in edit dialog.
207Added an option for changing formatted names of many contacts 209Added an option for changing formatted names of many contacts
208(menu: File - Change - Set formatted name). 210(menu: File - Change - Set formatted name).
209 211
210QWhatsThis was not working on the Z ( only black rectangle was shown). 212QWhatsThis was not working on the Z ( only black rectangle was shown).
211This is Fixed. 213This is Fixed.
212 214
213KDE-Sync: 215KDE-Sync:
214Now readonly KDE resources are synced as well. 216Now readonly KDE resources are synced as well.
215(They are not changed in KDE itself, of course). 217(They are not changed in KDE itself, of course).
216 218
217 219
218 220
219********** VERSION 1.9.16 ************ 221********** VERSION 1.9.16 ************
220 222
221KO/Pi: 223KO/Pi:
222Fixed search dialog size on Z 6000 (480x640 display). 224Fixed search dialog size on Z 6000 (480x640 display).
223Added setting to hide/show time in agenda items. 225Added setting to hide/show time in agenda items.
224Added setting to hide not running todos in todo view. 226Added setting to hide not running todos in todo view.
225Added columns for start date/time in todo view. 227Added columns for start date/time in todo view.
226Replaced the solid half-hour lines in agenda view by dot lines. 228Replaced the solid half-hour lines in agenda view by dot lines.
227Added possibility of printing the What's Next View on the desktop 229Added possibility of printing the What's Next View on the desktop
228(i.e. Windows and Linux). 230(i.e. Windows and Linux).
229Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 231Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
230Added tooltips in month view.(Tooltips only available on desktop) 232Added tooltips in month view.(Tooltips only available on desktop)
231 233
232Fixed a strange problem in KO/Pi alarm applet. 234Fixed a strange problem in KO/Pi alarm applet.
233Did not find the actual problem, 235Did not find the actual problem,
234such that now Qtopia reboots again if deinstalling the alarm applet. 236such that now Qtopia reboots again if deinstalling the alarm applet.
235But the alarm applet should work again. 237But the alarm applet should work again.
236 238
237KA/Pi: 239KA/Pi:
238Fixed the problem, that internal pictures were not saved. 240Fixed the problem, that internal pictures were not saved.
239 241
240Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 242Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
241 243
242Fixed some minor problems. (Like word wrap in help text windows). 244Fixed some minor problems. (Like word wrap in help text windows).
243 245
244Fixed a compiling problem in microkde/kresources. 246Fixed a compiling problem in microkde/kresources.
245 247
246KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 248KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
247This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 249This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
248such that now syncing KO/Pi with Sharp DTM should work on the 250such that now syncing KO/Pi with Sharp DTM should work on the
249Zaurus C 3000 model. 251Zaurus C 3000 model.
250 252
251********** VERSION 1.9.15 ************ 253********** VERSION 1.9.15 ************
252 254
253Usebilty enhancements in KO/Pi: 255Usebilty enhancements in KO/Pi:
254When clicking on the date in a month view cell, the day view is shown. 256When clicking on the date in a month view cell, the day view is shown.
255Old behaviour was, that the "new event" dialog popped up. 257Old behaviour was, that the "new event" dialog popped up.
256 258
257Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 259Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
258That means, you can restore the latest 260That means, you can restore the latest
259event/todo/journal you have deleted. 261event/todo/journal you have deleted.
260A journal is deleted, if you clear all the text of the journal. 262A journal is deleted, if you clear all the text of the journal.
261 263
262Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 264Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
263 265
264KA/Pi starting in 480x640 resolution: 266KA/Pi starting in 480x640 resolution:
265Hide the filter action in toolbar 267Hide the filter action in toolbar
266and added icons for undo/delete/redo in toolbar. 268and added icons for undo/delete/redo in toolbar.
267 269
268Change in OM/Pi ViewMail dialog: 270Change in OM/Pi ViewMail dialog:
269When clicking on the "delete" icon the mail is deleted after confirmation as usual. 271When clicking on the "delete" icon the mail is deleted after confirmation as usual.
270But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 272But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
271 273
272Fixed a crash when deleting mail-accounts in OM/Pi. 274Fixed a crash when deleting mail-accounts in OM/Pi.
273 275
274 276
275********** VERSION 1.9.14 ************ 277********** VERSION 1.9.14 ************
276 278
277Fixed some problems with the dialog sizes when switching 279Fixed some problems with the dialog sizes when switching
278portrait/landscape mode on 640x480 PDA display. 280portrait/landscape mode on 640x480 PDA display.
279 281
280Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 282Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
281 283
282Fixed an ugly bug in KOpieMail: 284Fixed an ugly bug in KOpieMail:
283KOpieMail was not able to write files (mails) to MSDOS file system, 285KOpieMail was not able to write files (mails) to MSDOS file system,
284like on an usual preformatted SD card. That should work now. 286like on an usual preformatted SD card. That should work now.
285To save your mail data on the Sd card do the following: 287To save your mail data on the Sd card do the following:
286Create a dir on the SD card: 288Create a dir on the SD card:
287mkdir /mnt/card/localmail 289mkdir /mnt/card/localmail
288Go to your home dir: 290Go to your home dir:
289cd 291cd
290Go to kopiemail data storage dir: 292Go to kopiemail data storage dir:
291cd kdepim/apps/kopiemail 293cd kdepim/apps/kopiemail
292Create a symlink to the SD card: 294Create a symlink to the SD card:
293ls -s /mnt/card/localmail 295ls -s /mnt/card/localmail
294Now KOpieMail will store all mails on the SD card. 296Now KOpieMail will store all mails on the SD card.
295 297
296KO/Pi Monthview: 298KO/Pi Monthview:
297Now "Go to Today" selects the current month from day 1-end, 299Now "Go to Today" selects the current month from day 1-end,
298not the current date + some days. 300not the current date + some days.
299I.e. "Go to Today" shows now always 301I.e. "Go to Today" shows now always
300the current month with first day of month in the first row. 302the current month with first day of month in the first row.
301 303
302Added missing German translation. 304Added missing German translation.
303 305
304Fixed icons of executeable on Wintendo. 306Fixed icons of executeable on Wintendo.
305 307
306Added a "Show next Mail" button to the OM/Pi 308Added a "Show next Mail" button to the OM/Pi
307mail viewer such that the mail below the current mail 309mail viewer such that the mail below the current mail
308in the mail list view of the current folder 310in the mail list view of the current folder
309can be read with a single click. 311can be read with a single click.
310 312
311 313
312********** VERSION 1.9.13 ************ 314********** VERSION 1.9.13 ************
313 315
314Fixed nasty PwM/Pi file reading bug, when 316Fixed nasty PwM/Pi file reading bug, when
315the used hash algo of file is different then the global 317the used hash algo of file is different then the global
316hash algo. 318hash algo.
317 319
318Added KA/Pi support for opie mailit mailapplication. 320Added KA/Pi support for opie mailit mailapplication.
319 321
320Fixed some bugs in OM/Pi. 322Fixed some bugs in OM/Pi.
321Now character conversion tables are available for the Zaurus 323Now character conversion tables are available for the Zaurus
322to make OM/Pi working properly. 324to make OM/Pi working properly.
323To get the character conversion in OM/Pi working, please download 325To get the character conversion in OM/Pi working, please download
324at the sourceforge project site the package 326at the sourceforge project site the package
325sr-character-conversion_SharpROM_arm.ipk.zip 327sr-character-conversion_SharpROM_arm.ipk.zip
326(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 328(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
327from the section "general files for KDE/Pim" 329from the section "general files for KDE/Pim"
328Instructions how to install this package are in a ReadMe in this file. 330Instructions how to install this package are in a ReadMe in this file.
329 331
330 332
331Fixed the orientation change problem in KA/Pi when switching 333Fixed the orientation change problem in KA/Pi when switching
332portrait/landscape mode. 334portrait/landscape mode.
333 335
334French translation available for KA/Pi and OM/Pi. 336French translation available for KA/Pi and OM/Pi.
335 337
336Fixed some problems with categories in KO/Pi in DTM sync. 338Fixed some problems with categories in KO/Pi in DTM sync.
337 339
338Added selection dialog for export to phone in KA/Pi. 340Added selection dialog for export to phone in KA/Pi.
339 341
340If in KO/Pi is an attendee selected to add to a meeting and this 342If in KO/Pi is an attendee selected to add to a meeting and this
341attendee is already in the list of attendees, this person is not added 343attendee is already in the list of attendees, this person is not added
342again. 344again.
343 345
344Some menu cleanup in KA/Pi. 346Some menu cleanup in KA/Pi.
345 347
346********** VERSION 1.9.12 ************ 348********** VERSION 1.9.12 ************
347 349
348Fix for the bug in KO/Pi What's Next view of version 1.9.11. 350Fix for the bug in KO/Pi What's Next view of version 1.9.11.
349 351
350Bugfix: Licence file is now shown again. 352Bugfix: Licence file is now shown again.
351 353
352OM/Pi now supports Unicode (utf8 charset). 354OM/Pi now supports Unicode (utf8 charset).
353Fixed some bugs in OM/Pi. 355Fixed some bugs in OM/Pi.
354 356
355KA/Pi has more German translation. 357KA/Pi has more German translation.
356 358
357 359
358********** VERSION 1.9.11 ************ 360********** VERSION 1.9.11 ************
359 361
360Fixed several problems in PWM/Pi, like 362Fixed several problems in PWM/Pi, like
361asking the user, if unsaved changed are pending 363asking the user, if unsaved changed are pending
362when closing the app. 364when closing the app.
363And PwM/Pi handles now different texts for the 365And PwM/Pi handles now different texts for the
364fields Description, Username, Password, configurable per category. 366fields Description, Username, Password, configurable per category.
365 367
366Fixed a crash in KO/Pi , when importing/loading vcs files 368Fixed a crash in KO/Pi , when importing/loading vcs files
367which have an entry with an attendee with state: 369which have an entry with an attendee with state:
368NEEDS ACTION 370NEEDS ACTION
369 371
370Fixed some problems in the German translation of OM/Pi, 372Fixed some problems in the German translation of OM/Pi,
371which makes some dialogs not fitting on the screen 373which makes some dialogs not fitting on the screen
372of the Z 5500. 374of the Z 5500.
373 375
374Fixed Qtopia crash, when disabling/deinstalling 376Fixed Qtopia crash, when disabling/deinstalling
375KO/Pi alarm applet. 377KO/Pi alarm applet.
376 378
377Implemented direct KDE<->KA/Pi sync for KA/Pi running 379Implemented direct KDE<->KA/Pi sync for KA/Pi running
378on Linux desktop. 380on Linux desktop.
379 381
380Added feature "remove sync info" to sync menu. 382Added feature "remove sync info" to sync menu.
381 383
382Tweaked the KO/Pi What's next view a bit, added 384Tweaked the KO/Pi What's next view a bit, added
383setting to hide events that are done. 385setting to hide events that are done.
384 386
385Disabled "beam receive enabled" on startup to 387Disabled "beam receive enabled" on startup to
386avoid problems if Fastload is enabled. 388avoid problems if Fastload is enabled.
387Please set "beam receive enabled", 389Please set "beam receive enabled",
388if you want to receive data via IR. 390if you want to receive data via IR.
389 391
390Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 392Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
391on Linux desktop. 393on Linux desktop.
392 394
393Made in KA/Pi scrolling possible, if details view is selected. 395Made in KA/Pi scrolling possible, if details view is selected.
394(The keyboard focus is set automatically to the search line) 396(The keyboard focus is set automatically to the search line)
395 397
396Fixed a bug in DMT sync, that a new entry in DTM was added 398Fixed a bug in DMT sync, that a new entry in DTM was added
397on every sync to Kx/Pi. 399on every sync to Kx/Pi.
398 400
399Fixed missing writing of KA/Pi categories to DMT entries when syncing. 401Fixed missing writing of KA/Pi categories to DMT entries when syncing.
400 402
401Fixed a bug in DMT sync with todos created in KO/Pi containing 403Fixed a bug in DMT sync with todos created in KO/Pi containing
402non-latin1 characters. 404non-latin1 characters.
403 405
404Rearranged package contents of Sharp-ipks and made all 406Rearranged package contents of Sharp-ipks and made all
405packages installable on SD again. 407packages installable on SD again.
406 408
407Fixed the writing of addressbook data in DTM sync. 409Fixed the writing of addressbook data in DTM sync.
408Empty fields in KA/Pi were not removed. 410Empty fields in KA/Pi were not removed.
409 411
410Added better category handling in KA/Pi: 412Added better category handling in KA/Pi:
411Added item 413Added item
412Edit Categories and 414Edit Categories and
413Manage new categories 415Manage new categories
414to the settings menu. 416to the settings menu.
415Possible to configure a view to display categories. 417Possible to configure a view to display categories.
416 418
417Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. 419Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
418 420
419Fixed displaying of "free" days and time in KO Monthview and Agendaview. 421Fixed displaying of "free" days and time in KO Monthview and Agendaview.
420 422
421... and many other bugfixes. 423... and many other bugfixes.
422 424
423********** VERSION 1.9.10 ************ 425********** VERSION 1.9.10 ************
424 426
425Many internal small bugfixes. 427Many internal small bugfixes.
426And fix of the "big" bug in KO/Pi, 428And fix of the "big" bug in KO/Pi,
427that after Syncing the appointments had an offset by several hours. 429that after Syncing the appointments had an offset by several hours.
428That was a problem with the internal timezone setting, 430That was a problem with the internal timezone setting,
429introduced by the changed timezone configuration settings. 431introduced by the changed timezone configuration settings.
430 432
431German translation for OM/Pi is now available. 433German translation for OM/Pi is now available.
432 434
433 435
434********** VERSION 1.9.9 ************ 436********** VERSION 1.9.9 ************
435 437
436KDE-Pim/Pi has a new Member! 438KDE-Pim/Pi has a new Member!
437It is called PWM/Pi (Passwordmanager/platform-independent) 439It is called PWM/Pi (Passwordmanager/platform-independent)
438and it is available for the Zaurus. 440and it is available for the Zaurus.
439It is planned, that it will be available later for Windows. 441It is planned, that it will be available later for Windows.
440(And for Linux, of course). 442(And for Linux, of course).
441It is a port of the Passwordmanager of KDE. 443It is a port of the Passwordmanager of KDE.
442It will need the MicroKDElibs to run. 444It will need the MicroKDElibs to run.
443 445
444Made loading of addressbooks in KA/Pi up to 7 times faster! 446Made loading of addressbooks in KA/Pi up to 7 times faster!
445The bigger your addressbook file, the more starting speed 447The bigger your addressbook file, the more starting speed
446will you gain. (relatively) 448will you gain. (relatively)
447 449
448The Qtopia addressbook connector is now platform independend 450The Qtopia addressbook connector is now platform independend
449as well and should work on any platform for importing/exporting 451as well and should work on any platform for importing/exporting
450Qtopia and Opie XML files. 452Qtopia and Opie XML files.
451 453
452Added a +30min feature to the timezone settings to make 454Added a +30min feature to the timezone settings to make
453KDE-Pim/Pi useable in Australia and other parts on the 455KDE-Pim/Pi useable in Australia and other parts on the
454world with strange timezones ;-) 456world with strange timezones ;-)
455 457
456German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 458German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
457 459
458It is now possible to disable the 460It is now possible to disable the
459"receive data via infrared" feature, such that syncing with 461"receive data via infrared" feature, such that syncing with
460Outlook is now possible again with Kx/Pi runing. 462Outlook is now possible again with Kx/Pi runing.
461Please disable it, before syncing Sharp DTM with Outlook. 463Please disable it, before syncing Sharp DTM with Outlook.
462For your convenience, the "receive data via infrared" feature 464For your convenience, the "receive data via infrared" feature
463is disabled automatically, if you sync Kx/Pi with DTM. 465is disabled automatically, if you sync Kx/Pi with DTM.
464You have to enable it again manually after syncing. 466You have to enable it again manually after syncing.
465Enabling this feature makes it impossible to start the 467Enabling this feature makes it impossible to start the
466Sharp DTM apps. If this feature is enabled, you will only get the 468Sharp DTM apps. If this feature is enabled, you will only get the
467alarm notification from KO/Pi and not from the Sharp calendar. 469alarm notification from KO/Pi and not from the Sharp calendar.
468This is very useful if you sync KO/Pi with Sharp DTM, 470This is very useful if you sync KO/Pi with Sharp DTM,
469because after syncing you usually would get notified about 471because after syncing you usually would get notified about
470an alarm by KO/Pi and the Sharp Calendar. 472an alarm by KO/Pi and the Sharp Calendar.
471 473
472Together with the Linux desktop version of KO/Pi 474Together with the Linux desktop version of KO/Pi
473it is now possible to sync KO/Pi on the Zaurus 475it is now possible to sync KO/Pi on the Zaurus
474with the complete KDE-desktop (3.3 or later) 476with the complete KDE-desktop (3.3 or later)
475calendar data easily. 477calendar data easily.
476That makes it possible to sync the Z with one 478That makes it possible to sync the Z with one
477click of a mouse with the KDE-Desktop. 479click of a mouse with the KDE-Desktop.
478This feature it available for all Zaurus platforms KO/Pi 480This feature it available for all Zaurus platforms KO/Pi
479is running on. 481is running on.
480The only thing needed is a running KO/Pi on Linux and 482The only thing needed is a running KO/Pi on Linux and
481a compiled version of the small 483a compiled version of the small
482KDE-Pim/Pi<->KDE-Desktop access command line program, 484KDE-Pim/Pi<->KDE-Desktop access command line program,
483which is in the KDE-Pim/Pi sources available. 485which is in the KDE-Pim/Pi sources available.
484 486
485The "KDE-desktop" syncing feature for KA/Pi will follow 487The "KDE-desktop" syncing feature for KA/Pi will follow
486in the next releases. 488in the next releases.
487 489
488Fixed the vcard export bug, which had the version 1.9.8. 490Fixed the vcard export bug, which had the version 1.9.8.
489 491
490Added missing GERMAN translation to KO/Pi. 492Added missing GERMAN translation to KO/Pi.
491Hi PsionX, could you add the missing french translation?Thx! 493Hi PsionX, could you add the missing french translation?Thx!
492 494
493Translation files for KA/Pi are available as well. 495Translation files for KA/Pi are available as well.
494GERMAN translation will be available in the next release. 496GERMAN translation will be available in the next release.
495PsionX ( yres, you again ;-) ), could you start translating 497PsionX ( yres, you again ;-) ), could you start translating
496KA/Pi? Thx! 498KA/Pi? Thx!
497 499
498You can download the version 1.9.9 at 500You can download the version 1.9.9 at
499 501
500http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 502http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
501 503
502Note: 504Note:
503To run the mail program OM/Pi you need libopenssl. 505To run the mail program OM/Pi you need libopenssl.
504A link to a download loaction is available at 506A link to a download loaction is available at
505ZSI at www.killefiz.de 507ZSI at www.killefiz.de
506 508
507 509
508********** VERSION 1.9.8 ************ 510********** VERSION 1.9.8 ************
509 511
510Fixed character decoding in OM/Pi. 512Fixed character decoding in OM/Pi.
511(e.g. German "Umlaute" were not displayed properly.) 513(e.g. German "Umlaute" were not displayed properly.)
512 514
513Made is possible to reparent todos in KO/Pi. 515Made is possible to reparent todos in KO/Pi.
514Use contextmenu or keys (look at Help-Keys + Colors) for that. 516Use contextmenu or keys (look at Help-Keys + Colors) for that.
515 517
516Added the missing Sync-Howto and WhatsNew to the packages. 518Added the missing Sync-Howto and WhatsNew to the packages.
517 519
518KO/Pi on Linux desktop can now sync with KDE desktop. 520KO/Pi on Linux desktop can now sync with KDE desktop.
519That means: When using KO/Pi on Linux desktop for syncing with 521That means: When using KO/Pi on Linux desktop for syncing with
520KDE desktop and the Zaurus, the Zaurus can be synced now 522KDE desktop and the Zaurus, the Zaurus can be synced now
521with all KDE-Calendar resources, not only with one local file. 523with all KDE-Calendar resources, not only with one local file.
522(That makes it possible to sync the Zaurus with the 524(That makes it possible to sync the Zaurus with the
523calendar data on a Kolab server) 525calendar data on a Kolab server)
524 526
525KA/Pi syncing with KDE desktop will be available in the next version. 527KA/Pi syncing with KDE desktop will be available in the next version.
526 528
527 529
528********** VERSION 1.9.7 ************ 530********** VERSION 1.9.7 ************
529 531
530KO/Pi - KA/Pi on Windows: 532KO/Pi - KA/Pi on Windows:
531Now a directory can be defined by the user, where the 533Now a directory can be defined by the user, where the
532application/config data should be saved. 534application/config data should be saved.
533 Define your desired path in the evironment variable 535 Define your desired path in the evironment variable
534 MICROKDEHOME 536 MICROKDEHOME
535 before starting KO/Pi or KA/Pi. 537 before starting KO/Pi or KA/Pi.
536 538
537An easy Kx/Pi to Kx/Pi syncing is now possible 539An easy Kx/Pi to Kx/Pi syncing is now possible
538(it is called Pi-Sync) via network. 540(it is called Pi-Sync) via network.
539Please look at the Sync Howto. 541Please look at the Sync Howto.
540 542
541Exporting of calendar data and contacts to mobile phones is now possible. 543Exporting of calendar data and contacts to mobile phones is now possible.
542The SyncHowto is updated with information howto 544The SyncHowto is updated with information howto
543access/sync mobile phones. 545access/sync mobile phones.
544Please look at the Sync Howto. 546Please look at the Sync Howto.
545 547
546Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 548Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
547Please disable Fastload for the original contact/calendar applications 549Please disable Fastload for the original contact/calendar applications
548and close them. 550and close them.
549KO/Pi and KA/Pi must be running in order to receive the data. 551KO/Pi and KA/Pi must be running in order to receive the data.
550(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 552(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
551 553
552In the KA/Pi details view are now the preferred tel. numbers displayed on top 554In the KA/Pi details view are now the preferred tel. numbers displayed on top
553of the other data ( emails/tel.numbers/addresses) 555of the other data ( emails/tel.numbers/addresses)
554 556
555Fixed some syncing problems in KA/Pi. 557Fixed some syncing problems in KA/Pi.
556 558
557Added font settings for the KA/Pi details view. 559Added font settings for the KA/Pi details view.
558Added fields "children's name" and "gender" to KA/Pi. 560Added fields "children's name" and "gender" to KA/Pi.
559 561
560Made searching in KA/Pi better: 562Made searching in KA/Pi better:
561Now the first item in a view is selected after a search automatically and 563Now the first item in a view is selected after a search automatically and
562the views can be scrolled up/down when the search input field has the keyboard focus. 564the views can be scrolled up/down when the search input field has the keyboard focus.
563 565
564And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 566And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
565 567
566 568
567********** VERSION 1.9.6 ************ 569********** VERSION 1.9.6 ************
568 570
569Changes in the external application communication on the Zaurus 571Changes in the external application communication on the Zaurus
570in order to use less RAM when the apps are running. 572in order to use less RAM when the apps are running.
571First syncing of addressbooks (KA/Pi) is possible. 573First syncing of addressbooks (KA/Pi) is possible.
572 574
573 575
574********** VERSION 1.9.5a ************ 576********** VERSION 1.9.5a ************
575 577
576Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 578Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
577Fixed some small bugs. 579Fixed some small bugs.
578KA/Pi shows now the birthday in summary view. 580KA/Pi shows now the birthday in summary view.
579Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 581Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
580for displaying dates. 582for displaying dates.
581 583
582 584
583********** VERSION 1.9.5 ************ 585********** VERSION 1.9.5 ************
584 586
585There is still no Addressbook syncing! 587There is still no Addressbook syncing!
586 588
587New in 1.9.5: 589New in 1.9.5:
588 590
589Many bugfixes. 591Many bugfixes.
590Better searching in KA/Pi. 592Better searching in KA/Pi.
591You can configure in KA/Pi if you want to search only after 593You can configure in KA/Pi if you want to search only after
592<return> key pressed. 594<return> key pressed.
593 595
594Better mail downloading in OM/Pi. 596Better mail downloading in OM/Pi.
595 597
596First experimental alpha version of sync of KO/Pi with mobile phones. 598First experimental alpha version of sync of KO/Pi with mobile phones.
597See gammu documentation for supported phones. 599See gammu documentation for supported phones.
598You 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. 600You 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.
599Quick hint how to use: 601Quick hint how to use:
600NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 602NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
601Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 603Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
602Create syncprofile - mobile device 604Create syncprofile - mobile device
603Remove entry for model. (Leave empty ). 605Remove entry for model. (Leave empty ).
604Enable infrared on Zaurus and your Phone. 606Enable infrared on Zaurus and your Phone.
605Sync. 607Sync.
606To get a more detailed log, start kopi from konsole. 608To get a more detailed log, start kopi from konsole.
607 609
608********** VERSION 1.9.4 ************ 610********** VERSION 1.9.4 ************
609 611
610This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 612This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
611 613
612WARNING: 614WARNING:
613PLEASE BACKUP ALL YOUR DATA! 615PLEASE BACKUP ALL YOUR DATA!
614We have changed a lot and maybe there are some unknown problems. 616We have changed a lot and maybe there are some unknown problems.
615 617
616SYNC HANDLING HAS CHANGED! 618SYNC HANDLING HAS CHANGED!
617Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 619Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
618(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 620(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
619 621
620You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 622You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
621If 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. 623If 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.
622 624
623As programs are available: 625As programs are available:
624KO/Pi (korganizer ipk) - a calendar program. 626KO/Pi (korganizer ipk) - a calendar program.
625KA/Pi (kaddressbook ipk ) - an addressbook 627KA/Pi (kaddressbook ipk ) - an addressbook
626OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 628OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
627 629
628An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 630An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
629(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 631(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
630 632
631All the applications are installed in a "Pim" TAB. 633All the applications are installed in a "Pim" TAB.
632If 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 634If 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
633 635
634All the application are integrated. 636All the application are integrated.
635Such 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. 637Such 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.
636 638
637HINT: 639HINT:
638If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 640If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
639 641
640What's new? 642What's new?
641 643
642SYNC HANDLING HAS CHANGED! 644SYNC HANDLING HAS CHANGED!
643Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 645Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
644(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 646(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
645 647
646New in OM/Pi: 648New in OM/Pi:
647When 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. 649When 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.
648 650
649New in KO/Pi: 651New in KO/Pi:
650French is now available for KO/Pi. 652French is now available for KO/Pi.
651Choose menu:Actions - Configure:TAB locale 653Choose menu:Actions - Configure:TAB locale
652Syncing has changed. 654Syncing has changed.
653Phone sync available soon. 655Phone sync available soon.
654Not much changes, I cannot remember them ... 656Not much changes, I cannot remember them ...
655 657
656New in KA/Pi: 658New in KA/Pi:
657Beaming possible. 659Beaming possible.
658Sharp DTM readonly access possible( create a new DTM resource ); 660Sharp DTM readonly access possible( create a new DTM resource );
659Better searching possible. 661Better searching possible.
660Search is performed only after pressing the return key. 662Search is performed only after pressing the return key.
661Use wildcard * to specify parts of a name. 663Use wildcard * to specify parts of a name.
662 664
663Better 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 * . 665Better 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 * .
664 666
665A big improvement is the new management of the contact access. 667A big improvement is the new management of the contact access.
666In version 1.9.3, every application was using their own addressbook access data. 668In version 1.9.3, every application was using their own addressbook access data.
667That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 669That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
668That was wasting of memory, if you had several hundreds of contacts. 670That was wasting of memory, if you had several hundreds of contacts.
669 671
670Now only KA/Pi accesses the addressbook. 672Now only KA/Pi accesses the addressbook.
671If 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. 673If 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.
672If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 674If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
673That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 675That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
674 676
675New in the KO/Pi alarm applet: 677New in the KO/Pi alarm applet:
676Configure your own timer popup menu! 678Configure your own timer popup menu!
677(Text and minutes for timer countdown) 679(Text and minutes for timer countdown)
678Just edit the file 680Just edit the file
679(yourhomedir)/.kopialarmtimerrc 681(yourhomedir)/.kopialarmtimerrc
680and start/stop a timer to get a new menu with the data of this file. 682and start/stop a timer to get a new menu with the data of this file.
681 683
682********** VERSION 1.9.3 ************ 684********** VERSION 1.9.3 ************
6831) 6851)
684Now KO/Pi on Windows imports directly the calendar data of 686Now KO/Pi on Windows imports directly the calendar data of
685an installed Outlook. Should work with OL version >= 2000. 687an installed Outlook. Should work with OL version >= 2000.
686 688
687********** VERSION 1.9.2 ************ 689********** VERSION 1.9.2 ************
6881) 6901)
689KDE-Pim/Pi has got a new member: 691KDE-Pim/Pi has got a new member:
690KmicroMail (KM/Pi) is a mail program, 692KmicroMail (KM/Pi) is a mail program,
691which can handle IMAP and POP mail access. 693which can handle IMAP and POP mail access.
692It is based on Opie-Mail v3. 694It is based on Opie-Mail v3.
693All dependencies to the Opie libraries ar removed, 695All dependencies to the Opie libraries ar removed,
694such that no additional Opie lib is needed. 696such that no additional Opie lib is needed.
695It is already integrated in KO/Pi and KA/Pi. 697It is already integrated in KO/Pi and KA/Pi.
696It it now available for the Zaurus,probably it 698It it now available for the Zaurus,probably it
697will be available for other platforms later. 699will be available for other platforms later.
698Hint: 700Hint:
699Create your own contact (name + email) 701Create your own contact (name + email)
700in KA/Pi, select this contact and choose menu: 702in KA/Pi, select this contact and choose menu:
701Settings - Set Who Am I. 703Settings - Set Who Am I.
702Now the settings of this contact are used as 704Now the settings of this contact are used as
703the sender data in KM/Pi. 705the sender data in KM/Pi.
7042) 7062)
705KDE-Pim/Pi is split up in five different 707KDE-Pim/Pi is split up in five different
706packages now precompiled for Sharp Zaurus: 708packages now precompiled for Sharp Zaurus:
707--kmicrokdelibs_1.9.2_arm.ipk 709--kmicrokdelibs_1.9.2_arm.ipk
708The libs are needed for any 710The libs are needed for any
709of the following programs: 711of the following programs:
710--kaddressbook_1.9.2_arm.ipk 712--kaddressbook_1.9.2_arm.ipk
711--kmicromail_1.9.2_arm.ipk 713--kmicromail_1.9.2_arm.ipk
712--korganizer_1.9.2_arm.ipk 714--korganizer_1.9.2_arm.ipk
713Independ from that, there is the alarm applet 715Independ from that, there is the alarm applet
714available for KO/Pi, which also offers 716available for KO/Pi, which also offers
715quick access for a new mail or 717quick access for a new mail or
716showing the addressbook.: 718showing the addressbook.:
717--korganizer-alarm_1.9.2_arm.ipk 719--korganizer-alarm_1.9.2_arm.ipk
718Independend means, that the alarm applet 720Independend means, that the alarm applet
719does not need any of the libs or programs above to run. 721does not need any of the libs or programs above to run.
720But it would be quite useless without these programs. 722But it would be quite useless without these programs.
721NOTE: 723NOTE:
722If you get a 724If you get a
723"This application depends on other programs" 725"This application depends on other programs"
724during installation of 726during installation of
725--kmicrokdelibs_1.9.2_arm.ipk 727--kmicrokdelibs_1.9.2_arm.ipk
726you probably do not have to care about that. 728you probably do not have to care about that.
727kmicrokdelibs_1.9.2 will come with some 729kmicrokdelibs_1.9.2 will come with some
728resource plugins, which needs additional libraries. 730resource plugins, which needs additional libraries.
729(E.g. libopie1, if you want to use the 731(E.g. libopie1, if you want to use the
730opie resource connector in KA/Pi). 732opie resource connector in KA/Pi).
731If you do not have this libraries installed, 733If you do not have this libraries installed,
732you simply cannot use the resource. 734you simply cannot use the resource.
733To make it clear: 735To make it clear:
734If the libraries are missing, the applications 736If the libraries are missing, the applications
735using kmicrokdelibs will start, 737using kmicrokdelibs will start,
736because the resources are plugins. 738because the resources are plugins.
7373) 7393)
738KO/Pi and friends are now installable on SD-Card! 740KO/Pi and friends are now installable on SD-Card!
739It is recommended to install all libs and apps 741It is recommended to install all libs and apps
740on the SD card or all in the internal storage. 742on the SD card or all in the internal storage.
741There may be problems, if this is mixed. 743There may be problems, if this is mixed.
7424) 7444)
743Fixed two bugs in the alarm notification on Windows. 745Fixed two bugs in the alarm notification on Windows.
7445) 7465)
745Great improvement! 747Great improvement!
746KO/Pi uses now the latest version of libical. 748KO/Pi uses now the latest version of libical.
747Libical is the library which actually reads 749Libical is the library which actually reads
748the calendar files and extract the data from it. 750the calendar files and extract the data from it.
749With the old version, there were problems 751With the old version, there were problems
750(crashes or program hangs) when licical did read 752(crashes or program hangs) when licical did read
751files, which were not stored from KO/Pi. 753files, which were not stored from KO/Pi.
752I do not know, if the new libical works perfect, 754I do not know, if the new libical works perfect,
753but actually it works much better than 755but actually it works much better than
754the old version. 756the old version.
755There are no problems with compatibility with 757There are no problems with compatibility with
756old calendar files of KO/Pi, of course! 758old calendar files of KO/Pi, of course!
7576) 7596)
758New in KA/Pi: 760New in KA/Pi:
759Opie addressbook resource connector available! 761Opie addressbook resource connector available!
760You will need libopie1 and the opie addressbook, 762You will need libopie1 and the opie addressbook,
761of course. 763of course.
762With the Opie addressbook resource connector, 764With the Opie addressbook resource connector,
763you can access the Opie addressbook readonly in KA/Pi. 765you can access the Opie addressbook readonly in KA/Pi.
764If you want to edit or import the data into KA/Pi, 766If you want to edit or import the data into KA/Pi,
765do this: 767do this:
766a) Create an Opie resource. 768a) Create an Opie resource.
767 (Menu: Settings-Configure Resources). 769 (Menu: Settings-Configure Resources).
768After configuration and restarting KA/Pi you should see 770After configuration and restarting KA/Pi you should see
769the Opie contacts in KA/Pi. 771the Opie contacts in KA/Pi.
770b) Select some or all Opie contacts. 772b) Select some or all Opie contacts.
771(NOTE: +++++ 773(NOTE: +++++
772To know exactly, what contacts are Opie contacts, 774To know exactly, what contacts are Opie contacts,
773do this: Choose menu: 775do this: Choose menu:
774View-Modify View - TAB Fields. 776View-Modify View - TAB Fields.
775Select in the above list "Resource" and click 777Select in the above list "Resource" and click
776down arrow to add it to the "Selected fields". 778down arrow to add it to the "Selected fields".
777Click OK. 779Click OK.
778Now you have a new column "Resource" in your list, 780Now you have a new column "Resource" in your list,
779where you can see, what an Opie resource is. 781where you can see, what an Opie resource is.
780++++ NOTE end.) 782++++ NOTE end.)
781Ok, we do have now some Opie contacts seleted. 783Ok, we do have now some Opie contacts seleted.
782(Use SHIFT or CTRL key in order to multiple select). 784(Use SHIFT or CTRL key in order to multiple select).
783c) Choose menu: Edit-Copy. 785c) Choose menu: Edit-Copy.
784d) Choose menu: Edit-Paste. 786d) Choose menu: Edit-Paste.
785e) Select the resource, you want to add the contacts to. 787e) Select the resource, you want to add the contacts to.
786Congrats! Now you have read/write access to the copied 788Congrats! Now you have read/write access to the copied
787opie contacts as "real" KA/Pi contacts. 789opie contacts as "real" KA/Pi contacts.
788 790
789 791
790********** VERSION 1.9.1 ************ 792********** VERSION 1.9.1 ************
7911) 7931)
792 +++ IMPORTANT 1 +++ 794 +++ IMPORTANT 1 +++
793 795
794The storing place of the default calendar 796The storing place of the default calendar
795file has changed! 797file has changed!
796The default calendar file was 798The default calendar file was
797Applications/korganizer/mycalendar.ics 799Applications/korganizer/mycalendar.ics
798on Zaurus and 800on Zaurus and
799(yourHomeDir)/korganizer/mycalendar.ics 801(yourHomeDir)/korganizer/mycalendar.ics
800on Windows/Linux desktop. Now it is 802on Windows/Linux desktop. Now it is
801(yourHomeDir)/kdepim/korganizer/mycalendar.ics 803(yourHomeDir)/kdepim/korganizer/mycalendar.ics
802on Zaurus, Windows and Linux. 804on Zaurus, Windows and Linux.
803To load the old file, choose menu 805To load the old file, choose menu
804File-Load calendar backup. 806File-Load calendar backup.
805(It should be loaded automatically 807(It should be loaded automatically
806at startup with a warning message displayed). 808at startup with a warning message displayed).
807The place of the configuration file has changed too. 809The place of the configuration file has changed too.
808If you want to use your old KO/Pi config, 810If you want to use your old KO/Pi config,
809copy it to 811copy it to
810(yourHomeDir)/kdepim/config/korganizerrc 812(yourHomeDir)/kdepim/config/korganizerrc
811Please read VERSION 1.9.0 - topic 3) as well! 813Please read VERSION 1.9.0 - topic 3) as well!
812 814
813 +++ IMPORTANT 2 +++ 815 +++ IMPORTANT 2 +++
814 816
815Because of the new paths, you will need 817Because of the new paths, you will need
816a new version of the KO/Pi alarm applet 818a new version of the KO/Pi alarm applet
817for Zaurus. 819for Zaurus.
818Use version >= 1.9.1 820Use version >= 1.9.1
819 821
8202) 8222)
821Now the QWhat'sThis Icon works for items 823Now the QWhat'sThis Icon works for items
822in the month view as well. 824in the month view as well.
823(See VERSION 1.7.8 Topic 1) ). 825(See VERSION 1.7.8 Topic 1) ).
8243) 8263)
825You can import birtsdays/anniversaries 827You can import birtsdays/anniversaries
826from KA/Pi into KO/Pi. 828from KA/Pi into KO/Pi.
827Choose menu File-Import birthdays. 829Choose menu File-Import birthdays.
828If you import twice, already imported items 830If you import twice, already imported items
829will not be imported again, if they 831will not be imported again, if they
830have not been changed in KO/Pi. 832have not been changed in KO/Pi.
8314) 8334)
832When syncing with sharp DTM, now a progress 834When syncing with sharp DTM, now a progress
833is shown, when the data is written back. 835is shown, when the data is written back.
834If there is much data in KO/Pi and no data 836If there is much data in KO/Pi and no data
835in DTM, that can take a long time. 837in DTM, that can take a long time.
836(But only for the first time ). 838(But only for the first time ).
8375) 8395)
838In the search dialog, you can search 840In the search dialog, you can search
839now for the name/email of an attendee 841now for the name/email of an attendee
840of an event/todo. 842of an event/todo.
841To get more space for displaying 843To get more space for displaying
842search results, the buttons 844search results, the buttons
843for "search" and "close" on the 845for "search" and "close" on the
844bottom are removed in the PDA version. 846bottom are removed in the PDA version.
845You have to click OK in the top right 847You have to click OK in the top right
846corner to do a search. 848corner to do a search.
8476) 8496)
848Now it is possible to disable the displaying 850Now it is possible to disable the displaying
849of todo items in the Allday part of the Agenda. 851of todo items in the Allday part of the Agenda.
850Choose Menu Action-Configure, 852Choose Menu Action-Configure,
851TAB Todo View, checkbox 853TAB Todo View, checkbox
852"Allday Agenda view shows todos" 854"Allday Agenda view shows todos"
8537) 8557)
854If FastLoad is enabled, now the settings and the 856If FastLoad is enabled, now the settings and the
855calendar data are saved, when KO/Pi is closed. 857calendar data are saved, when KO/Pi is closed.
856(If no Fastload is enabled, KO/Pi saves 858(If no Fastload is enabled, KO/Pi saves
857the data as well, of course) 859the data as well, of course)
8588) 8608)
859The Agenda View has a minimize-splitter now, 861The Agenda View has a minimize-splitter now,
860such that the height of the allday part can be 862such that the height of the allday part can be
861changed quickly. 863changed quickly.
862 864
863********** VERSION 1.9.0 ************ 865********** VERSION 1.9.0 ************
8641) 8661)
865KO/Pi is now merged with the new microKDE from KA/Pi. 867KO/Pi is now merged with the new microKDE from KA/Pi.
866KO/Pi accesses now KA/Pi as the addressbook. 868KO/Pi accesses now KA/Pi as the addressbook.
867The other ddressbook-plugins are not working any longer. 869The other ddressbook-plugins are not working any longer.
868(It is planned, that later KA/Pi itself uses these plugins) 870(It is planned, that later KA/Pi itself uses these plugins)
869New versions of KO/Pi are only available 871New versions of KO/Pi are only available
870together with KA/Pi as the KDE-Pim/Pi package. 872together with KA/Pi as the KDE-Pim/Pi package.
8712) 8732)
872If you click on an attendee of a meeting in the 874If you click on an attendee of a meeting in the
873event viewer, a detailed summary of the 875event viewer, a detailed summary of the
874attendee is shown. 876attendee is shown.
8753) 8773)
876The place of the configuration file has changed. 878The place of the configuration file has changed.
877If you want to use your old KO/Pi config, copy 879If you want to use your old KO/Pi config, copy
878Applications/korganizer/config_korganizerrc 880Applications/korganizer/config_korganizerrc
879to 881to
880Applications/korganizer/config/korganizerrc 882Applications/korganizer/config/korganizerrc
881 883
882********** VERSION 1.7.8 ************ 884********** VERSION 1.7.8 ************
8831) 8851)
884Now the QWhat'sThis ist working. 886Now the QWhat'sThis ist working.
885Enable the QWhat'sThis icon in the toolbar. 887Enable the QWhat'sThis icon in the toolbar.
886(You have to restart to reload the changed toolbar config). 888(You have to restart to reload the changed toolbar config).
887Now click on the QWhat'sThis Icon 889Now click on the QWhat'sThis Icon
888in the top right corner of KO/Pi. 890in the top right corner of KO/Pi.
889Then click on an item in the Agenda View: 891Then click on an item in the Agenda View:
890You will get a detailed display of the items content. 892You will get a detailed display of the items content.
8912) 8932)
892Some other very minor changes. 894Some other very minor changes.
893But I have forgotten the details ... 895But I have forgotten the details ...
894For that reason I start this log here: 896For that reason I start this log here:
895To document my changes, when I am doing it. 897To document my changes, when I am doing it.
896 898
897********** VERSION 1.7.7 ************ 899********** VERSION 1.7.7 ************
898Stable Version of KO/Pi 900Stable Version of KO/Pi
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9c1e4c3..daa37fd 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1,1425 +1,1532 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21#include <qfont.h> 21#include <qfont.h>
22#include <qfontmetrics.h> 22#include <qfontmetrics.h>
23#include <qkeycode.h> 23#include <qkeycode.h>
24#include <qhbox.h> 24#include <qhbox.h>
25#include <qvbox.h> 25#include <qvbox.h>
26#include <qwidgetstack.h>
26#include <qpushbutton.h> 27#include <qpushbutton.h>
27#include <qtooltip.h> 28#include <qtooltip.h>
28#include <qpainter.h> 29#include <qpainter.h>
29#include <qwhatsthis.h> 30#include <qwhatsthis.h>
30#ifndef DESKTOP_VERSION 31#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
32#else 33#else
33#include <qapplication.h> 34#include <qapplication.h>
34#endif 35#endif
35 36
36#include <kdebug.h> 37#include <kdebug.h>
37#include <klocale.h> 38#include <klocale.h>
38#include <kglobal.h> 39#include <kglobal.h>
39#include <kconfig.h> 40#include <kconfig.h>
40#include <kiconloader.h> 41#include <kiconloader.h>
41 42
42#include <kcalendarsystem.h> 43#include <kcalendarsystem.h>
43 44
44#ifndef KORG_NOPRINTER 45#ifndef KORG_NOPRINTER
45#include "calprinter.h" 46#include "calprinter.h"
46#endif 47#endif
47#include "koprefs.h" 48#include "koprefs.h"
48#ifndef KORG_NOPLUGINS 49#ifndef KORG_NOPLUGINS
49#include "kocore.h" 50#include "kocore.h"
50#endif 51#endif
51#include "koglobals.h" 52#include "koglobals.h"
52#include <libkcal/kincidenceformatter.h> 53#include <libkcal/kincidenceformatter.h>
53 54
54#include "komonthview.h" 55#include "komonthview.h"
55 56
56#define PIXMAP_SIZE 5 57#define PIXMAP_SIZE 5
57#ifdef DESKTOP_VERSION 58#ifdef DESKTOP_VERSION
58QToolTipGroup *MonthViewCell::mToolTipGroup = 0; 59QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
59#endif 60#endif
60class KNOWhatsThis :public QWhatsThis 61class KNOWhatsThis :public QWhatsThis
61{ 62{
62public: 63public:
63 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; 64 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
64 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; 65 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
65 66
66protected: 67protected:
67 virtual QString text( const QPoint& p) 68 virtual QString text( const QPoint& p)
68 { 69 {
69 return _wid->getWhatsThisText(p) ; 70 return _wid->getWhatsThisText(p) ;
70 }; 71 };
71private: 72private:
72 KNoScrollListBox* _wid; 73 KNoScrollListBox* _wid;
73 74
74}; 75};
75 76
76 77
77KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 78KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
78 : QListBox(parent, name, WRepaintNoErase) 79 : QListBox(parent, name, WRepaintNoErase)
79{ 80{
80#ifndef DESKTOP_VERSION 81#ifndef DESKTOP_VERSION
81 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 82 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
82#endif 83#endif
83 mWT = new KNOWhatsThis(this); 84 mWT = new KNOWhatsThis(this);
84} 85}
85KNoScrollListBox::~KNoScrollListBox() 86KNoScrollListBox::~KNoScrollListBox()
86{ 87{
87 88
88} 89}
89QString KNoScrollListBox::getWhatsThisText(QPoint p) 90QString KNoScrollListBox::getWhatsThisText(QPoint p)
90{ 91{
91 QListBoxItem* item = itemAt ( p ); 92 QListBoxItem* item = itemAt ( p );
92 if ( ! item ) { 93 if ( ! item ) {
93 return i18n("Click in the cell\nto add an event!"); 94 return i18n("Click in the cell\nto add an event!");
94 } 95 }
95 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); 96 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence());
96} 97}
97void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 98void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
98{ 99{
99 100
100 switch(e->key()) { 101 switch(e->key()) {
101 case Key_Right: 102 case Key_Right:
102 // if ( e->state() == Qt::ControlButton ) 103 // if ( e->state() == Qt::ControlButton )
103 { 104 {
104 e->ignore(); 105 e->ignore();
105 return; 106 return;
106 } 107 }
107 scrollBy(4,0); 108 scrollBy(4,0);
108 break; 109 break;
109 case Key_Left: 110 case Key_Left:
110 // if ( e->state() == Qt::ControlButton ) 111 // if ( e->state() == Qt::ControlButton )
111 { 112 {
112 e->ignore(); 113 e->ignore();
113 return; 114 return;
114 } 115 }
115 scrollBy(-4,0); 116 scrollBy(-4,0);
116 break; 117 break;
117 case Key_Up: 118 case Key_Up:
118 if(count() < 2) { 119 if(count() < 2) {
119 e->ignore(); 120 e->ignore();
120 break; 121 break;
121 } 122 }
122 setCurrentItem((currentItem()+count()-1)%count()); 123 setCurrentItem((currentItem()+count()-1)%count());
123 if(!itemVisible(currentItem())) { 124 if(!itemVisible(currentItem())) {
124 if((unsigned int) currentItem() == (count()-1)) { 125 if((unsigned int) currentItem() == (count()-1)) {
125 setTopItem(currentItem()-numItemsVisible()+1); 126 setTopItem(currentItem()-numItemsVisible()+1);
126 } else { 127 } else {
127 setTopItem(topItem()-1); 128 setTopItem(topItem()-1);
128 } 129 }
129 } 130 }
130 break; 131 break;
131 case Key_Down: 132 case Key_Down:
132 if(count() < 2) { 133 if(count() < 2) {
133 e->ignore(); 134 e->ignore();
134 break; 135 break;
135 } 136 }
136 setCurrentItem((currentItem()+1)%count()); 137 setCurrentItem((currentItem()+1)%count());
137 if(!itemVisible(currentItem())) { 138 if(!itemVisible(currentItem())) {
138 if(currentItem() == 0) { 139 if(currentItem() == 0) {
139 setTopItem(0); 140 setTopItem(0);
140 } else { 141 } else {
141 setTopItem(topItem()+1); 142 setTopItem(topItem()+1);
142 } 143 }
143 } 144 }
144 break; 145 break;
145 case Key_Shift: 146 case Key_Shift:
146 emit shiftDown(); 147 emit shiftDown();
147 break; 148 break;
148 default: 149 default:
149 e->ignore(); 150 e->ignore();
150 break; 151 break;
151 } 152 }
152} 153}
153 154
154void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 155void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
155{ 156{
156 switch(e->key()) { 157 switch(e->key()) {
157 case Key_Shift: 158 case Key_Shift:
158 emit shiftUp(); 159 emit shiftUp();
159 break; 160 break;
160 default: 161 default:
161 break; 162 break;
162 } 163 }
163} 164}
164 165
165void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 166void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
166{ 167{
167 QListBox::mousePressEvent(e); 168 QListBox::mousePressEvent(e);
168 169
169 if(e->button() == RightButton) { 170 if(e->button() == RightButton) {
170 emit rightClick(); 171 emit rightClick();
171 } 172 }
172} 173}
173 174
174MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) 175MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
175 : QListBoxItem() 176 : QListBoxItem()
176{ 177{
177 setText( s ); 178 setText( s );
178 179
179 mIncidence = incidence; 180 mIncidence = incidence;
180 mDate = qd; 181 mDate = qd;
181 // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); 182 // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
182 mRecur = false; 183 mRecur = false;
183 mAlarm = false; 184 mAlarm = false;
184 mReply = false; 185 mReply = false;
185 mInfo = false; 186 mInfo = false;
186} 187}
187 188
188void MonthViewItem::paint(QPainter *p) 189void MonthViewItem::paint(QPainter *p)
189{ 190{
190#if QT_VERSION >= 0x030000 191#if QT_VERSION >= 0x030000
191 bool sel = isSelected(); 192 bool sel = isSelected();
192#else 193#else
193 bool sel = selected(); 194 bool sel = selected();
194#endif 195#endif
195 196
196 197
197 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) 198 if (KOPrefs::instance()->mMonthViewUsesCategoryColor)
198 { 199 {
199 p->setBackgroundColor( palette().color( QPalette::Normal, \ 200 p->setBackgroundColor( palette().color( QPalette::Normal, \
200 sel ? QColorGroup::Highlight : QColorGroup::Background ) ); 201 sel ? QColorGroup::Highlight : QColorGroup::Background ) );
201 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); 202 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) );
202 } 203 }
203 int x = 1; 204 int x = 1;
204 int y = 3;//(height() - mRecurPixmap.height()) /2; 205 int y = 3;//(height() - mRecurPixmap.height()) /2;
205 int size = PIXMAP_SIZE; 206 int size = PIXMAP_SIZE;
206 if ( QApplication::desktop()->width() < 300 ) 207 if ( QApplication::desktop()->width() < 300 )
207 size = 3; 208 size = 3;
208 if ( KOPrefs::instance()->mMonthShowIcons ) { 209 if ( KOPrefs::instance()->mMonthShowIcons ) {
209 if ( mInfo ) { 210 if ( mInfo ) {
210 p->fillRect ( x, y,size,size, Qt::darkGreen ); 211 p->fillRect ( x, y,size,size, Qt::darkGreen );
211 x += size + 1; 212 x += size + 1;
212 } 213 }
213 if ( mRecur ) { 214 if ( mRecur ) {
214 p->fillRect ( x, y,size,size, Qt::blue ); 215 p->fillRect ( x, y,size,size, Qt::blue );
215 x += size + 1; 216 x += size + 1;
216 } 217 }
217 if ( mAlarm ) { 218 if ( mAlarm ) {
218 p->fillRect ( x, y,size,size, Qt::red ); 219 p->fillRect ( x, y,size,size, Qt::red );
219 x += size + 1; 220 x += size + 1;
220 } 221 }
221 if ( mReply ) { 222 if ( mReply ) {
222 p->fillRect ( x, y,size,size, Qt::yellow ); 223 p->fillRect ( x, y,size,size, Qt::yellow );
223 x += size + 1; 224 x += size + 1;
224 } 225 }
225 } 226 }
226 QFontMetrics fm = p->fontMetrics(); 227 QFontMetrics fm = p->fontMetrics();
227 int yPos; 228 int yPos;
228 int pmheight = size; 229 int pmheight = size;
229 if( pmheight < fm.height() ) 230 if( pmheight < fm.height() )
230 yPos = fm.ascent() + fm.leading()/2; 231 yPos = fm.ascent() + fm.leading()/2;
231 else 232 else
232 yPos = pmheight/2 - fm.height()/2 + fm.ascent(); 233 yPos = pmheight/2 - fm.height()/2 + fm.ascent();
233 p->setPen( palette().color( QPalette::Normal, sel ? \ 234 p->setPen( palette().color( QPalette::Normal, sel ? \
234 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 235 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
235 p->drawText( x, yPos, text() ); 236 p->drawText( x, yPos, text() );
236 if ( mIncidence->cancelled() ) { 237 if ( mIncidence->cancelled() ) {
237 int wid = fm.width( text() ); 238 int wid = fm.width( text() );
238 p->drawLine( x, yPos- fm.height()/2+2,x+wid, yPos- fm.height()/2 +2); 239 p->drawLine( x, yPos- fm.height()/2+2,x+wid, yPos- fm.height()/2 +2);
239 } 240 }
240 241
241} 242}
242 243
243int MonthViewItem::height(const QListBox *lb) const 244int MonthViewItem::height(const QListBox *lb) const
244{ 245{
245 return lb->fontMetrics().lineSpacing()+1; 246 return lb->fontMetrics().lineSpacing()+1;
246} 247}
247 248
248int MonthViewItem::width(const QListBox *lb) const 249int MonthViewItem::width(const QListBox *lb) const
249{ 250{
250 int size = PIXMAP_SIZE; 251 int size = PIXMAP_SIZE;
251 if ( QApplication::desktop()->width() < 300 ) 252 if ( QApplication::desktop()->width() < 300 )
252 size = 3; 253 size = 3;
253 int x = 1; 254 int x = 1;
254 if ( mInfo ) { 255 if ( mInfo ) {
255 x += size + 1; 256 x += size + 1;
256 } 257 }
257 if( mRecur ) { 258 if( mRecur ) {
258 x += size+1; 259 x += size+1;
259 } 260 }
260 if( mAlarm ) { 261 if( mAlarm ) {
261 x += size+1; 262 x += size+1;
262 } 263 }
263 if( mReply ) { 264 if( mReply ) {
264 x += size+1; 265 x += size+1;
265 } 266 }
266 267
267 return( x + lb->fontMetrics().width( text() ) + 1 ); 268 return( x + lb->fontMetrics().width( text() ) + 1 );
268} 269}
269 270
270 271
271MonthViewCell::MonthViewCell( KOMonthView *parent) 272MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
272 : QWidget( parent ), 273 : QWidget( par ),
273 mMonthView( parent ) 274 mMonthView( parent )
274{ 275{
275 276
276 QVBoxLayout *topLayout = new QVBoxLayout( this ); 277 QVBoxLayout *topLayout = new QVBoxLayout( this );
277 278
278 // mLabel = new QLabel( this );QPushButton 279 // mLabel = new QLabel( this );QPushButton
279 mLabel = new QPushButton( this ); 280 mLabel = new QPushButton( this );
280 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); 281 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
281 //mLabel->setLineWidth( 1 ); 282 //mLabel->setLineWidth( 1 );
282 //mLabel->setAlignment( AlignCenter ); 283 //mLabel->setAlignment( AlignCenter );
283 mLabel->setFlat( true ); 284 mLabel->setFlat( true );
284 mItemList = new KNoScrollListBox( this ); 285 mItemList = new KNoScrollListBox( this );
285 mItemList->setMinimumSize( 10, 10 ); 286 mItemList->setMinimumSize( 10, 10 );
286 mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); 287 mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain );
287 mItemList->setLineWidth( 1 ); 288 mItemList->setLineWidth( 1 );
288 topLayout->addWidget( mItemList ); 289 topLayout->addWidget( mItemList );
289 mLabel->raise(); 290 mLabel->raise();
290 // QColor( 0,0,255 ) QColor( 160,1600,255 ) 291 // QColor( 0,0,255 ) QColor( 160,1600,255 )
291 mStandardPalette = palette(); 292 mStandardPalette = palette();
292 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); 293 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) );
293 294
294 enableScrollBars( false ); 295 enableScrollBars( false );
295 updateConfig(); 296 updateConfig();
296 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); 297 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
297 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); 298 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
298 connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), 299 connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ),
299 SLOT( defaultAction( QListBoxItem * ) ) ); 300 SLOT( defaultAction( QListBoxItem * ) ) );
300 connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, 301 connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *,
301 const QPoint &) ), 302 const QPoint &) ),
302 SLOT( contextMenu( QListBoxItem * ) ) ); 303 SLOT( contextMenu( QListBoxItem * ) ) );
303 connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), 304 connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ),
304 SLOT( selection( QListBoxItem * ) ) ); 305 SLOT( selection( QListBoxItem * ) ) );
305 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), 306 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
306 SLOT( cellClicked( QListBoxItem * ) ) ); 307 SLOT( cellClicked( QListBoxItem * ) ) );
307 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), 308 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
308 SLOT( selection( QListBoxItem * ) ) ); 309 SLOT( selection( QListBoxItem * ) ) );
309} 310}
310#ifdef DESKTOP_VERSION 311#ifdef DESKTOP_VERSION
311QToolTipGroup *MonthViewCell::toolTipGroup() 312QToolTipGroup *MonthViewCell::toolTipGroup()
312{ 313{
313 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); 314 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
314 return mToolTipGroup; 315 return mToolTipGroup;
315} 316}
316#endif 317#endif
317 318
318void MonthViewCell::setDate( const QDate &date ) 319void MonthViewCell::setDate( const QDate &date )
319{ 320{
320 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; 321 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
321 mDate = date; 322 mDate = date;
322 323
323 324
324 325
325 //resizeEvent( 0 ); 326 //resizeEvent( 0 );
326} 327}
327 328
328QDate MonthViewCell::date() const 329QDate MonthViewCell::date() const
329{ 330{
330 return mDate; 331 return mDate;
331} 332}
332 333
333void MonthViewCell::setPrimary( bool primary ) 334void MonthViewCell::setPrimary( bool primary )
334{ 335{
335 mPrimary = primary; 336 mPrimary = primary;
336 //setMyPalette(); 337 //setMyPalette();
337} 338}
338void MonthViewCell::setMyPalette() 339void MonthViewCell::setMyPalette()
339{ 340{
340 341
341 if ( mHoliday) { 342 if ( mHoliday) {
342 setPalette( mHolidayPalette ); 343 setPalette( mHolidayPalette );
343 } else { 344 } else {
344 if ( mPrimary ) { 345 if ( mPrimary ) {
345 setPalette( mPrimaryPalette ); 346 setPalette( mPrimaryPalette );
346 } else { 347 } else {
347 setPalette( mNonPrimaryPalette ); 348 setPalette( mNonPrimaryPalette );
348 } 349 }
349 } 350 }
350 QPalette pal = palette(); 351 QPalette pal = palette();
351 352
352 mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); 353 mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) ));
353} 354}
354QPalette MonthViewCell::getPalette () 355QPalette MonthViewCell::getPalette ()
355{ 356{
356 if ( !KOPrefs::instance()->mMonthViewUsesDayColors ) 357 if ( !KOPrefs::instance()->mMonthViewUsesDayColors )
357 return mStandardPalette; 358 return mStandardPalette;
358 if ( mHoliday) { 359 if ( mHoliday) {
359 return mHolidayPalette ; 360 return mHolidayPalette ;
360 } else { 361 } else {
361 if ( mPrimary ) { 362 if ( mPrimary ) {
362 return mPrimaryPalette ; 363 return mPrimaryPalette ;
363 } 364 }
364 } 365 }
365 return mNonPrimaryPalette; 366 return mNonPrimaryPalette;
366} 367}
367bool MonthViewCell::isPrimary() const 368bool MonthViewCell::isPrimary() const
368{ 369{
369 return mPrimary; 370 return mPrimary;
370} 371}
371 372
372void MonthViewCell::setHoliday( bool holiday ) 373void MonthViewCell::setHoliday( bool holiday )
373{ 374{
374 mHoliday = holiday; 375 mHoliday = holiday;
375 //setMyPalette(); 376 //setMyPalette();
376} 377}
377 378
378void MonthViewCell::setHoliday( const QString &holiday ) 379void MonthViewCell::setHoliday( const QString &holiday )
379{ 380{
380 mHolidayString = holiday; 381 mHolidayString = holiday;
381 382
382 if ( !holiday.isEmpty() ) { 383 if ( !holiday.isEmpty() ) {
383 setHoliday( true ); 384 setHoliday( true );
384 } 385 }
385} 386}
386void MonthViewCell::keyPressEvent ( QKeyEvent * e ) 387void MonthViewCell::keyPressEvent ( QKeyEvent * e )
387{ 388{
388 389
389 e->ignore(); 390 e->ignore();
390 391
391} 392}
392void MonthViewCell::clear() 393void MonthViewCell::clear()
393{ 394{
394 mItemList->clear(); 395 mItemList->clear();
395 QApplication::removePostedEvents ( mItemList ); 396 QApplication::removePostedEvents ( mItemList );
396 QApplication::removePostedEvents ( mLabel ); 397 QApplication::removePostedEvents ( mLabel );
397 QApplication::removePostedEvents ( this ); 398 QApplication::removePostedEvents ( this );
398} 399}
399 400
400void MonthViewCell::startUpdateCell() 401void MonthViewCell::startUpdateCell()
401{ 402{
402 403
403 if ( !mMonthView->isUpdatePossible() ) 404 if ( !mMonthView->isUpdatePossible() )
404 return; 405 return;
405 /* 406 /*
406 if ( !isVisible() ){ 407 if ( !isVisible() ){
407 return; 408 return;
408 } 409 }
409 */ 410 */
410 // qDebug("MonthViewCell::updateCell() "); 411 // qDebug("MonthViewCell::updateCell() ");
411 setPrimary( mDate.month()%2 ); 412 setPrimary( mDate.month()%2 );
412 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); 413 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
413 if ( mDate == QDate::currentDate() ) { 414 if ( mDate == QDate::currentDate() ) {
414 mItemList->setLineWidth( 3 ); 415 mItemList->setLineWidth( 3 );
415 } else { 416 } else {
416 mItemList->setLineWidth( 1 ); 417 mItemList->setLineWidth( 1 );
417 } 418 }
418 mItemList->clear(); 419 mItemList->clear();
419 420
420#ifdef DESKTOP_VERSION 421#ifdef DESKTOP_VERSION
421 QToolTip::remove(this); 422 QToolTip::remove(this);
422#endif 423#endif
423 mToolTip = ""; 424 mToolTip = "";
424 //qApp->processEvents(); 425 //qApp->processEvents();
425 if ( !mHolidayString.isEmpty() ) { 426 if ( !mHolidayString.isEmpty() ) {
426 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); 427 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
427 item->setPalette( mHolidayPalette ); 428 item->setPalette( mHolidayPalette );
428 mItemList->insertItem( item ); 429 mItemList->insertItem( item );
429 mToolTip += mHolidayString+"\n"; 430 mToolTip += mHolidayString+"\n";
430 } 431 }
431} 432}
432 433
433void MonthViewCell::insertEvent(Event *event) 434void MonthViewCell::insertEvent(Event *event)
434{ 435{
435 if ( !(event->doesRecur() == Recurrence::rNone) ) { 436 if ( !(event->doesRecur() == Recurrence::rNone) ) {
436 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 437 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
437 return; 438 return;
438 else 439 else
439 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) 440 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
440 return; 441 return;
441 } 442 }
442 443
443 if ( event->categories().contains("Holiday") || 444 if ( event->categories().contains("Holiday") ||
444 event->categories().contains(i18n("Holiday"))) { 445 event->categories().contains(i18n("Holiday"))) {
445 setHoliday( true ); 446 setHoliday( true );
446 if ( mDate.dayOfWeek() == 7 ) 447 if ( mDate.dayOfWeek() == 7 )
447 mItemList->setLineWidth( 3 ); 448 mItemList->setLineWidth( 3 );
448 } 449 }
449 QString text; 450 QString text;
450 if (event->isMultiDay()) { 451 if (event->isMultiDay()) {
451 QString prefix = "<->"; 452 QString prefix = "<->";
452 if ( event->doesRecur() ) { 453 if ( event->doesRecur() ) {
453 if ( event->recursOn( mDate) ) 454 if ( event->recursOn( mDate) )
454 prefix ="->" ; 455 prefix ="->" ;
455 else { 456 else {
456 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 457 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
457 if ( event->recursOn( mDate.addDays( -days)) ) 458 if ( event->recursOn( mDate.addDays( -days)) )
458 prefix ="<-" ; 459 prefix ="<-" ;
459 } 460 }
460 461
461 } else { 462 } else {
462 if (mDate == event->dtStart().date()) { 463 if (mDate == event->dtStart().date()) {
463 prefix ="->" ; 464 prefix ="->" ;
464 } else if (mDate == event->dtEnd().date()) { 465 } else if (mDate == event->dtEnd().date()) {
465 prefix ="<-" ; 466 prefix ="<-" ;
466 } 467 }
467 } 468 }
468 if ( !event->doesFloat() ) { 469 if ( !event->doesFloat() ) {
469 if ( mDate == event->dtStart().date () ) 470 if ( mDate == event->dtStart().date () )
470 prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" "; 471 prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" ";
471 else if ( mDate == event->dtEnd().date () ) 472 else if ( mDate == event->dtEnd().date () )
472 prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" "; 473 prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
473 474
474 } 475 }
475 text = prefix + event->summary(); 476 text = prefix + event->summary();
476 mToolTip += text; 477 mToolTip += text;
477 } else { 478 } else {
478 if (event->doesFloat()) { 479 if (event->doesFloat()) {
479 text = event->summary(); 480 text = event->summary();
480 mToolTip += text; 481 mToolTip += text;
481 } 482 }
482 else { 483 else {
483 text = KGlobal::locale()->formatTime(event->dtStart().time()); 484 text = KGlobal::locale()->formatTime(event->dtStart().time());
484 text += " " + event->summary(); 485 text += " " + event->summary();
485 mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 486 mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
486 } 487 }
487 } 488 }
488 489
489 MonthViewItem *item = new MonthViewItem( event, mDate, text ); 490 MonthViewItem *item = new MonthViewItem( event, mDate, text );
490 QPalette pal; 491 QPalette pal;
491 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 492 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
492 QStringList categories = event->categories(); 493 QStringList categories = event->categories();
493 QString cat = categories.first(); 494 QString cat = categories.first();
494 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 495 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
495 pal = getPalette(); 496 pal = getPalette();
496 if (cat.isEmpty()) { 497 if (cat.isEmpty()) {
497 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 498 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
498 } else { 499 } else {
499 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 500 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
500 } 501 }
501 502
502 } else { 503 } else {
503 if (cat.isEmpty()) { 504 if (cat.isEmpty()) {
504 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 505 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
505 } else { 506 } else {
506 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 507 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
507 } 508 }
508 } 509 }
509 510
510 } else { 511 } else {
511 pal = mStandardPalette ; 512 pal = mStandardPalette ;
512 } 513 }
513 item->setPalette( pal ); 514 item->setPalette( pal );
514 item->setRecur( event->recurrence()->doesRecur() ); 515 item->setRecur( event->recurrence()->doesRecur() );
515 item->setAlarm( event->isAlarmEnabled() ); 516 item->setAlarm( event->isAlarmEnabled() );
516 item->setMoreInfo( event->description().length() > 0 ); 517 item->setMoreInfo( event->description().length() > 0 );
517#ifdef DESKTOP_VERSION 518#ifdef DESKTOP_VERSION
518 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, 519 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
519 KOPrefs::instance()->email()); 520 KOPrefs::instance()->email());
520 if ( me != 0 ) { 521 if ( me != 0 ) {
521 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 522 if ( me->status() == Attendee::NeedsAction && me->RSVP())
522 item->setReply(true); 523 item->setReply(true);
523 else 524 else
524 item->setReply(false); 525 item->setReply(false);
525 } else 526 } else
526 item->setReply(false); 527 item->setReply(false);
527#endif 528#endif
528 mItemList->insertItem( item ); 529 mItemList->insertItem( item );
529 mToolTip += "\n"; 530 mToolTip += "\n";
530} 531}
531void MonthViewCell::insertTodo(Todo *todo) 532void MonthViewCell::insertTodo(Todo *todo)
532{ 533{
533 QString text; 534 QString text;
534 if (todo->hasDueDate()) { 535 if (todo->hasDueDate()) {
535 if (!todo->doesFloat()) { 536 if (!todo->doesFloat()) {
536 text += KGlobal::locale()->formatTime(todo->dtDue().time()); 537 text += KGlobal::locale()->formatTime(todo->dtDue().time());
537 text += " "; 538 text += " ";
538 } 539 }
539 } 540 }
540 text += i18n("To-Do: %1").arg(todo->summary()); 541 text += i18n("To-Do: %1").arg(todo->summary());
541 542
542 MonthViewItem *item = new MonthViewItem( todo, mDate, text ); 543 MonthViewItem *item = new MonthViewItem( todo, mDate, text );
543 //item->setPalette( mStandardPalette ); 544 //item->setPalette( mStandardPalette );
544 QPalette pal; 545 QPalette pal;
545 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 546 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
546 QStringList categories = todo->categories(); 547 QStringList categories = todo->categories();
547 QString cat = categories.first(); 548 QString cat = categories.first();
548 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 549 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
549 pal = getPalette(); 550 pal = getPalette();
550 if (cat.isEmpty()) { 551 if (cat.isEmpty()) {
551 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 552 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
552 } else { 553 } else {
553 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 554 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
554 } 555 }
555 556
556 } else { 557 } else {
557 if (cat.isEmpty()) { 558 if (cat.isEmpty()) {
558 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 559 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
559 } else { 560 } else {
560 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 561 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
561 } 562 }
562 } 563 }
563 564
564 } else { 565 } else {
565 pal = mStandardPalette ; 566 pal = mStandardPalette ;
566 } 567 }
567 item->setPalette( pal ); 568 item->setPalette( pal );
568 mItemList->insertItem( item ); 569 mItemList->insertItem( item );
569 mToolTip += text+"\n"; 570 mToolTip += text+"\n";
570} 571}
571void MonthViewCell::finishUpdateCell() 572void MonthViewCell::finishUpdateCell()
572{ 573{
573#ifdef DESKTOP_VERSION 574#ifdef DESKTOP_VERSION
574 if (mToolTip != "") 575 if (mToolTip != "")
575 QToolTip::add(this,mToolTip,toolTipGroup(),""); 576 QToolTip::add(this,mToolTip,toolTipGroup(),"");
576#endif 577#endif
577 mItemList->sort(); 578 mItemList->sort();
578 //setMyPalette(); 579 //setMyPalette();
579 setMyPalette(); 580 setMyPalette();
580 QString text; 581 QString text;
581 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 582 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
582 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 583 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
583 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; 584 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
584 mLabel->resize( mLabelBigSize ); 585 mLabel->resize( mLabelBigSize );
585 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 586 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
586 } else { 587 } else {
587 mLabel->resize( mLabelSize ); 588 mLabel->resize( mLabelSize );
588 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 589 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
589 } 590 }
590 591
591 mLabel->setText( text ); 592 mLabel->setText( text );
592 resizeEvent( 0 ); 593 resizeEvent( 0 );
593} 594}
594void MonthViewCell::updateCell() 595void MonthViewCell::updateCell()
595{ 596{
596 if ( !mMonthView->isUpdatePossible() ) 597 if ( !mMonthView->isUpdatePossible() )
597 return; 598 return;
598 startUpdateCell(); 599 startUpdateCell();
599 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 600 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
600 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 601 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
601 Event *event; 602 Event *event;
602 for( event = events.first(); event; event = events.next() ) { // for event 603 for( event = events.first(); event; event = events.next() ) { // for event
603 insertEvent(event); 604 insertEvent(event);
604 } 605 }
605 // insert due todos 606 // insert due todos
606 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 607 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
607 Todo *todo; 608 Todo *todo;
608 for(todo = todos.first(); todo; todo = todos.next()) { 609 for(todo = todos.first(); todo; todo = todos.next()) {
609 insertTodo( todo ); 610 insertTodo( todo );
610 } 611 }
611 finishUpdateCell(); 612 finishUpdateCell();
612 // if ( isVisible()) 613 // if ( isVisible())
613 //qApp->processEvents(); 614 //qApp->processEvents();
614} 615}
615 616
616void MonthViewCell::updateConfig() 617void MonthViewCell::updateConfig()
617{ 618{
618 setFont( KOPrefs::instance()->mMonthViewFont ); 619 setFont( KOPrefs::instance()->mMonthViewFont );
619 620
620 QFontMetrics fm( font() ); 621 QFontMetrics fm( font() );
621 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 622 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
622 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 623 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
623 mHolidayPalette = mStandardPalette; 624 mHolidayPalette = mStandardPalette;
624 mPrimaryPalette = mStandardPalette; 625 mPrimaryPalette = mStandardPalette;
625 mNonPrimaryPalette = mStandardPalette; 626 mNonPrimaryPalette = mStandardPalette;
626 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 627 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
627 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 628 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
628 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 629 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
629 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 630 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
630 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 631 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
631 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 632 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
632 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 633 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
633 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 634 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
634 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 635 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
635 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 636 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
636 } 637 }
637 //updateCell(); 638 //updateCell();
638} 639}
639 640
640void MonthViewCell::enableScrollBars( bool enabled ) 641void MonthViewCell::enableScrollBars( bool enabled )
641{ 642{
642 if ( enabled ) { 643 if ( enabled ) {
643 mItemList->setVScrollBarMode(QScrollView::Auto); 644 mItemList->setVScrollBarMode(QScrollView::Auto);
644 mItemList->setHScrollBarMode(QScrollView::Auto); 645 mItemList->setHScrollBarMode(QScrollView::Auto);
645 } else { 646 } else {
646 mItemList->setVScrollBarMode(QScrollView::AlwaysOff); 647 mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
647 mItemList->setHScrollBarMode(QScrollView::AlwaysOff); 648 mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
648 } 649 }
649} 650}
650 651
651Incidence *MonthViewCell::selectedIncidence() 652Incidence *MonthViewCell::selectedIncidence()
652{ 653{
653 int index = mItemList->currentItem(); 654 int index = mItemList->currentItem();
654 if ( index < 0 ) return 0; 655 if ( index < 0 ) return 0;
655 656
656 MonthViewItem *item = 657 MonthViewItem *item =
657 static_cast<MonthViewItem *>( mItemList->item( index ) ); 658 static_cast<MonthViewItem *>( mItemList->item( index ) );
658 659
659 if ( !item ) return 0; 660 if ( !item ) return 0;
660 661
661 return item->incidence(); 662 return item->incidence();
662} 663}
663 664
664QDate MonthViewCell::selectedIncidenceDate() 665QDate MonthViewCell::selectedIncidenceDate()
665{ 666{
666 QDate qd; 667 QDate qd;
667 int index = mItemList->currentItem(); 668 int index = mItemList->currentItem();
668 if ( index < 0 ) return qd; 669 if ( index < 0 ) return qd;
669 670
670 MonthViewItem *item = 671 MonthViewItem *item =
671 static_cast<MonthViewItem *>( mItemList->item( index ) ); 672 static_cast<MonthViewItem *>( mItemList->item( index ) );
672 673
673 if ( !item ) return qd; 674 if ( !item ) return qd;
674 675
675 return item->incidenceDate(); 676 return item->incidenceDate();
676} 677}
677 678
678void MonthViewCell::deselect() 679void MonthViewCell::deselect()
679{ 680{
680 mItemList->clearSelection(); 681 mItemList->clearSelection();
681 enableScrollBars( false ); 682 enableScrollBars( false );
682 // updateCell(); 683 // updateCell();
683} 684}
684void MonthViewCell::select() 685void MonthViewCell::select()
685{ 686{
686 ;// updateCell(); 687 ;// updateCell();
687} 688}
688 689
689void MonthViewCell::resizeEvent ( QResizeEvent * ) 690void MonthViewCell::resizeEvent ( QResizeEvent * )
690{ 691{
691 if ( !mMonthView->isUpdatePossible() ) 692 if ( !mMonthView->isUpdatePossible() )
692 return; 693 return;
693 694
694 int size = height() - mLabel->height() - 2; 695 int size = height() - mLabel->height() - 2;
695 if ( size > 0 ) 696 if ( size > 0 )
696 mItemList->verticalScrollBar()->setMaximumHeight( size ); 697 mItemList->verticalScrollBar()->setMaximumHeight( size );
697 size = width() - mLabel->width() -2; 698 size = width() - mLabel->width() -2;
698 if ( size > 0 ) 699 if ( size > 0 )
699 mItemList->horizontalScrollBar()->setMaximumWidth( size ); 700 mItemList->horizontalScrollBar()->setMaximumWidth( size );
700 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); 701 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() );
701 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 702 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
702} 703}
703 704
704void MonthViewCell::defaultAction( QListBoxItem *item ) 705void MonthViewCell::defaultAction( QListBoxItem *item )
705{ 706{
706 if ( !item ) return; 707 if ( !item ) return;
707 708
708 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 709 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
709 Incidence *incidence = eventItem->incidence(); 710 Incidence *incidence = eventItem->incidence();
710 if ( incidence ) mMonthView->defaultAction( incidence ); 711 if ( incidence ) mMonthView->defaultAction( incidence );
711} 712}
712void MonthViewCell::showDay() 713void MonthViewCell::showDay()
713{ 714{
714 emit showDaySignal( date() ); 715 emit showDaySignal( date() );
715} 716}
716void MonthViewCell::newEvent() 717void MonthViewCell::newEvent()
717{ 718{
718 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 719 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
719 emit newEventSignal( dt ); 720 emit newEventSignal( dt );
720} 721}
721void MonthViewCell::cellClicked( QListBoxItem *item ) 722void MonthViewCell::cellClicked( QListBoxItem *item )
722{ 723{
723 static QListBoxItem * lastClicked = 0; 724 static QListBoxItem * lastClicked = 0;
724 if ( item == 0 ) { 725 if ( item == 0 ) {
725 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 726 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
726 emit newEventSignal( dt ); 727 emit newEventSignal( dt );
727 return; 728 return;
728 } 729 }
729 /* 730 /*
730 if ( lastClicked ) 731 if ( lastClicked )
731 if ( ! item ) { 732 if ( ! item ) {
732 if ( lastClicked->listBox() != item->listBox() ) 733 if ( lastClicked->listBox() != item->listBox() )
733 lastClicked->listBox()->clearSelection(); 734 lastClicked->listBox()->clearSelection();
734 } 735 }
735 */ 736 */
736 737
737 mMonthView->setSelectedCell( this ); 738 mMonthView->setSelectedCell( this );
738 if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); 739 if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true );
739 select(); 740 select();
740} 741}
741 742
742void MonthViewCell::contextMenu( QListBoxItem *item ) 743void MonthViewCell::contextMenu( QListBoxItem *item )
743{ 744{
744 if ( !item ) return; 745 if ( !item ) return;
745 746
746 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 747 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
747 Incidence *incidence = eventItem->incidence(); 748 Incidence *incidence = eventItem->incidence();
748 if ( incidence ) mMonthView->showContextMenu( incidence ); 749 if ( incidence ) mMonthView->showContextMenu( incidence );
749} 750}
750 751
751void MonthViewCell::selection( QListBoxItem *item ) 752void MonthViewCell::selection( QListBoxItem *item )
752{ 753{
753 if ( !item ) return; 754 if ( !item ) return;
754 755
755 mMonthView->setSelectedCell( this ); 756 mMonthView->setSelectedCell( this );
756} 757}
757 758
758 759
759// ******************************************************************************* 760// *******************************************************************************
760// ******************************************************************************* 761// *******************************************************************************
761// ******************************************************************************* 762// *******************************************************************************
762 763
763 764
764KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 765KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
765 : KOEventView( calendar, parent, name ), 766 : KOEventView( calendar, parent, name ),
766 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 767 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
767 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 768 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
768{ 769{
770
771 clPending = true;
772 mWidStack = new QWidgetStack( this );
773 QHBoxLayout* hb = new QHBoxLayout( this );
774 mMonthView = new QWidget( mWidStack );
775 mWeekView = new QWidget( mWidStack );
776#if QT_VERSION >= 0x030000
777 mWidStack->addWidget(mMonthView );
778 mWidStack->addWidget(mWeekView );
779#else
780 mWidStack->addWidget( mMonthView, 1 );
781 mWidStack->addWidget( mWeekView , 1 );
782#endif
783 hb->addWidget( mWidStack );
769 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 784 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
770 mShowWeekView = KOPrefs::instance()->mMonthViewWeek; 785 mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
771 if ( mShowWeekView ) 786 if ( mShowWeekView )
772 mWeekStartsMonday = true; 787 mWeekStartsMonday = true;
773 updatePossible = false; 788 updatePossible = false;
774 mCells.setAutoDelete( true ); 789 mCells.setAutoDelete( true );
775 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 790 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
776 // mDayLayout = new QGridLayout( this );
777 // create the day of the week labels (Sun, Mon, etc) and add them to
778 // the layout.
779 mDayLabels.resize( mDaysPerWeek ); 791 mDayLabels.resize( mDaysPerWeek );
792 mDayLabelsW.resize( mDaysPerWeek );
780 QFont bfont = font(); 793 QFont bfont = font();
781 if ( QApplication::desktop()->width() < 650 ) { 794 if ( QApplication::desktop()->width() < 650 ) {
782 bfont.setPointSize( bfont.pointSize() - 2 ); 795 bfont.setPointSize( bfont.pointSize() - 2 );
783 } 796 }
784 bfont.setBold( true ); 797 bfont.setBold( true );
785 int i; 798 int i;
786 799
787 for( i = 0; i < mDaysPerWeek; i++ ) { 800 for( i = 0; i < mDaysPerWeek; i++ ) {
788 QLabel *label = new QLabel( this ); 801 QLabel *label = new QLabel( mMonthView );
789 label->setFont(bfont); 802 label->setFont(bfont);
790 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 803 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
791 label->setLineWidth(1); 804 label->setLineWidth(1);
792 label->setAlignment(AlignCenter); 805 label->setAlignment(AlignCenter);
793 mDayLabels.insert( i, label ); 806 mDayLabels.insert( i, label );
807 label = new QLabel( mWeekView );
808 label->setFont(bfont);
809 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
810 label->setLineWidth(1);
811 label->setAlignment(AlignCenter);
812 mDayLabelsW.insert( i, label );
794 } 813 }
795 814
796 bfont.setBold( false ); 815 bfont.setBold( false );
797 mWeekLabels.resize( mNumWeeks+1 ); 816 mWeekLabels.resize( mNumWeeks+1 );
817 mWeekLabelsW.resize( 2 );
798 for( i = 0; i < mNumWeeks+1; i++ ) { 818 for( i = 0; i < mNumWeeks+1; i++ ) {
799 KOWeekButton *label = new KOWeekButton( this ); 819 KOWeekButton *label = new KOWeekButton( mMonthView );
800 label->setFont(bfont); 820 label->setFont(bfont);
801 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 821 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
802 label->setFlat(true); 822 label->setFlat(true);
803 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 823 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
804 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 824 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
805 //label->setLineWidth(1); 825 //label->setLineWidth(1);
806 //label->setAlignment(AlignCenter); 826 //label->setAlignment(AlignCenter);
807 mWeekLabels.insert( i, label ); 827 mWeekLabels.insert( i, label );
808 } 828 }
809 mWeekLabels[mNumWeeks]->setText( i18n("")); 829 mWeekLabels[mNumWeeks]->setText( i18n("W"));
810 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 830 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
831
832 for( i = 0; i < 1+1; i++ ) {
833 KOWeekButton *label = new KOWeekButton( mWeekView );
834 label->setFont(bfont);
835 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
836 label->setFlat(true);
837 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
838 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
839 //label->setLineWidth(1);
840 //label->setAlignment(AlignCenter);
841 mWeekLabelsW.insert( i, label );
842 }
843 mWeekLabelsW[1]->setText( i18n("W"));
844
845
811 int row, col; 846 int row, col;
812 mCells.resize( mNumCells ); 847 mCells.resize( mNumCells );
813 for( row = 0; row < mNumWeeks; ++row ) { 848 for( row = 0; row < mNumWeeks; ++row ) {
814 for( col = 0; col < mDaysPerWeek; ++col ) { 849 for( col = 0; col < mDaysPerWeek; ++col ) {
815 MonthViewCell *cell = new MonthViewCell( this ); 850 MonthViewCell *cell = new MonthViewCell( this, mMonthView );
816 mCells.insert( row * mDaysPerWeek + col, cell ); 851 mCells.insert( row * mDaysPerWeek + col, cell );
817 852
818 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 853 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
819 SLOT( defaultAction( Incidence * ) ) ); 854 SLOT( defaultAction( Incidence * ) ) );
820 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 855 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
821 SIGNAL( newEventSignal( QDateTime ) ) ); 856 SIGNAL( newEventSignal( QDateTime ) ) );
822 connect( cell, SIGNAL( showDaySignal( QDate ) ), 857 connect( cell, SIGNAL( showDaySignal( QDate ) ),
823 SIGNAL( showDaySignal( QDate ) ) ); 858 SIGNAL( showDaySignal( QDate ) ) );
824 } 859 }
825 } 860 }
861 mCellsW.resize( mDaysPerWeek );
862 for( col = 0; col < mDaysPerWeek; ++col ) {
863 MonthViewCell *cell = new MonthViewCell( this, mWeekView );
864 mCellsW.insert( col, cell );
865
866 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
867 SLOT( defaultAction( Incidence * ) ) );
868 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
869 SIGNAL( newEventSignal( QDateTime ) ) );
870 connect( cell, SIGNAL( showDaySignal( QDate ) ),
871 SIGNAL( showDaySignal( QDate ) ) );
872 }
826 873
827 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 874 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
828 mContextMenu = eventPopup(); 875 mContextMenu = eventPopup();
829 // updateConfig(); //useless here 876 // updateConfig(); //useless here
830 877
831 mWeekLabels[mNumWeeks]->setText( i18n("W")); 878 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
879#if 0
880 mWidStack = new QWidgetStack( this );
881 mMonthView = new QWidget( mWidStack );
882 mWeekView = new QWidget( mWidStack );
883#endif
884 if ( mShowWeekView )
885 mWidStack->raiseWidget( mWeekView );
886 else
887 mWidStack->raiseWidget( mMonthView );
888
832 emit incidenceSelected( 0 ); 889 emit incidenceSelected( 0 );
833} 890}
834 891
835KOMonthView::~KOMonthView() 892KOMonthView::~KOMonthView()
836{ 893{
837 delete mContextMenu; 894 delete mContextMenu;
838} 895}
839void KOMonthView::selectDateWeekNum ( int ) 896void KOMonthView::selectDateWeekNum ( int )
840{ 897{
841 898
842} 899}
843void KOMonthView::selectInternalWeekNum ( int n ) 900void KOMonthView::selectInternalWeekNum ( int n )
844{ 901{
845 emit selectWeekNum ( n );
846 switchView(); 902 switchView();
903 emit selectWeekNum ( n );
847} 904}
848 905
849void KOMonthView::switchView() 906void KOMonthView::switchView()
850{ 907{
908
851 if ( selectedCell( ) ) 909 if ( selectedCell( ) )
852 selectedCell()->deselect(); 910 selectedCell()->deselect();
853 mShowWeekView = !mShowWeekView; 911 mShowWeekView = !mShowWeekView;
854 KOPrefs::instance()->mMonthViewWeek = mShowWeekView; 912 KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
855 //emit showNavigator( !mShowWeekView ); 913 //emit showNavigator( !mShowWeekView );
856 computeLayout(); 914 if ( clPending ) {
857 updateConfig(); 915 computeLayout();
916 updateConfig();
917 }
918 if ( mShowWeekView )
919 mWidStack->raiseWidget( mWeekView );
920 else
921 mWidStack->raiseWidget( mMonthView );
922 clPending = false;
858} 923}
859 924
860int KOMonthView::maxDatesHint() 925int KOMonthView::maxDatesHint()
861{ 926{
862 return mNumCells; 927 return mNumCells;
863} 928}
864 929
865int KOMonthView::currentDateCount() 930int KOMonthView::currentDateCount()
866{ 931{
867 return mNumCells; 932 return mNumCells;
868} 933}
869 934
870QPtrList<Incidence> KOMonthView::selectedIncidences() 935QPtrList<Incidence> KOMonthView::selectedIncidences()
871{ 936{
872 QPtrList<Incidence> selected; 937 QPtrList<Incidence> selected;
873 938
874 if ( mSelectedCell ) { 939 if ( mSelectedCell ) {
875 Incidence *incidence = mSelectedCell->selectedIncidence(); 940 Incidence *incidence = mSelectedCell->selectedIncidence();
876 if ( incidence ) selected.append( incidence ); 941 if ( incidence ) selected.append( incidence );
877 } 942 }
878 943
879 return selected; 944 return selected;
880} 945}
881 946
882DateList KOMonthView::selectedDates() 947DateList KOMonthView::selectedDates()
883{ 948{
884 DateList selected; 949 DateList selected;
885 950
886 if ( mSelectedCell ) { 951 if ( mSelectedCell ) {
887 QDate qd = mSelectedCell->selectedIncidenceDate(); 952 QDate qd = mSelectedCell->selectedIncidenceDate();
888 if ( qd.isValid() ) selected.append( qd ); 953 if ( qd.isValid() ) selected.append( qd );
889 } 954 }
890 955
891 return selected; 956 return selected;
892} 957}
893 958
894void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, 959void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
895 const QDate &td) 960 const QDate &td)
896{ 961{
897#ifndef KORG_NOPRINTER 962#ifndef KORG_NOPRINTER
898 calPrinter->preview(CalPrinter::Month, fd, td); 963 calPrinter->preview(CalPrinter::Month, fd, td);
899#endif 964#endif
900} 965}
901 966
902void KOMonthView::updateConfig() 967void KOMonthView::updateConfig()
903{ 968{
904 969
905 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 970 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
906 971
907 if ( mShowWeekView ) { 972 if ( mShowWeekView ) {
908 mWeekStartsMonday = true; 973 mWeekStartsMonday = true;
909 } 974 }
910 QFontMetrics fontmetric(mDayLabels[0]->font()); 975 QFontMetrics fontmetric(mDayLabels[0]->font());
911 mWidthLongDayLabel = 0; 976 mWidthLongDayLabel = 0;
912 977
913 for (int i = 0; i < 7; i++) { 978 for (int i = 0; i < 7; i++) {
914 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 979 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
915 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 980 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
916 } 981 }
917 bool temp = mShowSatSunComp ; 982 bool temp = mShowSatSunComp ;
918 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 983 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
919 if ( ! mShowWeekView ) { 984 if ( ! mShowWeekView ) {
920 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) 985 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
921 computeLayout(); 986 computeLayout();
922 } 987 }
923 updateDayLabels(); 988 updateDayLabels();
924 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 989 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
925 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 990 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
926 //resizeEvent( 0 ); 991 //resizeEvent( 0 );
927 for (uint i = 0; i < mCells.count(); ++i) { 992 for (uint i = 0; i < mCells.count(); ++i) {
928 mCells[i]->updateConfig(); 993 mCells[i]->updateConfig();
929 } 994 }
930#ifdef DESKTOP_VERSION 995#ifdef DESKTOP_VERSION
931 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 996 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
932#endif 997#endif
933 updateView(); 998 updateView();
934} 999}
935 1000
936void KOMonthView::updateDayLabels() 1001void KOMonthView::updateDayLabels()
937{ 1002{
938 1003
1004 QPtrVector<QLabel> *mDayLabelsT;
1005#if 0
1006 if (mShowWeekView )
1007 mDayLabelsT = &mDayLabelsW;
1008 else
1009 mDayLabelsT = &mDayLabels;
1010#endif
1011
1012 mDayLabelsT = &mDayLabelsW;
1013 for (int i = 0; i < 7; i++) {
1014 if (mWeekStartsMonday) {
1015 bool show = mShortDayLabels;
1016 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
1017 show = true;
1018 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
1019 } else {
1020 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
1021 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
1022
1023 }
1024 }
1025 mDayLabelsT = &mDayLabels;
939 for (int i = 0; i < 7; i++) { 1026 for (int i = 0; i < 7; i++) {
940 if (mWeekStartsMonday) { 1027 if (mWeekStartsMonday) {
941 bool show = mShortDayLabels; 1028 bool show = mShortDayLabels;
942 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) 1029 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
943 show = true; 1030 show = true;
944 mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 1031 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
945 } else { 1032 } else {
946 if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); 1033 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
947 else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); 1034 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
948 1035
949 } 1036 }
950 } 1037 }
1038
951} 1039}
952 1040
953void KOMonthView::showDates(const QDate &start, const QDate &) 1041void KOMonthView::showDates(const QDate &start, const QDate &)
954{ 1042{
955 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; 1043 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
956 1044
1045 QPtrVector<MonthViewCell> *cells;
1046 QPtrVector<QLabel> *dayLabels;
1047 QPtrVector<KOWeekButton> *weekLabels;
1048 int weekNum = 6;
1049 if ( mShowWeekView ) {
1050 weekNum = 1;
1051 cells = &mCellsW;
1052 dayLabels = &mDayLabelsW;
1053 weekLabels = &mWeekLabelsW;
1054 } else {
1055 cells = &mCells;
1056 dayLabels = &mDayLabels;
1057 weekLabels = &mWeekLabels;
1058 }
957 1059
958 mStartDate = start; 1060 mStartDate = start;
959 1061
960 int startWeekDay = mWeekStartsMonday ? 1 : 7; 1062 int startWeekDay = mWeekStartsMonday ? 1 : 7;
961 1063
962 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { 1064 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
963 mStartDate = mStartDate.addDays( -1 ); 1065 mStartDate = mStartDate.addDays( -1 );
964 } 1066 }
965 1067
966 bool primary = false; 1068 bool primary = false;
967 uint i; 1069 uint i;
968 for( i = 0; i < mCells.size(); ++i ) { 1070 for( i = 0; i < (*cells).size(); ++i ) {
969 QDate date = mStartDate.addDays( i ); 1071 QDate date = mStartDate.addDays( i );
970 mCells[i]->setDate( date ); 1072 (*cells)[i]->setDate( date );
971 1073
972#ifndef KORG_NOPLUGINS 1074#ifndef KORG_NOPLUGINS
973 // add holiday, if present 1075 // add holiday, if present
974 QString hstring(KOCore::self()->holiday(date)); 1076 QString hstring(KOCore::self()->holiday(date));
975 mCells[i]->setHoliday( hstring ); 1077 (*cells)[i]->setHoliday( hstring );
976#endif 1078#endif
977 1079
978 } 1080 }
979 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); 1081 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 );
980 for( i = 0; i < 6; ++i ) { 1082 for( i = 0; i < weekNum; ++i ) {
981 int wno; 1083 int wno;
982 // remember, according to ISO 8601, the first week of the year is the 1084 // remember, according to ISO 8601, the first week of the year is the
983 // first week that contains a thursday. Thus we must subtract off 4, 1085 // first week that contains a thursday. Thus we must subtract off 4,
984 // not just 1. 1086 // not just 1.
985 int dayOfYear = date.dayOfYear(); 1087 int dayOfYear = date.dayOfYear();
986 if (dayOfYear % 7 != 0) 1088 if (dayOfYear % 7 != 0)
987 wno = dayOfYear / 7 + 1; 1089 wno = dayOfYear / 7 + 1;
988 else 1090 else
989 wno =dayOfYear / 7; 1091 wno =dayOfYear / 7;
990 mWeekLabels[i]->setWeekNum( wno ); 1092 (*weekLabels)[i]->setWeekNum( wno );
991 date = date.addDays( 7 ); 1093 date = date.addDays( 7 );
992 } 1094 }
993 updateView(); 1095 updateView();
994} 1096}
995 1097
996void KOMonthView::showEvents(QPtrList<Event>) 1098void KOMonthView::showEvents(QPtrList<Event>)
997{ 1099{
998 qDebug("KOMonthView::selectEvents is not implemented yet. "); 1100 qDebug("KOMonthView::selectEvents is not implemented yet. ");
999} 1101}
1000 1102
1001void KOMonthView::changeEventDisplay(Event *, int) 1103void KOMonthView::changeEventDisplay(Event *, int)
1002{ 1104{
1003 // this should be re-written to be much more efficient, but this 1105 // this should be re-written to be much more efficient, but this
1004 // quick-and-dirty-hack gets the job done for right now. 1106 // quick-and-dirty-hack gets the job done for right now.
1005 updateView(); 1107 updateView();
1006} 1108}
1007 1109
1008void KOMonthView::updateView() 1110void KOMonthView::updateView()
1009{ 1111{
1010 1112
1011 if ( !updatePossible ) 1113 if ( !updatePossible )
1012 return; 1114 return;
1013 //QTime ti; 1115 //QTime ti;
1014 //ti.start(); 1116 //ti.start();
1117 QPtrVector<MonthViewCell> *cells;
1118 if ( mShowWeekView ) {
1119 cells = &mCellsW;
1120 } else {
1121 cells = &mCells;
1122 }
1015#if 1 1123#if 1
1016 int i; 1124 int i;
1017 int timeSpan = mCells.size()-1; 1125 int timeSpan = (*cells).size()-1;
1018 if ( KOPrefs::instance()->mMonthViewWeek ) 1126 if ( KOPrefs::instance()->mMonthViewWeek )
1019 timeSpan = 6; 1127 timeSpan = 6;
1020 for( i = 0; i < timeSpan + 1; ++i ) { 1128 for( i = 0; i < timeSpan + 1; ++i ) {
1021 mCells[i]->startUpdateCell(); 1129 (*cells)[i]->startUpdateCell();
1022 } 1130 }
1023 1131
1024 QPtrList<Event> events = calendar()->events(); 1132 QPtrList<Event> events = calendar()->events();
1025 Event *event; 1133 Event *event;
1026 QDateTime dt; 1134 QDateTime dt;
1027 bool ok; 1135 bool ok;
1028 QDate endDate = mStartDate.addDays( timeSpan ); 1136 QDate endDate = mStartDate.addDays( timeSpan );
1029 for( event = events.first(); event; event = events.next() ) { // for event 1137 for( event = events.first(); event; event = events.next() ) { // for event
1030 if ( event->doesRecur() ) { 1138 if ( event->doesRecur() ) {
1031 bool last; 1139 bool last;
1032 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); 1140 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
1033 QDateTime incidenceEnd; 1141 QDateTime incidenceEnd;
1034 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); 1142 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
1035 bool invalid = false; 1143 bool invalid = false;
1036 while( true ) { 1144 while( true ) {
1037 if ( incidenceStart.isValid() ) { 1145 if ( incidenceStart.isValid() ) {
1038 incidenceEnd = incidenceStart.addDays( eventlen ); 1146 incidenceEnd = incidenceStart.addDays( eventlen );
1039 int st = incidenceStart.date().daysTo( endDate ); 1147 int st = incidenceStart.date().daysTo( endDate );
1040 if ( st >= 0 ) { // start before timeend 1148 if ( st >= 0 ) { // start before timeend
1041 int end = mStartDate.daysTo( incidenceEnd.date() ); 1149 int end = mStartDate.daysTo( incidenceEnd.date() );
1042 if ( end >= 0 ) { // end after timestart --- got one! 1150 if ( end >= 0 ) { // end after timestart --- got one!
1043 //normalize 1151 //normalize
1044 st = timeSpan - st; 1152 st = timeSpan - st;
1045 if ( st < 0 ) st = 0; 1153 if ( st < 0 ) st = 0;
1046 if ( end > timeSpan ) end = timeSpan; 1154 if ( end > timeSpan ) end = timeSpan;
1047 int iii; 1155 int iii;
1048 //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); 1156 //qDebug("found %s %d %d ",event->summary().latin1(), st, end );
1049 for ( iii = st;iii<= end;++iii) 1157 for ( iii = st;iii<= end;++iii)
1050 mCells[iii]->insertEvent( event ); 1158 (*cells)[iii]->insertEvent( event );
1051 } 1159 }
1052 } 1160 }
1053 } else { 1161 } else {
1054 if ( invalid ) 1162 if ( invalid )
1055 break; 1163 break;
1056 invalid = true; 1164 invalid = true;
1057 //qDebug("invalid %s", event->summary().latin1()); 1165 //qDebug("invalid %s", event->summary().latin1());
1058 incidenceStart = QDateTime( mStartDate ); 1166 incidenceStart = QDateTime( mStartDate );
1059 } 1167 }
1060 if ( last ) 1168 if ( last )
1061 break; 1169 break;
1062 bool ok; 1170 bool ok;
1063 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); 1171 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok );
1064 if ( ! ok ) 1172 if ( ! ok )
1065 break; 1173 break;
1066 if ( incidenceStart.date() > endDate ) 1174 if ( incidenceStart.date() > endDate )
1067 break; 1175 break;
1068 } 1176 }
1069 } else { // no recur 1177 } else { // no recur
1070 int st = event->dtStart().date().daysTo( endDate ); 1178 int st = event->dtStart().date().daysTo( endDate );
1071 if ( st >= 0 ) { // start before timeend 1179 if ( st >= 0 ) { // start before timeend
1072 int end = mStartDate.daysTo( event->dtEnd().date() ); 1180 int end = mStartDate.daysTo( event->dtEnd().date() );
1073 if ( end >= 0 ) { // end after timestart --- got one! 1181 if ( end >= 0 ) { // end after timestart --- got one!
1074 //normalize 1182 //normalize
1075 st = timeSpan - st; 1183 st = timeSpan - st;
1076 if ( st < 0 ) st = 0; 1184 if ( st < 0 ) st = 0;
1077 if ( end > timeSpan ) end = timeSpan; 1185 if ( end > timeSpan ) end = timeSpan;
1078 int iii; 1186 int iii;
1079 for ( iii = st;iii<= end;++iii) 1187 for ( iii = st;iii<= end;++iii)
1080 mCells[iii]->insertEvent( event ); 1188 (*cells)[iii]->insertEvent( event );
1081 } 1189 }
1082 } 1190 }
1083 } 1191 }
1084 } 1192 }
1085 // insert due todos 1193 // insert due todos
1086 QPtrList<Todo> todos = calendar()->todos( ); 1194 QPtrList<Todo> todos = calendar()->todos( );
1087 Todo *todo; 1195 Todo *todo;
1088 for(todo = todos.first(); todo; todo = todos.next()) { 1196 for(todo = todos.first(); todo; todo = todos.next()) {
1089 //insertTodo( todo ); 1197 //insertTodo( todo );
1090 if ( todo->hasDueDate() ) { 1198 if ( todo->hasDueDate() ) {
1091 int day = mStartDate.daysTo( todo->dtDue().date() ); 1199 int day = mStartDate.daysTo( todo->dtDue().date() );
1092 if ( day >= 0 && day < timeSpan + 1) { 1200 if ( day >= 0 && day < timeSpan + 1) {
1093 mCells[day]->insertTodo( todo ); 1201 (*cells)[day]->insertTodo( todo );
1094 } 1202 }
1095 } 1203 }
1096 } 1204 }
1097 1205
1098 for( i = 0; i < timeSpan+1; ++i ) { 1206 for( i = 0; i < timeSpan+1; ++i ) {
1099 mCells[i]->finishUpdateCell(); 1207 (*cells)[i]->finishUpdateCell();
1100 } 1208 }
1101 processSelectionChange(); 1209 processSelectionChange();
1102 mCells[0]->setFocus(); 1210 (*cells)[0]->setFocus();
1103 1211
1104 1212
1105#else 1213#else
1106 // old code 1214 // old code
1107 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); 1215 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
1108 int i; 1216 int i;
1109 for( i = 0; i < mCells.count(); ++i ) { 1217 for( i = 0; i < (*cells).count(); ++i ) {
1110 mCells[i]->updateCell(); 1218 (*cells)[i]->updateCell();
1111 } 1219 }
1112 1220
1113 //qDebug("KOMonthView::updateView() "); 1221 //qDebug("KOMonthView::updateView() ");
1114 processSelectionChange(); 1222 processSelectionChange();
1115 // qDebug("---------------------------------------------------------------------+ "); 1223 // qDebug("---------------------------------------------------------------------+ ");
1116 mCells[0]->setFocus(); 1224 (*cells)[0]->setFocus();
1117#endif 1225#endif
1118 1226
1119 //qDebug("update time %d ", ti.elapsed()); 1227 //qDebug("update time %d ", ti.elapsed());
1120} 1228}
1121 1229
1122void KOMonthView::resizeEvent(QResizeEvent * e) 1230void KOMonthView::resizeEvent(QResizeEvent * e)
1123{ 1231{
1124 computeLayout(); 1232 computeLayout();
1125 mCells[0]->setFocus(); 1233 clPending = true;
1234 if ( mShowWeekView )
1235 mCellsW[0]->setFocus();
1236 else
1237 mCells[0]->setFocus();
1126} 1238}
1127void KOMonthView::computeLayoutWeek() 1239void KOMonthView::computeLayoutWeek()
1128{ 1240{
1129 1241
1130 int daysToShow; 1242 int daysToShow;
1131 bool combinedSatSun = false; 1243 bool combinedSatSun = false;
1132 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { 1244 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
1133 daysToShow = 6; 1245 daysToShow = 6;
1134 combinedSatSun = true; 1246 combinedSatSun = true;
1135 } 1247 }
1136 int tWid = topLevelWidget()->size().width(); 1248 int tWid = topLevelWidget()->size().width();
1137 int tHei = topLevelWidget()->size().height(); 1249 int tHei = topLevelWidget()->size().height();
1138 1250
1139 int wid = size().width();//e 1251 int wid = size().width();//e
1140 int hei = size().height()-1; 1252 int hei = size().height()-1;
1141 1253
1142 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 1254 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1143 return; 1255 return;
1144 1256
1145 if ( wid < hei ) 1257 if ( wid < hei )
1146 daysToShow = 2; 1258 daysToShow = 2;
1147 else 1259 else
1148 daysToShow = 3; 1260 daysToShow = 3;
1149 mShowSatSunComp = true; 1261 mShowSatSunComp = true;
1150 combinedSatSun = true; 1262 combinedSatSun = true;
1151 1263
1152 //qDebug("KOMonthView::computeLayout()------------------------------------ "); 1264 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
1153 QFontMetrics fm ( mWeekLabels[0]->font() ); 1265 QFontMetrics fm ( mWeekLabels[0]->font() );
1154 int weeklabelwid = fm.width( "888" ); 1266 int weeklabelwid = fm.width( "888" );
1155 wid -= weeklabelwid; 1267 wid -= weeklabelwid;
1156 1268
1157 int colWid = wid / daysToShow; 1269 int colWid = wid / daysToShow;
1158 int lastCol = wid - ( colWid*6 ); 1270 int lastCol = wid - ( colWid*6 );
1159 int dayLabelHei = mDayLabels[0]->sizeHint().height(); 1271 int dayLabelHei = mDayLabelsW[0]->sizeHint().height();
1160 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); 1272 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow );
1161 int colModulo = wid % daysToShow; 1273 int colModulo = wid % daysToShow;
1162 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; 1274 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1;
1163 //qDebug("rowmod %d ", rowModulo); 1275 //qDebug("rowmod %d ", rowModulo);
1164 int i; 1276 int i;
1165 int x,y,w,h; 1277 int x,y,w,h;
1166 x= 0; 1278 x= 0;
1167 y= 0; 1279 y= 0;
1168 w = colWid; 1280 w = colWid;
1169 h = dayLabelHei ; 1281 h = dayLabelHei ;
1170 for ( i = 0; i < 7; i++) { 1282 for ( i = 0; i < 7; i++) {
1171 if ( i && !( i % daysToShow) && i < 6) { 1283 if ( i && !( i % daysToShow) && i < 6) {
1172 y += hei/(5-daysToShow); 1284 y += hei/(5-daysToShow);
1173 x = 0; 1285 x = 0;
1174 w = colWid; 1286 w = colWid;
1175 } 1287 }
1176 if ( ((i) % daysToShow) >= daysToShow-colModulo ) { 1288 if ( ((i) % daysToShow) >= daysToShow-colModulo ) {
1177 ++w; 1289 ++w;
1178 } 1290 }
1179 if ( i >= 5 ) { 1291 if ( i >= 5 ) {
1180 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h); 1292 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h);
1181 x -= (w/2 ); 1293 x -= (w/2 );
1182 } 1294 }
1183 else 1295 else
1184 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); 1296 mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,w,h);
1185 x += w; 1297 x += w;
1186 } 1298 }
1187 x= 0; 1299 x= 0;
1188 y= dayLabelHei; 1300 y= dayLabelHei;
1189 w = colWid; 1301 w = colWid;
1190 h = cellHei; 1302 h = cellHei;
1191 for ( i = 0; i < mCells.count(); ++i) { 1303 for ( i = 0; i < mCellsW.count(); ++i) {
1192 if ( i > 6 ) { 1304 if ( i > 6 ) {
1193 mCells[i]->hide(); 1305 mCellsW[i]->hide();
1194 continue; 1306 continue;
1195 } 1307 }
1196 1308
1197 w = colWid; 1309 w = colWid;
1198 if ( ((i) % daysToShow) >= daysToShow-colModulo ) { 1310 if ( ((i) % daysToShow) >= daysToShow-colModulo ) {
1199 ++w; 1311 ++w;
1200 } 1312 }
1201 if ( i == (daysToShow-1-rowModulo)*7) 1313 if ( i == (daysToShow-1-rowModulo)*7)
1202 ++h; 1314 ++h;
1203 1315
1204 if ( i >= 5 ) { 1316 if ( i >= 5 ) {
1205 if ( i ==5 ) { 1317 if ( i ==5 ) {
1206 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); 1318 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h/2 );
1207 x -= w ;y += h/2; 1319 x -= w ;y += h/2;
1208 } else { 1320 } else {
1209 if ( ((i-1) % daysToShow) >= daysToShow-colModulo ) { 1321 if ( ((i-1) % daysToShow) >= daysToShow-colModulo ) {
1210 ++w; 1322 ++w;
1211 } 1323 }
1212 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); 1324 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 );
1213 y -= h/2; 1325 y -= h/2;
1214 } 1326 }
1215 } else 1327 } else
1216 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); 1328 mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h );
1217 1329
1218 1330
1219 x += w; 1331 x += w;
1220 if ( x + w/2 > wid ) { 1332 if ( x + w/2 > wid ) {
1221 x = 0; 1333 x = 0;
1222 y += h+dayLabelHei ; 1334 y += h+dayLabelHei ;
1223 } 1335 }
1224 } 1336 }
1225 y= dayLabelHei; 1337 y= dayLabelHei;
1226 h = cellHei ; 1338 h = cellHei ;
1227 mWeekLabels[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); 1339 mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei);
1228 for ( i = 1; i < 6; i++) { 1340 mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1229 mWeekLabels[i]->hide();
1230 }
1231 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1232 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1341 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1233 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 1342 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1234 mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; 1343 mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ;
1235 updateDayLabels(); 1344 updateDayLabels();
1236 bool forceUpdate = !updatePossible; 1345 bool forceUpdate = !updatePossible;
1237 updatePossible = true; 1346 updatePossible = true;
1238 //mWeekLabels[mNumWeeks]->setText( i18n("M")); 1347 //mWeekLabels[mNumWeeks]->setText( i18n("M"));
1239 if ( forceUpdate ) 1348 if ( forceUpdate )
1240 updateView(); 1349 updateView();
1241} 1350}
1242void KOMonthView::computeLayout() 1351void KOMonthView::computeLayout()
1243{ 1352{
1244 // select the appropriate heading string size. E.g. "Wednesday" or "Wed". 1353 // select the appropriate heading string size. E.g. "Wednesday" or "Wed".
1245 // note this only changes the text if the requested size crosses the 1354 // note this only changes the text if the requested size crosses the
1246 // threshold between big enough to support the full name and not big 1355 // threshold between big enough to support the full name and not big
1247 // enough. 1356 // enough.
1248 if ( mShowWeekView ){ 1357 if ( mShowWeekView ){
1249 computeLayoutWeek(); 1358 computeLayoutWeek();
1250 return; 1359 return;
1251 } 1360 }
1252 int daysToShow = 7; 1361 int daysToShow = 7;
1253 bool combinedSatSun = false; 1362 bool combinedSatSun = false;
1254 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { 1363 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
1255 daysToShow = 6; 1364 daysToShow = 6;
1256 combinedSatSun = true; 1365 combinedSatSun = true;
1257 } 1366 }
1258 int tWid = topLevelWidget()->size().width(); 1367 int tWid = topLevelWidget()->size().width();
1259 int tHei = topLevelWidget()->size().height(); 1368 int tHei = topLevelWidget()->size().height();
1260 1369
1261 int wid = size().width();//e 1370 int wid = size().width();//e
1262 int hei = size().height()-1; 1371 int hei = size().height()-1;
1263 1372
1264 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 1373 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1265 return; 1374 return;
1266 //qDebug("KOMonthView::computeLayout()------------------------------------ "); 1375 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
1267 QFontMetrics fm ( mWeekLabels[0]->font() ); 1376 QFontMetrics fm ( mWeekLabels[0]->font() );
1268 int weeklabelwid = fm.width( "888" ); 1377 int weeklabelwid = fm.width( "888" );
1269 wid -= weeklabelwid; 1378 wid -= weeklabelwid;
1270 1379
1271 int colWid = wid / daysToShow; 1380 int colWid = wid / daysToShow;
1272 int lastCol = wid - ( colWid*6 ); 1381 int lastCol = wid - ( colWid*6 );
1273 int dayLabelHei = mDayLabels[0]->sizeHint().height(); 1382 int dayLabelHei = mDayLabels[0]->sizeHint().height();
1274 int cellHei = (hei - dayLabelHei) /6; 1383 int cellHei = (hei - dayLabelHei) /6;
1275 int colModulo = wid % daysToShow; 1384 int colModulo = wid % daysToShow;
1276 int rowModulo = (hei- dayLabelHei) % 6; 1385 int rowModulo = (hei- dayLabelHei) % 6;
1277 //qDebug("rowmod %d ", rowModulo); 1386 //qDebug("rowmod %d ", rowModulo);
1278 int i; 1387 int i;
1279 int x,y,w,h; 1388 int x,y,w,h;
1280 x= 0; 1389 x= 0;
1281 y= 0; 1390 y= 0;
1282 w = colWid; 1391 w = colWid;
1283 h = dayLabelHei ; 1392 h = dayLabelHei ;
1284 for ( i = 0; i < 7; i++) { 1393 for ( i = 0; i < 7; i++) {
1285 if ( i == daysToShow-colModulo ) 1394 if ( i == daysToShow-colModulo )
1286 ++w; 1395 ++w;
1287 if ( combinedSatSun ) { 1396 if ( combinedSatSun ) {
1288 if ( i >= daysToShow-1 ) { 1397 if ( i >= daysToShow-1 ) {
1289 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); 1398 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h);
1290 x -= w/2 ; 1399 x -= w/2 ;
1291 } 1400 }
1292 else 1401 else
1293 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); 1402 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h);
1294 } else 1403 } else
1295 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); 1404 mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h);
1296 x += w; 1405 x += w;
1297 } 1406 }
1298 x= 0; 1407 x= 0;
1299 y= dayLabelHei; 1408 y= dayLabelHei;
1300 w = colWid; 1409 w = colWid;
1301 h = cellHei ; 1410 h = cellHei ;
1302 for ( i = 0; i < mCells.count(); ++i) { 1411 for ( i = 0; i < mCells.count(); ++i) {
1303 mCells[i]->show();
1304 w = colWid; 1412 w = colWid;
1305 if ( ((i) % 7) >= 7-colModulo ) { 1413 if ( ((i) % 7) >= 7-colModulo ) {
1306 ++w; 1414 ++w;
1307 } 1415 }
1308 if ( i == (6-rowModulo)*7) 1416 if ( i == (6-rowModulo)*7)
1309 ++h; 1417 ++h;
1310 if ( combinedSatSun ) { 1418 if ( combinedSatSun ) {
1311 if ( (i)%7 >= daysToShow-1 ) { 1419 if ( (i)%7 >= daysToShow-1 ) {
1312 if ( (i)%7 == daysToShow-1 ) { 1420 if ( (i)%7 == daysToShow-1 ) {
1313 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); 1421 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 );
1314 x -= w ;y += h/2; 1422 x -= w ;y += h/2;
1315 } else { 1423 } else {
1316 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); 1424 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 );
1317 y -= h/2; 1425 y -= h/2;
1318 } 1426 }
1319 } else 1427 } else
1320 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); 1428 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h );
1321 1429
1322 } 1430 }
1323 else 1431 else
1324 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); 1432 mCells[i]->setGeometry ( x+weeklabelwid,y,w,h );
1325 x += w; 1433 x += w;
1326 if ( x + w/2 > wid ) { 1434 if ( x + w/2 > wid ) {
1327 x = 0; 1435 x = 0;
1328 y += h; 1436 y += h;
1329 } 1437 }
1330 } 1438 }
1331 y= dayLabelHei; 1439 y= dayLabelHei;
1332 h = cellHei ; 1440 h = cellHei ;
1333 for ( i = 0; i < 6; i++) { 1441 for ( i = 0; i < 6; i++) {
1334 mWeekLabels[i]->show();
1335 if ( i == (6-rowModulo)) 1442 if ( i == (6-rowModulo))
1336 ++h; 1443 ++h;
1337 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); 1444 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h);
1338 y += h; 1445 y += h;
1339 } 1446 }
1340 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1447 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1341 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1448 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1342 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 1449 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1343 mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; 1450 mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
1344 updateDayLabels(); 1451 updateDayLabels();
1345 bool forceUpdate = !updatePossible; 1452 bool forceUpdate = !updatePossible;
1346 updatePossible = true; 1453 updatePossible = true;
1347 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 1454 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
1348 if ( forceUpdate ) 1455 if ( forceUpdate )
1349 updateView(); 1456 updateView();
1350} 1457}
1351 1458
1352void KOMonthView::showContextMenu( Incidence *incidence ) 1459void KOMonthView::showContextMenu( Incidence *incidence )
1353{ 1460{
1354 mContextMenu->showIncidencePopup(incidence); 1461 mContextMenu->showIncidencePopup(incidence);
1355 /* 1462 /*
1356 if( incidence && incidence->type() == "Event" ) { 1463 if( incidence && incidence->type() == "Event" ) {
1357 Event *event = static_cast<Event *>(incidence); 1464 Event *event = static_cast<Event *>(incidence);
1358 mContextMenu->showEventPopup(event); 1465 mContextMenu->showEventPopup(event);
1359 } else { 1466 } else {
1360 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; 1467 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
1361 } 1468 }
1362 */ 1469 */
1363} 1470}
1364MonthViewCell * KOMonthView::selectedCell( ) 1471MonthViewCell * KOMonthView::selectedCell( )
1365{ 1472{
1366 return mSelectedCell; 1473 return mSelectedCell;
1367} 1474}
1368void KOMonthView::setSelectedCell( MonthViewCell *cell ) 1475void KOMonthView::setSelectedCell( MonthViewCell *cell )
1369{ 1476{
1370 // qDebug("KOMonthView::setSelectedCell "); 1477 // qDebug("KOMonthView::setSelectedCell ");
1371 if ( mSelectedCell && mSelectedCell != cell ) { 1478 if ( mSelectedCell && mSelectedCell != cell ) {
1372 MonthViewCell * mvc = mSelectedCell; 1479 MonthViewCell * mvc = mSelectedCell;
1373 mSelectedCell = cell; 1480 mSelectedCell = cell;
1374 mvc->deselect(); 1481 mvc->deselect();
1375 } else 1482 } else
1376 mSelectedCell = cell; 1483 mSelectedCell = cell;
1377 // if ( mSelectedCell ) 1484 // if ( mSelectedCell )
1378 // mSelectedCell->select(); 1485 // mSelectedCell->select();
1379 if ( !mSelectedCell ) 1486 if ( !mSelectedCell )
1380 emit incidenceSelected( 0 ); 1487 emit incidenceSelected( 0 );
1381 else 1488 else
1382 emit incidenceSelected( mSelectedCell->selectedIncidence() ); 1489 emit incidenceSelected( mSelectedCell->selectedIncidence() );
1383} 1490}
1384 1491
1385void KOMonthView::processSelectionChange() 1492void KOMonthView::processSelectionChange()
1386{ 1493{
1387 QPtrList<Incidence> incidences = selectedIncidences(); 1494 QPtrList<Incidence> incidences = selectedIncidences();
1388 if (incidences.count() > 0) { 1495 if (incidences.count() > 0) {
1389 emit incidenceSelected( incidences.first() ); 1496 emit incidenceSelected( incidences.first() );
1390 } else { 1497 } else {
1391 emit incidenceSelected( 0 ); 1498 emit incidenceSelected( 0 );
1392 } 1499 }
1393} 1500}
1394 1501
1395void KOMonthView::clearSelection() 1502void KOMonthView::clearSelection()
1396{ 1503{
1397 if ( mSelectedCell ) { 1504 if ( mSelectedCell ) {
1398 mSelectedCell->deselect(); 1505 mSelectedCell->deselect();
1399 mSelectedCell = 0; 1506 mSelectedCell = 0;
1400 } 1507 }
1401} 1508}
1402void KOMonthView::keyPressEvent ( QKeyEvent * e ) 1509void KOMonthView::keyPressEvent ( QKeyEvent * e )
1403{ 1510{
1404 //qDebug("KOMonthView::keyPressEvent "); 1511 //qDebug("KOMonthView::keyPressEvent ");
1405 switch(e->key()) { 1512 switch(e->key()) {
1406 case Key_Up: 1513 case Key_Up:
1407 { 1514 {
1408 emit prevMonth(); 1515 emit prevMonth();
1409 mCells[0]->setFocus(); 1516 mCells[0]->setFocus();
1410 } 1517 }
1411 e->accept(); 1518 e->accept();
1412 break; 1519 break;
1413 case Key_Down: 1520 case Key_Down:
1414 { 1521 {
1415 emit nextMonth(); 1522 emit nextMonth();
1416 mCells[0]->setFocus(); 1523 mCells[0]->setFocus();
1417 1524
1418 } 1525 }
1419 e->accept(); 1526 e->accept();
1420 break; 1527 break;
1421 default: 1528 default:
1422 e->ignore(); 1529 e->ignore();
1423 break; 1530 break;
1424 } 1531 }
1425} 1532}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 1ed200b..b89b2bc 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -1,285 +1,293 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#ifndef _KOMONTHVIEW_H 20#ifndef _KOMONTHVIEW_H
21#define _KOMONTHVIEW_H 21#define _KOMONTHVIEW_H
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qframe.h> 24#include <qframe.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <qlistbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h>
28#include <qlayout.h> 29#include <qlayout.h>
29#include <qintdict.h> 30#include <qintdict.h>
30#include <qpushbutton.h> 31#include <qpushbutton.h>
31#include <qvaluelist.h> 32#include <qvaluelist.h>
32#include <qptrvector.h> 33#include <qptrvector.h>
33 34
34#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
35#include <libkcal/event.h> 36#include <libkcal/event.h>
36 37
37#include "koeventview.h" 38#include "koeventview.h"
38 39
39#ifdef DESKTOP_VERSION 40#ifdef DESKTOP_VERSION
40class QToolTipGroup; 41class QToolTipGroup;
41#endif 42#endif
42 43
43class KNOWhatsThis; 44class KNOWhatsThis;
44class KOWeekButton : public QPushButton 45class KOWeekButton : public QPushButton
45{ 46{
46 Q_OBJECT 47 Q_OBJECT
47 public: 48 public:
48 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 49 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
49 QPushButton( parent, name) 50 QPushButton( parent, name)
50 { 51 {
51 connect( this, SIGNAL( clicked() ), 52 connect( this, SIGNAL( clicked() ),
52 SLOT( bottonClicked() )); 53 SLOT( bottonClicked() ));
53 mNumber = -1; 54 mNumber = -1;
54 } 55 }
55 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 56 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
56 signals: 57 signals:
57 void selectWeekNum ( int ); 58 void selectWeekNum ( int );
58private: 59private:
59 int mNumber; 60 int mNumber;
60private slots : 61private slots :
61 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 62 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
62}; 63};
63 64
64class KNoScrollListBox: public QListBox 65class KNoScrollListBox: public QListBox
65{ 66{
66 Q_OBJECT 67 Q_OBJECT
67 public: 68 public:
68 KNoScrollListBox(QWidget *parent=0, const char *name=0); 69 KNoScrollListBox(QWidget *parent=0, const char *name=0);
69 ~KNoScrollListBox(); 70 ~KNoScrollListBox();
70 QString getWhatsThisText(QPoint p) ; 71 QString getWhatsThisText(QPoint p) ;
71 72
72 signals: 73 signals:
73 void shiftDown(); 74 void shiftDown();
74 void shiftUp(); 75 void shiftUp();
75 void rightClick(); 76 void rightClick();
76 77
77 protected slots: 78 protected slots:
78 void keyPressEvent(QKeyEvent *); 79 void keyPressEvent(QKeyEvent *);
79 void keyReleaseEvent(QKeyEvent *); 80 void keyReleaseEvent(QKeyEvent *);
80 void mousePressEvent(QMouseEvent *); 81 void mousePressEvent(QMouseEvent *);
81 82
82 private: 83 private:
83 KNOWhatsThis * mWT; 84 KNOWhatsThis * mWT;
84}; 85};
85 86
86 87
87class MonthViewItem: public QListBoxItem 88class MonthViewItem: public QListBoxItem
88{ 89{
89 public: 90 public:
90 MonthViewItem( Incidence *, QDate qd, const QString & title ); 91 MonthViewItem( Incidence *, QDate qd, const QString & title );
91 92
92 void setRecur(bool on) { mRecur = on; } 93 void setRecur(bool on) { mRecur = on; }
93 void setAlarm(bool on) { mAlarm = on; } 94 void setAlarm(bool on) { mAlarm = on; }
94 void setReply(bool on) { mReply = on; } 95 void setReply(bool on) { mReply = on; }
95 void setMoreInfo(bool on) { mInfo = on; } 96 void setMoreInfo(bool on) { mInfo = on; }
96 97
97 98
98 void setPalette(const QPalette &p) { mPalette = p; } 99 void setPalette(const QPalette &p) { mPalette = p; }
99 QPalette palette() const { return mPalette; } 100 QPalette palette() const { return mPalette; }
100 101
101 Incidence *incidence() const { return mIncidence; } 102 Incidence *incidence() const { return mIncidence; }
102 QDate incidenceDate() { return mDate; } 103 QDate incidenceDate() { return mDate; }
103 104
104 protected: 105 protected:
105 virtual void paint(QPainter *); 106 virtual void paint(QPainter *);
106 virtual int height(const QListBox *) const; 107 virtual int height(const QListBox *) const;
107 virtual int width(const QListBox *) const; 108 virtual int width(const QListBox *) const;
108 109
109 private: 110 private:
110 bool mRecur; 111 bool mRecur;
111 bool mAlarm; 112 bool mAlarm;
112 bool mReply; 113 bool mReply;
113 bool mInfo; 114 bool mInfo;
114 115
115 QPalette mPalette; 116 QPalette mPalette;
116 QDate mDate; 117 QDate mDate;
117 118
118 Incidence *mIncidence; 119 Incidence *mIncidence;
119}; 120};
120 121
121 122
122class KOMonthView; 123class KOMonthView;
123 124
124class MonthViewCell : public QWidget 125class MonthViewCell : public QWidget
125{ 126{
126 Q_OBJECT 127 Q_OBJECT
127 public: 128 public:
128 MonthViewCell( KOMonthView * ); 129 MonthViewCell(KOMonthView *,QWidget* );
129 130
130 void setDate( const QDate & ); 131 void setDate( const QDate & );
131 QDate date() const; 132 QDate date() const;
132 133
133 void setPrimary( bool ); 134 void setPrimary( bool );
134 bool isPrimary() const; 135 bool isPrimary() const;
135 136
136 void setHoliday( bool ); 137 void setHoliday( bool );
137 void setHoliday( const QString & ); 138 void setHoliday( const QString & );
138 139
139 void updateCell(); 140 void updateCell();
140 void startUpdateCell(); 141 void startUpdateCell();
141 void finishUpdateCell(); 142 void finishUpdateCell();
142 void insertEvent(Event *); 143 void insertEvent(Event *);
143 void insertTodo(Todo *); 144 void insertTodo(Todo *);
144 145
145 void updateConfig(); 146 void updateConfig();
146 147
147 void enableScrollBars( bool ); 148 void enableScrollBars( bool );
148 149
149 Incidence *selectedIncidence(); 150 Incidence *selectedIncidence();
150 QDate selectedIncidenceDate(); 151 QDate selectedIncidenceDate();
151 152
152 void deselect(); 153 void deselect();
153 void select(); 154 void select();
154 void clear(); 155 void clear();
155 156
156#ifdef DESKTOP_VERSION 157#ifdef DESKTOP_VERSION
157 static QToolTipGroup *toolTipGroup(); 158 static QToolTipGroup *toolTipGroup();
158#endif 159#endif
159 signals: 160 signals:
160 void defaultAction( Incidence * ); 161 void defaultAction( Incidence * );
161 void newEventSignal( QDateTime ); 162 void newEventSignal( QDateTime );
162 void showDaySignal( QDate ); 163 void showDaySignal( QDate );
163 164
164 protected: 165 protected:
165 QString mToolTip; 166 QString mToolTip;
166 void resizeEvent( QResizeEvent * ); 167 void resizeEvent( QResizeEvent * );
167 168
168 protected slots: 169 protected slots:
169 void defaultAction( QListBoxItem * ); 170 void defaultAction( QListBoxItem * );
170 void contextMenu( QListBoxItem * ); 171 void contextMenu( QListBoxItem * );
171 void selection( QListBoxItem * ); 172 void selection( QListBoxItem * );
172 void cellClicked( QListBoxItem * ); 173 void cellClicked( QListBoxItem * );
173 void newEvent(); 174 void newEvent();
174 void showDay(); 175 void showDay();
175 176
176 private: 177 private:
177 KOMonthView *mMonthView; 178 KOMonthView *mMonthView;
178 179
179 QDate mDate; 180 QDate mDate;
180 bool mPrimary; 181 bool mPrimary;
181 bool mHoliday; 182 bool mHoliday;
182 QString mHolidayString; 183 QString mHolidayString;
183 184
184 //QLabel *mLabel; 185 //QLabel *mLabel;
185 QPushButton *mLabel; 186 QPushButton *mLabel;
186 QListBox *mItemList; 187 QListBox *mItemList;
187#ifdef DESKTOP_VERSION 188#ifdef DESKTOP_VERSION
188 static QToolTipGroup *mToolTipGroup; 189 static QToolTipGroup *mToolTipGroup;
189#endif 190#endif
190 QSize mLabelSize; 191 QSize mLabelSize;
191 QSize mLabelBigSize; 192 QSize mLabelBigSize;
192 QPalette mHolidayPalette; 193 QPalette mHolidayPalette;
193 QPalette mStandardPalette; 194 QPalette mStandardPalette;
194 QPalette mPrimaryPalette; 195 QPalette mPrimaryPalette;
195 QPalette mNonPrimaryPalette; 196 QPalette mNonPrimaryPalette;
196 void setMyPalette(); 197 void setMyPalette();
197 QPalette getPalette (); 198 QPalette getPalette ();
198 void keyPressEvent ( QKeyEvent * ) ; 199 void keyPressEvent ( QKeyEvent * ) ;
199 200
200}; 201};
201 202
202 203
203class KOMonthView: public KOEventView 204class KOMonthView: public KOEventView
204{ 205{
205 Q_OBJECT 206 Q_OBJECT
206 public: 207 public:
207 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 208 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
208 ~KOMonthView(); 209 ~KOMonthView();
209 210
210 /** Returns maximum number of days supported by the komonthview */ 211 /** Returns maximum number of days supported by the komonthview */
211 virtual int maxDatesHint(); 212 virtual int maxDatesHint();
212 213
213 /** Returns number of currently shown dates. */ 214 /** Returns number of currently shown dates. */
214 virtual int currentDateCount(); 215 virtual int currentDateCount();
215 216
216 /** returns the currently selected events */ 217 /** returns the currently selected events */
217 virtual QPtrList<Incidence> selectedIncidences(); 218 virtual QPtrList<Incidence> selectedIncidences();
218 219
219 /** returns dates of the currently selected events */ 220 /** returns dates of the currently selected events */
220 virtual DateList selectedDates(); 221 virtual DateList selectedDates();
221 222
222 virtual void printPreview(CalPrinter *calPrinter, 223 virtual void printPreview(CalPrinter *calPrinter,
223 const QDate &, const QDate &); 224 const QDate &, const QDate &);
224 bool isMonthView() { return true; } 225 bool isMonthView() { return true; }
225 bool isUpdatePossible() { return updatePossible; } 226 bool isUpdatePossible() { return updatePossible; }
226 227
227 MonthViewCell * selectedCell(); 228 MonthViewCell * selectedCell();
228 public slots: 229 public slots:
229 virtual void updateView(); 230 virtual void updateView();
230 virtual void updateConfig(); 231 virtual void updateConfig();
231 virtual void showDates(const QDate &start, const QDate &end); 232 virtual void showDates(const QDate &start, const QDate &end);
232 virtual void showEvents(QPtrList<Event> eventList); 233 virtual void showEvents(QPtrList<Event> eventList);
233 234
234 void changeEventDisplay(Event *, int); 235 void changeEventDisplay(Event *, int);
235 236
236 void clearSelection(); 237 void clearSelection();
237 238
238 void showContextMenu( Incidence * ); 239 void showContextMenu( Incidence * );
239 240
240 void setSelectedCell( MonthViewCell * ); 241 void setSelectedCell( MonthViewCell * );
241 242
242 protected slots: 243 protected slots:
243 void selectDateWeekNum ( int ); 244 void selectDateWeekNum ( int );
244 void selectInternalWeekNum ( int ); 245 void selectInternalWeekNum ( int );
245 void switchView(); 246 void switchView();
246 void processSelectionChange(); 247 void processSelectionChange();
247 signals: 248 signals:
248 void nextMonth(); 249 void nextMonth();
249 void prevMonth(); 250 void prevMonth();
250 void showNavigator( bool ); 251 void showNavigator( bool );
251 void selectWeekNum ( int ); 252 void selectWeekNum ( int );
252 void showDaySignal( QDate ); 253 void showDaySignal( QDate );
253 protected: 254 protected:
254 void resizeEvent(QResizeEvent *); 255 void resizeEvent(QResizeEvent *);
255 void viewChanged(); 256 void viewChanged();
256 void updateDayLabels(); 257 void updateDayLabels();
257 258
258 private: 259 private:
260 bool clPending;
261 QWidgetStack * mWidStack;
262 QWidget* mMonthView;
263 QWidget* mWeekView;
259 bool mShowWeekView; 264 bool mShowWeekView;
260 bool updatePossible; 265 bool updatePossible;
261 int mDaysPerWeek; 266 int mDaysPerWeek;
262 int mNumWeeks; 267 int mNumWeeks;
263 int mNumCells; 268 int mNumCells;
264 bool mWeekStartsMonday; 269 bool mWeekStartsMonday;
265 bool mShowSatSunComp; 270 bool mShowSatSunComp;
266 void computeLayout(); 271 void computeLayout();
267 void computeLayoutWeek(); 272 void computeLayoutWeek();
268 273
269 QPtrVector<MonthViewCell> mCells; 274 QPtrVector<MonthViewCell> mCells;
270 QPtrVector<QLabel> mDayLabels; 275 QPtrVector<QLabel> mDayLabels;
271 QPtrVector<KOWeekButton> mWeekLabels; 276 QPtrVector<KOWeekButton> mWeekLabels;
277 QPtrVector<MonthViewCell> mCellsW;
278 QPtrVector<QLabel> mDayLabelsW;
279 QPtrVector<KOWeekButton> mWeekLabelsW;
272 280
273 bool mShortDayLabels; 281 bool mShortDayLabels;
274 int mWidthLongDayLabel; 282 int mWidthLongDayLabel;
275 283
276 QDate mStartDate; 284 QDate mStartDate;
277 285
278 MonthViewCell *mSelectedCell; 286 MonthViewCell *mSelectedCell;
279 287
280 KOEventPopupMenu *mContextMenu; 288 KOEventPopupMenu *mContextMenu;
281 void keyPressEvent ( QKeyEvent * ) ; 289 void keyPressEvent ( QKeyEvent * ) ;
282 290
283}; 291};
284 292
285#endif 293#endif