-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 9f34d38..4f8fcc7 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,392 +1,394 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.2 ************ | 3 | ********** VERSION 2.0.2 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed the layout problem of the day label buttons | 6 | Fixed the layout problem of the day label buttons |
7 | of the agenda view introduced in version 2.0.1. | 7 | of the agenda view introduced in version 2.0.1. |
8 | 8 | ||
9 | Added WhatsThis support for the todo view and the list view. | ||
10 | |||
9 | Added a quite useful and quite hidden feature (to KO/Pi). | 11 | Added a quite useful and quite hidden feature (to KO/Pi). |
10 | Who does find it first? | 12 | Who does find it first? |
11 | Hint: You have to click somewhere in the views ... | 13 | Hint: You have to click somewhere in the views ... |
12 | 14 | ||
13 | 15 | ||
14 | ********** VERSION 2.0.1 ************ | 16 | ********** VERSION 2.0.1 ************ |
15 | 17 | ||
16 | Oooops ... I forgot to test on the Zaurus 5500 ... | 18 | Oooops ... I forgot to test on the Zaurus 5500 ... |
17 | 19 | ||
18 | Fixed many problems of new (english) strings (and german translations) | 20 | Fixed many problems of new (english) strings (and german translations) |
19 | introduced in the latest versions, where the text was not fitting on the | 21 | introduced in the latest versions, where the text was not fitting on the |
20 | 240x320 display of the Zaurus 5500. | 22 | 240x320 display of the Zaurus 5500. |
21 | 23 | ||
22 | KO/Pi: | 24 | KO/Pi: |
23 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 25 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
24 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 26 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
25 | 27 | ||
26 | Added items to the todolist popup menu for: | 28 | Added items to the todolist popup menu for: |
27 | Display all opened, all closed or all todos flat. | 29 | Display all opened, all closed or all todos flat. |
28 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 30 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
29 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 31 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
30 | Fixed several bugs in setting the completed datetime for todos. | 32 | Fixed several bugs in setting the completed datetime for todos. |
31 | Added info about completed datetime of todos to the todo viewer. | 33 | Added info about completed datetime of todos to the todo viewer. |
32 | Now displaying a completed todo (with completed datetime set) in the agenda view | 34 | Now displaying a completed todo (with completed datetime set) in the agenda view |
33 | at the time of the completion. Such that now it is possible to see in the agenda view | 35 | at the time of the completion. Such that now it is possible to see in the agenda view |
34 | when what todo was completed. | 36 | when what todo was completed. |
35 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 37 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
36 | Now the behaviour is: | 38 | Now the behaviour is: |
37 | Setting a parent to complete sets all (sub)childs to complete. | 39 | Setting a parent to complete sets all (sub)childs to complete. |
38 | Setting a parent to uncomplete does not change the childs. | 40 | Setting a parent to uncomplete does not change the childs. |
39 | Setting a child to uncomplete sets all parent to uncomplete. | 41 | Setting a child to uncomplete sets all parent to uncomplete. |
40 | Setting a child to complete does not change the parents. | 42 | Setting a child to complete does not change the parents. |
41 | 43 | ||
42 | Smart updating and double buffering of the daymatrix. | 44 | Smart updating and double buffering of the daymatrix. |
43 | Showing holidays in the day matrix. | 45 | Showing holidays in the day matrix. |
44 | Many other small performance updates. | 46 | Many other small performance updates. |
45 | 47 | ||
46 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 48 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
47 | 49 | ||
48 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 50 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
49 | If 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. | 51 | If 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. |
50 | 52 | ||
51 | 53 | ||
52 | ********** VERSION 2.0.0 ************ | 54 | ********** VERSION 2.0.0 ************ |
53 | 55 | ||
54 | Stable release 2.0.0! | 56 | Stable release 2.0.0! |
55 | 57 | ||
56 | KO/Pi: | 58 | KO/Pi: |
57 | Fixed problem in edit dialog recreation at startup. | 59 | Fixed problem in edit dialog recreation at startup. |
58 | Made "toggle view*" menu items enabled context sensitive. | 60 | Made "toggle view*" menu items enabled context sensitive. |
59 | Changed agenda size menu to items 1-10. | 61 | Changed agenda size menu to items 1-10. |
60 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 62 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
61 | Usebility enhancements in the KO/Pi menus. | 63 | Usebility enhancements in the KO/Pi menus. |
62 | Birthday import now adds year to summary. | 64 | Birthday import now adds year to summary. |
63 | What's Next view shows age in years for birthday. | 65 | What's Next view shows age in years for birthday. |
64 | 66 | ||
65 | OM/Pi: | 67 | OM/Pi: |
66 | Added three info lines to display subject, from and to of selected mails. | 68 | Added three info lines to display subject, from and to of selected mails. |
67 | 69 | ||
68 | KA/Pi: | 70 | KA/Pi: |
69 | Fixed jump bar behaviour on Zaurus. | 71 | Fixed jump bar behaviour on Zaurus. |
70 | Now KA/Pi search field supports searching for a range of starting characters. | 72 | Now KA/Pi search field supports searching for a range of starting characters. |
71 | E.g. to search for all contact beginning with b to n, type | 73 | E.g. to search for all contact beginning with b to n, type |
72 | b-n | 74 | b-n |
73 | in the search field. | 75 | in the search field. |
74 | 76 | ||
75 | ********** VERSION 1.9.20 ************ | 77 | ********** VERSION 1.9.20 ************ |
76 | 78 | ||
77 | KO/Pi: | 79 | KO/Pi: |
78 | Added for the "dislplay one day" agenda mode | 80 | Added for the "dislplay one day" agenda mode |
79 | info in the caption and in the day lables: | 81 | info in the caption and in the day lables: |
80 | Now it is displayed, if the selected day is from "day before yesterday" | 82 | Now it is displayed, if the selected day is from "day before yesterday" |
81 | to "day after tomorrow". | 83 | to "day after tomorrow". |
82 | Made it possible to delete a Todo, which has sub-todos. | 84 | Made it possible to delete a Todo, which has sub-todos. |
83 | Fixed two small problems in the todo view. | 85 | Fixed two small problems in the todo view. |
84 | Added missing German translation for filter edit and print dialog. | 86 | Added missing German translation for filter edit and print dialog. |
85 | Made search dialog closeable by cancel key. | 87 | Made search dialog closeable by cancel key. |
86 | 88 | ||
87 | Made it possible to select in the date picker the (ligt grey ) | 89 | Made it possible to select in the date picker the (ligt grey ) |
88 | dates of the prev./next month with the mouse. | 90 | dates of the prev./next month with the mouse. |
89 | 91 | ||
90 | OM/Pi: | 92 | OM/Pi: |
91 | "Delete mail" icon in main window now deletes all selected mails. | 93 | "Delete mail" icon in main window now deletes all selected mails. |
92 | Fixed the problem, that the state flag of imap mails was ignored. | 94 | Fixed the problem, that the state flag of imap mails was ignored. |
93 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view | 95 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view |
94 | to indecate that they are already seen. | 96 | to indecate that they are already seen. |
95 | Fixed the problem that the body of some mails was not displayed in the | 97 | Fixed the problem that the body of some mails was not displayed in the |
96 | mail viewer when fetching them from the imap server directly to read them. | 98 | mail viewer when fetching them from the imap server directly to read them. |
97 | Made it (configurable) possible to show the "To:" field in the list view. | 99 | Made it (configurable) possible to show the "To:" field in the list view. |
98 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | 100 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. |
99 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the | 101 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the |
100 | local storage folder (specified in account settings) of the account of the mail. | 102 | local storage folder (specified in account settings) of the account of the mail. |
101 | Removed some memory leaks in OM/Pi. | 103 | Removed some memory leaks in OM/Pi. |
102 | 104 | ||
103 | 105 | ||
104 | ********** VERSION 1.9.19 ************ | 106 | ********** VERSION 1.9.19 ************ |
105 | 107 | ||
106 | Added a lot of missing translations to KA/Pi, | 108 | Added a lot of missing translations to KA/Pi, |
107 | Added some missing translations to KO/Pi and OM/Pi. | 109 | Added some missing translations to KO/Pi and OM/Pi. |
108 | 110 | ||
109 | Fixed some minor problems in KA/Pi + KO/Pi. | 111 | Fixed some minor problems in KA/Pi + KO/Pi. |
110 | 112 | ||
111 | Fixed a crash when closing PwM/Pi. | 113 | Fixed a crash when closing PwM/Pi. |
112 | Added German translation for PwM/Pi. | 114 | Added German translation for PwM/Pi. |
113 | 115 | ||
114 | Made view change and Month View update faster in KO/Pi. | 116 | Made view change and Month View update faster in KO/Pi. |
115 | 117 | ||
116 | 118 | ||
117 | ********** VERSION 1.9.18 ************ | 119 | ********** VERSION 1.9.18 ************ |
118 | 120 | ||
119 | FYI: The VERSION 1.9.17 was a testing release only. | 121 | FYI: The VERSION 1.9.17 was a testing release only. |
120 | Please read the changelog of VERSION 1.9.17 as well. | 122 | Please read the changelog of VERSION 1.9.17 as well. |
121 | 123 | ||
122 | Cleaned up the syncing config dialog. | 124 | Cleaned up the syncing config dialog. |
123 | Added sync config options for date range for events. | 125 | Added sync config options for date range for events. |
124 | Added sync config options for filters on incoming data. | 126 | Added sync config options for filters on incoming data. |
125 | Added sync config options for filters on outgoing data. | 127 | Added sync config options for filters on outgoing data. |
126 | Please read the updated SyncHowTo about the new filter settings. | 128 | Please read the updated SyncHowTo about the new filter settings. |
127 | These filter settings make it now possible to sync with shared | 129 | These filter settings make it now possible to sync with shared |
128 | calendars without writing back private or confidential data | 130 | calendars without writing back private or confidential data |
129 | (via the outgoing filters). | 131 | (via the outgoing filters). |
130 | To sync only with particular parts of a shared calendar, | 132 | To sync only with particular parts of a shared calendar, |
131 | the incoming filter settings can be used. | 133 | the incoming filter settings can be used. |
132 | An example can be found in the SyncHowTo. | 134 | An example can be found in the SyncHowTo. |
133 | Same for shared addressbooks. | 135 | Same for shared addressbooks. |
134 | 136 | ||
135 | Added a setting for the global kdepim data storage. | 137 | Added a setting for the global kdepim data storage. |
136 | Usually the data is stored in (yourhomedir/kdepim). | 138 | Usually the data is stored in (yourhomedir/kdepim). |
137 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" | 139 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" |
138 | a directory where all the kdepim data is stored. | 140 | a directory where all the kdepim data is stored. |
139 | That makes it easy to save all kdepim data on a SD card on the Z, for example. | 141 | That makes it easy to save all kdepim data on a SD card on the Z, for example. |
140 | 142 | ||
141 | KO/Pi: | 143 | KO/Pi: |
142 | The timeedit input has a pulldown list for times. | 144 | The timeedit input has a pulldown list for times. |
143 | If opened, this pulldown list should now has the right time highlighted. | 145 | If opened, this pulldown list should now has the right time highlighted. |
144 | Added the possibility to exclude events/todos/journals in a filter. | 146 | Added the possibility to exclude events/todos/journals in a filter. |
145 | You should exclude journals, if you do not want them to sync with a public calendar. | 147 | You should exclude journals, if you do not want them to sync with a public calendar. |
146 | 148 | ||
147 | KA/Pi: | 149 | KA/Pi: |
148 | Added the possibility to in/exclude public/private/confidential contacts to a filter. | 150 | Added the possibility to in/exclude public/private/confidential contacts to a filter. |
149 | If 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 ... | 151 | If 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 ... |
150 | Added printing of card view and details view on desktop. | 152 | Added printing of card view and details view on desktop. |
151 | Printing of list view is not working... | 153 | Printing of list view is not working... |
152 | Added button for removing pictures in contact editor. | 154 | Added button for removing pictures in contact editor. |
153 | Parsing data fix of KA/Pi version 1.9.17. | 155 | Parsing data fix of KA/Pi version 1.9.17. |
154 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. | 156 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. |
155 | Fixed some syncing merging problems. | 157 | Fixed some syncing merging problems. |
156 | 158 | ||
157 | 159 | ||
158 | ********** VERSION 1.9.17 ************ | 160 | ********** VERSION 1.9.17 ************ |
159 | 161 | ||
160 | KO/Pi: | 162 | KO/Pi: |
161 | Fixed that tooltips were not updated after moving an item in agenda view. | 163 | Fixed that tooltips were not updated after moving an item in agenda view. |
162 | Fixed a bug in sorting start date for recurring events in list view. | 164 | Fixed a bug in sorting start date for recurring events in list view. |
163 | Changed the left button in todo viewer from "Agenda" to "Set completed". | 165 | Changed the left button in todo viewer from "Agenda" to "Set completed". |
164 | This 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. | 166 | This 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. |
165 | Added more info in the todo viewer: Startdate, parent/sub todos. | 167 | Added more info in the todo viewer: Startdate, parent/sub todos. |
166 | 168 | ||
167 | 169 | ||
168 | KA/Pi: | 170 | KA/Pi: |
169 | All fields search does now actually search all the (possible) fields, | 171 | All fields search does now actually search all the (possible) fields, |
170 | not only those listed in the contact list. | 172 | not only those listed in the contact list. |
171 | Made is possible to inline a picture in a vcard on the Z. | 173 | Made is possible to inline a picture in a vcard on the Z. |
172 | This was only possible on the desktop, now is it possible on the Z as well. | 174 | This was only possible on the desktop, now is it possible on the Z as well. |
173 | Fixed of missing save settings after filter configuration. | 175 | Fixed of missing save settings after filter configuration. |
174 | Made saving of addressbook much faster. | 176 | Made saving of addressbook much faster. |
175 | Fixed extension widget layout problem. | 177 | Fixed extension widget layout problem. |
176 | Fixed saving of default formatted name settings. | 178 | Fixed saving of default formatted name settings. |
177 | Fixed formatted name handling in edit dialog. | 179 | Fixed formatted name handling in edit dialog. |
178 | Added an option for changing formatted names of many contacts | 180 | Added an option for changing formatted names of many contacts |
179 | (menu: File - Change - Set formatted name). | 181 | (menu: File - Change - Set formatted name). |
180 | 182 | ||
181 | QWhatsThis was not working on the Z ( only black rectangle was shown). | 183 | QWhatsThis was not working on the Z ( only black rectangle was shown). |
182 | This is Fixed. | 184 | This is Fixed. |
183 | 185 | ||
184 | KDE-Sync: | 186 | KDE-Sync: |
185 | Now readonly KDE resources are synced as well. | 187 | Now readonly KDE resources are synced as well. |
186 | (They are not changed in KDE itself, of course). | 188 | (They are not changed in KDE itself, of course). |
187 | 189 | ||
188 | 190 | ||
189 | 191 | ||
190 | ********** VERSION 1.9.16 ************ | 192 | ********** VERSION 1.9.16 ************ |
191 | 193 | ||
192 | KO/Pi: | 194 | KO/Pi: |
193 | Fixed search dialog size on Z 6000 (480x640 display). | 195 | Fixed search dialog size on Z 6000 (480x640 display). |
194 | Added setting to hide/show time in agenda items. | 196 | Added setting to hide/show time in agenda items. |
195 | Added setting to hide not running todos in todo view. | 197 | Added setting to hide not running todos in todo view. |
196 | Added columns for start date/time in todo view. | 198 | Added columns for start date/time in todo view. |
197 | Replaced the solid half-hour lines in agenda view by dot lines. | 199 | Replaced the solid half-hour lines in agenda view by dot lines. |
198 | Added possibility of printing the What's Next View on the desktop | 200 | Added possibility of printing the What's Next View on the desktop |
199 | (i.e. Windows and Linux). | 201 | (i.e. Windows and Linux). |
200 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. | 202 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. |
201 | Added tooltips in month view.(Tooltips only available on desktop) | 203 | Added tooltips in month view.(Tooltips only available on desktop) |
202 | 204 | ||
203 | Fixed a strange problem in KO/Pi alarm applet. | 205 | Fixed a strange problem in KO/Pi alarm applet. |
204 | Did not find the actual problem, | 206 | Did not find the actual problem, |
205 | such that now Qtopia reboots again if deinstalling the alarm applet. | 207 | such that now Qtopia reboots again if deinstalling the alarm applet. |
206 | But the alarm applet should work again. | 208 | But the alarm applet should work again. |
207 | 209 | ||
208 | KA/Pi: | 210 | KA/Pi: |
209 | Fixed the problem, that internal pictures were not saved. | 211 | Fixed the problem, that internal pictures were not saved. |
210 | 212 | ||
211 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. | 213 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. |
212 | 214 | ||
213 | Fixed some minor problems. (Like word wrap in help text windows). | 215 | Fixed some minor problems. (Like word wrap in help text windows). |
214 | 216 | ||
215 | Fixed a compiling problem in microkde/kresources. | 217 | Fixed a compiling problem in microkde/kresources. |
216 | 218 | ||
217 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. | 219 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. |
218 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) | 220 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) |
219 | such that now syncing KO/Pi with Sharp DTM should work on the | 221 | such that now syncing KO/Pi with Sharp DTM should work on the |
220 | Zaurus C 3000 model. | 222 | Zaurus C 3000 model. |
221 | 223 | ||
222 | ********** VERSION 1.9.15 ************ | 224 | ********** VERSION 1.9.15 ************ |
223 | 225 | ||
224 | Usebilty enhancements in KO/Pi: | 226 | Usebilty enhancements in KO/Pi: |
225 | When clicking on the date in a month view cell, the day view is shown. | 227 | When clicking on the date in a month view cell, the day view is shown. |
226 | Old behaviour was, that the "new event" dialog popped up. | 228 | Old behaviour was, that the "new event" dialog popped up. |
227 | 229 | ||
228 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | 230 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). |
229 | That means, you can restore the latest | 231 | That means, you can restore the latest |
230 | event/todo/journal you have deleted. | 232 | event/todo/journal you have deleted. |
231 | A journal is deleted, if you clear all the text of the journal. | 233 | A journal is deleted, if you clear all the text of the journal. |
232 | 234 | ||
233 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. | 235 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. |
234 | 236 | ||
235 | KA/Pi starting in 480x640 resolution: | 237 | KA/Pi starting in 480x640 resolution: |
236 | Hide the filter action in toolbar | 238 | Hide the filter action in toolbar |
237 | and added icons for undo/delete/redo in toolbar. | 239 | and added icons for undo/delete/redo in toolbar. |
238 | 240 | ||
239 | Change in OM/Pi ViewMail dialog: | 241 | Change in OM/Pi ViewMail dialog: |
240 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. | 242 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. |
241 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). | 243 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). |
242 | 244 | ||
243 | Fixed a crash when deleting mail-accounts in OM/Pi. | 245 | Fixed a crash when deleting mail-accounts in OM/Pi. |
244 | 246 | ||
245 | 247 | ||
246 | ********** VERSION 1.9.14 ************ | 248 | ********** VERSION 1.9.14 ************ |
247 | 249 | ||
248 | Fixed some problems with the dialog sizes when switching | 250 | Fixed some problems with the dialog sizes when switching |
249 | portrait/landscape mode on 640x480 PDA display. | 251 | portrait/landscape mode on 640x480 PDA display. |
250 | 252 | ||
251 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 253 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
252 | 254 | ||
253 | Fixed an ugly bug in KOpieMail: | 255 | Fixed an ugly bug in KOpieMail: |
254 | KOpieMail was not able to write files (mails) to MSDOS file system, | 256 | KOpieMail was not able to write files (mails) to MSDOS file system, |
255 | like on an usual preformatted SD card. That should work now. | 257 | like on an usual preformatted SD card. That should work now. |
256 | To save your mail data on the Sd card do the following: | 258 | To save your mail data on the Sd card do the following: |
257 | Create a dir on the SD card: | 259 | Create a dir on the SD card: |
258 | mkdir /mnt/card/localmail | 260 | mkdir /mnt/card/localmail |
259 | Go to your home dir: | 261 | Go to your home dir: |
260 | cd | 262 | cd |
261 | Go to kopiemail data storage dir: | 263 | Go to kopiemail data storage dir: |
262 | cd kdepim/apps/kopiemail | 264 | cd kdepim/apps/kopiemail |
263 | Create a symlink to the SD card: | 265 | Create a symlink to the SD card: |
264 | ls -s /mnt/card/localmail | 266 | ls -s /mnt/card/localmail |
265 | Now KOpieMail will store all mails on the SD card. | 267 | Now KOpieMail will store all mails on the SD card. |
266 | 268 | ||
267 | KO/Pi Monthview: | 269 | KO/Pi Monthview: |
268 | Now "Go to Today" selects the current month from day 1-end, | 270 | Now "Go to Today" selects the current month from day 1-end, |
269 | not the current date + some days. | 271 | not the current date + some days. |
270 | I.e. "Go to Today" shows now always | 272 | I.e. "Go to Today" shows now always |
271 | the current month with first day of month in the first row. | 273 | the current month with first day of month in the first row. |
272 | 274 | ||
273 | Added missing German translation. | 275 | Added missing German translation. |
274 | 276 | ||
275 | Fixed icons of executeable on Wintendo. | 277 | Fixed icons of executeable on Wintendo. |
276 | 278 | ||
277 | Added a "Show next Mail" button to the OM/Pi | 279 | Added a "Show next Mail" button to the OM/Pi |
278 | mail viewer such that the mail below the current mail | 280 | mail viewer such that the mail below the current mail |
279 | in the mail list view of the current folder | 281 | in the mail list view of the current folder |
280 | can be read with a single click. | 282 | can be read with a single click. |
281 | 283 | ||
282 | 284 | ||
283 | ********** VERSION 1.9.13 ************ | 285 | ********** VERSION 1.9.13 ************ |
284 | 286 | ||
285 | Fixed nasty PwM/Pi file reading bug, when | 287 | Fixed nasty PwM/Pi file reading bug, when |
286 | the used hash algo of file is different then the global | 288 | the used hash algo of file is different then the global |
287 | hash algo. | 289 | hash algo. |
288 | 290 | ||
289 | Added KA/Pi support for opie mailit mailapplication. | 291 | Added KA/Pi support for opie mailit mailapplication. |
290 | 292 | ||
291 | Fixed some bugs in OM/Pi. | 293 | Fixed some bugs in OM/Pi. |
292 | Now character conversion tables are available for the Zaurus | 294 | Now character conversion tables are available for the Zaurus |
293 | to make OM/Pi working properly. | 295 | to make OM/Pi working properly. |
294 | To get the character conversion in OM/Pi working, please download | 296 | To get the character conversion in OM/Pi working, please download |
295 | at the sourceforge project site the package | 297 | at the sourceforge project site the package |
296 | sr-character-conversion_SharpROM_arm.ipk.zip | 298 | sr-character-conversion_SharpROM_arm.ipk.zip |
297 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 299 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
298 | from the section "general files for KDE/Pim" | 300 | from the section "general files for KDE/Pim" |
299 | Instructions how to install this package are in a ReadMe in this file. | 301 | Instructions how to install this package are in a ReadMe in this file. |
300 | 302 | ||
301 | 303 | ||
302 | Fixed the orientation change problem in KA/Pi when switching | 304 | Fixed the orientation change problem in KA/Pi when switching |
303 | portrait/landscape mode. | 305 | portrait/landscape mode. |
304 | 306 | ||
305 | French translation available for KA/Pi and OM/Pi. | 307 | French translation available for KA/Pi and OM/Pi. |
306 | 308 | ||
307 | Fixed some problems with categories in KO/Pi in DTM sync. | 309 | Fixed some problems with categories in KO/Pi in DTM sync. |
308 | 310 | ||
309 | Added selection dialog for export to phone in KA/Pi. | 311 | Added selection dialog for export to phone in KA/Pi. |
310 | 312 | ||
311 | If in KO/Pi is an attendee selected to add to a meeting and this | 313 | If in KO/Pi is an attendee selected to add to a meeting and this |
312 | attendee is already in the list of attendees, this person is not added | 314 | attendee is already in the list of attendees, this person is not added |
313 | again. | 315 | again. |
314 | 316 | ||
315 | Some menu cleanup in KA/Pi. | 317 | Some menu cleanup in KA/Pi. |
316 | 318 | ||
317 | ********** VERSION 1.9.12 ************ | 319 | ********** VERSION 1.9.12 ************ |
318 | 320 | ||
319 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 321 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
320 | 322 | ||
321 | Bugfix: Licence file is now shown again. | 323 | Bugfix: Licence file is now shown again. |
322 | 324 | ||
323 | OM/Pi now supports Unicode (utf8 charset). | 325 | OM/Pi now supports Unicode (utf8 charset). |
324 | Fixed some bugs in OM/Pi. | 326 | Fixed some bugs in OM/Pi. |
325 | 327 | ||
326 | KA/Pi has more German translation. | 328 | KA/Pi has more German translation. |
327 | 329 | ||
328 | 330 | ||
329 | ********** VERSION 1.9.11 ************ | 331 | ********** VERSION 1.9.11 ************ |
330 | 332 | ||
331 | Fixed several problems in PWM/Pi, like | 333 | Fixed several problems in PWM/Pi, like |
332 | asking the user, if unsaved changed are pending | 334 | asking the user, if unsaved changed are pending |
333 | when closing the app. | 335 | when closing the app. |
334 | And PwM/Pi handles now different texts for the | 336 | And PwM/Pi handles now different texts for the |
335 | fields Description, Username, Password, configurable per category. | 337 | fields Description, Username, Password, configurable per category. |
336 | 338 | ||
337 | Fixed a crash in KO/Pi , when importing/loading vcs files | 339 | Fixed a crash in KO/Pi , when importing/loading vcs files |
338 | which have an entry with an attendee with state: | 340 | which have an entry with an attendee with state: |
339 | NEEDS ACTION | 341 | NEEDS ACTION |
340 | 342 | ||
341 | Fixed some problems in the German translation of OM/Pi, | 343 | Fixed some problems in the German translation of OM/Pi, |
342 | which makes some dialogs not fitting on the screen | 344 | which makes some dialogs not fitting on the screen |
343 | of the Z 5500. | 345 | of the Z 5500. |
344 | 346 | ||
345 | Fixed Qtopia crash, when disabling/deinstalling | 347 | Fixed Qtopia crash, when disabling/deinstalling |
346 | KO/Pi alarm applet. | 348 | KO/Pi alarm applet. |
347 | 349 | ||
348 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 350 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
349 | on Linux desktop. | 351 | on Linux desktop. |
350 | 352 | ||
351 | Added feature "remove sync info" to sync menu. | 353 | Added feature "remove sync info" to sync menu. |
352 | 354 | ||
353 | Tweaked the KO/Pi What's next view a bit, added | 355 | Tweaked the KO/Pi What's next view a bit, added |
354 | setting to hide events that are done. | 356 | setting to hide events that are done. |
355 | 357 | ||
356 | Disabled "beam receive enabled" on startup to | 358 | Disabled "beam receive enabled" on startup to |
357 | avoid problems if Fastload is enabled. | 359 | avoid problems if Fastload is enabled. |
358 | Please set "beam receive enabled", | 360 | Please set "beam receive enabled", |
359 | if you want to receive data via IR. | 361 | if you want to receive data via IR. |
360 | 362 | ||
361 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 363 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
362 | on Linux desktop. | 364 | on Linux desktop. |
363 | 365 | ||
364 | Made in KA/Pi scrolling possible, if details view is selected. | 366 | Made in KA/Pi scrolling possible, if details view is selected. |
365 | (The keyboard focus is set automatically to the search line) | 367 | (The keyboard focus is set automatically to the search line) |
366 | 368 | ||
367 | Fixed a bug in DMT sync, that a new entry in DTM was added | 369 | Fixed a bug in DMT sync, that a new entry in DTM was added |
368 | on every sync to Kx/Pi. | 370 | on every sync to Kx/Pi. |
369 | 371 | ||
370 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 372 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
371 | 373 | ||
372 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 374 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
373 | non-latin1 characters. | 375 | non-latin1 characters. |
374 | 376 | ||
375 | Rearranged package contents of Sharp-ipks and made all | 377 | Rearranged package contents of Sharp-ipks and made all |
376 | packages installable on SD again. | 378 | packages installable on SD again. |
377 | 379 | ||
378 | Fixed the writing of addressbook data in DTM sync. | 380 | Fixed the writing of addressbook data in DTM sync. |
379 | Empty fields in KA/Pi were not removed. | 381 | Empty fields in KA/Pi were not removed. |
380 | 382 | ||
381 | Added better category handling in KA/Pi: | 383 | Added better category handling in KA/Pi: |
382 | Added item | 384 | Added item |
383 | Edit Categories and | 385 | Edit Categories and |
384 | Manage new categories | 386 | Manage new categories |
385 | to the settings menu. | 387 | to the settings menu. |
386 | Possible to configure a view to display categories. | 388 | Possible to configure a view to display categories. |
387 | 389 | ||
388 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 390 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
389 | 391 | ||
390 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 392 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
391 | 393 | ||
392 | ... and many other bugfixes. | 394 | ... and many other bugfixes. |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 0ef5ae4..00b1e92 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -426,768 +426,769 @@ void MonthViewCell::startUpdateCell() | |||
426 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 426 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
427 | item->setPalette( mHolidayPalette ); | 427 | item->setPalette( mHolidayPalette ); |
428 | mItemList->insertItem( item ); | 428 | mItemList->insertItem( item ); |
429 | mToolTip += mHolidayString+"\n"; | 429 | mToolTip += mHolidayString+"\n"; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | void MonthViewCell::insertEvent(Event *event) | 433 | void MonthViewCell::insertEvent(Event *event) |
434 | { | 434 | { |
435 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 435 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
436 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 436 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
437 | return; | 437 | return; |
438 | else | 438 | else |
439 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 439 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
440 | return; | 440 | return; |
441 | } | 441 | } |
442 | 442 | ||
443 | if ( event->categories().contains("Holiday") || | 443 | if ( event->categories().contains("Holiday") || |
444 | event->categories().contains(i18n("Holiday"))) { | 444 | event->categories().contains(i18n("Holiday"))) { |
445 | setHoliday( true ); | 445 | setHoliday( true ); |
446 | if ( mDate.dayOfWeek() == 7 ) | 446 | if ( mDate.dayOfWeek() == 7 ) |
447 | mItemList->setLineWidth( 3 ); | 447 | mItemList->setLineWidth( 3 ); |
448 | } | 448 | } |
449 | QString text; | 449 | QString text; |
450 | if (event->isMultiDay()) { | 450 | if (event->isMultiDay()) { |
451 | QString prefix = "<->"; | 451 | QString prefix = "<->"; |
452 | if ( event->doesRecur() ) { | 452 | if ( event->doesRecur() ) { |
453 | if ( event->recursOn( mDate) ) | 453 | if ( event->recursOn( mDate) ) |
454 | prefix ="->" ; | 454 | prefix ="->" ; |
455 | else { | 455 | else { |
456 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 456 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
457 | if ( event->recursOn( mDate.addDays( -days)) ) | 457 | if ( event->recursOn( mDate.addDays( -days)) ) |
458 | prefix ="<-" ; | 458 | prefix ="<-" ; |
459 | } | 459 | } |
460 | 460 | ||
461 | } else { | 461 | } else { |
462 | if (mDate == event->dtStart().date()) { | 462 | if (mDate == event->dtStart().date()) { |
463 | prefix ="->" ; | 463 | prefix ="->" ; |
464 | } else if (mDate == event->dtEnd().date()) { | 464 | } else if (mDate == event->dtEnd().date()) { |
465 | prefix ="<-" ; | 465 | prefix ="<-" ; |
466 | } | 466 | } |
467 | } | 467 | } |
468 | if ( !event->doesFloat() ) { | 468 | if ( !event->doesFloat() ) { |
469 | if ( mDate == event->dtStart().date () ) | 469 | if ( mDate == event->dtStart().date () ) |
470 | prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 470 | prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
471 | else if ( mDate == event->dtEnd().date () ) | 471 | else if ( mDate == event->dtEnd().date () ) |
472 | prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 472 | prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
473 | 473 | ||
474 | } | 474 | } |
475 | text = prefix + event->summary(); | 475 | text = prefix + event->summary(); |
476 | mToolTip += text; | 476 | mToolTip += text; |
477 | } else { | 477 | } else { |
478 | if (event->doesFloat()) { | 478 | if (event->doesFloat()) { |
479 | text = event->summary(); | 479 | text = event->summary(); |
480 | mToolTip += text; | 480 | mToolTip += text; |
481 | } | 481 | } |
482 | else { | 482 | else { |
483 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 483 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
484 | text += " " + event->summary(); | 484 | text += " " + event->summary(); |
485 | mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 485 | mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 | ||
489 | MonthViewItem *item = new MonthViewItem( event, mDate, text ); | 489 | MonthViewItem *item = new MonthViewItem( event, mDate, text ); |
490 | QPalette pal; | 490 | QPalette pal; |
491 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 491 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
492 | QStringList categories = event->categories(); | 492 | QStringList categories = event->categories(); |
493 | QString cat = categories.first(); | 493 | QString cat = categories.first(); |
494 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 494 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
495 | pal = getPalette(); | 495 | pal = getPalette(); |
496 | if (cat.isEmpty()) { | 496 | if (cat.isEmpty()) { |
497 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 497 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
498 | } else { | 498 | } else { |
499 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 499 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
500 | } | 500 | } |
501 | 501 | ||
502 | } else { | 502 | } else { |
503 | if (cat.isEmpty()) { | 503 | if (cat.isEmpty()) { |
504 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 504 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
505 | } else { | 505 | } else { |
506 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 506 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
510 | } else { | 510 | } else { |
511 | pal = mStandardPalette ; | 511 | pal = mStandardPalette ; |
512 | } | 512 | } |
513 | item->setPalette( pal ); | 513 | item->setPalette( pal ); |
514 | item->setRecur( event->recurrence()->doesRecur() ); | 514 | item->setRecur( event->recurrence()->doesRecur() ); |
515 | item->setAlarm( event->isAlarmEnabled() ); | 515 | item->setAlarm( event->isAlarmEnabled() ); |
516 | item->setMoreInfo( event->description().length() > 0 ); | 516 | item->setMoreInfo( event->description().length() > 0 ); |
517 | #ifdef DESKTOP_VERSION | 517 | #ifdef DESKTOP_VERSION |
518 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 518 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
519 | KOPrefs::instance()->email()); | 519 | KOPrefs::instance()->email()); |
520 | if ( me != 0 ) { | 520 | if ( me != 0 ) { |
521 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 521 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
522 | item->setReply(true); | 522 | item->setReply(true); |
523 | else | 523 | else |
524 | item->setReply(false); | 524 | item->setReply(false); |
525 | } else | 525 | } else |
526 | item->setReply(false); | 526 | item->setReply(false); |
527 | #endif | 527 | #endif |
528 | mItemList->insertItem( item ); | 528 | mItemList->insertItem( item ); |
529 | mToolTip += "\n"; | 529 | mToolTip += "\n"; |
530 | } | 530 | } |
531 | void MonthViewCell::insertTodo(Todo *todo) | 531 | void MonthViewCell::insertTodo(Todo *todo) |
532 | { | 532 | { |
533 | QString text; | 533 | QString text; |
534 | if (todo->hasDueDate()) { | 534 | if (todo->hasDueDate()) { |
535 | if (!todo->doesFloat()) { | 535 | if (!todo->doesFloat()) { |
536 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 536 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
537 | text += " "; | 537 | text += " "; |
538 | } | 538 | } |
539 | } | 539 | } |
540 | text += i18n("To-Do: %1").arg(todo->summary()); | 540 | text += i18n("To-Do: %1").arg(todo->summary()); |
541 | 541 | ||
542 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 542 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
543 | //item->setPalette( mStandardPalette ); | 543 | //item->setPalette( mStandardPalette ); |
544 | QPalette pal; | 544 | QPalette pal; |
545 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 545 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
546 | QStringList categories = todo->categories(); | 546 | QStringList categories = todo->categories(); |
547 | QString cat = categories.first(); | 547 | QString cat = categories.first(); |
548 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 548 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
549 | pal = getPalette(); | 549 | pal = getPalette(); |
550 | if (cat.isEmpty()) { | 550 | if (cat.isEmpty()) { |
551 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 551 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
552 | } else { | 552 | } else { |
553 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 553 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
554 | } | 554 | } |
555 | 555 | ||
556 | } else { | 556 | } else { |
557 | if (cat.isEmpty()) { | 557 | if (cat.isEmpty()) { |
558 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 558 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
559 | } else { | 559 | } else { |
560 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 560 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | } else { | 564 | } else { |
565 | pal = mStandardPalette ; | 565 | pal = mStandardPalette ; |
566 | } | 566 | } |
567 | item->setPalette( pal ); | 567 | item->setPalette( pal ); |
568 | mItemList->insertItem( item ); | 568 | mItemList->insertItem( item ); |
569 | mToolTip += text+"\n"; | 569 | mToolTip += text+"\n"; |
570 | } | 570 | } |
571 | void MonthViewCell::finishUpdateCell() | 571 | void MonthViewCell::finishUpdateCell() |
572 | { | 572 | { |
573 | #ifdef DESKTOP_VERSION | 573 | #ifdef DESKTOP_VERSION |
574 | if (mToolTip != "") | 574 | if (mToolTip != "") |
575 | QToolTip::add(this,mToolTip,toolTipGroup(),""); | 575 | QToolTip::add(this,mToolTip,toolTipGroup(),""); |
576 | #endif | 576 | #endif |
577 | mItemList->sort(); | 577 | mItemList->sort(); |
578 | //setMyPalette(); | 578 | //setMyPalette(); |
579 | setMyPalette(); | 579 | setMyPalette(); |
580 | QString text; | 580 | QString text; |
581 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | 581 | 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) { | 582 | 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 ) + " "; | 583 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; |
584 | mLabel->resize( mLabelBigSize ); | 584 | mLabel->resize( mLabelBigSize ); |
585 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 585 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
586 | } else { | 586 | } else { |
587 | mLabel->resize( mLabelSize ); | 587 | mLabel->resize( mLabelSize ); |
588 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 588 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
589 | } | 589 | } |
590 | 590 | ||
591 | mLabel->setText( text ); | 591 | mLabel->setText( text ); |
592 | resizeEvent( 0 ); | 592 | resizeEvent( 0 ); |
593 | } | 593 | } |
594 | void MonthViewCell::updateCell() | 594 | void MonthViewCell::updateCell() |
595 | { | 595 | { |
596 | if ( !mMonthView->isUpdatePossible() ) | 596 | if ( !mMonthView->isUpdatePossible() ) |
597 | return; | 597 | return; |
598 | startUpdateCell(); | 598 | startUpdateCell(); |
599 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 599 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
600 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); | 600 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); |
601 | Event *event; | 601 | Event *event; |
602 | for( event = events.first(); event; event = events.next() ) { // for event | 602 | for( event = events.first(); event; event = events.next() ) { // for event |
603 | insertEvent(event); | 603 | insertEvent(event); |
604 | } | 604 | } |
605 | // insert due todos | 605 | // insert due todos |
606 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); | 606 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); |
607 | Todo *todo; | 607 | Todo *todo; |
608 | for(todo = todos.first(); todo; todo = todos.next()) { | 608 | for(todo = todos.first(); todo; todo = todos.next()) { |
609 | insertTodo( todo ); | 609 | insertTodo( todo ); |
610 | } | 610 | } |
611 | finishUpdateCell(); | 611 | finishUpdateCell(); |
612 | // if ( isVisible()) | 612 | // if ( isVisible()) |
613 | //qApp->processEvents(); | 613 | //qApp->processEvents(); |
614 | } | 614 | } |
615 | 615 | ||
616 | void MonthViewCell::updateConfig() | 616 | void MonthViewCell::updateConfig() |
617 | { | 617 | { |
618 | setFont( KOPrefs::instance()->mMonthViewFont ); | 618 | setFont( KOPrefs::instance()->mMonthViewFont ); |
619 | 619 | ||
620 | QFontMetrics fm( font() ); | 620 | QFontMetrics fm( font() ); |
621 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); | 621 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); |
622 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); | 622 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); |
623 | mHolidayPalette = mStandardPalette; | 623 | mHolidayPalette = mStandardPalette; |
624 | mPrimaryPalette = mStandardPalette; | 624 | mPrimaryPalette = mStandardPalette; |
625 | mNonPrimaryPalette = mStandardPalette; | 625 | mNonPrimaryPalette = mStandardPalette; |
626 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { | 626 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { |
627 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); | 627 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); |
628 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); | 628 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); |
629 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); | 629 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); |
630 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); | 630 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); |
631 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); | 631 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); |
632 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); | 632 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); |
633 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); | 633 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); |
634 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); | 634 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); |
635 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); | 635 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); |
636 | } | 636 | } |
637 | //updateCell(); | 637 | //updateCell(); |
638 | } | 638 | } |
639 | 639 | ||
640 | void MonthViewCell::enableScrollBars( bool enabled ) | 640 | void MonthViewCell::enableScrollBars( bool enabled ) |
641 | { | 641 | { |
642 | if ( enabled ) { | 642 | if ( enabled ) { |
643 | mItemList->setVScrollBarMode(QScrollView::Auto); | 643 | mItemList->setVScrollBarMode(QScrollView::Auto); |
644 | mItemList->setHScrollBarMode(QScrollView::Auto); | 644 | mItemList->setHScrollBarMode(QScrollView::Auto); |
645 | } else { | 645 | } else { |
646 | mItemList->setVScrollBarMode(QScrollView::AlwaysOff); | 646 | mItemList->setVScrollBarMode(QScrollView::AlwaysOff); |
647 | mItemList->setHScrollBarMode(QScrollView::AlwaysOff); | 647 | mItemList->setHScrollBarMode(QScrollView::AlwaysOff); |
648 | } | 648 | } |
649 | } | 649 | } |
650 | 650 | ||
651 | Incidence *MonthViewCell::selectedIncidence() | 651 | Incidence *MonthViewCell::selectedIncidence() |
652 | { | 652 | { |
653 | int index = mItemList->currentItem(); | 653 | int index = mItemList->currentItem(); |
654 | if ( index < 0 ) return 0; | 654 | if ( index < 0 ) return 0; |
655 | 655 | ||
656 | MonthViewItem *item = | 656 | MonthViewItem *item = |
657 | static_cast<MonthViewItem *>( mItemList->item( index ) ); | 657 | static_cast<MonthViewItem *>( mItemList->item( index ) ); |
658 | 658 | ||
659 | if ( !item ) return 0; | 659 | if ( !item ) return 0; |
660 | 660 | ||
661 | return item->incidence(); | 661 | return item->incidence(); |
662 | } | 662 | } |
663 | 663 | ||
664 | QDate MonthViewCell::selectedIncidenceDate() | 664 | QDate MonthViewCell::selectedIncidenceDate() |
665 | { | 665 | { |
666 | QDate qd; | 666 | QDate qd; |
667 | int index = mItemList->currentItem(); | 667 | int index = mItemList->currentItem(); |
668 | if ( index < 0 ) return qd; | 668 | if ( index < 0 ) return qd; |
669 | 669 | ||
670 | MonthViewItem *item = | 670 | MonthViewItem *item = |
671 | static_cast<MonthViewItem *>( mItemList->item( index ) ); | 671 | static_cast<MonthViewItem *>( mItemList->item( index ) ); |
672 | 672 | ||
673 | if ( !item ) return qd; | 673 | if ( !item ) return qd; |
674 | 674 | ||
675 | return item->incidenceDate(); | 675 | return item->incidenceDate(); |
676 | } | 676 | } |
677 | 677 | ||
678 | void MonthViewCell::deselect() | 678 | void MonthViewCell::deselect() |
679 | { | 679 | { |
680 | mItemList->clearSelection(); | 680 | mItemList->clearSelection(); |
681 | enableScrollBars( false ); | 681 | enableScrollBars( false ); |
682 | // updateCell(); | 682 | // updateCell(); |
683 | } | 683 | } |
684 | void MonthViewCell::select() | 684 | void MonthViewCell::select() |
685 | { | 685 | { |
686 | ;// updateCell(); | 686 | ;// updateCell(); |
687 | } | 687 | } |
688 | 688 | ||
689 | void MonthViewCell::resizeEvent ( QResizeEvent * ) | 689 | void MonthViewCell::resizeEvent ( QResizeEvent * ) |
690 | { | 690 | { |
691 | if ( !mMonthView->isUpdatePossible() ) | 691 | if ( !mMonthView->isUpdatePossible() ) |
692 | return; | 692 | return; |
693 | 693 | ||
694 | int size = height() - mLabel->height() - 2; | 694 | int size = height() - mLabel->height() - 2; |
695 | if ( size > 0 ) | 695 | if ( size > 0 ) |
696 | mItemList->verticalScrollBar()->setMaximumHeight( size ); | 696 | mItemList->verticalScrollBar()->setMaximumHeight( size ); |
697 | size = width() - mLabel->width() -2; | 697 | size = width() - mLabel->width() -2; |
698 | if ( size > 0 ) | 698 | if ( size > 0 ) |
699 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); | 699 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); |
700 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); | 700 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); |
701 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 701 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
702 | } | 702 | } |
703 | 703 | ||
704 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 704 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
705 | { | 705 | { |
706 | if ( !item ) return; | 706 | if ( !item ) return; |
707 | 707 | ||
708 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 708 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
709 | Incidence *incidence = eventItem->incidence(); | 709 | Incidence *incidence = eventItem->incidence(); |
710 | if ( incidence ) mMonthView->defaultAction( incidence ); | 710 | if ( incidence ) mMonthView->defaultAction( incidence ); |
711 | } | 711 | } |
712 | void MonthViewCell::showDay() | 712 | void MonthViewCell::showDay() |
713 | { | 713 | { |
714 | emit showDaySignal( date() ); | 714 | emit showDaySignal( date() ); |
715 | } | 715 | } |
716 | void MonthViewCell::newEvent() | 716 | void MonthViewCell::newEvent() |
717 | { | 717 | { |
718 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 718 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
719 | emit newEventSignal( dt ); | 719 | emit newEventSignal( dt ); |
720 | } | 720 | } |
721 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 721 | void MonthViewCell::cellClicked( QListBoxItem *item ) |
722 | { | 722 | { |
723 | static QListBoxItem * lastClicked = 0; | 723 | static QListBoxItem * lastClicked = 0; |
724 | if ( item == 0 ) { | 724 | if ( item == 0 ) { |
725 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 725 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
726 | emit newEventSignal( dt ); | 726 | emit newEventSignal( dt ); |
727 | return; | 727 | return; |
728 | } | 728 | } |
729 | /* | 729 | /* |
730 | if ( lastClicked ) | 730 | if ( lastClicked ) |
731 | if ( ! item ) { | 731 | if ( ! item ) { |
732 | if ( lastClicked->listBox() != item->listBox() ) | 732 | if ( lastClicked->listBox() != item->listBox() ) |
733 | lastClicked->listBox()->clearSelection(); | 733 | lastClicked->listBox()->clearSelection(); |
734 | } | 734 | } |
735 | */ | 735 | */ |
736 | 736 | ||
737 | mMonthView->setSelectedCell( this ); | 737 | mMonthView->setSelectedCell( this ); |
738 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); | 738 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); |
739 | select(); | 739 | select(); |
740 | } | 740 | } |
741 | 741 | ||
742 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 742 | void MonthViewCell::contextMenu( QListBoxItem *item ) |
743 | { | 743 | { |
744 | if ( !item ) return; | 744 | if ( !item ) return; |
745 | 745 | ||
746 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 746 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
747 | Incidence *incidence = eventItem->incidence(); | 747 | Incidence *incidence = eventItem->incidence(); |
748 | if ( incidence ) mMonthView->showContextMenu( incidence ); | 748 | if ( incidence ) mMonthView->showContextMenu( incidence ); |
749 | } | 749 | } |
750 | 750 | ||
751 | void MonthViewCell::selection( QListBoxItem *item ) | 751 | void MonthViewCell::selection( QListBoxItem *item ) |
752 | { | 752 | { |
753 | if ( !item ) return; | 753 | if ( !item ) return; |
754 | 754 | ||
755 | mMonthView->setSelectedCell( this ); | 755 | mMonthView->setSelectedCell( this ); |
756 | } | 756 | } |
757 | 757 | ||
758 | 758 | ||
759 | // ******************************************************************************* | 759 | // ******************************************************************************* |
760 | // ******************************************************************************* | 760 | // ******************************************************************************* |
761 | // ******************************************************************************* | 761 | // ******************************************************************************* |
762 | 762 | ||
763 | 763 | ||
764 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 764 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
765 | : KOEventView( calendar, parent, name ), | 765 | : KOEventView( calendar, parent, name ), |
766 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 766 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
767 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 767 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
768 | { | 768 | { |
769 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 769 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
770 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; | 770 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; |
771 | if ( mShowWeekView ) | 771 | if ( mShowWeekView ) |
772 | mWeekStartsMonday = true; | 772 | mWeekStartsMonday = true; |
773 | updatePossible = false; | 773 | updatePossible = false; |
774 | mCells.setAutoDelete( true ); | 774 | mCells.setAutoDelete( true ); |
775 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 775 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
776 | // mDayLayout = new QGridLayout( this ); | 776 | // mDayLayout = new QGridLayout( this ); |
777 | // create the day of the week labels (Sun, Mon, etc) and add them to | 777 | // create the day of the week labels (Sun, Mon, etc) and add them to |
778 | // the layout. | 778 | // the layout. |
779 | mDayLabels.resize( mDaysPerWeek ); | 779 | mDayLabels.resize( mDaysPerWeek ); |
780 | QFont bfont = font(); | 780 | QFont bfont = font(); |
781 | if ( QApplication::desktop()->width() < 650 ) { | 781 | if ( QApplication::desktop()->width() < 650 ) { |
782 | bfont.setPointSize( bfont.pointSize() - 2 ); | 782 | bfont.setPointSize( bfont.pointSize() - 2 ); |
783 | } | 783 | } |
784 | bfont.setBold( true ); | 784 | bfont.setBold( true ); |
785 | int i; | 785 | int i; |
786 | 786 | ||
787 | for( i = 0; i < mDaysPerWeek; i++ ) { | 787 | for( i = 0; i < mDaysPerWeek; i++ ) { |
788 | QLabel *label = new QLabel( this ); | 788 | QLabel *label = new QLabel( this ); |
789 | label->setFont(bfont); | 789 | label->setFont(bfont); |
790 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 790 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
791 | label->setLineWidth(1); | 791 | label->setLineWidth(1); |
792 | label->setAlignment(AlignCenter); | 792 | label->setAlignment(AlignCenter); |
793 | mDayLabels.insert( i, label ); | 793 | mDayLabels.insert( i, label ); |
794 | } | 794 | } |
795 | 795 | ||
796 | bfont.setBold( false ); | 796 | bfont.setBold( false ); |
797 | mWeekLabels.resize( mNumWeeks+1 ); | 797 | mWeekLabels.resize( mNumWeeks+1 ); |
798 | for( i = 0; i < mNumWeeks+1; i++ ) { | 798 | for( i = 0; i < mNumWeeks+1; i++ ) { |
799 | KOWeekButton *label = new KOWeekButton( this ); | 799 | KOWeekButton *label = new KOWeekButton( this ); |
800 | label->setFont(bfont); | 800 | label->setFont(bfont); |
801 | connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) ); | 801 | connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) ); |
802 | label->setFlat(true); | 802 | label->setFlat(true); |
803 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view")); | 803 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view")); |
804 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 804 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
805 | //label->setLineWidth(1); | 805 | //label->setLineWidth(1); |
806 | //label->setAlignment(AlignCenter); | 806 | //label->setAlignment(AlignCenter); |
807 | mWeekLabels.insert( i, label ); | 807 | mWeekLabels.insert( i, label ); |
808 | } | 808 | } |
809 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 809 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
810 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nswitch to week mode view")); | ||
810 | int row, col; | 811 | int row, col; |
811 | mCells.resize( mNumCells ); | 812 | mCells.resize( mNumCells ); |
812 | for( row = 0; row < mNumWeeks; ++row ) { | 813 | for( row = 0; row < mNumWeeks; ++row ) { |
813 | for( col = 0; col < mDaysPerWeek; ++col ) { | 814 | for( col = 0; col < mDaysPerWeek; ++col ) { |
814 | MonthViewCell *cell = new MonthViewCell( this ); | 815 | MonthViewCell *cell = new MonthViewCell( this ); |
815 | mCells.insert( row * mDaysPerWeek + col, cell ); | 816 | mCells.insert( row * mDaysPerWeek + col, cell ); |
816 | 817 | ||
817 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 818 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
818 | SLOT( defaultAction( Incidence * ) ) ); | 819 | SLOT( defaultAction( Incidence * ) ) ); |
819 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 820 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
820 | SIGNAL( newEventSignal( QDateTime ) ) ); | 821 | SIGNAL( newEventSignal( QDateTime ) ) ); |
821 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 822 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
822 | SIGNAL( showDaySignal( QDate ) ) ); | 823 | SIGNAL( showDaySignal( QDate ) ) ); |
823 | } | 824 | } |
824 | } | 825 | } |
825 | 826 | ||
826 | connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), | 827 | connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), |
827 | SLOT( switchView() ) ); | 828 | SLOT( switchView() ) ); |
828 | mContextMenu = eventPopup(); | 829 | mContextMenu = eventPopup(); |
829 | // updateConfig(); //useless here | 830 | // updateConfig(); //useless here |
830 | 831 | ||
831 | emit incidenceSelected( 0 ); | 832 | emit incidenceSelected( 0 ); |
832 | } | 833 | } |
833 | 834 | ||
834 | KOMonthView::~KOMonthView() | 835 | KOMonthView::~KOMonthView() |
835 | { | 836 | { |
836 | delete mContextMenu; | 837 | delete mContextMenu; |
837 | } | 838 | } |
838 | void KOMonthView::switchView() | 839 | void KOMonthView::switchView() |
839 | { | 840 | { |
840 | if ( selectedCell( ) ) | 841 | if ( selectedCell( ) ) |
841 | selectedCell()->deselect(); | 842 | selectedCell()->deselect(); |
842 | mShowWeekView = !mShowWeekView; | 843 | mShowWeekView = !mShowWeekView; |
843 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; | 844 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; |
844 | emit showNavigator( !mShowWeekView ); | 845 | emit showNavigator( !mShowWeekView ); |
845 | computeLayout(); | 846 | computeLayout(); |
846 | updateConfig(); | 847 | updateConfig(); |
847 | } | 848 | } |
848 | 849 | ||
849 | int KOMonthView::maxDatesHint() | 850 | int KOMonthView::maxDatesHint() |
850 | { | 851 | { |
851 | return mNumCells; | 852 | return mNumCells; |
852 | } | 853 | } |
853 | 854 | ||
854 | int KOMonthView::currentDateCount() | 855 | int KOMonthView::currentDateCount() |
855 | { | 856 | { |
856 | return mNumCells; | 857 | return mNumCells; |
857 | } | 858 | } |
858 | 859 | ||
859 | QPtrList<Incidence> KOMonthView::selectedIncidences() | 860 | QPtrList<Incidence> KOMonthView::selectedIncidences() |
860 | { | 861 | { |
861 | QPtrList<Incidence> selected; | 862 | QPtrList<Incidence> selected; |
862 | 863 | ||
863 | if ( mSelectedCell ) { | 864 | if ( mSelectedCell ) { |
864 | Incidence *incidence = mSelectedCell->selectedIncidence(); | 865 | Incidence *incidence = mSelectedCell->selectedIncidence(); |
865 | if ( incidence ) selected.append( incidence ); | 866 | if ( incidence ) selected.append( incidence ); |
866 | } | 867 | } |
867 | 868 | ||
868 | return selected; | 869 | return selected; |
869 | } | 870 | } |
870 | 871 | ||
871 | DateList KOMonthView::selectedDates() | 872 | DateList KOMonthView::selectedDates() |
872 | { | 873 | { |
873 | DateList selected; | 874 | DateList selected; |
874 | 875 | ||
875 | if ( mSelectedCell ) { | 876 | if ( mSelectedCell ) { |
876 | QDate qd = mSelectedCell->selectedIncidenceDate(); | 877 | QDate qd = mSelectedCell->selectedIncidenceDate(); |
877 | if ( qd.isValid() ) selected.append( qd ); | 878 | if ( qd.isValid() ) selected.append( qd ); |
878 | } | 879 | } |
879 | 880 | ||
880 | return selected; | 881 | return selected; |
881 | } | 882 | } |
882 | 883 | ||
883 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 884 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
884 | const QDate &td) | 885 | const QDate &td) |
885 | { | 886 | { |
886 | #ifndef KORG_NOPRINTER | 887 | #ifndef KORG_NOPRINTER |
887 | calPrinter->preview(CalPrinter::Month, fd, td); | 888 | calPrinter->preview(CalPrinter::Month, fd, td); |
888 | #endif | 889 | #endif |
889 | } | 890 | } |
890 | 891 | ||
891 | void KOMonthView::updateConfig() | 892 | void KOMonthView::updateConfig() |
892 | { | 893 | { |
893 | 894 | ||
894 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 895 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
895 | 896 | ||
896 | if ( mShowWeekView ) | 897 | if ( mShowWeekView ) |
897 | mWeekStartsMonday = true; | 898 | mWeekStartsMonday = true; |
898 | QFontMetrics fontmetric(mDayLabels[0]->font()); | 899 | QFontMetrics fontmetric(mDayLabels[0]->font()); |
899 | mWidthLongDayLabel = 0; | 900 | mWidthLongDayLabel = 0; |
900 | 901 | ||
901 | for (int i = 0; i < 7; i++) { | 902 | for (int i = 0; i < 7; i++) { |
902 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 903 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
903 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 904 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
904 | } | 905 | } |
905 | bool temp = mShowSatSunComp ; | 906 | bool temp = mShowSatSunComp ; |
906 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 907 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
907 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) | 908 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) |
908 | computeLayout(); | 909 | computeLayout(); |
909 | updateDayLabels(); | 910 | updateDayLabels(); |
910 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); | 911 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); |
911 | int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; | 912 | int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; |
912 | //resizeEvent( 0 ); | 913 | //resizeEvent( 0 ); |
913 | for (uint i = 0; i < mCells.count(); ++i) { | 914 | for (uint i = 0; i < mCells.count(); ++i) { |
914 | mCells[i]->updateConfig(); | 915 | mCells[i]->updateConfig(); |
915 | } | 916 | } |
916 | #ifdef DESKTOP_VERSION | 917 | #ifdef DESKTOP_VERSION |
917 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 918 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); |
918 | #endif | 919 | #endif |
919 | updateView(); | 920 | updateView(); |
920 | } | 921 | } |
921 | 922 | ||
922 | void KOMonthView::updateDayLabels() | 923 | void KOMonthView::updateDayLabels() |
923 | { | 924 | { |
924 | 925 | ||
925 | for (int i = 0; i < 7; i++) { | 926 | for (int i = 0; i < 7; i++) { |
926 | if (mWeekStartsMonday) { | 927 | if (mWeekStartsMonday) { |
927 | bool show = mShortDayLabels; | 928 | bool show = mShortDayLabels; |
928 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) | 929 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) |
929 | show = true; | 930 | show = true; |
930 | mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 931 | mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
931 | } else { | 932 | } else { |
932 | if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); | 933 | if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); |
933 | else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); | 934 | else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); |
934 | 935 | ||
935 | } | 936 | } |
936 | } | 937 | } |
937 | } | 938 | } |
938 | 939 | ||
939 | void KOMonthView::showDates(const QDate &start, const QDate &) | 940 | void KOMonthView::showDates(const QDate &start, const QDate &) |
940 | { | 941 | { |
941 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 942 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
942 | 943 | ||
943 | 944 | ||
944 | mStartDate = start; | 945 | mStartDate = start; |
945 | 946 | ||
946 | int startWeekDay = mWeekStartsMonday ? 1 : 7; | 947 | int startWeekDay = mWeekStartsMonday ? 1 : 7; |
947 | 948 | ||
948 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { | 949 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { |
949 | mStartDate = mStartDate.addDays( -1 ); | 950 | mStartDate = mStartDate.addDays( -1 ); |
950 | } | 951 | } |
951 | 952 | ||
952 | bool primary = false; | 953 | bool primary = false; |
953 | uint i; | 954 | uint i; |
954 | for( i = 0; i < mCells.size(); ++i ) { | 955 | for( i = 0; i < mCells.size(); ++i ) { |
955 | QDate date = mStartDate.addDays( i ); | 956 | QDate date = mStartDate.addDays( i ); |
956 | mCells[i]->setDate( date ); | 957 | mCells[i]->setDate( date ); |
957 | 958 | ||
958 | #ifndef KORG_NOPLUGINS | 959 | #ifndef KORG_NOPLUGINS |
959 | // add holiday, if present | 960 | // add holiday, if present |
960 | QString hstring(KOCore::self()->holiday(date)); | 961 | QString hstring(KOCore::self()->holiday(date)); |
961 | mCells[i]->setHoliday( hstring ); | 962 | mCells[i]->setHoliday( hstring ); |
962 | #endif | 963 | #endif |
963 | 964 | ||
964 | } | 965 | } |
965 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); | 966 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); |
966 | for( i = 0; i < 6; ++i ) { | 967 | for( i = 0; i < 6; ++i ) { |
967 | int wno; | 968 | int wno; |
968 | // remember, according to ISO 8601, the first week of the year is the | 969 | // remember, according to ISO 8601, the first week of the year is the |
969 | // first week that contains a thursday. Thus we must subtract off 4, | 970 | // first week that contains a thursday. Thus we must subtract off 4, |
970 | // not just 1. | 971 | // not just 1. |
971 | int dayOfYear = date.dayOfYear(); | 972 | int dayOfYear = date.dayOfYear(); |
972 | if (dayOfYear % 7 != 0) | 973 | if (dayOfYear % 7 != 0) |
973 | wno = dayOfYear / 7 + 1; | 974 | wno = dayOfYear / 7 + 1; |
974 | else | 975 | else |
975 | wno =dayOfYear / 7; | 976 | wno =dayOfYear / 7; |
976 | mWeekLabels[i]->setWeekNum( wno ); | 977 | mWeekLabels[i]->setWeekNum( wno ); |
977 | date = date.addDays( 7 ); | 978 | date = date.addDays( 7 ); |
978 | } | 979 | } |
979 | updateView(); | 980 | updateView(); |
980 | } | 981 | } |
981 | 982 | ||
982 | void KOMonthView::showEvents(QPtrList<Event>) | 983 | void KOMonthView::showEvents(QPtrList<Event>) |
983 | { | 984 | { |
984 | qDebug("KOMonthView::selectEvents is not implemented yet. "); | 985 | qDebug("KOMonthView::selectEvents is not implemented yet. "); |
985 | } | 986 | } |
986 | 987 | ||
987 | void KOMonthView::changeEventDisplay(Event *, int) | 988 | void KOMonthView::changeEventDisplay(Event *, int) |
988 | { | 989 | { |
989 | // this should be re-written to be much more efficient, but this | 990 | // this should be re-written to be much more efficient, but this |
990 | // quick-and-dirty-hack gets the job done for right now. | 991 | // quick-and-dirty-hack gets the job done for right now. |
991 | updateView(); | 992 | updateView(); |
992 | } | 993 | } |
993 | 994 | ||
994 | void KOMonthView::updateView() | 995 | void KOMonthView::updateView() |
995 | { | 996 | { |
996 | 997 | ||
997 | if ( !updatePossible ) | 998 | if ( !updatePossible ) |
998 | return; | 999 | return; |
999 | //QTime ti; | 1000 | //QTime ti; |
1000 | //ti.start(); | 1001 | //ti.start(); |
1001 | #if 1 | 1002 | #if 1 |
1002 | int i; | 1003 | int i; |
1003 | int timeSpan = mCells.size()-1; | 1004 | int timeSpan = mCells.size()-1; |
1004 | if ( KOPrefs::instance()->mMonthViewWeek ) | 1005 | if ( KOPrefs::instance()->mMonthViewWeek ) |
1005 | timeSpan = 6; | 1006 | timeSpan = 6; |
1006 | for( i = 0; i < timeSpan + 1; ++i ) { | 1007 | for( i = 0; i < timeSpan + 1; ++i ) { |
1007 | mCells[i]->startUpdateCell(); | 1008 | mCells[i]->startUpdateCell(); |
1008 | } | 1009 | } |
1009 | 1010 | ||
1010 | QPtrList<Event> events = calendar()->events(); | 1011 | QPtrList<Event> events = calendar()->events(); |
1011 | Event *event; | 1012 | Event *event; |
1012 | QDateTime dt; | 1013 | QDateTime dt; |
1013 | bool ok; | 1014 | bool ok; |
1014 | QDate endDate = mStartDate.addDays( timeSpan ); | 1015 | QDate endDate = mStartDate.addDays( timeSpan ); |
1015 | for( event = events.first(); event; event = events.next() ) { // for event | 1016 | for( event = events.first(); event; event = events.next() ) { // for event |
1016 | if ( event->doesRecur() ) { | 1017 | if ( event->doesRecur() ) { |
1017 | bool last; | 1018 | bool last; |
1018 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); | 1019 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); |
1019 | QDateTime incidenceEnd; | 1020 | QDateTime incidenceEnd; |
1020 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 1021 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
1021 | bool invalid = false; | 1022 | bool invalid = false; |
1022 | while( true ) { | 1023 | while( true ) { |
1023 | if ( incidenceStart.isValid() ) { | 1024 | if ( incidenceStart.isValid() ) { |
1024 | incidenceEnd = incidenceStart.addDays( eventlen ); | 1025 | incidenceEnd = incidenceStart.addDays( eventlen ); |
1025 | int st = incidenceStart.date().daysTo( endDate ); | 1026 | int st = incidenceStart.date().daysTo( endDate ); |
1026 | if ( st >= 0 ) { // start before timeend | 1027 | if ( st >= 0 ) { // start before timeend |
1027 | int end = mStartDate.daysTo( incidenceEnd.date() ); | 1028 | int end = mStartDate.daysTo( incidenceEnd.date() ); |
1028 | if ( end >= 0 ) { // end after timestart --- got one! | 1029 | if ( end >= 0 ) { // end after timestart --- got one! |
1029 | //normalize | 1030 | //normalize |
1030 | st = timeSpan - st; | 1031 | st = timeSpan - st; |
1031 | if ( st < 0 ) st = 0; | 1032 | if ( st < 0 ) st = 0; |
1032 | if ( end > timeSpan ) end = timeSpan; | 1033 | if ( end > timeSpan ) end = timeSpan; |
1033 | int iii; | 1034 | int iii; |
1034 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); | 1035 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); |
1035 | for ( iii = st;iii<= end;++iii) | 1036 | for ( iii = st;iii<= end;++iii) |
1036 | mCells[iii]->insertEvent( event ); | 1037 | mCells[iii]->insertEvent( event ); |
1037 | } | 1038 | } |
1038 | } | 1039 | } |
1039 | } else { | 1040 | } else { |
1040 | if ( invalid ) | 1041 | if ( invalid ) |
1041 | break; | 1042 | break; |
1042 | invalid = true; | 1043 | invalid = true; |
1043 | //qDebug("invalid %s", event->summary().latin1()); | 1044 | //qDebug("invalid %s", event->summary().latin1()); |
1044 | incidenceStart = QDateTime( mStartDate ); | 1045 | incidenceStart = QDateTime( mStartDate ); |
1045 | } | 1046 | } |
1046 | if ( last ) | 1047 | if ( last ) |
1047 | break; | 1048 | break; |
1048 | bool ok; | 1049 | bool ok; |
1049 | incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); | 1050 | incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); |
1050 | if ( ! ok ) | 1051 | if ( ! ok ) |
1051 | break; | 1052 | break; |
1052 | if ( incidenceStart.date() > endDate ) | 1053 | if ( incidenceStart.date() > endDate ) |
1053 | break; | 1054 | break; |
1054 | } | 1055 | } |
1055 | } else { // no recur | 1056 | } else { // no recur |
1056 | int st = event->dtStart().date().daysTo( endDate ); | 1057 | int st = event->dtStart().date().daysTo( endDate ); |
1057 | if ( st >= 0 ) { // start before timeend | 1058 | if ( st >= 0 ) { // start before timeend |
1058 | int end = mStartDate.daysTo( event->dtEnd().date() ); | 1059 | int end = mStartDate.daysTo( event->dtEnd().date() ); |
1059 | if ( end >= 0 ) { // end after timestart --- got one! | 1060 | if ( end >= 0 ) { // end after timestart --- got one! |
1060 | //normalize | 1061 | //normalize |
1061 | st = timeSpan - st; | 1062 | st = timeSpan - st; |
1062 | if ( st < 0 ) st = 0; | 1063 | if ( st < 0 ) st = 0; |
1063 | if ( end > timeSpan ) end = timeSpan; | 1064 | if ( end > timeSpan ) end = timeSpan; |
1064 | int iii; | 1065 | int iii; |
1065 | for ( iii = st;iii<= end;++iii) | 1066 | for ( iii = st;iii<= end;++iii) |
1066 | mCells[iii]->insertEvent( event ); | 1067 | mCells[iii]->insertEvent( event ); |
1067 | } | 1068 | } |
1068 | } | 1069 | } |
1069 | } | 1070 | } |
1070 | } | 1071 | } |
1071 | // insert due todos | 1072 | // insert due todos |
1072 | QPtrList<Todo> todos = calendar()->todos( ); | 1073 | QPtrList<Todo> todos = calendar()->todos( ); |
1073 | Todo *todo; | 1074 | Todo *todo; |
1074 | for(todo = todos.first(); todo; todo = todos.next()) { | 1075 | for(todo = todos.first(); todo; todo = todos.next()) { |
1075 | //insertTodo( todo ); | 1076 | //insertTodo( todo ); |
1076 | if ( todo->hasDueDate() ) { | 1077 | if ( todo->hasDueDate() ) { |
1077 | int day = mStartDate.daysTo( todo->dtDue().date() ); | 1078 | int day = mStartDate.daysTo( todo->dtDue().date() ); |
1078 | if ( day >= 0 && day < timeSpan + 1) { | 1079 | if ( day >= 0 && day < timeSpan + 1) { |
1079 | mCells[day]->insertTodo( todo ); | 1080 | mCells[day]->insertTodo( todo ); |
1080 | } | 1081 | } |
1081 | } | 1082 | } |
1082 | } | 1083 | } |
1083 | 1084 | ||
1084 | for( i = 0; i < timeSpan+1; ++i ) { | 1085 | for( i = 0; i < timeSpan+1; ++i ) { |
1085 | mCells[i]->finishUpdateCell(); | 1086 | mCells[i]->finishUpdateCell(); |
1086 | } | 1087 | } |
1087 | processSelectionChange(); | 1088 | processSelectionChange(); |
1088 | mCells[0]->setFocus(); | 1089 | mCells[0]->setFocus(); |
1089 | 1090 | ||
1090 | 1091 | ||
1091 | #else | 1092 | #else |
1092 | // old code | 1093 | // old code |
1093 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); | 1094 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); |
1094 | int i; | 1095 | int i; |
1095 | for( i = 0; i < mCells.count(); ++i ) { | 1096 | for( i = 0; i < mCells.count(); ++i ) { |
1096 | mCells[i]->updateCell(); | 1097 | mCells[i]->updateCell(); |
1097 | } | 1098 | } |
1098 | 1099 | ||
1099 | //qDebug("KOMonthView::updateView() "); | 1100 | //qDebug("KOMonthView::updateView() "); |
1100 | processSelectionChange(); | 1101 | processSelectionChange(); |
1101 | // qDebug("---------------------------------------------------------------------+ "); | 1102 | // qDebug("---------------------------------------------------------------------+ "); |
1102 | mCells[0]->setFocus(); | 1103 | mCells[0]->setFocus(); |
1103 | #endif | 1104 | #endif |
1104 | 1105 | ||
1105 | //qDebug("update time %d ", ti.elapsed()); | 1106 | //qDebug("update time %d ", ti.elapsed()); |
1106 | } | 1107 | } |
1107 | 1108 | ||
1108 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1109 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1109 | { | 1110 | { |
1110 | computeLayout(); | 1111 | computeLayout(); |
1111 | mCells[0]->setFocus(); | 1112 | mCells[0]->setFocus(); |
1112 | } | 1113 | } |
1113 | void KOMonthView::computeLayoutWeek() | 1114 | void KOMonthView::computeLayoutWeek() |
1114 | { | 1115 | { |
1115 | 1116 | ||
1116 | int daysToShow; | 1117 | int daysToShow; |
1117 | bool combinedSatSun = false; | 1118 | bool combinedSatSun = false; |
1118 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1119 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1119 | daysToShow = 6; | 1120 | daysToShow = 6; |
1120 | combinedSatSun = true; | 1121 | combinedSatSun = true; |
1121 | } | 1122 | } |
1122 | int tWid = topLevelWidget()->size().width(); | 1123 | int tWid = topLevelWidget()->size().width(); |
1123 | int tHei = topLevelWidget()->size().height(); | 1124 | int tHei = topLevelWidget()->size().height(); |
1124 | 1125 | ||
1125 | int wid = size().width();//e | 1126 | int wid = size().width();//e |
1126 | int hei = size().height()-1; | 1127 | int hei = size().height()-1; |
1127 | 1128 | ||
1128 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) | 1129 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) |
1129 | return; | 1130 | return; |
1130 | 1131 | ||
1131 | if ( wid < hei ) | 1132 | if ( wid < hei ) |
1132 | daysToShow = 2; | 1133 | daysToShow = 2; |
1133 | else | 1134 | else |
1134 | daysToShow = 3; | 1135 | daysToShow = 3; |
1135 | mShowSatSunComp = true; | 1136 | mShowSatSunComp = true; |
1136 | combinedSatSun = true; | 1137 | combinedSatSun = true; |
1137 | 1138 | ||
1138 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); | 1139 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); |
1139 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1140 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1140 | int weeklabelwid = fm.width( "888" ); | 1141 | int weeklabelwid = fm.width( "888" ); |
1141 | wid -= weeklabelwid; | 1142 | wid -= weeklabelwid; |
1142 | 1143 | ||
1143 | int colWid = wid / daysToShow; | 1144 | int colWid = wid / daysToShow; |
1144 | int lastCol = wid - ( colWid*6 ); | 1145 | int lastCol = wid - ( colWid*6 ); |
1145 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); | 1146 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); |
1146 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); | 1147 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); |
1147 | int colModulo = wid % daysToShow; | 1148 | int colModulo = wid % daysToShow; |
1148 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; | 1149 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; |
1149 | //qDebug("rowmod %d ", rowModulo); | 1150 | //qDebug("rowmod %d ", rowModulo); |
1150 | int i; | 1151 | int i; |
1151 | int x,y,w,h; | 1152 | int x,y,w,h; |
1152 | x= 0; | 1153 | x= 0; |
1153 | y= 0; | 1154 | y= 0; |
1154 | w = colWid; | 1155 | w = colWid; |
1155 | h = dayLabelHei ; | 1156 | h = dayLabelHei ; |
1156 | for ( i = 0; i < 7; i++) { | 1157 | for ( i = 0; i < 7; i++) { |
1157 | if ( i && !( i % daysToShow) && i < 6) { | 1158 | if ( i && !( i % daysToShow) && i < 6) { |
1158 | y += hei/(5-daysToShow); | 1159 | y += hei/(5-daysToShow); |
1159 | x = 0; | 1160 | x = 0; |
1160 | w = colWid; | 1161 | w = colWid; |
1161 | } | 1162 | } |
1162 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { | 1163 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { |
1163 | ++w; | 1164 | ++w; |
1164 | } | 1165 | } |
1165 | if ( i >= 5 ) { | 1166 | if ( i >= 5 ) { |
1166 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h); | 1167 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h); |
1167 | x -= (w/2 ); | 1168 | x -= (w/2 ); |
1168 | } | 1169 | } |
1169 | else | 1170 | else |
1170 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1171 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1171 | x += w; | 1172 | x += w; |
1172 | } | 1173 | } |
1173 | x= 0; | 1174 | x= 0; |
1174 | y= dayLabelHei; | 1175 | y= dayLabelHei; |
1175 | w = colWid; | 1176 | w = colWid; |
1176 | h = cellHei; | 1177 | h = cellHei; |
1177 | for ( i = 0; i < mCells.count(); ++i) { | 1178 | for ( i = 0; i < mCells.count(); ++i) { |
1178 | if ( i > 6 ) { | 1179 | if ( i > 6 ) { |
1179 | mCells[i]->hide(); | 1180 | mCells[i]->hide(); |
1180 | continue; | 1181 | continue; |
1181 | } | 1182 | } |
1182 | 1183 | ||
1183 | w = colWid; | 1184 | w = colWid; |
1184 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { | 1185 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { |
1185 | ++w; | 1186 | ++w; |
1186 | } | 1187 | } |
1187 | if ( i == (daysToShow-1-rowModulo)*7) | 1188 | if ( i == (daysToShow-1-rowModulo)*7) |
1188 | ++h; | 1189 | ++h; |
1189 | 1190 | ||
1190 | if ( i >= 5 ) { | 1191 | if ( i >= 5 ) { |
1191 | if ( i ==5 ) { | 1192 | if ( i ==5 ) { |
1192 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); | 1193 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); |
1193 | x -= w ;y += h/2; | 1194 | x -= w ;y += h/2; |