-rw-r--r-- | bin/kdepim/WhatsNew.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefs.h | 2 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 13 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 78 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 7 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 33 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 1 | ||||
-rw-r--r-- | version | 2 |
12 files changed, 124 insertions, 30 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index ec75fad..bfe87f0 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,386 +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 1.9.16 ************ | ||
4 | |||
5 | KO/Pi: | ||
6 | Fixed search dialog size on Z 6000 (480x640 display). | ||
7 | Added setting to hide/show time in agenda items. | ||
8 | Added setting to hide not running todos in todo view. | ||
9 | Added columns for start date/time in todo view. | ||
10 | |||
3 | ********** VERSION 1.9.15 ************ | 11 | ********** VERSION 1.9.15 ************ |
4 | 12 | ||
5 | Usebilty enhancements in KO/Pi: | 13 | Usebilty enhancements in KO/Pi: |
6 | When clicking on the date in a month view cell, the day view is shown. | 14 | When clicking on the date in a month view cell, the day view is shown. |
7 | Old behaviour was, that the "new event" dialog popped up. | 15 | Old behaviour was, that the "new event" dialog popped up. |
8 | 16 | ||
9 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | 17 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). |
10 | That means, you can restore the latest | 18 | That means, you can restore the latest |
11 | event/todo/journal you have deleted. | 19 | event/todo/journal you have deleted. |
12 | A journal is deleted, if you clear all the text of the journal. | 20 | A journal is deleted, if you clear all the text of the journal. |
13 | 21 | ||
14 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. | 22 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. |
15 | 23 | ||
16 | KA/Pi starting in 480x640 resolution: | 24 | KA/Pi starting in 480x640 resolution: |
17 | Hide the filter action in toolbar | 25 | Hide the filter action in toolbar |
18 | and added icons for undo/delete/redo in toolbar. | 26 | and added icons for undo/delete/redo in toolbar. |
19 | 27 | ||
20 | Change in OM/Pi ViewMail dialog: | 28 | Change in OM/Pi ViewMail dialog: |
21 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). | 29 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). |
22 | 30 | ||
23 | Fixed a crash when deleting mail-accounts in OM/Pi. | 31 | Fixed a crash when deleting mail-accounts in OM/Pi. |
24 | 32 | ||
25 | 33 | ||
26 | ********** VERSION 1.9.14 ************ | 34 | ********** VERSION 1.9.14 ************ |
27 | 35 | ||
28 | Fixed some problems with the dialog sizes when switching | 36 | Fixed some problems with the dialog sizes when switching |
29 | portrait/landscape mode on 640x480 PDA display. | 37 | portrait/landscape mode on 640x480 PDA display. |
30 | 38 | ||
31 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 39 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
32 | 40 | ||
33 | Fixed an ugly bug in KOpieMail: | 41 | Fixed an ugly bug in KOpieMail: |
34 | KOpieMail was not able to write files (mails) to MSDOS file system, | 42 | KOpieMail was not able to write files (mails) to MSDOS file system, |
35 | like on an usual preformatted SD card. That should work now. | 43 | like on an usual preformatted SD card. That should work now. |
36 | To save your mail data on the Sd card do the following: | 44 | To save your mail data on the Sd card do the following: |
37 | Create a dir on the SD card: | 45 | Create a dir on the SD card: |
38 | mkdir /mnt/card/localmail | 46 | mkdir /mnt/card/localmail |
39 | Go to your home dir: | 47 | Go to your home dir: |
40 | cd | 48 | cd |
41 | Go to kopiemail data storage dir: | 49 | Go to kopiemail data storage dir: |
42 | cd kdepim/apps/kopiemail | 50 | cd kdepim/apps/kopiemail |
43 | Create a symlink to the SD card: | 51 | Create a symlink to the SD card: |
44 | ls -s /mnt/card/localmail | 52 | ls -s /mnt/card/localmail |
45 | Now KOpieMail will store all mails on the SD card. | 53 | Now KOpieMail will store all mails on the SD card. |
46 | 54 | ||
47 | KO/Pi Monthview: | 55 | KO/Pi Monthview: |
48 | Now "Go to Today" selects the current month from day 1-end, | 56 | Now "Go to Today" selects the current month from day 1-end, |
49 | not the current date + some days. | 57 | not the current date + some days. |
50 | I.e. "Go to Today" shows now always | 58 | I.e. "Go to Today" shows now always |
51 | the current month with first day of month in the first row. | 59 | the current month with first day of month in the first row. |
52 | 60 | ||
53 | Added missing German translation. | 61 | Added missing German translation. |
54 | 62 | ||
55 | Fixed icons of executeable on Wintendo. | 63 | Fixed icons of executeable on Wintendo. |
56 | 64 | ||
57 | Added a "Show next Mail" button to the OM/Pi | 65 | Added a "Show next Mail" button to the OM/Pi |
58 | mail viewer such that the mail below the current mail | 66 | mail viewer such that the mail below the current mail |
59 | in the mail list view of the current folder | 67 | in the mail list view of the current folder |
60 | can be read with a single click. | 68 | can be read with a single click. |
61 | 69 | ||
62 | 70 | ||
63 | ********** VERSION 1.9.13 ************ | 71 | ********** VERSION 1.9.13 ************ |
64 | 72 | ||
65 | Fixed nasty PwM/Pi file reading bug, when | 73 | Fixed nasty PwM/Pi file reading bug, when |
66 | the used hash algo of file is different then the global | 74 | the used hash algo of file is different then the global |
67 | hash algo. | 75 | hash algo. |
68 | 76 | ||
69 | Added KA/Pi support for opie mailit mailapplication. | 77 | Added KA/Pi support for opie mailit mailapplication. |
70 | 78 | ||
71 | Fixed some bugs in OM/Pi. | 79 | Fixed some bugs in OM/Pi. |
72 | Now character conversion tables are available for the Zaurus | 80 | Now character conversion tables are available for the Zaurus |
73 | to make OM/Pi working properly. | 81 | to make OM/Pi working properly. |
74 | To get the character conversion in OM/Pi working, please download | 82 | To get the character conversion in OM/Pi working, please download |
75 | at the sourceforge project site the package | 83 | at the sourceforge project site the package |
76 | sr-character-conversion_SharpROM_arm.ipk.zip | 84 | sr-character-conversion_SharpROM_arm.ipk.zip |
77 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 85 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
78 | from the section "general files for KDE/Pim" | 86 | from the section "general files for KDE/Pim" |
79 | Instructions how to install this package are in a ReadMe in this file. | 87 | Instructions how to install this package are in a ReadMe in this file. |
80 | 88 | ||
81 | 89 | ||
82 | Fixed the orientation change problem in KA/Pi when switching | 90 | Fixed the orientation change problem in KA/Pi when switching |
83 | portrait/landscape mode. | 91 | portrait/landscape mode. |
84 | 92 | ||
85 | French translation available for KA/Pi and OM/Pi. | 93 | French translation available for KA/Pi and OM/Pi. |
86 | 94 | ||
87 | Fixed some problems with categories in KO/Pi in DTM sync. | 95 | Fixed some problems with categories in KO/Pi in DTM sync. |
88 | 96 | ||
89 | Added selection dialog for export to phone in KA/Pi. | 97 | Added selection dialog for export to phone in KA/Pi. |
90 | 98 | ||
91 | If in KO/Pi is an attendee selected to add to a meeting and this | 99 | If in KO/Pi is an attendee selected to add to a meeting and this |
92 | attendee is already in the list of attendees, this person is not added | 100 | attendee is already in the list of attendees, this person is not added |
93 | again. | 101 | again. |
94 | 102 | ||
95 | Some menu cleanup in KA/Pi. | 103 | Some menu cleanup in KA/Pi. |
96 | 104 | ||
97 | ********** VERSION 1.9.12 ************ | 105 | ********** VERSION 1.9.12 ************ |
98 | 106 | ||
99 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 107 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
100 | 108 | ||
101 | Bugfix: Licence file is now shown again. | 109 | Bugfix: Licence file is now shown again. |
102 | 110 | ||
103 | OM/Pi now supports Unicode (utf8 charset). | 111 | OM/Pi now supports Unicode (utf8 charset). |
104 | Fixed some bugs in OM/Pi. | 112 | Fixed some bugs in OM/Pi. |
105 | 113 | ||
106 | KA/Pi has more German translation. | 114 | KA/Pi has more German translation. |
107 | 115 | ||
108 | 116 | ||
109 | ********** VERSION 1.9.11 ************ | 117 | ********** VERSION 1.9.11 ************ |
110 | 118 | ||
111 | Fixed several problems in PWM/Pi, like | 119 | Fixed several problems in PWM/Pi, like |
112 | asking the user, if unsaved changed are pending | 120 | asking the user, if unsaved changed are pending |
113 | when closing the app. | 121 | when closing the app. |
114 | And PwM/Pi handles now different texts for the | 122 | And PwM/Pi handles now different texts for the |
115 | fields Description, Username, Password, configurable per category. | 123 | fields Description, Username, Password, configurable per category. |
116 | 124 | ||
117 | Fixed a crash in KO/Pi , when importing/loading vcs files | 125 | Fixed a crash in KO/Pi , when importing/loading vcs files |
118 | which have an entry with an attendee with state: | 126 | which have an entry with an attendee with state: |
119 | NEEDS ACTION | 127 | NEEDS ACTION |
120 | 128 | ||
121 | Fixed some problems in the German translation of OM/Pi, | 129 | Fixed some problems in the German translation of OM/Pi, |
122 | which makes some dialogs not fitting on the screen | 130 | which makes some dialogs not fitting on the screen |
123 | of the Z 5500. | 131 | of the Z 5500. |
124 | 132 | ||
125 | Fixed Qtopia crash, when disabling/deinstalling | 133 | Fixed Qtopia crash, when disabling/deinstalling |
126 | KO/Pi alarm applet. | 134 | KO/Pi alarm applet. |
127 | 135 | ||
128 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 136 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
129 | on Linux desktop. | 137 | on Linux desktop. |
130 | 138 | ||
131 | Added feature "remove sync info" to sync menu. | 139 | Added feature "remove sync info" to sync menu. |
132 | 140 | ||
133 | Tweaked the KO/Pi What's next view a bit, added | 141 | Tweaked the KO/Pi What's next view a bit, added |
134 | setting to hide events that are done. | 142 | setting to hide events that are done. |
135 | 143 | ||
136 | Disabled "beam receive enabled" on startup to | 144 | Disabled "beam receive enabled" on startup to |
137 | avoid problems if Fastload is enabled. | 145 | avoid problems if Fastload is enabled. |
138 | Please set "beam receive enabled", | 146 | Please set "beam receive enabled", |
139 | if you want to receive data via IR. | 147 | if you want to receive data via IR. |
140 | 148 | ||
141 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 149 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
142 | on Linux desktop. | 150 | on Linux desktop. |
143 | 151 | ||
144 | Made in KA/Pi scrolling possible, if details view is selected. | 152 | Made in KA/Pi scrolling possible, if details view is selected. |
145 | (The keyboard focus is set automatically to the search line) | 153 | (The keyboard focus is set automatically to the search line) |
146 | 154 | ||
147 | Fixed a bug in DMT sync, that a new entry in DTM was added | 155 | Fixed a bug in DMT sync, that a new entry in DTM was added |
148 | on every sync to Kx/Pi. | 156 | on every sync to Kx/Pi. |
149 | 157 | ||
150 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 158 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
151 | 159 | ||
152 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 160 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
153 | non-latin1 characters. | 161 | non-latin1 characters. |
154 | 162 | ||
155 | Rearranged package contents of Sharp-ipks and made all | 163 | Rearranged package contents of Sharp-ipks and made all |
156 | packages installable on SD again. | 164 | packages installable on SD again. |
157 | 165 | ||
158 | Fixed the writing of addressbook data in DTM sync. | 166 | Fixed the writing of addressbook data in DTM sync. |
159 | Empty fields in KA/Pi were not removed. | 167 | Empty fields in KA/Pi were not removed. |
160 | 168 | ||
161 | Added better category handling in KA/Pi: | 169 | Added better category handling in KA/Pi: |
162 | Added item | 170 | Added item |
163 | Edit Categories and | 171 | Edit Categories and |
164 | Manage new categories | 172 | Manage new categories |
165 | to the settings menu. | 173 | to the settings menu. |
166 | Possible to configure a view to display categories. | 174 | Possible to configure a view to display categories. |
167 | 175 | ||
168 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 176 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
169 | 177 | ||
170 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 178 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
171 | 179 | ||
172 | ... and many other bugfixes. | 180 | ... and many other bugfixes. |
173 | 181 | ||
174 | ********** VERSION 1.9.10 ************ | 182 | ********** VERSION 1.9.10 ************ |
175 | 183 | ||
176 | Many internal small bugfixes. | 184 | Many internal small bugfixes. |
177 | And fix of the "big" bug in KO/Pi, | 185 | And fix of the "big" bug in KO/Pi, |
178 | that after Syncing the appointments had an offset by several hours. | 186 | that after Syncing the appointments had an offset by several hours. |
179 | That was a problem with the internal timezone setting, | 187 | That was a problem with the internal timezone setting, |
180 | introduced by the changed timezone configuration settings. | 188 | introduced by the changed timezone configuration settings. |
181 | 189 | ||
182 | German translation for OM/Pi is now available. | 190 | German translation for OM/Pi is now available. |
183 | 191 | ||
184 | 192 | ||
185 | ********** VERSION 1.9.9 ************ | 193 | ********** VERSION 1.9.9 ************ |
186 | 194 | ||
187 | KDE-Pim/Pi has a new Member! | 195 | KDE-Pim/Pi has a new Member! |
188 | It is called PWM/Pi (Passwordmanager/platform-independent) | 196 | It is called PWM/Pi (Passwordmanager/platform-independent) |
189 | and it is available for the Zaurus. | 197 | and it is available for the Zaurus. |
190 | It is planned, that it will be available later for Windows. | 198 | It is planned, that it will be available later for Windows. |
191 | (And for Linux, of course). | 199 | (And for Linux, of course). |
192 | It is a port of the Passwordmanager of KDE. | 200 | It is a port of the Passwordmanager of KDE. |
193 | It will need the MicroKDElibs to run. | 201 | It will need the MicroKDElibs to run. |
194 | 202 | ||
195 | Made loading of addressbooks in KA/Pi up to 7 times faster! | 203 | Made loading of addressbooks in KA/Pi up to 7 times faster! |
196 | The bigger your addressbook file, the more starting speed | 204 | The bigger your addressbook file, the more starting speed |
197 | will you gain. (relatively) | 205 | will you gain. (relatively) |
198 | 206 | ||
199 | The Qtopia addressbook connector is now platform independend | 207 | The Qtopia addressbook connector is now platform independend |
200 | as well and should work on any platform for importing/exporting | 208 | as well and should work on any platform for importing/exporting |
201 | Qtopia and Opie XML files. | 209 | Qtopia and Opie XML files. |
202 | 210 | ||
203 | Added a +30min feature to the timezone settings to make | 211 | Added a +30min feature to the timezone settings to make |
204 | KDE-Pim/Pi useable in Australia and other parts on the | 212 | KDE-Pim/Pi useable in Australia and other parts on the |
205 | world with strange timezones ;-) | 213 | world with strange timezones ;-) |
206 | 214 | ||
207 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. | 215 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. |
208 | 216 | ||
209 | It is now possible to disable the | 217 | It is now possible to disable the |
210 | "receive data via infrared" feature, such that syncing with | 218 | "receive data via infrared" feature, such that syncing with |
211 | Outlook is now possible again with Kx/Pi runing. | 219 | Outlook is now possible again with Kx/Pi runing. |
212 | Please disable it, before syncing Sharp DTM with Outlook. | 220 | Please disable it, before syncing Sharp DTM with Outlook. |
213 | For your convenience, the "receive data via infrared" feature | 221 | For your convenience, the "receive data via infrared" feature |
214 | is disabled automatically, if you sync Kx/Pi with DTM. | 222 | is disabled automatically, if you sync Kx/Pi with DTM. |
215 | You have to enable it again manually after syncing. | 223 | You have to enable it again manually after syncing. |
216 | Enabling this feature makes it impossible to start the | 224 | Enabling this feature makes it impossible to start the |
217 | Sharp DTM apps. If this feature is enabled, you will only get the | 225 | Sharp DTM apps. If this feature is enabled, you will only get the |
218 | alarm notification from KO/Pi and not from the Sharp calendar. | 226 | alarm notification from KO/Pi and not from the Sharp calendar. |
219 | This is very useful if you sync KO/Pi with Sharp DTM, | 227 | This is very useful if you sync KO/Pi with Sharp DTM, |
220 | because after syncing you usually would get notified about | 228 | because after syncing you usually would get notified about |
221 | an alarm by KO/Pi and the Sharp Calendar. | 229 | an alarm by KO/Pi and the Sharp Calendar. |
222 | 230 | ||
223 | Together with the Linux desktop version of KO/Pi | 231 | Together with the Linux desktop version of KO/Pi |
224 | it is now possible to sync KO/Pi on the Zaurus | 232 | it is now possible to sync KO/Pi on the Zaurus |
225 | with the complete KDE-desktop (3.3 or later) | 233 | with the complete KDE-desktop (3.3 or later) |
226 | calendar data easily. | 234 | calendar data easily. |
227 | That makes it possible to sync the Z with one | 235 | That makes it possible to sync the Z with one |
228 | click of a mouse with the KDE-Desktop. | 236 | click of a mouse with the KDE-Desktop. |
229 | This feature it available for all Zaurus platforms KO/Pi | 237 | This feature it available for all Zaurus platforms KO/Pi |
230 | is running on. | 238 | is running on. |
231 | The only thing needed is a running KO/Pi on Linux and | 239 | The only thing needed is a running KO/Pi on Linux and |
232 | a compiled version of the small | 240 | a compiled version of the small |
233 | KDE-Pim/Pi<->KDE-Desktop access command line program, | 241 | KDE-Pim/Pi<->KDE-Desktop access command line program, |
234 | which is in the KDE-Pim/Pi sources available. | 242 | which is in the KDE-Pim/Pi sources available. |
235 | 243 | ||
236 | The "KDE-desktop" syncing feature for KA/Pi will follow | 244 | The "KDE-desktop" syncing feature for KA/Pi will follow |
237 | in the next releases. | 245 | in the next releases. |
238 | 246 | ||
239 | Fixed the vcard export bug, which had the version 1.9.8. | 247 | Fixed the vcard export bug, which had the version 1.9.8. |
240 | 248 | ||
241 | Added missing GERMAN translation to KO/Pi. | 249 | Added missing GERMAN translation to KO/Pi. |
242 | Hi PsionX, could you add the missing french translation?Thx! | 250 | Hi PsionX, could you add the missing french translation?Thx! |
243 | 251 | ||
244 | Translation files for KA/Pi are available as well. | 252 | Translation files for KA/Pi are available as well. |
245 | GERMAN translation will be available in the next release. | 253 | GERMAN translation will be available in the next release. |
246 | PsionX ( yres, you again ;-) ), could you start translating | 254 | PsionX ( yres, you again ;-) ), could you start translating |
247 | KA/Pi? Thx! | 255 | KA/Pi? Thx! |
248 | 256 | ||
249 | You can download the version 1.9.9 at | 257 | You can download the version 1.9.9 at |
250 | 258 | ||
251 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 | 259 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 |
252 | 260 | ||
253 | Note: | 261 | Note: |
254 | To run the mail program OM/Pi you need libopenssl. | 262 | To run the mail program OM/Pi you need libopenssl. |
255 | A link to a download loaction is available at | 263 | A link to a download loaction is available at |
256 | ZSI at www.killefiz.de | 264 | ZSI at www.killefiz.de |
257 | 265 | ||
258 | 266 | ||
259 | ********** VERSION 1.9.8 ************ | 267 | ********** VERSION 1.9.8 ************ |
260 | 268 | ||
261 | Fixed character decoding in OM/Pi. | 269 | Fixed character decoding in OM/Pi. |
262 | (e.g. German "Umlaute" were not displayed properly.) | 270 | (e.g. German "Umlaute" were not displayed properly.) |
263 | 271 | ||
264 | Made is possible to reparent todos in KO/Pi. | 272 | Made is possible to reparent todos in KO/Pi. |
265 | Use contextmenu or keys (look at Help-Keys + Colors) for that. | 273 | Use contextmenu or keys (look at Help-Keys + Colors) for that. |
266 | 274 | ||
267 | Added the missing Sync-Howto and WhatsNew to the packages. | 275 | Added the missing Sync-Howto and WhatsNew to the packages. |
268 | 276 | ||
269 | KO/Pi on Linux desktop can now sync with KDE desktop. | 277 | KO/Pi on Linux desktop can now sync with KDE desktop. |
270 | That means: When using KO/Pi on Linux desktop for syncing with | 278 | That means: When using KO/Pi on Linux desktop for syncing with |
271 | KDE desktop and the Zaurus, the Zaurus can be synced now | 279 | KDE desktop and the Zaurus, the Zaurus can be synced now |
272 | with all KDE-Calendar resources, not only with one local file. | 280 | with all KDE-Calendar resources, not only with one local file. |
273 | (That makes it possible to sync the Zaurus with the | 281 | (That makes it possible to sync the Zaurus with the |
274 | calendar data on a Kolab server) | 282 | calendar data on a Kolab server) |
275 | 283 | ||
276 | KA/Pi syncing with KDE desktop will be available in the next version. | 284 | KA/Pi syncing with KDE desktop will be available in the next version. |
277 | 285 | ||
278 | 286 | ||
279 | ********** VERSION 1.9.7 ************ | 287 | ********** VERSION 1.9.7 ************ |
280 | 288 | ||
281 | KO/Pi - KA/Pi on Windows: | 289 | KO/Pi - KA/Pi on Windows: |
282 | Now a directory can be defined by the user, where the | 290 | Now a directory can be defined by the user, where the |
283 | application/config data should be saved. | 291 | application/config data should be saved. |
284 | Define your desired path in the evironment variable | 292 | Define your desired path in the evironment variable |
285 | MICROKDEHOME | 293 | MICROKDEHOME |
286 | before starting KO/Pi or KA/Pi. | 294 | before starting KO/Pi or KA/Pi. |
287 | 295 | ||
288 | An easy Kx/Pi to Kx/Pi syncing is now possible | 296 | An easy Kx/Pi to Kx/Pi syncing is now possible |
289 | (it is called Pi-Sync) via network. | 297 | (it is called Pi-Sync) via network. |
290 | Please look at the Sync Howto. | 298 | Please look at the Sync Howto. |
291 | 299 | ||
292 | Exporting of calendar data and contacts to mobile phones is now possible. | 300 | Exporting of calendar data and contacts to mobile phones is now possible. |
293 | The SyncHowto is updated with information howto | 301 | The SyncHowto is updated with information howto |
294 | access/sync mobile phones. | 302 | access/sync mobile phones. |
295 | Please look at the Sync Howto. | 303 | Please look at the Sync Howto. |
296 | 304 | ||
297 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | 305 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. |
298 | Please disable Fastload for the original contact/calendar applications | 306 | Please disable Fastload for the original contact/calendar applications |
299 | and close them. | 307 | and close them. |
300 | KO/Pi and KA/Pi must be running in order to receive the data. | 308 | KO/Pi and KA/Pi must be running in order to receive the data. |
301 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | 309 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) |
302 | 310 | ||
303 | In the KA/Pi details view are now the preferred tel. numbers displayed on top | 311 | In the KA/Pi details view are now the preferred tel. numbers displayed on top |
304 | of the other data ( emails/tel.numbers/addresses) | 312 | of the other data ( emails/tel.numbers/addresses) |
305 | 313 | ||
306 | Fixed some syncing problems in KA/Pi. | 314 | Fixed some syncing problems in KA/Pi. |
307 | 315 | ||
308 | Added font settings for the KA/Pi details view. | 316 | Added font settings for the KA/Pi details view. |
309 | Added fields "children's name" and "gender" to KA/Pi. | 317 | Added fields "children's name" and "gender" to KA/Pi. |
310 | 318 | ||
311 | Made searching in KA/Pi better: | 319 | Made searching in KA/Pi better: |
312 | Now the first item in a view is selected after a search automatically and | 320 | Now the first item in a view is selected after a search automatically and |
313 | the views can be scrolled up/down when the search input field has the keyboard focus. | 321 | the views can be scrolled up/down when the search input field has the keyboard focus. |
314 | 322 | ||
315 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. | 323 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. |
316 | 324 | ||
317 | 325 | ||
318 | ********** VERSION 1.9.6 ************ | 326 | ********** VERSION 1.9.6 ************ |
319 | 327 | ||
320 | Changes in the external application communication on the Zaurus | 328 | Changes in the external application communication on the Zaurus |
321 | in order to use less RAM when the apps are running. | 329 | in order to use less RAM when the apps are running. |
322 | First syncing of addressbooks (KA/Pi) is possible. | 330 | First syncing of addressbooks (KA/Pi) is possible. |
323 | 331 | ||
324 | 332 | ||
325 | ********** VERSION 1.9.5a ************ | 333 | ********** VERSION 1.9.5a ************ |
326 | 334 | ||
327 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. | 335 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. |
328 | Fixed some small bugs. | 336 | Fixed some small bugs. |
329 | KA/Pi shows now the birthday in summary view. | 337 | KA/Pi shows now the birthday in summary view. |
330 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi | 338 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi |
331 | for displaying dates. | 339 | for displaying dates. |
332 | 340 | ||
333 | 341 | ||
334 | ********** VERSION 1.9.5 ************ | 342 | ********** VERSION 1.9.5 ************ |
335 | 343 | ||
336 | There is still no Addressbook syncing! | 344 | There is still no Addressbook syncing! |
337 | 345 | ||
338 | New in 1.9.5: | 346 | New in 1.9.5: |
339 | 347 | ||
340 | Many bugfixes. | 348 | Many bugfixes. |
341 | Better searching in KA/Pi. | 349 | Better searching in KA/Pi. |
342 | You can configure in KA/Pi if you want to search only after | 350 | You can configure in KA/Pi if you want to search only after |
343 | <return> key pressed. | 351 | <return> key pressed. |
344 | 352 | ||
345 | Better mail downloading in OM/Pi. | 353 | Better mail downloading in OM/Pi. |
346 | 354 | ||
347 | First experimental alpha version of sync of KO/Pi with mobile phones. | 355 | First experimental alpha version of sync of KO/Pi with mobile phones. |
348 | See gammu documentation for supported phones. | 356 | See gammu documentation for supported phones. |
349 | You 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. | 357 | You 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. |
350 | Quick hint how to use: | 358 | Quick hint how to use: |
351 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! | 359 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! |
352 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. | 360 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. |
353 | Create syncprofile - mobile device | 361 | Create syncprofile - mobile device |
354 | Remove entry for model. (Leave empty ). | 362 | Remove entry for model. (Leave empty ). |
355 | Enable infrared on Zaurus and your Phone. | 363 | Enable infrared on Zaurus and your Phone. |
356 | Sync. | 364 | Sync. |
357 | To get a more detailed log, start kopi from konsole. | 365 | To get a more detailed log, start kopi from konsole. |
358 | 366 | ||
359 | ********** VERSION 1.9.4 ************ | 367 | ********** VERSION 1.9.4 ************ |
360 | 368 | ||
361 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. | 369 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. |
362 | 370 | ||
363 | WARNING: | 371 | WARNING: |
364 | PLEASE BACKUP ALL YOUR DATA! | 372 | PLEASE BACKUP ALL YOUR DATA! |
365 | We have changed a lot and maybe there are some unknown problems. | 373 | We have changed a lot and maybe there are some unknown problems. |
366 | 374 | ||
367 | SYNC HANDLING HAS CHANGED! | 375 | SYNC HANDLING HAS CHANGED! |
368 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 376 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
369 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 377 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
370 | 378 | ||
371 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. | 379 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. |
372 | If 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. | 380 | If 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. |
373 | 381 | ||
374 | As programs are available: | 382 | As programs are available: |
375 | KO/Pi (korganizer ipk) - a calendar program. | 383 | KO/Pi (korganizer ipk) - a calendar program. |
376 | KA/Pi (kaddressbook ipk ) - an addressbook | 384 | KA/Pi (kaddressbook ipk ) - an addressbook |
377 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. | 385 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. |
378 | 386 | ||
379 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. | 387 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. |
380 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) | 388 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) |
381 | 389 | ||
382 | All the applications are installed in a "Pim" TAB. | 390 | All the applications are installed in a "Pim" TAB. |
383 | If 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 | 391 | If 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 |
384 | 392 | ||
385 | All the application are integrated. | 393 | All the application are integrated. |
386 | Such 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. | 394 | Such 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. |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a46cd87..7ddbe23 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1,697 +1,699 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Requires the Qt and KDE widget libraries, available at no cost at | 4 | Requires the Qt and KDE widget libraries, available at no cost at |
5 | http://www.troll.no and http://www.kde.org respectively | 5 | http://www.troll.no and http://www.kde.org respectively |
6 | 6 | ||
7 | Copyright (c) 1997, 1998, 1999 | 7 | Copyright (c) 1997, 1998, 1999 |
8 | Preston Brown (preston.brown@yale.edu) | 8 | Preston Brown (preston.brown@yale.edu) |
9 | Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) | 9 | Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) |
10 | Ian Dawes (iadawes@globalserve.net) | 10 | Ian Dawes (iadawes@globalserve.net) |
11 | Laszlo Boloni (boloni@cs.purdue.edu) | 11 | Laszlo Boloni (boloni@cs.purdue.edu) |
12 | 12 | ||
13 | Copyright (c) 2000, 2001, 2002 | 13 | Copyright (c) 2000, 2001, 2002 |
14 | Cornelius Schumacher <schumacher@kde.org> | 14 | Cornelius Schumacher <schumacher@kde.org> |
15 | 15 | ||
16 | This program is free software; you can redistribute it and/or modify | 16 | This program is free software; you can redistribute it and/or modify |
17 | it under the terms of the GNU General Public License as published by | 17 | it under the terms of the GNU General Public License as published by |
18 | the Free Software Foundation; either version 2 of the License, or | 18 | the Free Software Foundation; either version 2 of the License, or |
19 | (at your option) any later version. | 19 | (at your option) any later version. |
20 | 20 | ||
21 | This program is distributed in the hope that it will be useful, | 21 | This program is distributed in the hope that it will be useful, |
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
24 | GNU General Public License for more details. | 24 | GNU General Public License for more details. |
25 | 25 | ||
26 | You should have received a copy of the GNU General Public License | 26 | You should have received a copy of the GNU General Public License |
27 | along with this program; if not, write to the Free Software | 27 | along with this program; if not, write to the Free Software |
28 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 28 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | 32 | ||
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qbuttongroup.h> | 35 | #include <qbuttongroup.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qclipboard.h> | 37 | #include <qclipboard.h> |
38 | #include <qcursor.h> | 38 | #include <qcursor.h> |
39 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
40 | #include <qprogressbar.h> | 40 | #include <qprogressbar.h> |
41 | #include <qmultilineedit.h> | 41 | #include <qmultilineedit.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qwidgetstack.h> | 43 | #include <qwidgetstack.h> |
44 | #include <qptrlist.h> | 44 | #include <qptrlist.h> |
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | #include <qgroupbox.h> | 46 | #include <qgroupbox.h> |
47 | #include <qfile.h> | 47 | #include <qfile.h> |
48 | #include <qdir.h> | 48 | #include <qdir.h> |
49 | #ifndef KORG_NOSPLITTER | 49 | #ifndef KORG_NOSPLITTER |
50 | #include <qsplitter.h> | 50 | #include <qsplitter.h> |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #include <kglobal.h> | 53 | #include <kglobal.h> |
54 | #include <kdebug.h> | 54 | #include <kdebug.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | #include <kmessagebox.h> | 57 | #include <kmessagebox.h> |
58 | #include <knotifyclient.h> | 58 | #include <knotifyclient.h> |
59 | #include <kconfig.h> | 59 | #include <kconfig.h> |
60 | 60 | ||
61 | #include <libkdepim/ksyncprefsdialog.h> | 61 | #include <libkdepim/ksyncprefsdialog.h> |
62 | #include <krun.h> | 62 | #include <krun.h> |
63 | #include <kdirwatch.h> | 63 | #include <kdirwatch.h> |
64 | #include <libkdepim/kdatepicker.h> | 64 | #include <libkdepim/kdatepicker.h> |
65 | #include <libkdepim/ksyncprofile.h> | 65 | #include <libkdepim/ksyncprofile.h> |
66 | #include <libkdepim/kpimglobalprefs.h> | 66 | #include <libkdepim/kpimglobalprefs.h> |
67 | 67 | ||
68 | #include <libkcal/vcaldrag.h> | 68 | #include <libkcal/vcaldrag.h> |
69 | #include <libkcal/icaldrag.h> | 69 | #include <libkcal/icaldrag.h> |
70 | #include <libkcal/icalformat.h> | 70 | #include <libkcal/icalformat.h> |
71 | #include <libkcal/vcalformat.h> | 71 | #include <libkcal/vcalformat.h> |
72 | #include <libkcal/scheduler.h> | 72 | #include <libkcal/scheduler.h> |
73 | #include <libkcal/calendarlocal.h> | 73 | #include <libkcal/calendarlocal.h> |
74 | #include <libkcal/journal.h> | 74 | #include <libkcal/journal.h> |
75 | #include <libkcal/calfilter.h> | 75 | #include <libkcal/calfilter.h> |
76 | #include <libkcal/attendee.h> | 76 | #include <libkcal/attendee.h> |
77 | #include <libkcal/dndfactory.h> | 77 | #include <libkcal/dndfactory.h> |
78 | #include <libkcal/freebusy.h> | 78 | #include <libkcal/freebusy.h> |
79 | #include <libkcal/filestorage.h> | 79 | #include <libkcal/filestorage.h> |
80 | #include <libkcal/calendarresources.h> | 80 | #include <libkcal/calendarresources.h> |
81 | #include <libkcal/qtopiaformat.h> | 81 | #include <libkcal/qtopiaformat.h> |
82 | #include "../kalarmd/alarmdialog.h" | 82 | #include "../kalarmd/alarmdialog.h" |
83 | 83 | ||
84 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
85 | #include <libkcal/sharpformat.h> | 85 | #include <libkcal/sharpformat.h> |
86 | #include <externalapphandler.h> | 86 | #include <externalapphandler.h> |
87 | #endif | 87 | #endif |
88 | #include <libkcal/phoneformat.h> | 88 | #include <libkcal/phoneformat.h> |
89 | #ifndef KORG_NOMAIL | 89 | #ifndef KORG_NOMAIL |
90 | #include "komailclient.h" | 90 | #include "komailclient.h" |
91 | #endif | 91 | #endif |
92 | #ifndef KORG_NOPRINTER | 92 | #ifndef KORG_NOPRINTER |
93 | #include "calprinter.h" | 93 | #include "calprinter.h" |
94 | #endif | 94 | #endif |
95 | #ifndef KORG_NOPLUGINS | 95 | #ifndef KORG_NOPLUGINS |
96 | #include "kocore.h" | 96 | #include "kocore.h" |
97 | #endif | 97 | #endif |
98 | #include "koeventeditor.h" | 98 | #include "koeventeditor.h" |
99 | #include "kotodoeditor.h" | 99 | #include "kotodoeditor.h" |
100 | #include "koprefs.h" | 100 | #include "koprefs.h" |
101 | #include "koeventviewerdialog.h" | 101 | #include "koeventviewerdialog.h" |
102 | #include "publishdialog.h" | 102 | #include "publishdialog.h" |
103 | #include "kofilterview.h" | 103 | #include "kofilterview.h" |
104 | #include "koglobals.h" | 104 | #include "koglobals.h" |
105 | #include "koviewmanager.h" | 105 | #include "koviewmanager.h" |
106 | #include "koagendaview.h" | 106 | #include "koagendaview.h" |
107 | #include "kodialogmanager.h" | 107 | #include "kodialogmanager.h" |
108 | #include "outgoingdialog.h" | 108 | #include "outgoingdialog.h" |
109 | #include "incomingdialog.h" | 109 | #include "incomingdialog.h" |
110 | #include "statusdialog.h" | 110 | #include "statusdialog.h" |
111 | #include "kdatenavigator.h" | 111 | #include "kdatenavigator.h" |
112 | #include "kotodoview.h" | 112 | #include "kotodoview.h" |
113 | #include "datenavigator.h" | 113 | #include "datenavigator.h" |
114 | #include "resourceview.h" | 114 | #include "resourceview.h" |
115 | #include "navigatorbar.h" | 115 | #include "navigatorbar.h" |
116 | #include "searchdialog.h" | 116 | #include "searchdialog.h" |
117 | #include "mainwindow.h" | 117 | #include "mainwindow.h" |
118 | 118 | ||
119 | #include "calendarview.h" | 119 | #include "calendarview.h" |
120 | #ifndef DESKTOP_VERSION | 120 | #ifndef DESKTOP_VERSION |
121 | #include <qtopia/alarmserver.h> | 121 | #include <qtopia/alarmserver.h> |
122 | #endif | 122 | #endif |
123 | #ifndef _WIN32_ | 123 | #ifndef _WIN32_ |
124 | #include <stdlib.h> | 124 | #include <stdlib.h> |
125 | #include <stdio.h> | 125 | #include <stdio.h> |
126 | #include <unistd.h> | 126 | #include <unistd.h> |
127 | #else | 127 | #else |
128 | #include <qprocess.h> | 128 | #include <qprocess.h> |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #ifdef DESKTOP_VERSION | 131 | #ifdef DESKTOP_VERSION |
132 | #include <kabc/stdaddressbook.h> | 132 | #include <kabc/stdaddressbook.h> |
133 | #endif | 133 | #endif |
134 | using namespace KOrg; | 134 | using namespace KOrg; |
135 | using namespace KCal; | 135 | using namespace KCal; |
136 | extern int globalFlagBlockAgenda; | 136 | extern int globalFlagBlockAgenda; |
137 | extern int globalFlagBlockStartup; | 137 | extern int globalFlagBlockStartup; |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | class KOBeamPrefs : public QDialog | 141 | class KOBeamPrefs : public QDialog |
142 | { | 142 | { |
143 | public: | 143 | public: |
144 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : | 144 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : |
145 | QDialog( parent, name, true ) | 145 | QDialog( parent, name, true ) |
146 | { | 146 | { |
147 | setCaption( i18n("Beam Options") ); | 147 | setCaption( i18n("Beam Options") ); |
148 | QVBoxLayout* lay = new QVBoxLayout( this ); | 148 | QVBoxLayout* lay = new QVBoxLayout( this ); |
149 | lay->setSpacing( 3 ); | 149 | lay->setSpacing( 3 ); |
150 | lay->setMargin( 3 ); | 150 | lay->setMargin( 3 ); |
151 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); | 151 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); |
152 | lay->addWidget( format ); | 152 | lay->addWidget( format ); |
153 | format->setExclusive ( true ) ; | 153 | format->setExclusive ( true ) ; |
154 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); | 154 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); |
155 | lay->addWidget( time ); time->setExclusive ( true ) ; | 155 | lay->addWidget( time ); time->setExclusive ( true ) ; |
156 | vcal = new QRadioButton(" vCalendar ", format ); | 156 | vcal = new QRadioButton(" vCalendar ", format ); |
157 | ical = new QRadioButton(" iCalendar ", format ); | 157 | ical = new QRadioButton(" iCalendar ", format ); |
158 | vcal->setChecked( true ); | 158 | vcal->setChecked( true ); |
159 | tz = new QRadioButton(i18n(" With timezone "), time ); | 159 | tz = new QRadioButton(i18n(" With timezone "), time ); |
160 | local = new QRadioButton(i18n(" Local time "), time ); | 160 | local = new QRadioButton(i18n(" Local time "), time ); |
161 | tz->setChecked( true ); | 161 | tz->setChecked( true ); |
162 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); | 162 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); |
163 | lay->addWidget( ok ); | 163 | lay->addWidget( ok ); |
164 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 164 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
165 | lay->addWidget( cancel ); | 165 | lay->addWidget( cancel ); |
166 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 166 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
167 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 167 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
168 | resize( 200, 200 ); | 168 | resize( 200, 200 ); |
169 | } | 169 | } |
170 | 170 | ||
171 | bool beamVcal() { return vcal->isChecked(); } | 171 | bool beamVcal() { return vcal->isChecked(); } |
172 | bool beamLocal() { return local->isChecked(); } | 172 | bool beamLocal() { return local->isChecked(); } |
173 | private: | 173 | private: |
174 | QRadioButton* vcal, *ical, *local, *tz; | 174 | QRadioButton* vcal, *ical, *local, *tz; |
175 | }; | 175 | }; |
176 | class KOCatPrefs : public QDialog | 176 | class KOCatPrefs : public QDialog |
177 | { | 177 | { |
178 | public: | 178 | public: |
179 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : | 179 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : |
180 | QDialog( parent, name, true ) | 180 | QDialog( parent, name, true ) |
181 | { | 181 | { |
182 | setCaption( i18n("Manage new Categories") ); | 182 | setCaption( i18n("Manage new Categories") ); |
183 | QVBoxLayout* lay = new QVBoxLayout( this ); | 183 | QVBoxLayout* lay = new QVBoxLayout( this ); |
184 | lay->setSpacing( 3 ); | 184 | lay->setSpacing( 3 ); |
185 | lay->setMargin( 3 ); | 185 | lay->setMargin( 3 ); |
186 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); | 186 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); |
187 | lay->addWidget( lab ); | 187 | lay->addWidget( lab ); |
188 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 188 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); |
189 | lay->addWidget( format ); | 189 | lay->addWidget( format ); |
190 | format->setExclusive ( true ) ; | 190 | format->setExclusive ( true ) ; |
191 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 191 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
192 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 192 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
193 | addCatBut->setChecked( true ); | 193 | addCatBut->setChecked( true ); |
194 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 194 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
195 | lay->addWidget( ok ); | 195 | lay->addWidget( ok ); |
196 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 196 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
197 | lay->addWidget( cancel ); | 197 | lay->addWidget( cancel ); |
198 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 198 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
199 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 199 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
200 | resize( 200, 200 ); | 200 | resize( 200, 200 ); |
201 | } | 201 | } |
202 | 202 | ||
203 | bool addCat() { return addCatBut->isChecked(); } | 203 | bool addCat() { return addCatBut->isChecked(); } |
204 | private: | 204 | private: |
205 | QRadioButton* addCatBut; | 205 | QRadioButton* addCatBut; |
206 | }; | 206 | }; |
207 | 207 | ||
208 | 208 | ||
209 | 209 | ||
210 | CalendarView::CalendarView( CalendarResources *calendar, | 210 | CalendarView::CalendarView( CalendarResources *calendar, |
211 | QWidget *parent, const char *name ) | 211 | QWidget *parent, const char *name ) |
212 | : CalendarViewBase( parent, name ), | 212 | : CalendarViewBase( parent, name ), |
213 | mCalendar( calendar ), | 213 | mCalendar( calendar ), |
214 | mResourceManager( calendar->resourceManager() ) | 214 | mResourceManager( calendar->resourceManager() ) |
215 | { | 215 | { |
216 | 216 | ||
217 | mEventEditor = 0; | 217 | mEventEditor = 0; |
218 | mTodoEditor = 0; | 218 | mTodoEditor = 0; |
219 | 219 | ||
220 | init(); | 220 | init(); |
221 | } | 221 | } |
222 | 222 | ||
223 | CalendarView::CalendarView( Calendar *calendar, | 223 | CalendarView::CalendarView( Calendar *calendar, |
224 | QWidget *parent, const char *name ) | 224 | QWidget *parent, const char *name ) |
225 | : CalendarViewBase( parent, name ), | 225 | : CalendarViewBase( parent, name ), |
226 | mCalendar( calendar ), | 226 | mCalendar( calendar ), |
227 | mResourceManager( 0 ) | 227 | mResourceManager( 0 ) |
228 | { | 228 | { |
229 | 229 | ||
230 | mEventEditor = 0; | 230 | mEventEditor = 0; |
231 | mTodoEditor = 0; | 231 | mTodoEditor = 0; |
232 | init();} | 232 | init();} |
233 | 233 | ||
234 | void CalendarView::init() | 234 | void CalendarView::init() |
235 | { | 235 | { |
236 | beamDialog = new KOBeamPrefs(); | 236 | beamDialog = new KOBeamPrefs(); |
237 | mDatePickerMode = 0; | 237 | mDatePickerMode = 0; |
238 | mCurrentSyncDevice = ""; | 238 | mCurrentSyncDevice = ""; |
239 | writeLocale(); | 239 | writeLocale(); |
240 | mViewManager = new KOViewManager( this ); | 240 | mViewManager = new KOViewManager( this ); |
241 | mDialogManager = new KODialogManager( this ); | 241 | mDialogManager = new KODialogManager( this ); |
242 | mEventViewerDialog = 0; | 242 | mEventViewerDialog = 0; |
243 | mModified = false; | 243 | mModified = false; |
244 | mReadOnly = false; | 244 | mReadOnly = false; |
245 | mSelectedIncidence = 0; | 245 | mSelectedIncidence = 0; |
246 | mCalPrinter = 0; | 246 | mCalPrinter = 0; |
247 | mFilters.setAutoDelete(true); | 247 | mFilters.setAutoDelete(true); |
248 | 248 | ||
249 | mCalendar->registerObserver( this ); | 249 | mCalendar->registerObserver( this ); |
250 | // TODO: Make sure that view is updated, when calendar is changed. | 250 | // TODO: Make sure that view is updated, when calendar is changed. |
251 | 251 | ||
252 | mStorage = new FileStorage( mCalendar ); | 252 | mStorage = new FileStorage( mCalendar ); |
253 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 253 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
254 | 254 | ||
255 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 255 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
256 | #ifndef KORG_NOSPLITTER | 256 | #ifndef KORG_NOSPLITTER |
257 | // create the main layout frames. | 257 | // create the main layout frames. |
258 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 258 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
259 | topLayout->addWidget(mPanner); | 259 | topLayout->addWidget(mPanner); |
260 | 260 | ||
261 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 261 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
262 | "CalendarView::LeftFrame"); | 262 | "CalendarView::LeftFrame"); |
263 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 263 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
264 | 264 | ||
265 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, | 265 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, |
266 | "CalendarView::DateNavigator", QDate::currentDate() ); | 266 | "CalendarView::DateNavigator", QDate::currentDate() ); |
267 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 267 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
268 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 268 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
269 | mTodoList->setNavigator( mNavigator ); | ||
269 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 270 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
270 | 271 | ||
271 | #ifdef KORG_NORESOURCEVIEW | 272 | #ifdef KORG_NORESOURCEVIEW |
272 | mResourceView = 0; | 273 | mResourceView = 0; |
273 | #else | 274 | #else |
274 | if ( mResourceManager ) { | 275 | if ( mResourceManager ) { |
275 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 276 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
276 | mResourceView->updateView(); | 277 | mResourceView->updateView(); |
277 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 278 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
278 | SLOT( updateView() ) ); | 279 | SLOT( updateView() ) ); |
279 | } else { | 280 | } else { |
280 | mResourceView = 0; | 281 | mResourceView = 0; |
281 | } | 282 | } |
282 | #endif | 283 | #endif |
283 | QWidget *rightBox = new QWidget( mPanner ); | 284 | QWidget *rightBox = new QWidget( mPanner ); |
284 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 285 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
285 | 286 | ||
286 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 287 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
287 | rightLayout->addWidget( mNavigatorBar ); | 288 | rightLayout->addWidget( mNavigatorBar ); |
288 | 289 | ||
289 | mRightFrame = new QWidgetStack( rightBox ); | 290 | mRightFrame = new QWidgetStack( rightBox ); |
290 | rightLayout->addWidget( mRightFrame, 1 ); | 291 | rightLayout->addWidget( mRightFrame, 1 ); |
291 | 292 | ||
292 | mLeftFrame = mLeftSplitter; | 293 | mLeftFrame = mLeftSplitter; |
293 | #else | 294 | #else |
294 | QWidget *mainBox = new QWidget( this ); | 295 | QWidget *mainBox = new QWidget( this ); |
295 | QWidget *leftFrame = new QWidget( mainBox ); | 296 | QWidget *leftFrame = new QWidget( mainBox ); |
296 | 297 | ||
297 | QBoxLayout * mainBoxLayout; | 298 | QBoxLayout * mainBoxLayout; |
298 | QBoxLayout * leftFrameLayout; | 299 | QBoxLayout * leftFrameLayout; |
299 | if ( KOPrefs::instance()->mVerticalScreen ) { | 300 | if ( KOPrefs::instance()->mVerticalScreen ) { |
300 | mainBoxLayout = new QVBoxLayout(mainBox); | 301 | mainBoxLayout = new QVBoxLayout(mainBox); |
301 | leftFrameLayout = new QHBoxLayout(leftFrame ); | 302 | leftFrameLayout = new QHBoxLayout(leftFrame ); |
302 | } else { | 303 | } else { |
303 | mainBoxLayout = new QHBoxLayout(mainBox); | 304 | mainBoxLayout = new QHBoxLayout(mainBox); |
304 | leftFrameLayout = new QVBoxLayout(leftFrame ); | 305 | leftFrameLayout = new QVBoxLayout(leftFrame ); |
305 | } | 306 | } |
306 | topLayout->addWidget( mainBox ); | 307 | topLayout->addWidget( mainBox ); |
307 | mainBoxLayout->addWidget (leftFrame); | 308 | mainBoxLayout->addWidget (leftFrame); |
308 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, | 309 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, |
309 | "CalendarView::DateNavigator", QDate::currentDate()); | 310 | "CalendarView::DateNavigator", QDate::currentDate()); |
310 | // mDateNavigator->blockSignals( true ); | 311 | // mDateNavigator->blockSignals( true ); |
311 | leftFrameLayout->addWidget( mDateNavigator ); | 312 | leftFrameLayout->addWidget( mDateNavigator ); |
312 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); | 313 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); |
313 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); | 314 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); |
315 | mTodoList->setNavigator( mNavigator ); | ||
314 | 316 | ||
315 | if ( QApplication::desktop()->width() < 480 ) { | 317 | if ( QApplication::desktop()->width() < 480 ) { |
316 | leftFrameLayout->addWidget(mFilterView); | 318 | leftFrameLayout->addWidget(mFilterView); |
317 | leftFrameLayout->addWidget(mTodoList, 2 ); | 319 | leftFrameLayout->addWidget(mTodoList, 2 ); |
318 | 320 | ||
319 | } else { | 321 | } else { |
320 | leftFrameLayout->addWidget(mTodoList,2 ); | 322 | leftFrameLayout->addWidget(mTodoList,2 ); |
321 | leftFrameLayout->addWidget(mFilterView ); | 323 | leftFrameLayout->addWidget(mFilterView ); |
322 | } | 324 | } |
323 | mFilterView->hide(); | 325 | mFilterView->hide(); |
324 | QWidget *rightBox = new QWidget( mainBox ); | 326 | QWidget *rightBox = new QWidget( mainBox ); |
325 | mainBoxLayout->addWidget ( rightBox, 10 ); | 327 | mainBoxLayout->addWidget ( rightBox, 10 ); |
326 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 328 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
327 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 329 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
328 | mRightFrame = new QWidgetStack( rightBox ); | 330 | mRightFrame = new QWidgetStack( rightBox ); |
329 | rightLayout->addWidget( mNavigatorBar ); | 331 | rightLayout->addWidget( mNavigatorBar ); |
330 | rightLayout->addWidget( mRightFrame, 10 ); | 332 | rightLayout->addWidget( mRightFrame, 10 ); |
331 | 333 | ||
332 | mLeftFrame = leftFrame; | 334 | mLeftFrame = leftFrame; |
333 | if ( KOPrefs::instance()->mVerticalScreen ) { | 335 | if ( KOPrefs::instance()->mVerticalScreen ) { |
334 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 336 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
335 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 337 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
336 | } else { | 338 | } else { |
337 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 339 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
338 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 340 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
339 | } | 341 | } |
340 | 342 | ||
341 | //qDebug("Calendarview Size %d %d ", width(), height()); | 343 | //qDebug("Calendarview Size %d %d ", width(), height()); |
342 | #endif | 344 | #endif |
343 | 345 | ||
344 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 346 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
345 | SLOT( showDates( const KCal::DateList & ) ) ); | 347 | SLOT( showDates( const KCal::DateList & ) ) ); |
346 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 348 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
347 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 349 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
348 | 350 | ||
349 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), | 351 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), |
350 | mNavigator, SLOT( selectPreviousYear() ) ); | 352 | mNavigator, SLOT( selectPreviousYear() ) ); |
351 | connect( mNavigatorBar, SIGNAL( goNextYear() ), | 353 | connect( mNavigatorBar, SIGNAL( goNextYear() ), |
352 | mNavigator, SLOT( selectNextYear() ) ); | 354 | mNavigator, SLOT( selectNextYear() ) ); |
353 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), | 355 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), |
354 | mNavigator, SLOT( selectPreviousMonth() ) ); | 356 | mNavigator, SLOT( selectPreviousMonth() ) ); |
355 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), | 357 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), |
356 | mNavigator, SLOT( selectNextMonth() ) ); | 358 | mNavigator, SLOT( selectNextMonth() ) ); |
357 | 359 | ||
358 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 360 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
359 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); | 361 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); |
360 | 362 | ||
361 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 363 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
362 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 364 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
363 | 365 | ||
364 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 366 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
365 | mNavigator, SLOT( selectPreviousYear() ) ); | 367 | mNavigator, SLOT( selectPreviousYear() ) ); |
366 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 368 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
367 | mNavigator, SLOT( selectNextYear() ) ); | 369 | mNavigator, SLOT( selectNextYear() ) ); |
368 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 370 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
369 | mNavigator, SLOT( selectPreviousMonth() ) ); | 371 | mNavigator, SLOT( selectPreviousMonth() ) ); |
370 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 372 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
371 | mNavigator, SLOT( selectNextMonth() ) ); | 373 | mNavigator, SLOT( selectNextMonth() ) ); |
372 | 374 | ||
373 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 375 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
374 | mNavigator, SLOT( selectPrevious() ) ); | 376 | mNavigator, SLOT( selectPrevious() ) ); |
375 | connect( mDateNavigator, SIGNAL( goNext() ), | 377 | connect( mDateNavigator, SIGNAL( goNext() ), |
376 | mNavigator, SLOT( selectNext() ) ); | 378 | mNavigator, SLOT( selectNext() ) ); |
377 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 379 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
378 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 380 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
379 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), | 381 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), |
380 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 382 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
381 | 383 | ||
382 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 384 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
383 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 385 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
384 | 386 | ||
385 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), | 387 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), |
386 | SLOT( eventAdded( Event *) ) ); | 388 | SLOT( eventAdded( Event *) ) ); |
387 | 389 | ||
388 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 390 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
389 | 391 | ||
390 | connect( this, SIGNAL( configChanged() ), | 392 | connect( this, SIGNAL( configChanged() ), |
391 | mDateNavigator, SLOT( updateConfig() ) ); | 393 | mDateNavigator, SLOT( updateConfig() ) ); |
392 | 394 | ||
393 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 395 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
394 | SLOT( newTodo() ) ); | 396 | SLOT( newTodo() ) ); |
395 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 397 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
396 | SLOT( newSubTodo( Todo * ) ) ); | 398 | SLOT( newSubTodo( Todo * ) ) ); |
397 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 399 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
398 | SLOT( editTodo( Todo * ) ) ); | 400 | SLOT( editTodo( Todo * ) ) ); |
399 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 401 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
400 | SLOT( showTodo( Todo *) ) ); | 402 | SLOT( showTodo( Todo *) ) ); |
401 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 403 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
402 | SLOT( deleteTodo( Todo *) ) ); | 404 | SLOT( deleteTodo( Todo *) ) ); |
403 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 405 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
404 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 406 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
405 | SLOT( purgeCompleted() ) ); | 407 | SLOT( purgeCompleted() ) ); |
406 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 408 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
407 | SIGNAL( todoModified( Todo *, int ) ) ); | 409 | SIGNAL( todoModified( Todo *, int ) ) ); |
408 | 410 | ||
409 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), | 411 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), |
410 | this, SLOT ( cloneIncidence( Incidence * ) ) ); | 412 | this, SLOT ( cloneIncidence( Incidence * ) ) ); |
411 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), | 413 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), |
412 | this, SLOT (cancelIncidence( Incidence * ) ) ); | 414 | this, SLOT (cancelIncidence( Incidence * ) ) ); |
413 | 415 | ||
414 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), | 416 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), |
415 | this, SLOT ( moveIncidence( Incidence * ) ) ); | 417 | this, SLOT ( moveIncidence( Incidence * ) ) ); |
416 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), | 418 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), |
417 | this, SLOT ( beamIncidence( Incidence * ) ) ); | 419 | this, SLOT ( beamIncidence( Incidence * ) ) ); |
418 | 420 | ||
419 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), | 421 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), |
420 | this, SLOT ( todo_unsub( Todo * ) ) ); | 422 | this, SLOT ( todo_unsub( Todo * ) ) ); |
421 | 423 | ||
422 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 424 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
423 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); | 425 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); |
424 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, | 426 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, |
425 | SLOT( updateTodo( Todo *, int ) ) ); | 427 | SLOT( updateTodo( Todo *, int ) ) ); |
426 | connect( this, SIGNAL( todoModified( Todo *, int )), this, | 428 | connect( this, SIGNAL( todoModified( Todo *, int )), this, |
427 | SLOT( changeTodoDisplay( Todo *, int ) ) ); | 429 | SLOT( changeTodoDisplay( Todo *, int ) ) ); |
428 | 430 | ||
429 | 431 | ||
430 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); | 432 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); |
431 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); | 433 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); |
432 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); | 434 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); |
433 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); | 435 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); |
434 | 436 | ||
435 | 437 | ||
436 | 438 | ||
437 | 439 | ||
438 | 440 | ||
439 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), | 441 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), |
440 | SLOT(checkClipboard())); | 442 | SLOT(checkClipboard())); |
441 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 443 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
442 | SLOT( processTodoListSelection( Incidence * ) ) ); | 444 | SLOT( processTodoListSelection( Incidence * ) ) ); |
443 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 445 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
444 | 446 | ||
445 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 447 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
446 | 448 | ||
447 | mDateFrame = new QVBox(0,0,WType_Popup); | 449 | mDateFrame = new QVBox(0,0,WType_Popup); |
448 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 450 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
449 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 451 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
450 | mDateFrame->setLineWidth(3); | 452 | mDateFrame->setLineWidth(3); |
451 | mDateFrame->hide(); | 453 | mDateFrame->hide(); |
452 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 454 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
453 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 455 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
454 | 456 | ||
455 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 457 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
456 | 458 | ||
457 | mEventEditor = mDialogManager->getEventEditor(); | 459 | mEventEditor = mDialogManager->getEventEditor(); |
458 | mTodoEditor = mDialogManager->getTodoEditor(); | 460 | mTodoEditor = mDialogManager->getTodoEditor(); |
459 | 461 | ||
460 | mFlagEditDescription = false; | 462 | mFlagEditDescription = false; |
461 | 463 | ||
462 | mSuspendTimer = new QTimer( this ); | 464 | mSuspendTimer = new QTimer( this ); |
463 | mAlarmTimer = new QTimer( this ); | 465 | mAlarmTimer = new QTimer( this ); |
464 | mRecheckAlarmTimer = new QTimer( this ); | 466 | mRecheckAlarmTimer = new QTimer( this ); |
465 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 467 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
466 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 468 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
467 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 469 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
468 | mAlarmDialog = new AlarmDialog( this ); | 470 | mAlarmDialog = new AlarmDialog( this ); |
469 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 471 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
470 | mAlarmDialog->setServerNotification( false ); | 472 | mAlarmDialog->setServerNotification( false ); |
471 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 473 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
472 | 474 | ||
473 | 475 | ||
474 | #ifndef DESKTOP_VERSION | 476 | #ifndef DESKTOP_VERSION |
475 | //US listen for arriving address resultsets | 477 | //US listen for arriving address resultsets |
476 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 478 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
477 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 479 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
478 | #endif | 480 | #endif |
479 | 481 | ||
480 | } | 482 | } |
481 | 483 | ||
482 | 484 | ||
483 | CalendarView::~CalendarView() | 485 | CalendarView::~CalendarView() |
484 | { | 486 | { |
485 | // kdDebug() << "~CalendarView()" << endl; | 487 | // kdDebug() << "~CalendarView()" << endl; |
486 | //qDebug("CalendarView::~CalendarView() "); | 488 | //qDebug("CalendarView::~CalendarView() "); |
487 | delete mDialogManager; | 489 | delete mDialogManager; |
488 | delete mViewManager; | 490 | delete mViewManager; |
489 | delete mStorage; | 491 | delete mStorage; |
490 | delete mDateFrame ; | 492 | delete mDateFrame ; |
491 | delete beamDialog; | 493 | delete beamDialog; |
492 | //kdDebug() << "~CalendarView() done" << endl; | 494 | //kdDebug() << "~CalendarView() done" << endl; |
493 | } | 495 | } |
494 | 496 | ||
495 | void CalendarView::showDay( QDate d ) | 497 | void CalendarView::showDay( QDate d ) |
496 | { | 498 | { |
497 | dateNavigator()->selectDate( d ); | 499 | dateNavigator()->selectDate( d ); |
498 | mViewManager->showWeekView(); | 500 | mViewManager->showWeekView(); |
499 | dateNavigator()->selectDate( d ); | 501 | dateNavigator()->selectDate( d ); |
500 | } | 502 | } |
501 | void CalendarView::timerAlarm() | 503 | void CalendarView::timerAlarm() |
502 | { | 504 | { |
503 | //qDebug("CalendarView::timerAlarm() "); | 505 | //qDebug("CalendarView::timerAlarm() "); |
504 | computeAlarm(mAlarmNotification ); | 506 | computeAlarm(mAlarmNotification ); |
505 | } | 507 | } |
506 | 508 | ||
507 | void CalendarView::suspendAlarm() | 509 | void CalendarView::suspendAlarm() |
508 | { | 510 | { |
509 | //qDebug(" CalendarView::suspendAlarm() "); | 511 | //qDebug(" CalendarView::suspendAlarm() "); |
510 | computeAlarm(mSuspendAlarmNotification ); | 512 | computeAlarm(mSuspendAlarmNotification ); |
511 | 513 | ||
512 | } | 514 | } |
513 | 515 | ||
514 | void CalendarView::startAlarm( QString mess , QString filename) | 516 | void CalendarView::startAlarm( QString mess , QString filename) |
515 | { | 517 | { |
516 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 518 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
517 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); | 519 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); |
518 | 520 | ||
519 | } | 521 | } |
520 | 522 | ||
521 | void CalendarView::checkNextTimerAlarm() | 523 | void CalendarView::checkNextTimerAlarm() |
522 | { | 524 | { |
523 | mCalendar->checkAlarmForIncidence( 0, true ); | 525 | mCalendar->checkAlarmForIncidence( 0, true ); |
524 | } | 526 | } |
525 | 527 | ||
526 | void CalendarView::computeAlarm( QString msg ) | 528 | void CalendarView::computeAlarm( QString msg ) |
527 | { | 529 | { |
528 | 530 | ||
529 | QString mess = msg; | 531 | QString mess = msg; |
530 | QString mAlarmMessage = mess.mid( 9 ); | 532 | QString mAlarmMessage = mess.mid( 9 ); |
531 | QString filename = MainWindow::resourcePath(); | 533 | QString filename = MainWindow::resourcePath(); |
532 | filename += "koalarm.wav"; | 534 | filename += "koalarm.wav"; |
533 | QString tempfilename; | 535 | QString tempfilename; |
534 | if ( mess.left( 13 ) == "suspend_alarm") { | 536 | if ( mess.left( 13 ) == "suspend_alarm") { |
535 | bool error = false; | 537 | bool error = false; |
536 | int len = mess.mid( 13 ).find("+++"); | 538 | int len = mess.mid( 13 ).find("+++"); |
537 | if ( len < 2 ) | 539 | if ( len < 2 ) |
538 | error = true; | 540 | error = true; |
539 | else { | 541 | else { |
540 | tempfilename = mess.mid( 13, len ); | 542 | tempfilename = mess.mid( 13, len ); |
541 | if ( !QFile::exists( tempfilename ) ) | 543 | if ( !QFile::exists( tempfilename ) ) |
542 | error = true; | 544 | error = true; |
543 | } | 545 | } |
544 | if ( ! error ) { | 546 | if ( ! error ) { |
545 | filename = tempfilename; | 547 | filename = tempfilename; |
546 | } | 548 | } |
547 | mAlarmMessage = mess.mid( 13+len+3 ); | 549 | mAlarmMessage = mess.mid( 13+len+3 ); |
548 | //qDebug("suspend file %s ",tempfilename.latin1() ); | 550 | //qDebug("suspend file %s ",tempfilename.latin1() ); |
549 | startAlarm( mAlarmMessage, filename); | 551 | startAlarm( mAlarmMessage, filename); |
550 | return; | 552 | return; |
551 | } | 553 | } |
552 | if ( mess.left( 11 ) == "timer_alarm") { | 554 | if ( mess.left( 11 ) == "timer_alarm") { |
553 | //mTimerTime = 0; | 555 | //mTimerTime = 0; |
554 | startAlarm( mess.mid( 11 ), filename ); | 556 | startAlarm( mess.mid( 11 ), filename ); |
555 | return; | 557 | return; |
556 | } | 558 | } |
557 | if ( mess.left( 10 ) == "proc_alarm") { | 559 | if ( mess.left( 10 ) == "proc_alarm") { |
558 | bool error = false; | 560 | bool error = false; |
559 | int len = mess.mid( 10 ).find("+++"); | 561 | int len = mess.mid( 10 ).find("+++"); |
560 | if ( len < 2 ) | 562 | if ( len < 2 ) |
561 | error = true; | 563 | error = true; |
562 | else { | 564 | else { |
563 | tempfilename = mess.mid( 10, len ); | 565 | tempfilename = mess.mid( 10, len ); |
564 | if ( !QFile::exists( tempfilename ) ) | 566 | if ( !QFile::exists( tempfilename ) ) |
565 | error = true; | 567 | error = true; |
566 | } | 568 | } |
567 | if ( error ) { | 569 | if ( error ) { |
568 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 570 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
569 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 571 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
570 | } else { | 572 | } else { |
571 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 573 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
572 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 574 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
573 | #ifndef _WIN32_ | 575 | #ifndef _WIN32_ |
574 | if ( vfork () == 0 ) { | 576 | if ( vfork () == 0 ) { |
575 | execl ( tempfilename.latin1(), 0 ); | 577 | execl ( tempfilename.latin1(), 0 ); |
576 | return; | 578 | return; |
577 | } | 579 | } |
578 | #else | 580 | #else |
579 | QProcess* p = new QProcess(); | 581 | QProcess* p = new QProcess(); |
580 | p->addArgument( tempfilename.latin1() ); | 582 | p->addArgument( tempfilename.latin1() ); |
581 | p->start(); | 583 | p->start(); |
582 | return; | 584 | return; |
583 | #endif | 585 | #endif |
584 | 586 | ||
585 | return; | 587 | return; |
586 | } | 588 | } |
587 | 589 | ||
588 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 590 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
589 | } | 591 | } |
590 | if ( mess.left( 11 ) == "audio_alarm") { | 592 | if ( mess.left( 11 ) == "audio_alarm") { |
591 | bool error = false; | 593 | bool error = false; |
592 | int len = mess.mid( 11 ).find("+++"); | 594 | int len = mess.mid( 11 ).find("+++"); |
593 | if ( len < 2 ) | 595 | if ( len < 2 ) |
594 | error = true; | 596 | error = true; |
595 | else { | 597 | else { |
596 | tempfilename = mess.mid( 11, len ); | 598 | tempfilename = mess.mid( 11, len ); |
597 | if ( !QFile::exists( tempfilename ) ) | 599 | if ( !QFile::exists( tempfilename ) ) |
598 | error = true; | 600 | error = true; |
599 | } | 601 | } |
600 | if ( ! error ) { | 602 | if ( ! error ) { |
601 | filename = tempfilename; | 603 | filename = tempfilename; |
602 | } | 604 | } |
603 | mAlarmMessage = mess.mid( 11+len+3+9 ); | 605 | mAlarmMessage = mess.mid( 11+len+3+9 ); |
604 | //qDebug("audio file command %s ",tempfilename.latin1() ); | 606 | //qDebug("audio file command %s ",tempfilename.latin1() ); |
605 | } | 607 | } |
606 | if ( mess.left( 9 ) == "cal_alarm") { | 608 | if ( mess.left( 9 ) == "cal_alarm") { |
607 | mAlarmMessage = mess.mid( 9 ) ; | 609 | mAlarmMessage = mess.mid( 9 ) ; |
608 | } | 610 | } |
609 | 611 | ||
610 | startAlarm( mAlarmMessage, filename ); | 612 | startAlarm( mAlarmMessage, filename ); |
611 | 613 | ||
612 | 614 | ||
613 | } | 615 | } |
614 | 616 | ||
615 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) | 617 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) |
616 | { | 618 | { |
617 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 619 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
618 | 620 | ||
619 | mSuspendAlarmNotification = noti; | 621 | mSuspendAlarmNotification = noti; |
620 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; | 622 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; |
621 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); | 623 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); |
622 | mSuspendTimer->start( ms , true ); | 624 | mSuspendTimer->start( ms , true ); |
623 | 625 | ||
624 | } | 626 | } |
625 | 627 | ||
626 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | 628 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) |
627 | { | 629 | { |
628 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 630 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
629 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 631 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
630 | #ifndef DESKTOP_VERSION | 632 | #ifndef DESKTOP_VERSION |
631 | AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); | 633 | AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); |
632 | #endif | 634 | #endif |
633 | return; | 635 | return; |
634 | } | 636 | } |
635 | int maxSec; | 637 | int maxSec; |
636 | //maxSec = 5; //testing only | 638 | //maxSec = 5; //testing only |
637 | maxSec = 86400+3600; // one day+1hour | 639 | maxSec = 86400+3600; // one day+1hour |
638 | mAlarmNotification = noti; | 640 | mAlarmNotification = noti; |
639 | int sec = QDateTime::currentDateTime().secsTo( qdt ); | 641 | int sec = QDateTime::currentDateTime().secsTo( qdt ); |
640 | if ( sec > maxSec ) { | 642 | if ( sec > maxSec ) { |
641 | mRecheckAlarmTimer->start( maxSec * 1000 ); | 643 | mRecheckAlarmTimer->start( maxSec * 1000 ); |
642 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); | 644 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); |
643 | return; | 645 | return; |
644 | } else { | 646 | } else { |
645 | mRecheckAlarmTimer->stop(); | 647 | mRecheckAlarmTimer->stop(); |
646 | } | 648 | } |
647 | //qDebug("Alarm timer started with secs: %d ", sec); | 649 | //qDebug("Alarm timer started with secs: %d ", sec); |
648 | mAlarmTimer->start( sec *1000 , true ); | 650 | mAlarmTimer->start( sec *1000 , true ); |
649 | 651 | ||
650 | } | 652 | } |
651 | // called by mRecheckAlarmTimer to get next alarm | 653 | // called by mRecheckAlarmTimer to get next alarm |
652 | // we need this, because a QTimer has only a max range of 25 days | 654 | // we need this, because a QTimer has only a max range of 25 days |
653 | void CalendarView::recheckTimerAlarm() | 655 | void CalendarView::recheckTimerAlarm() |
654 | { | 656 | { |
655 | mAlarmTimer->stop(); | 657 | mAlarmTimer->stop(); |
656 | mRecheckAlarmTimer->stop(); | 658 | mRecheckAlarmTimer->stop(); |
657 | mCalendar->checkAlarmForIncidence( 0, true ); | 659 | mCalendar->checkAlarmForIncidence( 0, true ); |
658 | } | 660 | } |
659 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) | 661 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) |
660 | { | 662 | { |
661 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 663 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
662 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 664 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
663 | #ifndef DESKTOP_VERSION | 665 | #ifndef DESKTOP_VERSION |
664 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); | 666 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); |
665 | #endif | 667 | #endif |
666 | return; | 668 | return; |
667 | } | 669 | } |
668 | mAlarmTimer->stop(); | 670 | mAlarmTimer->stop(); |
669 | } | 671 | } |
670 | void CalendarView::selectWeekNum ( int num ) | 672 | void CalendarView::selectWeekNum ( int num ) |
671 | { | 673 | { |
672 | dateNavigator()->selectWeek( num ); | 674 | dateNavigator()->selectWeek( num ); |
673 | mViewManager->showWeekView(); | 675 | mViewManager->showWeekView(); |
674 | } | 676 | } |
675 | KOViewManager *CalendarView::viewManager() | 677 | KOViewManager *CalendarView::viewManager() |
676 | { | 678 | { |
677 | return mViewManager; | 679 | return mViewManager; |
678 | } | 680 | } |
679 | 681 | ||
680 | KODialogManager *CalendarView::dialogManager() | 682 | KODialogManager *CalendarView::dialogManager() |
681 | { | 683 | { |
682 | return mDialogManager; | 684 | return mDialogManager; |
683 | } | 685 | } |
684 | 686 | ||
685 | QDate CalendarView::startDate() | 687 | QDate CalendarView::startDate() |
686 | { | 688 | { |
687 | DateList dates = mNavigator->selectedDates(); | 689 | DateList dates = mNavigator->selectedDates(); |
688 | 690 | ||
689 | return dates.first(); | 691 | return dates.first(); |
690 | } | 692 | } |
691 | 693 | ||
692 | QDate CalendarView::endDate() | 694 | QDate CalendarView::endDate() |
693 | { | 695 | { |
694 | DateList dates = mNavigator->selectedDates(); | 696 | DateList dates = mNavigator->selectedDates(); |
695 | 697 | ||
696 | return dates.last(); | 698 | return dates.last(); |
697 | } | 699 | } |
@@ -1763,768 +1765,770 @@ void CalendarView::readSettings() | |||
1763 | config->setGroup("KOrganizer Geometry"); | 1765 | config->setGroup("KOrganizer Geometry"); |
1764 | 1766 | ||
1765 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1767 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1766 | if (sizes.count() != 2) { | 1768 | if (sizes.count() != 2) { |
1767 | sizes << mDateNavigator->minimumSizeHint().width(); | 1769 | sizes << mDateNavigator->minimumSizeHint().width(); |
1768 | sizes << 300; | 1770 | sizes << 300; |
1769 | } | 1771 | } |
1770 | mPanner->setSizes(sizes); | 1772 | mPanner->setSizes(sizes); |
1771 | 1773 | ||
1772 | sizes = config->readIntListEntry("Separator2"); | 1774 | sizes = config->readIntListEntry("Separator2"); |
1773 | if ( ( mResourceView && sizes.count() == 4 ) || | 1775 | if ( ( mResourceView && sizes.count() == 4 ) || |
1774 | ( !mResourceView && sizes.count() == 3 ) ) { | 1776 | ( !mResourceView && sizes.count() == 3 ) ) { |
1775 | mLeftSplitter->setSizes(sizes); | 1777 | mLeftSplitter->setSizes(sizes); |
1776 | } | 1778 | } |
1777 | #endif | 1779 | #endif |
1778 | globalFlagBlockAgenda = 1; | 1780 | globalFlagBlockAgenda = 1; |
1779 | mViewManager->showAgendaView(); | 1781 | mViewManager->showAgendaView(); |
1780 | //mViewManager->readSettings( config ); | 1782 | //mViewManager->readSettings( config ); |
1781 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1783 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1782 | readFilterSettings(config); | 1784 | readFilterSettings(config); |
1783 | config->setGroup( "Views" ); | 1785 | config->setGroup( "Views" ); |
1784 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1786 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1785 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1787 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1786 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1788 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1787 | else mNavigator->selectDates( dateCount ); | 1789 | else mNavigator->selectDates( dateCount ); |
1788 | // mViewManager->readSettings( config ); | 1790 | // mViewManager->readSettings( config ); |
1789 | updateConfig(); | 1791 | updateConfig(); |
1790 | globalFlagBlockAgenda = 2; | 1792 | globalFlagBlockAgenda = 2; |
1791 | mViewManager->readSettings( config ); | 1793 | mViewManager->readSettings( config ); |
1792 | #ifdef DESKTOP_VERSION | 1794 | #ifdef DESKTOP_VERSION |
1793 | config->setGroup("WidgetLayout"); | 1795 | config->setGroup("WidgetLayout"); |
1794 | QStringList list; | 1796 | QStringList list; |
1795 | list = config->readListEntry("MainLayout"); | 1797 | list = config->readListEntry("MainLayout"); |
1796 | int x,y,w,h; | 1798 | int x,y,w,h; |
1797 | if ( ! list.isEmpty() ) { | 1799 | if ( ! list.isEmpty() ) { |
1798 | x = list[0].toInt(); | 1800 | x = list[0].toInt(); |
1799 | y = list[1].toInt(); | 1801 | y = list[1].toInt(); |
1800 | w = list[2].toInt(); | 1802 | w = list[2].toInt(); |
1801 | h = list[3].toInt(); | 1803 | h = list[3].toInt(); |
1802 | topLevelWidget()->setGeometry(x,y,w,h); | 1804 | topLevelWidget()->setGeometry(x,y,w,h); |
1803 | 1805 | ||
1804 | } else { | 1806 | } else { |
1805 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1807 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1806 | } | 1808 | } |
1807 | list = config->readListEntry("EditEventLayout"); | 1809 | list = config->readListEntry("EditEventLayout"); |
1808 | if ( ! list.isEmpty() ) { | 1810 | if ( ! list.isEmpty() ) { |
1809 | x = list[0].toInt(); | 1811 | x = list[0].toInt(); |
1810 | y = list[1].toInt(); | 1812 | y = list[1].toInt(); |
1811 | w = list[2].toInt(); | 1813 | w = list[2].toInt(); |
1812 | h = list[3].toInt(); | 1814 | h = list[3].toInt(); |
1813 | mEventEditor->setGeometry(x,y,w,h); | 1815 | mEventEditor->setGeometry(x,y,w,h); |
1814 | 1816 | ||
1815 | } | 1817 | } |
1816 | list = config->readListEntry("EditTodoLayout"); | 1818 | list = config->readListEntry("EditTodoLayout"); |
1817 | if ( ! list.isEmpty() ) { | 1819 | if ( ! list.isEmpty() ) { |
1818 | x = list[0].toInt(); | 1820 | x = list[0].toInt(); |
1819 | y = list[1].toInt(); | 1821 | y = list[1].toInt(); |
1820 | w = list[2].toInt(); | 1822 | w = list[2].toInt(); |
1821 | h = list[3].toInt(); | 1823 | h = list[3].toInt(); |
1822 | mTodoEditor->setGeometry(x,y,w,h); | 1824 | mTodoEditor->setGeometry(x,y,w,h); |
1823 | 1825 | ||
1824 | } | 1826 | } |
1825 | list = config->readListEntry("ViewerLayout"); | 1827 | list = config->readListEntry("ViewerLayout"); |
1826 | if ( ! list.isEmpty() ) { | 1828 | if ( ! list.isEmpty() ) { |
1827 | x = list[0].toInt(); | 1829 | x = list[0].toInt(); |
1828 | y = list[1].toInt(); | 1830 | y = list[1].toInt(); |
1829 | w = list[2].toInt(); | 1831 | w = list[2].toInt(); |
1830 | h = list[3].toInt(); | 1832 | h = list[3].toInt(); |
1831 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1833 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1832 | } | 1834 | } |
1833 | #endif | 1835 | #endif |
1834 | 1836 | ||
1835 | } | 1837 | } |
1836 | 1838 | ||
1837 | 1839 | ||
1838 | void CalendarView::writeSettings() | 1840 | void CalendarView::writeSettings() |
1839 | { | 1841 | { |
1840 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1842 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1841 | 1843 | ||
1842 | KConfig *config = KOGlobals::config(); | 1844 | KConfig *config = KOGlobals::config(); |
1843 | 1845 | ||
1844 | #ifndef KORG_NOSPLITTER | 1846 | #ifndef KORG_NOSPLITTER |
1845 | config->setGroup("KOrganizer Geometry"); | 1847 | config->setGroup("KOrganizer Geometry"); |
1846 | 1848 | ||
1847 | QValueList<int> list = mPanner->sizes(); | 1849 | QValueList<int> list = mPanner->sizes(); |
1848 | config->writeEntry("Separator1",list); | 1850 | config->writeEntry("Separator1",list); |
1849 | 1851 | ||
1850 | list = mLeftSplitter->sizes(); | 1852 | list = mLeftSplitter->sizes(); |
1851 | config->writeEntry("Separator2",list); | 1853 | config->writeEntry("Separator2",list); |
1852 | #endif | 1854 | #endif |
1853 | 1855 | ||
1854 | mViewManager->writeSettings( config ); | 1856 | mViewManager->writeSettings( config ); |
1855 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1857 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1856 | mDialogManager->writeSettings( config ); | 1858 | mDialogManager->writeSettings( config ); |
1857 | //KOPrefs::instance()->usrWriteConfig(); | 1859 | //KOPrefs::instance()->usrWriteConfig(); |
1858 | KOPrefs::instance()->writeConfig(); | 1860 | KOPrefs::instance()->writeConfig(); |
1859 | 1861 | ||
1860 | writeFilterSettings(config); | 1862 | writeFilterSettings(config); |
1861 | 1863 | ||
1862 | config->setGroup( "Views" ); | 1864 | config->setGroup( "Views" ); |
1863 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1865 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1864 | 1866 | ||
1865 | #ifdef DESKTOP_VERSION | 1867 | #ifdef DESKTOP_VERSION |
1866 | config->setGroup("WidgetLayout"); | 1868 | config->setGroup("WidgetLayout"); |
1867 | QStringList list ;//= config->readListEntry("MainLayout"); | 1869 | QStringList list ;//= config->readListEntry("MainLayout"); |
1868 | int x,y,w,h; | 1870 | int x,y,w,h; |
1869 | QWidget* wid; | 1871 | QWidget* wid; |
1870 | wid = topLevelWidget(); | 1872 | wid = topLevelWidget(); |
1871 | x = wid->geometry().x(); | 1873 | x = wid->geometry().x(); |
1872 | y = wid->geometry().y(); | 1874 | y = wid->geometry().y(); |
1873 | w = wid->width(); | 1875 | w = wid->width(); |
1874 | h = wid->height(); | 1876 | h = wid->height(); |
1875 | list.clear(); | 1877 | list.clear(); |
1876 | list << QString::number( x ); | 1878 | list << QString::number( x ); |
1877 | list << QString::number( y ); | 1879 | list << QString::number( y ); |
1878 | list << QString::number( w ); | 1880 | list << QString::number( w ); |
1879 | list << QString::number( h ); | 1881 | list << QString::number( h ); |
1880 | config->writeEntry("MainLayout",list ); | 1882 | config->writeEntry("MainLayout",list ); |
1881 | 1883 | ||
1882 | wid = mEventEditor; | 1884 | wid = mEventEditor; |
1883 | x = wid->geometry().x(); | 1885 | x = wid->geometry().x(); |
1884 | y = wid->geometry().y(); | 1886 | y = wid->geometry().y(); |
1885 | w = wid->width(); | 1887 | w = wid->width(); |
1886 | h = wid->height(); | 1888 | h = wid->height(); |
1887 | list.clear(); | 1889 | list.clear(); |
1888 | list << QString::number( x ); | 1890 | list << QString::number( x ); |
1889 | list << QString::number( y ); | 1891 | list << QString::number( y ); |
1890 | list << QString::number( w ); | 1892 | list << QString::number( w ); |
1891 | list << QString::number( h ); | 1893 | list << QString::number( h ); |
1892 | config->writeEntry("EditEventLayout",list ); | 1894 | config->writeEntry("EditEventLayout",list ); |
1893 | 1895 | ||
1894 | wid = mTodoEditor; | 1896 | wid = mTodoEditor; |
1895 | x = wid->geometry().x(); | 1897 | x = wid->geometry().x(); |
1896 | y = wid->geometry().y(); | 1898 | y = wid->geometry().y(); |
1897 | w = wid->width(); | 1899 | w = wid->width(); |
1898 | h = wid->height(); | 1900 | h = wid->height(); |
1899 | list.clear(); | 1901 | list.clear(); |
1900 | list << QString::number( x ); | 1902 | list << QString::number( x ); |
1901 | list << QString::number( y ); | 1903 | list << QString::number( y ); |
1902 | list << QString::number( w ); | 1904 | list << QString::number( w ); |
1903 | list << QString::number( h ); | 1905 | list << QString::number( h ); |
1904 | config->writeEntry("EditTodoLayout",list ); | 1906 | config->writeEntry("EditTodoLayout",list ); |
1905 | wid = getEventViewerDialog(); | 1907 | wid = getEventViewerDialog(); |
1906 | x = wid->geometry().x(); | 1908 | x = wid->geometry().x(); |
1907 | y = wid->geometry().y(); | 1909 | y = wid->geometry().y(); |
1908 | w = wid->width(); | 1910 | w = wid->width(); |
1909 | h = wid->height(); | 1911 | h = wid->height(); |
1910 | list.clear(); | 1912 | list.clear(); |
1911 | list << QString::number( x ); | 1913 | list << QString::number( x ); |
1912 | list << QString::number( y ); | 1914 | list << QString::number( y ); |
1913 | list << QString::number( w ); | 1915 | list << QString::number( w ); |
1914 | list << QString::number( h ); | 1916 | list << QString::number( h ); |
1915 | config->writeEntry("ViewerLayout",list ); | 1917 | config->writeEntry("ViewerLayout",list ); |
1916 | wid = mDialogManager->getSearchDialog(); | 1918 | wid = mDialogManager->getSearchDialog(); |
1917 | if ( wid ) { | 1919 | if ( wid ) { |
1918 | x = wid->geometry().x(); | 1920 | x = wid->geometry().x(); |
1919 | y = wid->geometry().y(); | 1921 | y = wid->geometry().y(); |
1920 | w = wid->width(); | 1922 | w = wid->width(); |
1921 | h = wid->height(); | 1923 | h = wid->height(); |
1922 | list.clear(); | 1924 | list.clear(); |
1923 | list << QString::number( x ); | 1925 | list << QString::number( x ); |
1924 | list << QString::number( y ); | 1926 | list << QString::number( y ); |
1925 | list << QString::number( w ); | 1927 | list << QString::number( w ); |
1926 | list << QString::number( h ); | 1928 | list << QString::number( h ); |
1927 | config->writeEntry("SearchLayout",list ); | 1929 | config->writeEntry("SearchLayout",list ); |
1928 | } | 1930 | } |
1929 | #endif | 1931 | #endif |
1930 | 1932 | ||
1931 | 1933 | ||
1932 | config->sync(); | 1934 | config->sync(); |
1933 | } | 1935 | } |
1934 | 1936 | ||
1935 | void CalendarView::readFilterSettings(KConfig *config) | 1937 | void CalendarView::readFilterSettings(KConfig *config) |
1936 | { | 1938 | { |
1937 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 1939 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
1938 | 1940 | ||
1939 | mFilters.clear(); | 1941 | mFilters.clear(); |
1940 | 1942 | ||
1941 | config->setGroup("General"); | 1943 | config->setGroup("General"); |
1942 | QStringList filterList = config->readListEntry("CalendarFilters"); | 1944 | QStringList filterList = config->readListEntry("CalendarFilters"); |
1943 | 1945 | ||
1944 | QStringList::ConstIterator it = filterList.begin(); | 1946 | QStringList::ConstIterator it = filterList.begin(); |
1945 | QStringList::ConstIterator end = filterList.end(); | 1947 | QStringList::ConstIterator end = filterList.end(); |
1946 | while(it != end) { | 1948 | while(it != end) { |
1947 | // kdDebug() << " filter: " << (*it) << endl; | 1949 | // kdDebug() << " filter: " << (*it) << endl; |
1948 | 1950 | ||
1949 | CalFilter *filter; | 1951 | CalFilter *filter; |
1950 | filter = new CalFilter(*it); | 1952 | filter = new CalFilter(*it); |
1951 | config->setGroup("Filter_" + (*it)); | 1953 | config->setGroup("Filter_" + (*it)); |
1952 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 1954 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
1953 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 1955 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
1954 | filter->setCategoryList(config->readListEntry("CategoryList")); | 1956 | filter->setCategoryList(config->readListEntry("CategoryList")); |
1955 | mFilters.append(filter); | 1957 | mFilters.append(filter); |
1956 | 1958 | ||
1957 | ++it; | 1959 | ++it; |
1958 | } | 1960 | } |
1959 | 1961 | ||
1960 | if (mFilters.count() == 0) { | 1962 | if (mFilters.count() == 0) { |
1961 | CalFilter *filter = new CalFilter(i18n("Default")); | 1963 | CalFilter *filter = new CalFilter(i18n("Default")); |
1962 | mFilters.append(filter); | 1964 | mFilters.append(filter); |
1963 | } | 1965 | } |
1964 | mFilterView->updateFilters(); | 1966 | mFilterView->updateFilters(); |
1965 | config->setGroup("FilterView"); | 1967 | config->setGroup("FilterView"); |
1966 | 1968 | ||
1967 | mFilterView->blockSignals(true); | 1969 | mFilterView->blockSignals(true); |
1968 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 1970 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
1969 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 1971 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
1970 | mFilterView->blockSignals(false); | 1972 | mFilterView->blockSignals(false); |
1971 | // We do it manually to avoid it being done twice by the above calls | 1973 | // We do it manually to avoid it being done twice by the above calls |
1972 | updateFilter(); | 1974 | updateFilter(); |
1973 | } | 1975 | } |
1974 | 1976 | ||
1975 | void CalendarView::writeFilterSettings(KConfig *config) | 1977 | void CalendarView::writeFilterSettings(KConfig *config) |
1976 | { | 1978 | { |
1977 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 1979 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
1978 | 1980 | ||
1979 | QStringList filterList; | 1981 | QStringList filterList; |
1980 | 1982 | ||
1981 | CalFilter *filter = mFilters.first(); | 1983 | CalFilter *filter = mFilters.first(); |
1982 | while(filter) { | 1984 | while(filter) { |
1983 | // kdDebug() << " fn: " << filter->name() << endl; | 1985 | // kdDebug() << " fn: " << filter->name() << endl; |
1984 | filterList << filter->name(); | 1986 | filterList << filter->name(); |
1985 | config->setGroup("Filter_" + filter->name()); | 1987 | config->setGroup("Filter_" + filter->name()); |
1986 | config->writeEntry("Criteria",filter->criteria()); | 1988 | config->writeEntry("Criteria",filter->criteria()); |
1987 | config->writeEntry("CategoryList",filter->categoryList()); | 1989 | config->writeEntry("CategoryList",filter->categoryList()); |
1988 | filter = mFilters.next(); | 1990 | filter = mFilters.next(); |
1989 | } | 1991 | } |
1990 | config->setGroup("General"); | 1992 | config->setGroup("General"); |
1991 | config->writeEntry("CalendarFilters",filterList); | 1993 | config->writeEntry("CalendarFilters",filterList); |
1992 | 1994 | ||
1993 | config->setGroup("FilterView"); | 1995 | config->setGroup("FilterView"); |
1994 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 1996 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
1995 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 1997 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
1996 | } | 1998 | } |
1997 | 1999 | ||
1998 | 2000 | ||
1999 | void CalendarView::goToday() | 2001 | void CalendarView::goToday() |
2000 | { | 2002 | { |
2001 | if ( mViewManager->currentView()->isMonthView() ) | 2003 | if ( mViewManager->currentView()->isMonthView() ) |
2002 | mNavigator->selectTodayMonth(); | 2004 | mNavigator->selectTodayMonth(); |
2003 | else | 2005 | else |
2004 | mNavigator->selectToday(); | 2006 | mNavigator->selectToday(); |
2005 | } | 2007 | } |
2006 | 2008 | ||
2007 | void CalendarView::goNext() | 2009 | void CalendarView::goNext() |
2008 | { | 2010 | { |
2009 | mNavigator->selectNext(); | 2011 | mNavigator->selectNext(); |
2010 | } | 2012 | } |
2011 | 2013 | ||
2012 | void CalendarView::goPrevious() | 2014 | void CalendarView::goPrevious() |
2013 | { | 2015 | { |
2014 | mNavigator->selectPrevious(); | 2016 | mNavigator->selectPrevious(); |
2015 | } | 2017 | } |
2016 | void CalendarView::goNextMonth() | 2018 | void CalendarView::goNextMonth() |
2017 | { | 2019 | { |
2018 | mNavigator->selectNextMonth(); | 2020 | mNavigator->selectNextMonth(); |
2019 | } | 2021 | } |
2020 | 2022 | ||
2021 | void CalendarView::goPreviousMonth() | 2023 | void CalendarView::goPreviousMonth() |
2022 | { | 2024 | { |
2023 | mNavigator->selectPreviousMonth(); | 2025 | mNavigator->selectPreviousMonth(); |
2024 | } | 2026 | } |
2025 | void CalendarView::writeLocale() | 2027 | void CalendarView::writeLocale() |
2026 | { | 2028 | { |
2027 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 2029 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
2028 | #if 0 | 2030 | #if 0 |
2029 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); | 2031 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); |
2030 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); | 2032 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); |
2031 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2033 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2032 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2034 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2033 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2035 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2034 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2036 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2035 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2037 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2036 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2038 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2037 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2039 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2038 | KOPrefs::instance()->mDaylightsavingStart, | 2040 | KOPrefs::instance()->mDaylightsavingStart, |
2039 | KOPrefs::instance()->mDaylightsavingEnd ); | 2041 | KOPrefs::instance()->mDaylightsavingEnd ); |
2040 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2042 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2041 | #endif | 2043 | #endif |
2042 | } | 2044 | } |
2043 | void CalendarView::updateConfig() | 2045 | void CalendarView::updateConfig() |
2044 | { | 2046 | { |
2045 | writeLocale(); | 2047 | writeLocale(); |
2046 | if ( KOPrefs::instance()->mUseAppColors ) | 2048 | if ( KOPrefs::instance()->mUseAppColors ) |
2047 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2049 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2048 | emit configChanged(); | 2050 | emit configChanged(); |
2049 | mTodoList->updateConfig(); | 2051 | mTodoList->updateConfig(); |
2050 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2052 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2051 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2053 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2052 | // To make the "fill window" configurations work | 2054 | // To make the "fill window" configurations work |
2053 | //mViewManager->raiseCurrentView(); | 2055 | //mViewManager->raiseCurrentView(); |
2054 | } | 2056 | } |
2055 | 2057 | ||
2056 | 2058 | ||
2057 | void CalendarView::eventChanged(Event *event) | 2059 | void CalendarView::eventChanged(Event *event) |
2058 | { | 2060 | { |
2059 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2061 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2060 | //updateUnmanagedViews(); | 2062 | //updateUnmanagedViews(); |
2061 | } | 2063 | } |
2062 | 2064 | ||
2063 | void CalendarView::eventAdded(Event *event) | 2065 | void CalendarView::eventAdded(Event *event) |
2064 | { | 2066 | { |
2065 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2067 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2066 | } | 2068 | } |
2067 | 2069 | ||
2068 | void CalendarView::eventToBeDeleted(Event *) | 2070 | void CalendarView::eventToBeDeleted(Event *) |
2069 | { | 2071 | { |
2070 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2072 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2071 | } | 2073 | } |
2072 | 2074 | ||
2073 | void CalendarView::eventDeleted() | 2075 | void CalendarView::eventDeleted() |
2074 | { | 2076 | { |
2075 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2077 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2076 | } | 2078 | } |
2077 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2079 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2078 | { | 2080 | { |
2079 | changeIncidenceDisplay((Incidence *)which, action); | 2081 | changeIncidenceDisplay((Incidence *)which, action); |
2080 | mDateNavigator->updateView(); //LR | 2082 | mDateNavigator->updateView(); //LR |
2081 | //mDialogManager->updateSearchDialog(); | 2083 | //mDialogManager->updateSearchDialog(); |
2082 | 2084 | ||
2083 | if (which) { | 2085 | if (which) { |
2084 | mViewManager->updateWNview(); | 2086 | mViewManager->updateWNview(); |
2085 | //mTodoList->updateView(); | 2087 | //mTodoList->updateView(); |
2086 | } | 2088 | } |
2087 | 2089 | ||
2088 | } | 2090 | } |
2089 | 2091 | ||
2090 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2092 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2091 | { | 2093 | { |
2092 | updateUnmanagedViews(); | 2094 | updateUnmanagedViews(); |
2093 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2095 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2094 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2096 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2095 | mCalendar->checkAlarmForIncidence( 0, true ); | 2097 | mCalendar->checkAlarmForIncidence( 0, true ); |
2096 | if ( mEventViewerDialog ) | 2098 | if ( mEventViewerDialog ) |
2097 | mEventViewerDialog->hide(); | 2099 | mEventViewerDialog->hide(); |
2098 | } | 2100 | } |
2099 | else | 2101 | else |
2100 | mCalendar->checkAlarmForIncidence( which , false ); | 2102 | mCalendar->checkAlarmForIncidence( which , false ); |
2101 | } | 2103 | } |
2102 | 2104 | ||
2103 | // most of the changeEventDisplays() right now just call the view's | 2105 | // most of the changeEventDisplays() right now just call the view's |
2104 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2106 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2105 | void CalendarView::changeEventDisplay(Event *which, int action) | 2107 | void CalendarView::changeEventDisplay(Event *which, int action) |
2106 | { | 2108 | { |
2107 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2109 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2108 | changeIncidenceDisplay((Incidence *)which, action); | 2110 | changeIncidenceDisplay((Incidence *)which, action); |
2109 | mDateNavigator->updateView(); | 2111 | mDateNavigator->updateView(); |
2110 | //mDialogManager->updateSearchDialog(); | 2112 | //mDialogManager->updateSearchDialog(); |
2111 | 2113 | ||
2112 | if (which) { | 2114 | if (which) { |
2113 | // If there is an event view visible update the display | 2115 | // If there is an event view visible update the display |
2114 | mViewManager->currentView()->changeEventDisplay(which,action); | 2116 | mViewManager->currentView()->changeEventDisplay(which,action); |
2115 | // TODO: check, if update needed | 2117 | // TODO: check, if update needed |
2116 | // if (which->getTodoStatus()) { | 2118 | // if (which->getTodoStatus()) { |
2117 | mTodoList->updateView(); | 2119 | mTodoList->updateView(); |
2118 | // } | 2120 | // } |
2119 | } else { | 2121 | } else { |
2120 | mViewManager->currentView()->updateView(); | 2122 | mViewManager->currentView()->updateView(); |
2121 | } | 2123 | } |
2122 | } | 2124 | } |
2123 | 2125 | ||
2124 | 2126 | ||
2125 | void CalendarView::updateTodoViews() | 2127 | void CalendarView::updateTodoViews() |
2126 | { | 2128 | { |
2127 | 2129 | ||
2128 | mTodoList->updateView(); | 2130 | mTodoList->updateView(); |
2129 | mViewManager->currentView()->updateView(); | 2131 | mViewManager->currentView()->updateView(); |
2130 | 2132 | ||
2131 | } | 2133 | } |
2132 | 2134 | ||
2133 | 2135 | ||
2134 | void CalendarView::updateView(const QDate &start, const QDate &end) | 2136 | void CalendarView::updateView(const QDate &start, const QDate &end) |
2135 | { | 2137 | { |
2136 | mTodoList->updateView(); | 2138 | mTodoList->updateView(); |
2137 | mViewManager->updateView(start, end); | 2139 | mViewManager->updateView(start, end); |
2138 | //mDateNavigator->updateView(); | 2140 | //mDateNavigator->updateView(); |
2139 | } | 2141 | } |
2140 | 2142 | ||
2141 | void CalendarView::updateView() | 2143 | void CalendarView::updateView() |
2142 | { | 2144 | { |
2143 | DateList tmpList = mNavigator->selectedDates(); | 2145 | DateList tmpList = mNavigator->selectedDates(); |
2144 | 2146 | ||
2145 | // We assume that the navigator only selects consecutive days. | 2147 | // We assume that the navigator only selects consecutive days. |
2146 | updateView( tmpList.first(), tmpList.last() ); | 2148 | updateView( tmpList.first(), tmpList.last() ); |
2149 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | ||
2150 | mTodoList->updateView(); | ||
2147 | } | 2151 | } |
2148 | 2152 | ||
2149 | void CalendarView::updateUnmanagedViews() | 2153 | void CalendarView::updateUnmanagedViews() |
2150 | { | 2154 | { |
2151 | mDateNavigator->updateDayMatrix(); | 2155 | mDateNavigator->updateDayMatrix(); |
2152 | } | 2156 | } |
2153 | 2157 | ||
2154 | int CalendarView::msgItemDelete() | 2158 | int CalendarView::msgItemDelete() |
2155 | { | 2159 | { |
2156 | return KMessageBox::warningContinueCancel(this, | 2160 | return KMessageBox::warningContinueCancel(this, |
2157 | i18n("This item will be\npermanently deleted."), | 2161 | i18n("This item will be\npermanently deleted."), |
2158 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2162 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2159 | } | 2163 | } |
2160 | 2164 | ||
2161 | 2165 | ||
2162 | void CalendarView::edit_cut() | 2166 | void CalendarView::edit_cut() |
2163 | { | 2167 | { |
2164 | Event *anEvent=0; | 2168 | Event *anEvent=0; |
2165 | 2169 | ||
2166 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2170 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2167 | 2171 | ||
2168 | if (mViewManager->currentView()->isEventView()) { | 2172 | if (mViewManager->currentView()->isEventView()) { |
2169 | if ( incidence && incidence->type() == "Event" ) { | 2173 | if ( incidence && incidence->type() == "Event" ) { |
2170 | anEvent = static_cast<Event *>(incidence); | 2174 | anEvent = static_cast<Event *>(incidence); |
2171 | } | 2175 | } |
2172 | } | 2176 | } |
2173 | 2177 | ||
2174 | if (!anEvent) { | 2178 | if (!anEvent) { |
2175 | KNotifyClient::beep(); | 2179 | KNotifyClient::beep(); |
2176 | return; | 2180 | return; |
2177 | } | 2181 | } |
2178 | DndFactory factory( mCalendar ); | 2182 | DndFactory factory( mCalendar ); |
2179 | factory.cutEvent(anEvent); | 2183 | factory.cutEvent(anEvent); |
2180 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2184 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2181 | } | 2185 | } |
2182 | 2186 | ||
2183 | void CalendarView::edit_copy() | 2187 | void CalendarView::edit_copy() |
2184 | { | 2188 | { |
2185 | Event *anEvent=0; | 2189 | Event *anEvent=0; |
2186 | 2190 | ||
2187 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2191 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2188 | 2192 | ||
2189 | if (mViewManager->currentView()->isEventView()) { | 2193 | if (mViewManager->currentView()->isEventView()) { |
2190 | if ( incidence && incidence->type() == "Event" ) { | 2194 | if ( incidence && incidence->type() == "Event" ) { |
2191 | anEvent = static_cast<Event *>(incidence); | 2195 | anEvent = static_cast<Event *>(incidence); |
2192 | } | 2196 | } |
2193 | } | 2197 | } |
2194 | 2198 | ||
2195 | if (!anEvent) { | 2199 | if (!anEvent) { |
2196 | KNotifyClient::beep(); | 2200 | KNotifyClient::beep(); |
2197 | return; | 2201 | return; |
2198 | } | 2202 | } |
2199 | DndFactory factory( mCalendar ); | 2203 | DndFactory factory( mCalendar ); |
2200 | factory.copyEvent(anEvent); | 2204 | factory.copyEvent(anEvent); |
2201 | } | 2205 | } |
2202 | 2206 | ||
2203 | void CalendarView::edit_paste() | 2207 | void CalendarView::edit_paste() |
2204 | { | 2208 | { |
2205 | QDate date = mNavigator->selectedDates().first(); | 2209 | QDate date = mNavigator->selectedDates().first(); |
2206 | 2210 | ||
2207 | DndFactory factory( mCalendar ); | 2211 | DndFactory factory( mCalendar ); |
2208 | Event *pastedEvent = factory.pasteEvent( date ); | 2212 | Event *pastedEvent = factory.pasteEvent( date ); |
2209 | 2213 | ||
2210 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2214 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2211 | } | 2215 | } |
2212 | 2216 | ||
2213 | void CalendarView::edit_options() | 2217 | void CalendarView::edit_options() |
2214 | { | 2218 | { |
2215 | mDialogManager->showOptionsDialog(); | 2219 | mDialogManager->showOptionsDialog(); |
2216 | //writeSettings(); | 2220 | //writeSettings(); |
2217 | } | 2221 | } |
2218 | 2222 | ||
2219 | 2223 | ||
2220 | void CalendarView::slotSelectPickerDate( QDate d) | 2224 | void CalendarView::slotSelectPickerDate( QDate d) |
2221 | { | 2225 | { |
2222 | mDateFrame->hide(); | 2226 | mDateFrame->hide(); |
2223 | if ( mDatePickerMode == 1 ) { | 2227 | if ( mDatePickerMode == 1 ) { |
2224 | mNavigator->slotDaySelect( d ); | 2228 | mNavigator->slotDaySelect( d ); |
2225 | } else if ( mDatePickerMode == 2 ) { | 2229 | } else if ( mDatePickerMode == 2 ) { |
2226 | if ( mMoveIncidence->type() == "Todo" ) { | 2230 | if ( mMoveIncidence->type() == "Todo" ) { |
2227 | Todo * to = (Todo *) mMoveIncidence; | 2231 | Todo * to = (Todo *) mMoveIncidence; |
2228 | QTime tim; | 2232 | QTime tim; |
2229 | if ( to->hasDueDate() ) | 2233 | if ( to->hasDueDate() ) |
2230 | tim = to->dtDue().time(); | 2234 | tim = to->dtDue().time(); |
2231 | else { | 2235 | else { |
2232 | tim = QTime ( 0,0,0 ); | 2236 | tim = QTime ( 0,0,0 ); |
2233 | to->setFloats( true ); | 2237 | to->setFloats( true ); |
2234 | to->setHasDueDate( true ); | 2238 | to->setHasDueDate( true ); |
2235 | } | 2239 | } |
2236 | QDateTime dt ( d,tim ); | 2240 | QDateTime dt ( d,tim ); |
2237 | to->setDtDue( dt ); | 2241 | to->setDtDue( dt ); |
2238 | todoChanged( to ); | 2242 | todoChanged( to ); |
2239 | } else { | 2243 | } else { |
2240 | if ( mMoveIncidence->doesRecur() ) { | 2244 | if ( mMoveIncidence->doesRecur() ) { |
2241 | #if 0 | 2245 | #if 0 |
2242 | // PENDING implement this | 2246 | // PENDING implement this |
2243 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | 2247 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); |
2244 | mCalendar()->addIncidence( newInc ); | 2248 | mCalendar()->addIncidence( newInc ); |
2245 | if ( mMoveIncidence->type() == "Todo" ) | 2249 | if ( mMoveIncidence->type() == "Todo" ) |
2246 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | 2250 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); |
2247 | else | 2251 | else |
2248 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | 2252 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); |
2249 | mMoveIncidence = newInc; | 2253 | mMoveIncidence = newInc; |
2250 | 2254 | ||
2251 | #endif | 2255 | #endif |
2252 | } | 2256 | } |
2253 | QTime tim = mMoveIncidence->dtStart().time(); | 2257 | QTime tim = mMoveIncidence->dtStart().time(); |
2254 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2258 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2255 | QDateTime dt ( d,tim ); | 2259 | QDateTime dt ( d,tim ); |
2256 | mMoveIncidence->setDtStart( dt ); | 2260 | mMoveIncidence->setDtStart( dt ); |
2257 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2261 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2258 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2262 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2259 | } | 2263 | } |
2260 | 2264 | ||
2261 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2265 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2262 | } | 2266 | } |
2263 | } | 2267 | } |
2264 | 2268 | ||
2265 | void CalendarView::removeCategories() | 2269 | void CalendarView::removeCategories() |
2266 | { | 2270 | { |
2267 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2271 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2268 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2272 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2269 | QStringList catIncList; | 2273 | QStringList catIncList; |
2270 | QStringList newCatList; | 2274 | QStringList newCatList; |
2271 | Incidence* inc = incList.first(); | 2275 | Incidence* inc = incList.first(); |
2272 | int i; | 2276 | int i; |
2273 | int count = 0; | 2277 | int count = 0; |
2274 | while ( inc ) { | 2278 | while ( inc ) { |
2275 | newCatList.clear(); | 2279 | newCatList.clear(); |
2276 | catIncList = inc->categories() ; | 2280 | catIncList = inc->categories() ; |
2277 | for( i = 0; i< catIncList.count(); ++i ) { | 2281 | for( i = 0; i< catIncList.count(); ++i ) { |
2278 | if ( catList.contains (catIncList[i])) | 2282 | if ( catList.contains (catIncList[i])) |
2279 | newCatList.append( catIncList[i] ); | 2283 | newCatList.append( catIncList[i] ); |
2280 | } | 2284 | } |
2281 | newCatList.sort(); | 2285 | newCatList.sort(); |
2282 | inc->setCategories( newCatList.join(",") ); | 2286 | inc->setCategories( newCatList.join(",") ); |
2283 | inc = incList.next(); | 2287 | inc = incList.next(); |
2284 | } | 2288 | } |
2285 | } | 2289 | } |
2286 | 2290 | ||
2287 | int CalendarView::addCategories() | 2291 | int CalendarView::addCategories() |
2288 | { | 2292 | { |
2289 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2293 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2290 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2294 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2291 | QStringList catIncList; | 2295 | QStringList catIncList; |
2292 | Incidence* inc = incList.first(); | 2296 | Incidence* inc = incList.first(); |
2293 | int i; | 2297 | int i; |
2294 | int count = 0; | 2298 | int count = 0; |
2295 | while ( inc ) { | 2299 | while ( inc ) { |
2296 | catIncList = inc->categories() ; | 2300 | catIncList = inc->categories() ; |
2297 | for( i = 0; i< catIncList.count(); ++i ) { | 2301 | for( i = 0; i< catIncList.count(); ++i ) { |
2298 | if ( !catList.contains (catIncList[i])) { | 2302 | if ( !catList.contains (catIncList[i])) { |
2299 | catList.append( catIncList[i] ); | 2303 | catList.append( catIncList[i] ); |
2300 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2304 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2301 | ++count; | 2305 | ++count; |
2302 | } | 2306 | } |
2303 | } | 2307 | } |
2304 | inc = incList.next(); | 2308 | inc = incList.next(); |
2305 | } | 2309 | } |
2306 | catList.sort(); | 2310 | catList.sort(); |
2307 | KOPrefs::instance()->mCustomCategories = catList; | 2311 | KOPrefs::instance()->mCustomCategories = catList; |
2308 | return count; | 2312 | return count; |
2309 | } | 2313 | } |
2310 | 2314 | ||
2311 | void CalendarView::manageCategories() | 2315 | void CalendarView::manageCategories() |
2312 | { | 2316 | { |
2313 | KOCatPrefs* cp = new KOCatPrefs(); | 2317 | KOCatPrefs* cp = new KOCatPrefs(); |
2314 | cp->show(); | 2318 | cp->show(); |
2315 | int w =cp->sizeHint().width() ; | 2319 | int w =cp->sizeHint().width() ; |
2316 | int h = cp->sizeHint().height() ; | 2320 | int h = cp->sizeHint().height() ; |
2317 | int dw = QApplication::desktop()->width(); | 2321 | int dw = QApplication::desktop()->width(); |
2318 | int dh = QApplication::desktop()->height(); | 2322 | int dh = QApplication::desktop()->height(); |
2319 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2323 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2320 | if ( !cp->exec() ) { | 2324 | if ( !cp->exec() ) { |
2321 | delete cp; | 2325 | delete cp; |
2322 | return; | 2326 | return; |
2323 | } | 2327 | } |
2324 | int count = 0; | 2328 | int count = 0; |
2325 | if ( cp->addCat() ) { | 2329 | if ( cp->addCat() ) { |
2326 | count = addCategories(); | 2330 | count = addCategories(); |
2327 | if ( count ) { | 2331 | if ( count ) { |
2328 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2332 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2329 | writeSettings(); | 2333 | writeSettings(); |
2330 | } else | 2334 | } else |
2331 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | 2335 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); |
2332 | } else { | 2336 | } else { |
2333 | removeCategories(); | 2337 | removeCategories(); |
2334 | updateView(); | 2338 | updateView(); |
2335 | } | 2339 | } |
2336 | delete cp; | 2340 | delete cp; |
2337 | } | 2341 | } |
2338 | 2342 | ||
2339 | void CalendarView::beamIncidence(Incidence * Inc) | 2343 | void CalendarView::beamIncidence(Incidence * Inc) |
2340 | { | 2344 | { |
2341 | QPtrList<Incidence> delSel ; | 2345 | QPtrList<Incidence> delSel ; |
2342 | delSel.append(Inc); | 2346 | delSel.append(Inc); |
2343 | beamIncidenceList( delSel ); | 2347 | beamIncidenceList( delSel ); |
2344 | } | 2348 | } |
2345 | void CalendarView::beamCalendar() | 2349 | void CalendarView::beamCalendar() |
2346 | { | 2350 | { |
2347 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 2351 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2348 | //qDebug("beamCalendar() "); | 2352 | //qDebug("beamCalendar() "); |
2349 | beamIncidenceList( delSel ); | 2353 | beamIncidenceList( delSel ); |
2350 | } | 2354 | } |
2351 | void CalendarView::beamFilteredCalendar() | 2355 | void CalendarView::beamFilteredCalendar() |
2352 | { | 2356 | { |
2353 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 2357 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2354 | //qDebug("beamFilteredCalendar() "); | 2358 | //qDebug("beamFilteredCalendar() "); |
2355 | beamIncidenceList( delSel ); | 2359 | beamIncidenceList( delSel ); |
2356 | } | 2360 | } |
2357 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 2361 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2358 | { | 2362 | { |
2359 | if ( beamDialog->exec () == QDialog::Rejected ) | 2363 | if ( beamDialog->exec () == QDialog::Rejected ) |
2360 | return; | 2364 | return; |
2361 | #ifdef DESKTOP_VERSION | 2365 | #ifdef DESKTOP_VERSION |
2362 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 2366 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2363 | #else | 2367 | #else |
2364 | QString fn = "/tmp/kopibeamfile"; | 2368 | QString fn = "/tmp/kopibeamfile"; |
2365 | #endif | 2369 | #endif |
2366 | QString mes; | 2370 | QString mes; |
2367 | bool createbup = true; | 2371 | bool createbup = true; |
2368 | if ( createbup ) { | 2372 | if ( createbup ) { |
2369 | QString description = "\n"; | 2373 | QString description = "\n"; |
2370 | CalendarLocal* cal = new CalendarLocal(); | 2374 | CalendarLocal* cal = new CalendarLocal(); |
2371 | if ( beamDialog->beamLocal() ) | 2375 | if ( beamDialog->beamLocal() ) |
2372 | cal->setLocalTime(); | 2376 | cal->setLocalTime(); |
2373 | else | 2377 | else |
2374 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2378 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2375 | Incidence *incidence = delSel.first(); | 2379 | Incidence *incidence = delSel.first(); |
2376 | bool addText = false; | 2380 | bool addText = false; |
2377 | if ( delSel.count() < 10 ) | 2381 | if ( delSel.count() < 10 ) |
2378 | addText = true; | 2382 | addText = true; |
2379 | else { | 2383 | else { |
2380 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 2384 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2381 | } | 2385 | } |
2382 | while ( incidence ) { | 2386 | while ( incidence ) { |
2383 | Incidence *in = incidence->clone(); | 2387 | Incidence *in = incidence->clone(); |
2384 | if ( ! in->summary().isEmpty() ) { | 2388 | if ( ! in->summary().isEmpty() ) { |
2385 | in->setDescription(""); | 2389 | in->setDescription(""); |
2386 | } else { | 2390 | } else { |
2387 | in->setSummary( in->description().left(20)); | 2391 | in->setSummary( in->description().left(20)); |
2388 | in->setDescription(""); | 2392 | in->setDescription(""); |
2389 | } | 2393 | } |
2390 | if ( addText ) | 2394 | if ( addText ) |
2391 | description += in->summary() + "\n"; | 2395 | description += in->summary() + "\n"; |
2392 | cal->addIncidence( in ); | 2396 | cal->addIncidence( in ); |
2393 | incidence = delSel.next(); | 2397 | incidence = delSel.next(); |
2394 | } | 2398 | } |
2395 | if ( beamDialog->beamVcal() ) { | 2399 | if ( beamDialog->beamVcal() ) { |
2396 | fn += ".vcs"; | 2400 | fn += ".vcs"; |
2397 | FileStorage storage( cal, fn, new VCalFormat ); | 2401 | FileStorage storage( cal, fn, new VCalFormat ); |
2398 | storage.save(); | 2402 | storage.save(); |
2399 | } else { | 2403 | } else { |
2400 | fn += ".ics"; | 2404 | fn += ".ics"; |
2401 | FileStorage storage( cal, fn, new ICalFormat( ) ); | 2405 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2402 | storage.save(); | 2406 | storage.save(); |
2403 | } | 2407 | } |
2404 | delete cal; | 2408 | delete cal; |
2405 | mes = i18n("KO/Pi: Ready for beaming"); | 2409 | mes = i18n("KO/Pi: Ready for beaming"); |
2406 | topLevelWidget()->setCaption(mes); | 2410 | topLevelWidget()->setCaption(mes); |
2407 | KApplication::convert2latin1( fn ); | 2411 | KApplication::convert2latin1( fn ); |
2408 | #ifndef DESKTOP_VERSION | 2412 | #ifndef DESKTOP_VERSION |
2409 | Ir *ir = new Ir( this ); | 2413 | Ir *ir = new Ir( this ); |
2410 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 2414 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
2411 | ir->send( fn, description, "text/x-vCalendar" ); | 2415 | ir->send( fn, description, "text/x-vCalendar" ); |
2412 | #endif | 2416 | #endif |
2413 | } | 2417 | } |
2414 | } | 2418 | } |
2415 | void CalendarView::beamDone( Ir *ir ) | 2419 | void CalendarView::beamDone( Ir *ir ) |
2416 | { | 2420 | { |
2417 | #ifndef DESKTOP_VERSION | 2421 | #ifndef DESKTOP_VERSION |
2418 | delete ir; | 2422 | delete ir; |
2419 | #endif | 2423 | #endif |
2420 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2424 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2421 | topLevelWidget()->raise(); | 2425 | topLevelWidget()->raise(); |
2422 | } | 2426 | } |
2423 | 2427 | ||
2424 | void CalendarView::moveIncidence(Incidence * inc ) | 2428 | void CalendarView::moveIncidence(Incidence * inc ) |
2425 | { | 2429 | { |
2426 | if ( !inc ) return; | 2430 | if ( !inc ) return; |
2427 | // qDebug("showDatePickerForIncidence( ) "); | 2431 | // qDebug("showDatePickerForIncidence( ) "); |
2428 | if ( mDateFrame->isVisible() ) | 2432 | if ( mDateFrame->isVisible() ) |
2429 | mDateFrame->hide(); | 2433 | mDateFrame->hide(); |
2430 | else { | 2434 | else { |
2431 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; | 2435 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; |
2432 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; | 2436 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; |
2433 | int dw = QApplication::desktop()->width(); | 2437 | int dw = QApplication::desktop()->width(); |
2434 | int dh = QApplication::desktop()->height(); | 2438 | int dh = QApplication::desktop()->height(); |
2435 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2439 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2436 | mDateFrame->show(); | 2440 | mDateFrame->show(); |
2437 | } | 2441 | } |
2438 | mDatePickerMode = 2; | 2442 | mDatePickerMode = 2; |
2439 | mMoveIncidence = inc ; | 2443 | mMoveIncidence = inc ; |
2440 | QDate da; | 2444 | QDate da; |
2441 | if ( mMoveIncidence->type() == "Todo" ) { | 2445 | if ( mMoveIncidence->type() == "Todo" ) { |
2442 | Todo * to = (Todo *) mMoveIncidence; | 2446 | Todo * to = (Todo *) mMoveIncidence; |
2443 | if ( to->hasDueDate() ) | 2447 | if ( to->hasDueDate() ) |
2444 | da = to->dtDue().date(); | 2448 | da = to->dtDue().date(); |
2445 | else | 2449 | else |
2446 | da = QDate::currentDate(); | 2450 | da = QDate::currentDate(); |
2447 | } else { | 2451 | } else { |
2448 | da = mMoveIncidence->dtStart().date(); | 2452 | da = mMoveIncidence->dtStart().date(); |
2449 | } | 2453 | } |
2450 | //PENDING set date for recurring incidence to date of recurrence | 2454 | //PENDING set date for recurring incidence to date of recurrence |
2451 | //mMoveIncidenceOldDate; | 2455 | //mMoveIncidenceOldDate; |
2452 | mDatePicker->setDate( da ); | 2456 | mDatePicker->setDate( da ); |
2453 | } | 2457 | } |
2454 | void CalendarView::showDatePicker( ) | 2458 | void CalendarView::showDatePicker( ) |
2455 | { | 2459 | { |
2456 | //qDebug("CalendarView::showDatePicker( ) "); | 2460 | //qDebug("CalendarView::showDatePicker( ) "); |
2457 | if ( mDateFrame->isVisible() ) | 2461 | if ( mDateFrame->isVisible() ) |
2458 | mDateFrame->hide(); | 2462 | mDateFrame->hide(); |
2459 | else { | 2463 | else { |
2460 | int w =mDatePicker->sizeHint().width() ; | 2464 | int w =mDatePicker->sizeHint().width() ; |
2461 | int h = mDatePicker->sizeHint().height() ; | 2465 | int h = mDatePicker->sizeHint().height() ; |
2462 | int dw = QApplication::desktop()->width(); | 2466 | int dw = QApplication::desktop()->width(); |
2463 | int dh = QApplication::desktop()->height(); | 2467 | int dh = QApplication::desktop()->height(); |
2464 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2468 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2465 | mDateFrame->show(); | 2469 | mDateFrame->show(); |
2466 | } | 2470 | } |
2467 | mDatePickerMode = 1; | 2471 | mDatePickerMode = 1; |
2468 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2472 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2469 | } | 2473 | } |
2470 | 2474 | ||
2471 | void CalendarView::showEventEditor() | 2475 | void CalendarView::showEventEditor() |
2472 | { | 2476 | { |
2473 | #ifdef DESKTOP_VERSION | 2477 | #ifdef DESKTOP_VERSION |
2474 | mEventEditor->show(); | 2478 | mEventEditor->show(); |
2475 | #else | 2479 | #else |
2476 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2480 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2477 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2481 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2478 | qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2482 | qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2479 | delete mEventEditor; | 2483 | delete mEventEditor; |
2480 | mEventEditor = mDialogManager->getEventEditor(); | 2484 | mEventEditor = mDialogManager->getEventEditor(); |
2481 | } | 2485 | } |
2482 | mEventEditor->showMaximized(); | 2486 | mEventEditor->showMaximized(); |
2483 | #endif | 2487 | #endif |
2484 | } | 2488 | } |
2485 | void CalendarView::showTodoEditor() | 2489 | void CalendarView::showTodoEditor() |
2486 | { | 2490 | { |
2487 | #ifdef DESKTOP_VERSION | 2491 | #ifdef DESKTOP_VERSION |
2488 | mTodoEditor->show(); | 2492 | mTodoEditor->show(); |
2489 | #else | 2493 | #else |
2490 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2494 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2491 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2495 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2492 | qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2496 | qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2493 | delete mTodoEditor; | 2497 | delete mTodoEditor; |
2494 | mTodoEditor = mDialogManager->getTodoEditor(); | 2498 | mTodoEditor = mDialogManager->getTodoEditor(); |
2495 | } | 2499 | } |
2496 | mTodoEditor->showMaximized(); | 2500 | mTodoEditor->showMaximized(); |
2497 | #endif | 2501 | #endif |
2498 | } | 2502 | } |
2499 | 2503 | ||
2500 | void CalendarView::cloneIncidence() | 2504 | void CalendarView::cloneIncidence() |
2501 | { | 2505 | { |
2502 | Incidence *incidence = currentSelection(); | 2506 | Incidence *incidence = currentSelection(); |
2503 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2507 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2504 | if ( incidence ) { | 2508 | if ( incidence ) { |
2505 | cloneIncidence(incidence); | 2509 | cloneIncidence(incidence); |
2506 | } | 2510 | } |
2507 | } | 2511 | } |
2508 | void CalendarView::moveIncidence() | 2512 | void CalendarView::moveIncidence() |
2509 | { | 2513 | { |
2510 | Incidence *incidence = currentSelection(); | 2514 | Incidence *incidence = currentSelection(); |
2511 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2515 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2512 | if ( incidence ) { | 2516 | if ( incidence ) { |
2513 | moveIncidence(incidence); | 2517 | moveIncidence(incidence); |
2514 | } | 2518 | } |
2515 | } | 2519 | } |
2516 | void CalendarView::beamIncidence() | 2520 | void CalendarView::beamIncidence() |
2517 | { | 2521 | { |
2518 | Incidence *incidence = currentSelection(); | 2522 | Incidence *incidence = currentSelection(); |
2519 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2523 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2520 | if ( incidence ) { | 2524 | if ( incidence ) { |
2521 | beamIncidence(incidence); | 2525 | beamIncidence(incidence); |
2522 | } | 2526 | } |
2523 | } | 2527 | } |
2524 | void CalendarView::toggleCancelIncidence() | 2528 | void CalendarView::toggleCancelIncidence() |
2525 | { | 2529 | { |
2526 | Incidence *incidence = currentSelection(); | 2530 | Incidence *incidence = currentSelection(); |
2527 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2531 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2528 | if ( incidence ) { | 2532 | if ( incidence ) { |
2529 | cancelIncidence(incidence); | 2533 | cancelIncidence(incidence); |
2530 | } | 2534 | } |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 46184ac..6965ba7 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -117,606 +117,606 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
117 | QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); | 117 | QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); |
118 | if ( !mIncidence->doesFloat() ) | 118 | if ( !mIncidence->doesFloat() ) |
119 | if ( mIncidence->type() == "Event" ) { | 119 | if ( mIncidence->type() == "Event" ) { |
120 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { | 120 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { |
121 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); | 121 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); |
122 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); | 122 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); |
123 | } | 123 | } |
124 | else { | 124 | else { |
125 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); | 125 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); |
126 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); | 126 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | else if ( mIncidence->type() == "Todo" ) { | 129 | else if ( mIncidence->type() == "Todo" ) { |
130 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr(); | 130 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr(); |
131 | } | 131 | } |
132 | 132 | ||
133 | if (!mIncidence->location().isEmpty()) { | 133 | if (!mIncidence->location().isEmpty()) { |
134 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); | 134 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); |
135 | } | 135 | } |
136 | QToolTip::add(this,tipText,toolTipGroup(),""); | 136 | QToolTip::add(this,tipText,toolTipGroup(),""); |
137 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 137 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
138 | mFontPixelSize = fontinf.height();; | 138 | mFontPixelSize = fontinf.height();; |
139 | hide(); | 139 | hide(); |
140 | xPaintCoord = -1; | 140 | xPaintCoord = -1; |
141 | yPaintCoord = -1; | 141 | yPaintCoord = -1; |
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | KOAgendaItem::~KOAgendaItem() | 145 | KOAgendaItem::~KOAgendaItem() |
146 | { | 146 | { |
147 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); | 147 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | void KOAgendaItem::recreateIncidence() | 151 | void KOAgendaItem::recreateIncidence() |
152 | { | 152 | { |
153 | #if 0 | 153 | #if 0 |
154 | Incidence* newInc = mIncidence->clone(); | 154 | Incidence* newInc = mIncidence->clone(); |
155 | newInc->recreate(); | 155 | newInc->recreate(); |
156 | if ( mIncidence->doesRecur() ) { | 156 | if ( mIncidence->doesRecur() ) { |
157 | mIncidence->addExDate( mDate ); | 157 | mIncidence->addExDate( mDate ); |
158 | newInc->recurrence()->unsetRecurs(); | 158 | newInc->recurrence()->unsetRecurs(); |
159 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); | 159 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); |
160 | QTime tim = mIncidence->dtStart().time(); | 160 | QTime tim = mIncidence->dtStart().time(); |
161 | newInc->setDtStart( QDateTime(mDate, tim) ); | 161 | newInc->setDtStart( QDateTime(mDate, tim) ); |
162 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | 162 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); |
163 | } | 163 | } |
164 | #endif | 164 | #endif |
165 | mIncidence = mIncidence->recreateCloneException( mDate ); | 165 | mIncidence = mIncidence->recreateCloneException( mDate ); |
166 | } | 166 | } |
167 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | 167 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) |
168 | { | 168 | { |
169 | int size = AGENDA_ICON_SIZE; | 169 | int size = AGENDA_ICON_SIZE; |
170 | 170 | ||
171 | int yOff = 0; | 171 | int yOff = 0; |
172 | int xOff = 0; | 172 | int xOff = 0; |
173 | int x = pos().x() +3; | 173 | int x = pos().x() +3; |
174 | int y; | 174 | int y; |
175 | if ( mAllDay ) | 175 | if ( mAllDay ) |
176 | y = pos().y()+3; | 176 | y = pos().y()+3; |
177 | else | 177 | else |
178 | y = mCellYTop * ( height() / cellHeight() ) +3; | 178 | y = mCellYTop * ( height() / cellHeight() ) +3; |
179 | if (mIncidence->cancelled()) { | 179 | if (mIncidence->cancelled()) { |
180 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 180 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
181 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; | 181 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; |
182 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); | 182 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); |
183 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); | 183 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); |
184 | if ( horLayout ) | 184 | if ( horLayout ) |
185 | ++xOff; | 185 | ++xOff; |
186 | else | 186 | else |
187 | ++yOff; | 187 | ++yOff; |
188 | } | 188 | } |
189 | if (mIncidence->isAlarmEnabled()) { | 189 | if (mIncidence->isAlarmEnabled()) { |
190 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); | 190 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); |
191 | if ( horLayout ) | 191 | if ( horLayout ) |
192 | ++xOff; | 192 | ++xOff; |
193 | else | 193 | else |
194 | ++yOff; | 194 | ++yOff; |
195 | } | 195 | } |
196 | if (mIncidence->recurrence()->doesRecur()) { | 196 | if (mIncidence->recurrence()->doesRecur()) { |
197 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); | 197 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); |
198 | if ( horLayout ) | 198 | if ( horLayout ) |
199 | ++xOff; | 199 | ++xOff; |
200 | else | 200 | else |
201 | ++yOff; | 201 | ++yOff; |
202 | } | 202 | } |
203 | if (mIncidence->description().length() > 0) { | 203 | if (mIncidence->description().length() > 0) { |
204 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); | 204 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); |
205 | if ( horLayout ) | 205 | if ( horLayout ) |
206 | ++xOff; | 206 | ++xOff; |
207 | else | 207 | else |
208 | ++yOff; | 208 | ++yOff; |
209 | } | 209 | } |
210 | if (mIncidence->isReadOnly()) { | 210 | if (mIncidence->isReadOnly()) { |
211 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); | 211 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); |
212 | if ( horLayout ) | 212 | if ( horLayout ) |
213 | ++xOff; | 213 | ++xOff; |
214 | else | 214 | else |
215 | ++yOff; | 215 | ++yOff; |
216 | } | 216 | } |
217 | 217 | ||
218 | if (mIncidence->attendeeCount()>0) { | 218 | if (mIncidence->attendeeCount()>0) { |
219 | 219 | ||
220 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { | 220 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { |
221 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); | 221 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); |
222 | if ( horLayout ) | 222 | if ( horLayout ) |
223 | ++xOff; | 223 | ++xOff; |
224 | else | 224 | else |
225 | ++yOff; | 225 | ++yOff; |
226 | } else { | 226 | } else { |
227 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 227 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
228 | if (me!=0) { | 228 | if (me!=0) { |
229 | 229 | ||
230 | 230 | ||
231 | } else { | 231 | } else { |
232 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); | 232 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); |
233 | if ( horLayout ) | 233 | if ( horLayout ) |
234 | ++xOff; | 234 | ++xOff; |
235 | else | 235 | else |
236 | ++yOff; | 236 | ++yOff; |
237 | 237 | ||
238 | } | 238 | } |
239 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); | 239 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); |
240 | if ( horLayout ) | 240 | if ( horLayout ) |
241 | ++xOff; | 241 | ++xOff; |
242 | else | 242 | else |
243 | ++yOff; | 243 | ++yOff; |
244 | 244 | ||
245 | } | 245 | } |
246 | 246 | ||
247 | } | 247 | } |
248 | return ( yOff || xOff ); | 248 | return ( yOff || xOff ); |
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | void KOAgendaItem::select(bool selected) | 252 | void KOAgendaItem::select(bool selected) |
253 | { | 253 | { |
254 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); | 254 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); |
255 | if (mSelected == selected) return; | 255 | if (mSelected == selected) return; |
256 | mSelected = selected; | 256 | mSelected = selected; |
257 | if ( ! isVisible() ) | 257 | if ( ! isVisible() ) |
258 | return; | 258 | return; |
259 | if ( firstMultiItem() ) | 259 | if ( firstMultiItem() ) |
260 | firstMultiItem()->select( selected ); | 260 | firstMultiItem()->select( selected ); |
261 | if ( !firstMultiItem() && nextMultiItem() ) { | 261 | if ( !firstMultiItem() && nextMultiItem() ) { |
262 | KOAgendaItem * placeItem = nextMultiItem(); | 262 | KOAgendaItem * placeItem = nextMultiItem(); |
263 | while ( placeItem ) { | 263 | while ( placeItem ) { |
264 | placeItem->select( selected ); | 264 | placeItem->select( selected ); |
265 | placeItem = placeItem->nextMultiItem(); | 265 | placeItem = placeItem->nextMultiItem(); |
266 | } | 266 | } |
267 | } | 267 | } |
268 | globalFlagBlockAgendaItemUpdate = 0; | 268 | globalFlagBlockAgendaItemUpdate = 0; |
269 | paintMe( selected ); | 269 | paintMe( selected ); |
270 | globalFlagBlockAgendaItemUpdate = 1; | 270 | globalFlagBlockAgendaItemUpdate = 1; |
271 | repaint( false ); | 271 | repaint( false ); |
272 | } | 272 | } |
273 | 273 | ||
274 | 274 | ||
275 | /* | 275 | /* |
276 | The eventFilter has to filter the mouse events of the agenda item childs. The | 276 | The eventFilter has to filter the mouse events of the agenda item childs. The |
277 | events are fed into the event handling method of KOAgendaItem. This allows the | 277 | events are fed into the event handling method of KOAgendaItem. This allows the |
278 | KOAgenda to handle the KOAgendaItems by using an eventFilter. | 278 | KOAgenda to handle the KOAgendaItems by using an eventFilter. |
279 | */ | 279 | */ |
280 | bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) | 280 | bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) |
281 | { | 281 | { |
282 | if (e->type() == QEvent::MouseButtonPress || | 282 | if (e->type() == QEvent::MouseButtonPress || |
283 | e->type() == QEvent::MouseButtonDblClick || | 283 | e->type() == QEvent::MouseButtonDblClick || |
284 | e->type() == QEvent::MouseButtonRelease || | 284 | e->type() == QEvent::MouseButtonRelease || |
285 | e->type() == QEvent::MouseMove) { | 285 | e->type() == QEvent::MouseMove) { |
286 | QMouseEvent *me = (QMouseEvent *)e; | 286 | QMouseEvent *me = (QMouseEvent *)e; |
287 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> | 287 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> |
288 | mapToGlobal(me->pos())); | 288 | mapToGlobal(me->pos())); |
289 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); | 289 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); |
290 | return event(&returnEvent); | 290 | return event(&returnEvent); |
291 | } else { | 291 | } else { |
292 | return false; | 292 | return false; |
293 | } | 293 | } |
294 | } | 294 | } |
295 | void KOAgendaItem::repaintMe( ) | 295 | void KOAgendaItem::repaintMe( ) |
296 | { | 296 | { |
297 | paintMe ( mSelected ); | 297 | paintMe ( mSelected ); |
298 | } | 298 | } |
299 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | 299 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) |
300 | { | 300 | { |
301 | if ( globalFlagBlockAgendaItemUpdate && ! selected) | 301 | if ( globalFlagBlockAgendaItemUpdate && ! selected) |
302 | return; | 302 | return; |
303 | QPainter pa; | 303 | QPainter pa; |
304 | 304 | ||
305 | if ( mSelected ) { | 305 | if ( mSelected ) { |
306 | pa.begin( paintPixSel() ); | 306 | pa.begin( paintPixSel() ); |
307 | } else { | 307 | } else { |
308 | if ( mAllDay ) | 308 | if ( mAllDay ) |
309 | pa.begin( paintPixAllday() ); | 309 | pa.begin( paintPixAllday() ); |
310 | else | 310 | else |
311 | pa.begin( paintPix() ); | 311 | pa.begin( paintPix() ); |
312 | } | 312 | } |
313 | int x, yy, w, h; | 313 | int x, yy, w, h; |
314 | float nfh; | 314 | float nfh; |
315 | x = pos().x(); w = width(); h = height (); | 315 | x = pos().x(); w = width(); h = height (); |
316 | if ( mAllDay ) | 316 | if ( mAllDay ) |
317 | yy = y(); | 317 | yy = y(); |
318 | else | 318 | else |
319 | yy = mCellYTop * ( height() / cellHeight() ); | 319 | yy = mCellYTop * ( height() / cellHeight() ); |
320 | xPaintCoord= x; | 320 | xPaintCoord= x; |
321 | yPaintCoord = yy; | 321 | yPaintCoord = yy; |
322 | wPaintCoord = width(); | 322 | wPaintCoord = width(); |
323 | hPaintCoord = height(); | 323 | hPaintCoord = height(); |
324 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); | 324 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); |
325 | if ( paint == 0 ) | 325 | if ( paint == 0 ) |
326 | paint = &pa; | 326 | paint = &pa; |
327 | bool horLayout = ( w < h ); | 327 | bool horLayout = ( w < h ); |
328 | int maxhei = mFontPixelSize+4; | 328 | int maxhei = mFontPixelSize+4; |
329 | if ( horLayout ) | 329 | if ( horLayout ) |
330 | maxhei += AGENDA_ICON_SIZE -4; | 330 | maxhei += AGENDA_ICON_SIZE -4; |
331 | bool small = ( h < maxhei ); | 331 | bool small = ( h < maxhei ); |
332 | if ( ! small ) | 332 | if ( ! small ) |
333 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); | 333 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); |
334 | else { | 334 | else { |
335 | QFont f = KOPrefs::instance()->mAgendaViewFont; | 335 | QFont f = KOPrefs::instance()->mAgendaViewFont; |
336 | f.setBold( false ); | 336 | f.setBold( false ); |
337 | int fh = f.pointSize(); | 337 | int fh = f.pointSize(); |
338 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; | 338 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; |
339 | if ( nfh < 6 ) | 339 | if ( nfh < 6 ) |
340 | nfh = 6; | 340 | nfh = 6; |
341 | f.setPointSize( nfh ); | 341 | f.setPointSize( nfh ); |
342 | paint->setFont(f); | 342 | paint->setFont(f); |
343 | } | 343 | } |
344 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); | 344 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); |
345 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); | 345 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); |
346 | static const QPixmap overduePxmp = SmallIcon("redcross16"); | 346 | static const QPixmap overduePxmp = SmallIcon("redcross16"); |
347 | if ( mIncidence->type() == "Todo" ) { | 347 | if ( mIncidence->type() == "Todo" ) { |
348 | Todo* tempTodo = static_cast<Todo*>(mIncidence); | 348 | Todo* tempTodo = static_cast<Todo*>(mIncidence); |
349 | int xx = pos().x()+(width()-completedPxmp.width()-3 ); | 349 | int xx = pos().x()+(width()-completedPxmp.width()-3 ); |
350 | int yyy = yy+3; | 350 | int yyy = yy+3; |
351 | if ( tempTodo->isCompleted() ) | 351 | if ( tempTodo->isCompleted() ) |
352 | paint->drawPixmap ( xx, yyy, completedPxmp ); | 352 | paint->drawPixmap ( xx, yyy, completedPxmp ); |
353 | else { | 353 | else { |
354 | paint->drawPixmap ( xx, yyy, overduePxmp ); | 354 | paint->drawPixmap ( xx, yyy, overduePxmp ); |
355 | 355 | ||
356 | } | 356 | } |
357 | } | 357 | } |
358 | bool addIcon = false; | 358 | bool addIcon = false; |
359 | if ( ! small || w > 3 * h || h > 3* w ) | 359 | if ( ! small || w > 3 * h || h > 3* w ) |
360 | addIcon = updateIcons( paint, horLayout ); | 360 | addIcon = updateIcons( paint, horLayout ); |
361 | 361 | ||
362 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); | 362 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); |
363 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); | 363 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); |
364 | if ( ! small ) { | 364 | if ( ! small ) { |
365 | x += 3; yy += 3;w -= 6; h-= 5; | 365 | x += 3; yy += 3;w -= 6; h-= 5; |
366 | } else { | 366 | } else { |
367 | x += 2; yy += 1;w -= 4; h-= 4; | 367 | x += 2; yy += 1;w -= 4; h-= 4; |
368 | if ( nfh < 6.01 ) { | 368 | if ( nfh < 6.01 ) { |
369 | yy -= 2; | 369 | yy -= 2; |
370 | h += 4; | 370 | h += 4; |
371 | } | 371 | } |
372 | else | 372 | else |
373 | if ( nfh < h -2 ) | 373 | if ( nfh < h -2 ) |
374 | ++yy; | 374 | ++yy; |
375 | } | 375 | } |
376 | int align; | 376 | int align; |
377 | #ifndef DESKTOP_VERSION | 377 | #ifndef DESKTOP_VERSION |
378 | align = ( AlignLeft|WordBreak|AlignTop); | 378 | align = ( AlignLeft|WordBreak|AlignTop); |
379 | #else | 379 | #else |
380 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 380 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
381 | #endif | 381 | #endif |
382 | if ( addIcon ) { | 382 | if ( addIcon ) { |
383 | if ( ! horLayout ) { | 383 | if ( ! horLayout ) { |
384 | x += AGENDA_ICON_SIZE+3; | 384 | x += AGENDA_ICON_SIZE+3; |
385 | w -= (AGENDA_ICON_SIZE+3); | 385 | w -= (AGENDA_ICON_SIZE+3); |
386 | } | 386 | } |
387 | else { | 387 | else { |
388 | yy+= AGENDA_ICON_SIZE+2; | 388 | yy+= AGENDA_ICON_SIZE+2; |
389 | h -=(AGENDA_ICON_SIZE+3); | 389 | h -=(AGENDA_ICON_SIZE+3); |
390 | } | 390 | } |
391 | } | 391 | } |
392 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); | 392 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); |
393 | if ( colsum < 250 ) | 393 | if ( colsum < 250 ) |
394 | paint->setPen ( white); | 394 | paint->setPen ( white); |
395 | if ( x < 0 ) { | 395 | if ( x < 0 ) { |
396 | w = w+x-3; | 396 | w = w+x-3; |
397 | x = 3; | 397 | x = 3; |
398 | if ( w > parentWidget()->width() ){ | 398 | if ( w > parentWidget()->width() ){ |
399 | w = parentWidget()->width() - 6; | 399 | w = parentWidget()->width() - 6; |
400 | #ifndef DESKTOP_VERSION | 400 | #ifndef DESKTOP_VERSION |
401 | align = ( AlignCenter|WordBreak); | 401 | align = ( AlignCenter|WordBreak); |
402 | #else | 402 | #else |
403 | align = ( AlignCenter|BreakAnywhere|WordBreak); | 403 | align = ( AlignCenter|BreakAnywhere|WordBreak); |
404 | #endif | 404 | #endif |
405 | 405 | ||
406 | } | 406 | } |
407 | } | 407 | } |
408 | QRect dr; | 408 | QRect dr; |
409 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); | 409 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); |
410 | if ( mIncidence->cancelled() ){ | 410 | if ( mIncidence->cancelled() ){ |
411 | if ( ! small ) { | 411 | if ( ! small ) { |
412 | QFontMetrics fm ( paint->font() ); | 412 | QFontMetrics fm ( paint->font() ); |
413 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); | 413 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); |
414 | } | 414 | } |
415 | 415 | ||
416 | } | 416 | } |
417 | pa.end(); | 417 | pa.end(); |
418 | 418 | ||
419 | } | 419 | } |
420 | void KOAgendaItem::resizePixmap( int w , int h ) | 420 | void KOAgendaItem::resizePixmap( int w , int h ) |
421 | { | 421 | { |
422 | paintPix()->resize( w, h ); | 422 | paintPix()->resize( w, h ); |
423 | paintPixSel()->resize( w, h ); | 423 | paintPixSel()->resize( w, h ); |
424 | 424 | ||
425 | } | 425 | } |
426 | QPixmap * KOAgendaItem::paintPix() | 426 | QPixmap * KOAgendaItem::paintPix() |
427 | { | 427 | { |
428 | static QPixmap* mPaintPix = 0; | 428 | static QPixmap* mPaintPix = 0; |
429 | if ( ! mPaintPix ) | 429 | if ( ! mPaintPix ) |
430 | mPaintPix = new QPixmap(); | 430 | mPaintPix = new QPixmap(); |
431 | return mPaintPix ; | 431 | return mPaintPix ; |
432 | } | 432 | } |
433 | QPixmap * KOAgendaItem::paintPixAllday() | 433 | QPixmap * KOAgendaItem::paintPixAllday() |
434 | { | 434 | { |
435 | static QPixmap* mPaintPixA = 0; | 435 | static QPixmap* mPaintPixA = 0; |
436 | if ( ! mPaintPixA ) | 436 | if ( ! mPaintPixA ) |
437 | mPaintPixA = new QPixmap(); | 437 | mPaintPixA = new QPixmap(); |
438 | return mPaintPixA ; | 438 | return mPaintPixA ; |
439 | } | 439 | } |
440 | QPixmap * KOAgendaItem::paintPixSel() | 440 | QPixmap * KOAgendaItem::paintPixSel() |
441 | { | 441 | { |
442 | static QPixmap* mPaintPixSel = 0; | 442 | static QPixmap* mPaintPixSel = 0; |
443 | if ( ! mPaintPixSel ) | 443 | if ( ! mPaintPixSel ) |
444 | mPaintPixSel = new QPixmap(); | 444 | mPaintPixSel = new QPixmap(); |
445 | return mPaintPixSel ; | 445 | return mPaintPixSel ; |
446 | } | 446 | } |
447 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) | 447 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) |
448 | { | 448 | { |
449 | 449 | ||
450 | if ( globalFlagBlockAgendaItemPaint ) | 450 | if ( globalFlagBlockAgendaItemPaint ) |
451 | return; | 451 | return; |
452 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) | 452 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) |
453 | return; | 453 | return; |
454 | int yy; | 454 | int yy; |
455 | if ( mAllDay ) | 455 | if ( mAllDay ) |
456 | yy = y(); | 456 | yy = y(); |
457 | else | 457 | else |
458 | yy = mCellYTop * ( height() / cellHeight() ); | 458 | yy = mCellYTop * ( height() / cellHeight() ); |
459 | int xx = x(); | 459 | int xx = x(); |
460 | if ( xPaintCoord != xx || yPaintCoord != yy || | 460 | if ( xPaintCoord != xx || yPaintCoord != yy || |
461 | wPaintCoord != width() || hPaintCoord != height()) { | 461 | wPaintCoord != width() || hPaintCoord != height()) { |
462 | xPaintCoord= xx; | 462 | xPaintCoord= xx; |
463 | yPaintCoord = yy; | 463 | yPaintCoord = yy; |
464 | wPaintCoord = width(); | 464 | wPaintCoord = width(); |
465 | hPaintCoord = height(); | 465 | hPaintCoord = height(); |
466 | globalFlagBlockAgendaItemUpdate = 0; | 466 | globalFlagBlockAgendaItemUpdate = 0; |
467 | paintMe( mSelected ); | 467 | paintMe( mSelected ); |
468 | //qDebug("calling paintMe "); | 468 | //qDebug("calling paintMe "); |
469 | globalFlagBlockAgendaItemUpdate = 1; | 469 | globalFlagBlockAgendaItemUpdate = 1; |
470 | } | 470 | } |
471 | int rx, ry, rw, rh; | 471 | int rx, ry, rw, rh; |
472 | rx = e->rect().x(); | 472 | rx = e->rect().x(); |
473 | ry = e->rect().y(); | 473 | ry = e->rect().y(); |
474 | rw = e->rect().width(); | 474 | rw = e->rect().width(); |
475 | rh = e->rect().height(); | 475 | rh = e->rect().height(); |
476 | //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); | 476 | //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); |
477 | 477 | ||
478 | QPixmap* paintFrom ; | 478 | QPixmap* paintFrom ; |
479 | if ( mSelected ) { | 479 | if ( mSelected ) { |
480 | paintFrom = paintPixSel(); | 480 | paintFrom = paintPixSel(); |
481 | } else { | 481 | } else { |
482 | if ( mAllDay ) | 482 | if ( mAllDay ) |
483 | paintFrom = paintPixAllday(); | 483 | paintFrom = paintPixAllday(); |
484 | else | 484 | else |
485 | paintFrom = paintPix(); | 485 | paintFrom = paintPix(); |
486 | } | 486 | } |
487 | bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP); | 487 | bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP); |
488 | } | 488 | } |
489 | void KOAgendaItem::computeText() | 489 | void KOAgendaItem::computeText() |
490 | { | 490 | { |
491 | mDisplayedText = mIncidence->summary(); | 491 | mDisplayedText = mIncidence->summary(); |
492 | if ( (mIncidence->type() == "Todo") ) { | 492 | if ( (mIncidence->type() == "Todo") ) { |
493 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) | 493 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) |
494 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; | 494 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; |
495 | else if ( !(mIncidence->doesFloat())) | 495 | else if ( !(mIncidence->doesFloat())) |
496 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; | 496 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; |
497 | 497 | ||
498 | 498 | ||
499 | 499 | ||
500 | } else { | 500 | } else { |
501 | if ( !(mIncidence->doesFloat())) | 501 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) |
502 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; | 502 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; |
503 | 503 | ||
504 | if ( mAllDay ) { | 504 | if ( mAllDay ) { |
505 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { | 505 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { |
506 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; | 506 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
510 | } | 510 | } |
511 | 511 | ||
512 | if ( !mIncidence->location().isEmpty() ) { | 512 | if ( !mIncidence->location().isEmpty() ) { |
513 | if ( mAllDay ) | 513 | if ( mAllDay ) |
514 | mDisplayedText += " ("; | 514 | mDisplayedText += " ("; |
515 | else | 515 | else |
516 | mDisplayedText += "\n("; | 516 | mDisplayedText += "\n("; |
517 | mDisplayedText += mIncidence->location() +")"; | 517 | mDisplayedText += mIncidence->location() +")"; |
518 | } | 518 | } |
519 | } | 519 | } |
520 | void KOAgendaItem::updateItem() | 520 | void KOAgendaItem::updateItem() |
521 | { | 521 | { |
522 | computeText(); | 522 | computeText(); |
523 | 523 | ||
524 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); | 524 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); |
525 | paintMe( mSelected ); | 525 | paintMe( mSelected ); |
526 | repaint( false); | 526 | repaint( false); |
527 | } | 527 | } |
528 | 528 | ||
529 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) | 529 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) |
530 | { | 530 | { |
531 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); | 531 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); |
532 | paintMe( mSelected ); | 532 | paintMe( mSelected ); |
533 | repaint( false ); | 533 | repaint( false ); |
534 | } | 534 | } |
535 | 535 | ||
536 | /* | 536 | /* |
537 | Return height of item in units of agenda cells | 537 | Return height of item in units of agenda cells |
538 | */ | 538 | */ |
539 | int KOAgendaItem::cellHeight() | 539 | int KOAgendaItem::cellHeight() |
540 | { | 540 | { |
541 | int ret = mCellYBottom - mCellYTop + 1; | 541 | int ret = mCellYBottom - mCellYTop + 1; |
542 | if ( ret <= 0 ) { | 542 | if ( ret <= 0 ) { |
543 | ret = 1; | 543 | ret = 1; |
544 | mCellYBottom = 0; | 544 | mCellYBottom = 0; |
545 | mCellYTop = 0; | 545 | mCellYTop = 0; |
546 | } | 546 | } |
547 | return ret; | 547 | return ret; |
548 | } | 548 | } |
549 | 549 | ||
550 | /* | 550 | /* |
551 | Return height of item in units of agenda cells | 551 | Return height of item in units of agenda cells |
552 | */ | 552 | */ |
553 | int KOAgendaItem::cellWidth() | 553 | int KOAgendaItem::cellWidth() |
554 | { | 554 | { |
555 | return mCellXWidth - mCellX + 1; | 555 | return mCellXWidth - mCellX + 1; |
556 | } | 556 | } |
557 | 557 | ||
558 | void KOAgendaItem::setItemDate(QDate qd) | 558 | void KOAgendaItem::setItemDate(QDate qd) |
559 | { | 559 | { |
560 | mDate = qd; | 560 | mDate = qd; |
561 | } | 561 | } |
562 | 562 | ||
563 | void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) | 563 | void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) |
564 | { | 564 | { |
565 | mCellX = X; | 565 | mCellX = X; |
566 | mCellYTop = YTop; | 566 | mCellYTop = YTop; |
567 | mCellYBottom = YBottom; | 567 | mCellYBottom = YBottom; |
568 | } | 568 | } |
569 | 569 | ||
570 | void KOAgendaItem::setCellXWidth(int xwidth) | 570 | void KOAgendaItem::setCellXWidth(int xwidth) |
571 | { | 571 | { |
572 | mCellXWidth = xwidth; | 572 | mCellXWidth = xwidth; |
573 | } | 573 | } |
574 | 574 | ||
575 | void KOAgendaItem::setCellX(int XLeft, int XRight) | 575 | void KOAgendaItem::setCellX(int XLeft, int XRight) |
576 | { | 576 | { |
577 | mCellX = XLeft; | 577 | mCellX = XLeft; |
578 | mCellXWidth = XRight; | 578 | mCellXWidth = XRight; |
579 | } | 579 | } |
580 | 580 | ||
581 | void KOAgendaItem::setCellY(int YTop, int YBottom) | 581 | void KOAgendaItem::setCellY(int YTop, int YBottom) |
582 | { | 582 | { |
583 | mCellYTop = YTop; | 583 | mCellYTop = YTop; |
584 | mCellYBottom = YBottom; | 584 | mCellYBottom = YBottom; |
585 | } | 585 | } |
586 | 586 | ||
587 | void KOAgendaItem::setSubCell(int subCell) | 587 | void KOAgendaItem::setSubCell(int subCell) |
588 | { | 588 | { |
589 | mSubCell = subCell; | 589 | mSubCell = subCell; |
590 | } | 590 | } |
591 | 591 | ||
592 | void KOAgendaItem::setSubCells(int subCells) | 592 | void KOAgendaItem::setSubCells(int subCells) |
593 | { | 593 | { |
594 | mSubCells = subCells; | 594 | mSubCells = subCells; |
595 | } | 595 | } |
596 | 596 | ||
597 | void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, | 597 | void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, |
598 | KOAgendaItem *last) | 598 | KOAgendaItem *last) |
599 | { | 599 | { |
600 | mFirstMultiItem = first; | 600 | mFirstMultiItem = first; |
601 | mNextMultiItem = next; | 601 | mNextMultiItem = next; |
602 | mLastMultiItem = last; | 602 | mLastMultiItem = last; |
603 | } | 603 | } |
604 | 604 | ||
605 | void KOAgendaItem::startMove() | 605 | void KOAgendaItem::startMove() |
606 | { | 606 | { |
607 | mStartCellX = mCellX; | 607 | mStartCellX = mCellX; |
608 | mStartCellXWidth = mCellXWidth; | 608 | mStartCellXWidth = mCellXWidth; |
609 | mStartCellYTop = mCellYTop; | 609 | mStartCellYTop = mCellYTop; |
610 | mStartCellYBottom = mCellYBottom; | 610 | mStartCellYBottom = mCellYBottom; |
611 | } | 611 | } |
612 | 612 | ||
613 | void KOAgendaItem::resetMove() | 613 | void KOAgendaItem::resetMove() |
614 | { | 614 | { |
615 | mCellX = mStartCellX; | 615 | mCellX = mStartCellX; |
616 | mCellXWidth = mStartCellXWidth; | 616 | mCellXWidth = mStartCellXWidth; |
617 | mCellYTop = mStartCellYTop; | 617 | mCellYTop = mStartCellYTop; |
618 | mCellYBottom = mStartCellYBottom; | 618 | mCellYBottom = mStartCellYBottom; |
619 | } | 619 | } |
620 | 620 | ||
621 | void KOAgendaItem::moveRelative(int dx, int dy) | 621 | void KOAgendaItem::moveRelative(int dx, int dy) |
622 | { | 622 | { |
623 | int newX = cellX() + dx; | 623 | int newX = cellX() + dx; |
624 | int newXWidth = cellXWidth() + dx; | 624 | int newXWidth = cellXWidth() + dx; |
625 | int newYTop = cellYTop() + dy; | 625 | int newYTop = cellYTop() + dy; |
626 | int newYBottom = cellYBottom() + dy; | 626 | int newYBottom = cellYBottom() + dy; |
627 | setCellXY(newX,newYTop,newYBottom); | 627 | setCellXY(newX,newYTop,newYBottom); |
628 | setCellXWidth(newXWidth); | 628 | setCellXWidth(newXWidth); |
629 | } | 629 | } |
630 | 630 | ||
631 | void KOAgendaItem::expandTop(int dy) | 631 | void KOAgendaItem::expandTop(int dy) |
632 | { | 632 | { |
633 | int newYTop = cellYTop() + dy; | 633 | int newYTop = cellYTop() + dy; |
634 | int newYBottom = cellYBottom(); | 634 | int newYBottom = cellYBottom(); |
635 | if (newYTop > newYBottom) newYTop = newYBottom; | 635 | if (newYTop > newYBottom) newYTop = newYBottom; |
636 | setCellY(newYTop, newYBottom); | 636 | setCellY(newYTop, newYBottom); |
637 | } | 637 | } |
638 | 638 | ||
639 | void KOAgendaItem::expandBottom(int dy) | 639 | void KOAgendaItem::expandBottom(int dy) |
640 | { | 640 | { |
641 | int newYTop = cellYTop(); | 641 | int newYTop = cellYTop(); |
642 | int newYBottom = cellYBottom() + dy; | 642 | int newYBottom = cellYBottom() + dy; |
643 | if (newYBottom < newYTop) newYBottom = newYTop; | 643 | if (newYBottom < newYTop) newYBottom = newYTop; |
644 | setCellY(newYTop, newYBottom); | 644 | setCellY(newYTop, newYBottom); |
645 | } | 645 | } |
646 | 646 | ||
647 | void KOAgendaItem::expandLeft(int dx) | 647 | void KOAgendaItem::expandLeft(int dx) |
648 | { | 648 | { |
649 | int newX = cellX() + dx; | 649 | int newX = cellX() + dx; |
650 | int newXWidth = cellXWidth(); | 650 | int newXWidth = cellXWidth(); |
651 | if (newX > newXWidth) newX = newXWidth; | 651 | if (newX > newXWidth) newX = newXWidth; |
652 | setCellX(newX,newXWidth); | 652 | setCellX(newX,newXWidth); |
653 | } | 653 | } |
654 | 654 | ||
655 | void KOAgendaItem::expandRight(int dx) | 655 | void KOAgendaItem::expandRight(int dx) |
656 | { | 656 | { |
657 | int newX = cellX(); | 657 | int newX = cellX(); |
658 | int newXWidth = cellXWidth() + dx; | 658 | int newXWidth = cellXWidth() + dx; |
659 | if (newXWidth < newX) newXWidth = newX; | 659 | if (newXWidth < newX) newXWidth = newX; |
660 | setCellX(newX,newXWidth); | 660 | setCellX(newX,newXWidth); |
661 | } | 661 | } |
662 | 662 | ||
663 | QToolTipGroup *KOAgendaItem::toolTipGroup() | 663 | QToolTipGroup *KOAgendaItem::toolTipGroup() |
664 | { | 664 | { |
665 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 665 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); |
666 | return mToolTipGroup; | 666 | return mToolTipGroup; |
667 | } | 667 | } |
668 | 668 | ||
669 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) | 669 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) |
670 | { | 670 | { |
671 | #ifndef KORG_NODND | 671 | #ifndef KORG_NODND |
672 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || | 672 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || |
673 | !QTextDrag::canDecode( e ) ) { | 673 | !QTextDrag::canDecode( e ) ) { |
674 | e->ignore(); | 674 | e->ignore(); |
675 | return; | 675 | return; |
676 | } | 676 | } |
677 | e->accept(); | 677 | e->accept(); |
678 | #endif | 678 | #endif |
679 | } | 679 | } |
680 | 680 | ||
681 | void KOAgendaItem::dropEvent( QDropEvent *e ) | 681 | void KOAgendaItem::dropEvent( QDropEvent *e ) |
682 | { | 682 | { |
683 | #ifndef KORG_NODND | 683 | #ifndef KORG_NODND |
684 | QString text; | 684 | QString text; |
685 | if(QTextDrag::decode(e,text)) | 685 | if(QTextDrag::decode(e,text)) |
686 | { | 686 | { |
687 | kdDebug() << "Dropped : " << text << endl; | 687 | kdDebug() << "Dropped : " << text << endl; |
688 | QStringList emails = QStringList::split(",",text); | 688 | QStringList emails = QStringList::split(",",text); |
689 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 689 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
690 | kdDebug() << " Email: " << (*it) << endl; | 690 | kdDebug() << " Email: " << (*it) << endl; |
691 | int pos = (*it).find("<"); | 691 | int pos = (*it).find("<"); |
692 | QString name = (*it).left(pos); | 692 | QString name = (*it).left(pos); |
693 | QString email = (*it).mid(pos); | 693 | QString email = (*it).mid(pos); |
694 | if (!email.isEmpty()) { | 694 | if (!email.isEmpty()) { |
695 | mIncidence->addAttendee(new Attendee(name,email)); | 695 | mIncidence->addAttendee(new Attendee(name,email)); |
696 | } | 696 | } |
697 | } | 697 | } |
698 | } | 698 | } |
699 | #endif | 699 | #endif |
700 | } | 700 | } |
701 | 701 | ||
702 | 702 | ||
703 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() | 703 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() |
704 | { | 704 | { |
705 | return mConflictItems; | 705 | return mConflictItems; |
706 | } | 706 | } |
707 | 707 | ||
708 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) | 708 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) |
709 | { | 709 | { |
710 | mConflictItems = ci; | 710 | mConflictItems = ci; |
711 | KOAgendaItem *item; | 711 | KOAgendaItem *item; |
712 | for ( item=mConflictItems.first(); item != 0; | 712 | for ( item=mConflictItems.first(); item != 0; |
713 | item=mConflictItems.next() ) { | 713 | item=mConflictItems.next() ) { |
714 | item->addConflictItem(this); | 714 | item->addConflictItem(this); |
715 | } | 715 | } |
716 | } | 716 | } |
717 | 717 | ||
718 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) | 718 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) |
719 | { | 719 | { |
720 | if (mConflictItems.find(ci)<0) | 720 | if (mConflictItems.find(ci)<0) |
721 | mConflictItems.append(ci); | 721 | mConflictItems.append(ci); |
722 | } | 722 | } |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index db7c3f2..c99c0cb 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -1,341 +1,341 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001 | 4 | Copyright (c) 2001 |
5 | Cornelius Schumacher <schumacher@kde.org> | 5 | Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <libkdepim/categoryeditdialog.h> | 22 | #include <libkdepim/categoryeditdialog.h> |
23 | 23 | ||
24 | #include "calendarview.h" | 24 | #include "calendarview.h" |
25 | #include "incomingdialog.h" | 25 | #include "incomingdialog.h" |
26 | #include "outgoingdialog.h" | 26 | #include "outgoingdialog.h" |
27 | #include "koprefsdialog.h" | 27 | #include "koprefsdialog.h" |
28 | #include "koeventeditor.h" | 28 | #include "koeventeditor.h" |
29 | #include "koprefs.h" | 29 | #include "koprefs.h" |
30 | #include "datenavigator.h" | 30 | #include "datenavigator.h" |
31 | #include "kotodoeditor.h" | 31 | #include "kotodoeditor.h" |
32 | #include "searchdialog.h" | 32 | #include "searchdialog.h" |
33 | #include "filtereditdialog.h" | 33 | #include "filtereditdialog.h" |
34 | #ifndef KORG_NOPLUGINS | 34 | #ifndef KORG_NOPLUGINS |
35 | #include "plugindialog.h" | 35 | #include "plugindialog.h" |
36 | #endif | 36 | #endif |
37 | #ifndef KORG_NOARCHIVE | 37 | #ifndef KORG_NOARCHIVE |
38 | #include "archivedialog.h" | 38 | #include "archivedialog.h" |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #include "kconfig.h" | 41 | #include "kconfig.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | 43 | ||
44 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 44 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
45 | QObject(), mMainView( mainView ) | 45 | QObject(), mMainView( mainView ) |
46 | { | 46 | { |
47 | mOutgoingDialog = 0; | 47 | mOutgoingDialog = 0; |
48 | mIncomingDialog = 0; | 48 | mIncomingDialog = 0; |
49 | mOptionsDialog = 0; | 49 | mOptionsDialog = 0; |
50 | mSearchDialog = 0; | 50 | mSearchDialog = 0; |
51 | mArchiveDialog = 0; | 51 | mArchiveDialog = 0; |
52 | mFilterEditDialog = 0; | 52 | mFilterEditDialog = 0; |
53 | mPluginDialog = 0; | 53 | mPluginDialog = 0; |
54 | 54 | ||
55 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); | 55 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); |
56 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); | 56 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); |
57 | } | 57 | } |
58 | 58 | ||
59 | KODialogManager::~KODialogManager() | 59 | KODialogManager::~KODialogManager() |
60 | { | 60 | { |
61 | delete mOutgoingDialog; | 61 | delete mOutgoingDialog; |
62 | delete mIncomingDialog; | 62 | delete mIncomingDialog; |
63 | delete mOptionsDialog; | 63 | delete mOptionsDialog; |
64 | delete mSearchDialog; | 64 | delete mSearchDialog; |
65 | #ifndef KORG_NOARCHIVE | 65 | #ifndef KORG_NOARCHIVE |
66 | delete mArchiveDialog; | 66 | delete mArchiveDialog; |
67 | #endif | 67 | #endif |
68 | delete mFilterEditDialog; | 68 | delete mFilterEditDialog; |
69 | #ifndef KORG_NOPLUGINS | 69 | #ifndef KORG_NOPLUGINS |
70 | delete mPluginDialog; | 70 | delete mPluginDialog; |
71 | #endif | 71 | #endif |
72 | } | 72 | } |
73 | 73 | ||
74 | OutgoingDialog *KODialogManager::outgoingDialog() | 74 | OutgoingDialog *KODialogManager::outgoingDialog() |
75 | { | 75 | { |
76 | createOutgoingDialog(); | 76 | createOutgoingDialog(); |
77 | return mOutgoingDialog; | 77 | return mOutgoingDialog; |
78 | } | 78 | } |
79 | 79 | ||
80 | void KODialogManager::createOutgoingDialog() | 80 | void KODialogManager::createOutgoingDialog() |
81 | { | 81 | { |
82 | if (!mOutgoingDialog) { | 82 | if (!mOutgoingDialog) { |
83 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); | 83 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); |
84 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); | 84 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); |
85 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), | 85 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), |
86 | mMainView,SIGNAL(numOutgoingChanged(int))); | 86 | mMainView,SIGNAL(numOutgoingChanged(int))); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void KODialogManager::showOptionsDialog( bool showSync ) | 90 | void KODialogManager::showOptionsDialog( bool showSync ) |
91 | { | 91 | { |
92 | 92 | ||
93 | if (!mOptionsDialog) { | 93 | if (!mOptionsDialog) { |
94 | mOptionsDialog = new KOPrefsDialog(mMainView); | 94 | mOptionsDialog = new KOPrefsDialog(mMainView); |
95 | //mOptionsDialog->readConfig(); | 95 | //mOptionsDialog->readConfig(); |
96 | connect(mOptionsDialog,SIGNAL(configChanged()), | 96 | connect(mOptionsDialog,SIGNAL(configChanged()), |
97 | mMainView,SLOT(updateConfig())); | 97 | mMainView,SLOT(updateConfig())); |
98 | //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 98 | //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
99 | // mOptionsDialog,SLOT(updateCategories())); | 99 | // mOptionsDialog,SLOT(updateCategories())); |
100 | 100 | ||
101 | } | 101 | } |
102 | mOptionsDialog->readConfig(); | 102 | mOptionsDialog->readConfig(); |
103 | #ifndef DESKTOP_VERSION | 103 | #ifndef DESKTOP_VERSION |
104 | mOptionsDialog->showMaximized(); | 104 | mOptionsDialog->showMaximized(); |
105 | #else | 105 | #else |
106 | mOptionsDialog->show(); | 106 | mOptionsDialog->show(); |
107 | #endif | 107 | #endif |
108 | if ( showSync ) | 108 | if ( showSync ) |
109 | mOptionsDialog->showSyncPage(); | 109 | mOptionsDialog->showSyncPage(); |
110 | mOptionsDialog->exec(); | 110 | mOptionsDialog->exec(); |
111 | 111 | ||
112 | } | 112 | } |
113 | void KODialogManager::showSyncOptions() | 113 | void KODialogManager::showSyncOptions() |
114 | { | 114 | { |
115 | showOptionsDialog( true ); | 115 | showOptionsDialog( true ); |
116 | 116 | ||
117 | } | 117 | } |
118 | void KODialogManager::showOutgoingDialog() | 118 | void KODialogManager::showOutgoingDialog() |
119 | { | 119 | { |
120 | createOutgoingDialog(); | 120 | createOutgoingDialog(); |
121 | mOutgoingDialog->show(); | 121 | mOutgoingDialog->show(); |
122 | mOutgoingDialog->raise(); | 122 | mOutgoingDialog->raise(); |
123 | } | 123 | } |
124 | 124 | ||
125 | IncomingDialog *KODialogManager::incomingDialog() | 125 | IncomingDialog *KODialogManager::incomingDialog() |
126 | { | 126 | { |
127 | createOutgoingDialog(); | 127 | createOutgoingDialog(); |
128 | if (!mIncomingDialog) { | 128 | if (!mIncomingDialog) { |
129 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); | 129 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); |
130 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), | 130 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), |
131 | mMainView,SIGNAL(numIncomingChanged(int))); | 131 | mMainView,SIGNAL(numIncomingChanged(int))); |
132 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), | 132 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), |
133 | mMainView,SLOT(updateView())); | 133 | mMainView,SLOT(updateView())); |
134 | } | 134 | } |
135 | return mIncomingDialog; | 135 | return mIncomingDialog; |
136 | } | 136 | } |
137 | 137 | ||
138 | void KODialogManager::createIncomingDialog() | 138 | void KODialogManager::createIncomingDialog() |
139 | { | 139 | { |
140 | createOutgoingDialog(); | 140 | createOutgoingDialog(); |
141 | if (!mIncomingDialog) { | 141 | if (!mIncomingDialog) { |
142 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); | 142 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); |
143 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), | 143 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), |
144 | mMainView,SIGNAL(numIncomingChanged(int))); | 144 | mMainView,SIGNAL(numIncomingChanged(int))); |
145 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), | 145 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), |
146 | mMainView,SLOT(updateView())); | 146 | mMainView,SLOT(updateView())); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | void KODialogManager::showIncomingDialog() | 150 | void KODialogManager::showIncomingDialog() |
151 | { | 151 | { |
152 | createIncomingDialog(); | 152 | createIncomingDialog(); |
153 | mIncomingDialog->show(); | 153 | mIncomingDialog->show(); |
154 | mIncomingDialog->raise(); | 154 | mIncomingDialog->raise(); |
155 | } | 155 | } |
156 | /* | 156 | /* |
157 | void KODialogManager::showCategoryEditDialog() | 157 | void KODialogManager::showCategoryEditDialog() |
158 | { | 158 | { |
159 | mCategoryEditDialog->show(); | 159 | mCategoryEditDialog->show(); |
160 | } | 160 | } |
161 | */ | 161 | */ |
162 | void KODialogManager::hideSearchDialog() | 162 | void KODialogManager::hideSearchDialog() |
163 | { | 163 | { |
164 | if (mSearchDialog) | 164 | if (mSearchDialog) |
165 | mSearchDialog->hide(); | 165 | mSearchDialog->hide(); |
166 | } | 166 | } |
167 | 167 | ||
168 | void KODialogManager::showSearchDialog() | 168 | void KODialogManager::showSearchDialog() |
169 | { | 169 | { |
170 | if (!mSearchDialog) { | 170 | if (!mSearchDialog) { |
171 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); | 171 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); |
172 | KOListView * lview = mSearchDialog->listview(); | 172 | KOListView * lview = mSearchDialog->listview(); |
173 | 173 | ||
174 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), | 174 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), |
175 | mMainView, SLOT(showIncidence(Incidence *))); | 175 | mMainView, SLOT(showIncidence(Incidence *))); |
176 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), | 176 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), |
177 | mMainView, SLOT(editIncidence(Incidence *))); | 177 | mMainView, SLOT(editIncidence(Incidence *))); |
178 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), | 178 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), |
179 | mMainView, SLOT(deleteIncidence(Incidence *))); | 179 | mMainView, SLOT(deleteIncidence(Incidence *))); |
180 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), | 180 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), |
181 | mMainView, SLOT(cloneIncidence(Incidence *))); | 181 | mMainView, SLOT(cloneIncidence(Incidence *))); |
182 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), | 182 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), |
183 | mMainView, SLOT(beamIncidence(Incidence *))); | 183 | mMainView, SLOT(beamIncidence(Incidence *))); |
184 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), | 184 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), |
185 | mMainView, SLOT(moveIncidence(Incidence *))); | 185 | mMainView, SLOT(moveIncidence(Incidence *))); |
186 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), | 186 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), |
187 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); | 187 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); |
188 | 188 | ||
189 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); | 189 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); |
190 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); | 190 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); |
191 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), | 191 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), |
192 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 192 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
193 | #ifndef DESKTOP_VERSION | 193 | #ifndef DESKTOP_VERSION |
194 | mSearchDialog->setMaximumSize( 640, 480 ); | 194 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
195 | //mSearchDialog->setGeometry( 40,40, 400, 300); | 195 | //mSearchDialog->setGeometry( 40,40, 400, 300); |
196 | mSearchDialog->showMaximized(); | 196 | mSearchDialog->showMaximized(); |
197 | #else | 197 | #else |
198 | KConfig *config = KOGlobals::config(); | 198 | KConfig *config = KOGlobals::config(); |
199 | config->setGroup("WidgetLayout"); | 199 | config->setGroup("WidgetLayout"); |
200 | QStringList list; | 200 | QStringList list; |
201 | list = config->readListEntry("SearchLayout"); | 201 | list = config->readListEntry("SearchLayout"); |
202 | int x,y,w,h; | 202 | int x,y,w,h; |
203 | if ( ! list.isEmpty() ) { | 203 | if ( ! list.isEmpty() ) { |
204 | x = list[0].toInt(); | 204 | x = list[0].toInt(); |
205 | y = list[1].toInt(); | 205 | y = list[1].toInt(); |
206 | w = list[2].toInt(); | 206 | w = list[2].toInt(); |
207 | h = list[3].toInt(); | 207 | h = list[3].toInt(); |
208 | mSearchDialog->setGeometry(x,y,w,h); | 208 | mSearchDialog->setGeometry(x,y,w,h); |
209 | 209 | ||
210 | } | 210 | } |
211 | 211 | ||
212 | #endif | 212 | #endif |
213 | } | 213 | } |
214 | // make sure the widget is on top again | 214 | // make sure the widget is on top again |
215 | mSearchDialog->show(); | 215 | mSearchDialog->show(); |
216 | mSearchDialog->raise(); | 216 | mSearchDialog->raise(); |
217 | } | 217 | } |
218 | 218 | ||
219 | SearchDialog * KODialogManager::getSearchDialog() | 219 | SearchDialog * KODialogManager::getSearchDialog() |
220 | { | 220 | { |
221 | return mSearchDialog; | 221 | return mSearchDialog; |
222 | } | 222 | } |
223 | void KODialogManager::showArchiveDialog() | 223 | void KODialogManager::showArchiveDialog() |
224 | { | 224 | { |
225 | #ifndef KORG_NOARCHIVE | 225 | #ifndef KORG_NOARCHIVE |
226 | if (!mArchiveDialog) { | 226 | if (!mArchiveDialog) { |
227 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); | 227 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); |
228 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), | 228 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), |
229 | mMainView,SLOT(updateView())); | 229 | mMainView,SLOT(updateView())); |
230 | } | 230 | } |
231 | mArchiveDialog->show(); | 231 | mArchiveDialog->show(); |
232 | mArchiveDialog->raise(); | 232 | mArchiveDialog->raise(); |
233 | 233 | ||
234 | // Workaround. | 234 | // Workaround. |
235 | QApplication::restoreOverrideCursor(); | 235 | QApplication::restoreOverrideCursor(); |
236 | #endif | 236 | #endif |
237 | } | 237 | } |
238 | 238 | ||
239 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 239 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) |
240 | { | 240 | { |
241 | if (!mFilterEditDialog) { | 241 | if (!mFilterEditDialog) { |
242 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 242 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
243 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 243 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
244 | mMainView,SLOT(filterEdited())); | 244 | mMainView,SLOT(filterEdited())); |
245 | 245 | ||
246 | } | 246 | } |
247 | 247 | ||
248 | #ifndef DESKTOP_VERSION | 248 | #ifndef DESKTOP_VERSION |
249 | mFilterEditDialog->showMaximized(); | 249 | mFilterEditDialog->showMaximized(); |
250 | #else | 250 | #else |
251 | mFilterEditDialog->show(); | 251 | mFilterEditDialog->show(); |
252 | #endif | 252 | #endif |
253 | mFilterEditDialog->raise(); | 253 | mFilterEditDialog->raise(); |
254 | } | 254 | } |
255 | 255 | ||
256 | void KODialogManager::showPluginDialog() | 256 | void KODialogManager::showPluginDialog() |
257 | { | 257 | { |
258 | #ifndef KORG_NOPLUGINS | 258 | #ifndef KORG_NOPLUGINS |
259 | if (!mPluginDialog) { | 259 | if (!mPluginDialog) { |
260 | mPluginDialog = new PluginDialog(mMainView); | 260 | mPluginDialog = new PluginDialog(mMainView); |
261 | connect(mPluginDialog,SIGNAL(configChanged()), | 261 | connect(mPluginDialog,SIGNAL(configChanged()), |
262 | mMainView,SLOT(updateConfig())); | 262 | mMainView,SLOT(updateConfig())); |
263 | } | 263 | } |
264 | mPluginDialog->show(); | 264 | mPluginDialog->show(); |
265 | mPluginDialog->raise(); | 265 | mPluginDialog->raise(); |
266 | #endif | 266 | #endif |
267 | } | 267 | } |
268 | 268 | ||
269 | KOEventEditor *KODialogManager::getEventEditor() | 269 | KOEventEditor *KODialogManager::getEventEditor() |
270 | { | 270 | { |
271 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), | 271 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), |
272 | mMainView ); | 272 | mMainView ); |
273 | 273 | ||
274 | connect(eventEditor,SIGNAL(eventAdded(Event *)), | 274 | connect(eventEditor,SIGNAL(eventAdded(Event *)), |
275 | mMainView,SLOT(eventAdded(Event *))); | 275 | mMainView,SLOT(eventAdded(Event *))); |
276 | connect(eventEditor,SIGNAL(eventChanged(Event *)), | 276 | connect(eventEditor,SIGNAL(eventChanged(Event *)), |
277 | mMainView,SLOT(eventChanged(Event *))); | 277 | mMainView,SLOT(eventChanged(Event *))); |
278 | connect(eventEditor,SIGNAL(eventDeleted()), | 278 | connect(eventEditor,SIGNAL(eventDeleted()), |
279 | mMainView,SLOT(eventDeleted())); | 279 | mMainView,SLOT(eventDeleted())); |
280 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), | 280 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), |
281 | mMainView,SLOT(schedule_cancel(Incidence *))); | 281 | mMainView,SLOT(schedule_cancel(Incidence *))); |
282 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), | 282 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), |
283 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 283 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
284 | connect( eventEditor, SIGNAL( showAgendaView( bool)), | 284 | connect( eventEditor, SIGNAL( showAgendaView( bool)), |
285 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 285 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
286 | 286 | ||
287 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 287 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
288 | // eventEditor,SLOT(updateCategoryConfig())); | 288 | // eventEditor,SLOT(updateCategoryConfig())); |
289 | // connect(eventEditor,SIGNAL(editCategories()), | 289 | // connect(eventEditor,SIGNAL(editCategories()), |
290 | // mCategoryEditDialog,SLOT(show())); | 290 | // mCategoryEditDialog,SLOT(show())); |
291 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), | 291 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), |
292 | mMainView,SLOT(dialogClosing(Incidence*))); | 292 | mMainView,SLOT(dialogClosing(Incidence*))); |
293 | 293 | ||
294 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); | 294 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); |
295 | 295 | ||
296 | return eventEditor; | 296 | return eventEditor; |
297 | } | 297 | } |
298 | 298 | ||
299 | KOTodoEditor *KODialogManager::getTodoEditor() | 299 | KOTodoEditor *KODialogManager::getTodoEditor() |
300 | { | 300 | { |
301 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), | 301 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), |
302 | mMainView ); | 302 | mMainView ); |
303 | 303 | ||
304 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 304 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
305 | // todoEditor,SLOT(updateCategoryConfig())); | 305 | // todoEditor,SLOT(updateCategoryConfig())); |
306 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); | 306 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); |
307 | 307 | ||
308 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), | 308 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), |
309 | mMainView,SLOT(todoAdded(Todo *))); | 309 | mMainView,SLOT(todoAdded(Todo *))); |
310 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), | 310 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), |
311 | mMainView,SLOT(todoChanged(Todo *))); | 311 | mMainView,SLOT(todoChanged(Todo *))); |
312 | connect(todoEditor,SIGNAL(todoDeleted()), | 312 | connect(todoEditor,SIGNAL(todoDeleted()), |
313 | mMainView,SLOT(todoDeleted())); | 313 | mMainView,SLOT(todoDeleted())); |
314 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), | 314 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), |
315 | mMainView,SLOT(dialogClosing(Incidence*))); | 315 | mMainView,SLOT(dialogClosing(Incidence*))); |
316 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), | 316 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), |
317 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 317 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
318 | connect( todoEditor, SIGNAL( showAgendaView( bool)), | 318 | connect( todoEditor, SIGNAL( showAgendaView( bool)), |
319 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 319 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
320 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), | 320 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), |
321 | // mMainView,SLOT(schedule_cancel(Incidence *))); | 321 | // mMainView,SLOT(schedule_cancel(Incidence *))); |
322 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); | 322 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); |
323 | 323 | ||
324 | return todoEditor; | 324 | return todoEditor; |
325 | } | 325 | } |
326 | 326 | ||
327 | void KODialogManager::updateSearchDialog() | 327 | void KODialogManager::updateSearchDialog() |
328 | { | 328 | { |
329 | if (mSearchDialog) mSearchDialog->updateView(); | 329 | if (mSearchDialog) mSearchDialog->updateView(); |
330 | } | 330 | } |
331 | 331 | ||
332 | void KODialogManager::setDocumentId( const QString &id ) | 332 | void KODialogManager::setDocumentId( const QString &id ) |
333 | { | 333 | { |
334 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); | 334 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); |
335 | } | 335 | } |
336 | 336 | ||
337 | void KODialogManager::writeSettings( KConfig *config ) | 337 | void KODialogManager::writeSettings( KConfig *config ) |
338 | { | 338 | { |
339 | if (mSearchDialog) | 339 | if (mSearchDialog) |
340 | mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); | 340 | mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); |
341 | } | 341 | } |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 1cdb2fb..aae4692 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -1,468 +1,470 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <time.h> | 24 | #include <time.h> |
25 | #ifndef _WIN32_ | 25 | #ifndef _WIN32_ |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #endif | 27 | #endif |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qtextcodec.h> | 30 | #include <qtextcodec.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | #include <qfont.h> | 33 | #include <qfont.h> |
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <stdlib.h> | 36 | #include <stdlib.h> |
37 | 37 | ||
38 | #include <kglobal.h> | 38 | #include <kglobal.h> |
39 | #include <kconfig.h> | 39 | #include <kconfig.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <kemailsettings.h> | 42 | #include <kemailsettings.h> |
43 | #include <kstaticdeleter.h> | 43 | #include <kstaticdeleter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "koprefs.h" | 46 | #include "koprefs.h" |
47 | #include "mainwindow.h" | 47 | #include "mainwindow.h" |
48 | 48 | ||
49 | KOPrefs *KOPrefs::mInstance = 0; | 49 | KOPrefs *KOPrefs::mInstance = 0; |
50 | static KStaticDeleter<KOPrefs> insd; | 50 | static KStaticDeleter<KOPrefs> insd; |
51 | 51 | ||
52 | KOPrefs::KOPrefs() : | 52 | KOPrefs::KOPrefs() : |
53 | KPimPrefs("korganizerrc") | 53 | KPimPrefs("korganizerrc") |
54 | { | 54 | { |
55 | mCategoryColors.setAutoDelete(true); | 55 | mCategoryColors.setAutoDelete(true); |
56 | fillMailDefaults(); | 56 | fillMailDefaults(); |
57 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 57 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
58 | QColor defaultHolidayColor = QColor(255,0,0); | 58 | QColor defaultHolidayColor = QColor(255,0,0); |
59 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 59 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
60 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 60 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
61 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 61 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
62 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 62 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
63 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 63 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
64 | 64 | ||
65 | mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); | 65 | mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); |
66 | mDefaultViewFont = QFont("helvetica",10); | 66 | mDefaultViewFont = QFont("helvetica",10); |
67 | mDefaultMonthViewFont = QFont("helvetica",8); | 67 | mDefaultMonthViewFont = QFont("helvetica",8); |
68 | mMarcusBainsFont= QFont("helvetica",10); | 68 | mMarcusBainsFont= QFont("helvetica",10); |
69 | mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); | 69 | mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); |
70 | mEditBoxFont = QFont("helvetica",12); | 70 | mEditBoxFont = QFont("helvetica",12); |
71 | mJornalViewFont = QFont("helvetica",12); | 71 | mJornalViewFont = QFont("helvetica",12); |
72 | 72 | ||
73 | KPrefs::setCurrentGroup("General"); | 73 | KPrefs::setCurrentGroup("General"); |
74 | 74 | ||
75 | 75 | ||
76 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 76 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
77 | 77 | ||
78 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 78 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
79 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 79 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
80 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 80 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
81 | addItemBool("ShowIconList",&mShowIconList,true); | 81 | addItemBool("ShowIconList",&mShowIconList,true); |
82 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 82 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
83 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 83 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
84 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 84 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
85 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 85 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
86 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 86 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
87 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 87 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
88 | addItemBool("ShowIconBack",&mShowIconBack,true); | 88 | addItemBool("ShowIconBack",&mShowIconBack,true); |
89 | addItemBool("ShowIconToday",&mShowIconToday,true); | 89 | addItemBool("ShowIconToday",&mShowIconToday,true); |
90 | addItemBool("ShowIconForward",&mShowIconForward,true); | 90 | addItemBool("ShowIconForward",&mShowIconForward,true); |
91 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 91 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
92 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); | 92 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); |
93 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 93 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
94 | addItemBool("ShowIconNext",&mShowIconNext,true); | 94 | addItemBool("ShowIconNext",&mShowIconNext,true); |
95 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 95 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
96 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 96 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
97 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 97 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
98 | 98 | ||
99 | addItemBool("AskForQuit",&mAskForQuit,false); | 99 | addItemBool("AskForQuit",&mAskForQuit,false); |
100 | 100 | ||
101 | #ifndef DESKTOP_VERSION | 101 | #ifndef DESKTOP_VERSION |
102 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 102 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
103 | #else | 103 | #else |
104 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 104 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
105 | #endif | 105 | #endif |
106 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 106 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
107 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 107 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
108 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 108 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
109 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 109 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
110 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 110 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
111 | 111 | ||
112 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 112 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
113 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | ||
114 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | ||
113 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 115 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
114 | addItemInt("AllDay Size",&mAllDaySize,28); | 116 | addItemInt("AllDay Size",&mAllDaySize,28); |
115 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 117 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
116 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 118 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
117 | 119 | ||
118 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 120 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
119 | addItemStringList("EventSummary User",&mEventSummaryUser); | 121 | addItemStringList("EventSummary User",&mEventSummaryUser); |
120 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 122 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
121 | 123 | ||
122 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 124 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
123 | addItemBool("Enable Project View",&mEnableProjectView,false); | 125 | addItemBool("Enable Project View",&mEnableProjectView,false); |
124 | addItemBool("Auto Save",&mAutoSave,false); | 126 | addItemBool("Auto Save",&mAutoSave,false); |
125 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 127 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
126 | addItemBool("Confirm Deletes",&mConfirm,true); | 128 | addItemBool("Confirm Deletes",&mConfirm,true); |
127 | addItemString("Archive File",&mArchiveFile); | 129 | addItemString("Archive File",&mArchiveFile); |
128 | addItemString("Html Export File",&mHtmlExportFile, | 130 | addItemString("Html Export File",&mHtmlExportFile, |
129 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 131 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
130 | addItemBool("Html With Save",&mHtmlWithSave,false); | 132 | addItemBool("Html With Save",&mHtmlWithSave,false); |
131 | 133 | ||
132 | KPrefs::setCurrentGroup("Personal Settings"); | 134 | KPrefs::setCurrentGroup("Personal Settings"); |
133 | 135 | ||
134 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 136 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
135 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 137 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
136 | addItemBool("Bcc",&mBcc,false); | 138 | addItemBool("Bcc",&mBcc,false); |
137 | 139 | ||
138 | KPrefs::setCurrentGroup("Time & Date"); | 140 | KPrefs::setCurrentGroup("Time & Date"); |
139 | 141 | ||
140 | 142 | ||
141 | addItemInt("Default Start Time",&mStartTime,10); | 143 | addItemInt("Default Start Time",&mStartTime,10); |
142 | addItemInt("Default Duration",&mDefaultDuration,2); | 144 | addItemInt("Default Duration",&mDefaultDuration,2); |
143 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 145 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
144 | KPrefs::setCurrentGroup("AlarmSettings"); | 146 | KPrefs::setCurrentGroup("AlarmSettings"); |
145 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 147 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
146 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 148 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
147 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 149 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
148 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 150 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
149 | 151 | ||
150 | 152 | ||
151 | KPrefs::setCurrentGroup("Calendar"); | 153 | KPrefs::setCurrentGroup("Calendar"); |
152 | 154 | ||
153 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 155 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
154 | 156 | ||
155 | KPrefs::setCurrentGroup("Fonts"); | 157 | KPrefs::setCurrentGroup("Fonts"); |
156 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 158 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
157 | addItemFont("TimeBar Font",&mTimeBarFont); | 159 | addItemFont("TimeBar Font",&mTimeBarFont); |
158 | addItemFont("MonthView Font",&mMonthViewFont); | 160 | addItemFont("MonthView Font",&mMonthViewFont); |
159 | addItemFont("AgendaView Font",&mAgendaViewFont); | 161 | addItemFont("AgendaView Font",&mAgendaViewFont); |
160 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 162 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
161 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 163 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
162 | addItemFont("TodoView Font",&mTodoViewFont); | 164 | addItemFont("TodoView Font",&mTodoViewFont); |
163 | addItemFont("ListView Font",&mListViewFont); | 165 | addItemFont("ListView Font",&mListViewFont); |
164 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 166 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
165 | addItemFont("EditBox Font",&mEditBoxFont); | 167 | addItemFont("EditBox Font",&mEditBoxFont); |
166 | addItemFont("JournalView Font",&mJornalViewFont); | 168 | addItemFont("JournalView Font",&mJornalViewFont); |
167 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 169 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
168 | addItemFont("EventView Font",&mEventViewFont); | 170 | addItemFont("EventView Font",&mEventViewFont); |
169 | 171 | ||
170 | KPrefs::setCurrentGroup("RemoteSyncing"); | 172 | KPrefs::setCurrentGroup("RemoteSyncing"); |
171 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 173 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
172 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 174 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
173 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 175 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
174 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 176 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
175 | 177 | ||
176 | #ifdef _WIN32_ | 178 | #ifdef _WIN32_ |
177 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 179 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
178 | #else | 180 | #else |
179 | QString hdp= locateLocal("data","korganizer")+"/"; | 181 | QString hdp= locateLocal("data","korganizer")+"/"; |
180 | #endif | 182 | #endif |
181 | 183 | ||
182 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 184 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
183 | 185 | ||
184 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 186 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
185 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 187 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
186 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 188 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
187 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 189 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
188 | 190 | ||
189 | 191 | ||
190 | KPrefs::setCurrentGroup("Locale"); | 192 | KPrefs::setCurrentGroup("Locale"); |
191 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 193 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
192 | 194 | ||
193 | 195 | ||
194 | KPrefs::setCurrentGroup("Colors"); | 196 | KPrefs::setCurrentGroup("Colors"); |
195 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 197 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
196 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 198 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
197 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 199 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
198 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 200 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
199 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 201 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
200 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 202 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
201 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 203 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
202 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 204 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
203 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 205 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
204 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 206 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
205 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 207 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
206 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 208 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
207 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 209 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
208 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 210 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
209 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 211 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
210 | addItemBool("UseAppColors",&mUseAppColors,false); | 212 | addItemBool("UseAppColors",&mUseAppColors,false); |
211 | 213 | ||
212 | 214 | ||
213 | 215 | ||
214 | KPrefs::setCurrentGroup("Views"); | 216 | KPrefs::setCurrentGroup("Views"); |
215 | addItemInt("Hour Size",&mHourSize,8); | 217 | addItemInt("Hour Size",&mHourSize,8); |
216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 218 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 219 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 220 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 221 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 222 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 223 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
222 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 224 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
223 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 225 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
224 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 226 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
225 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 227 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
226 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 228 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
227 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); | 229 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); |
228 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 230 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
229 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 231 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
230 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 232 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
231 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 233 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
232 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 234 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
233 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 235 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
234 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 236 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
235 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 237 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
236 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 238 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
237 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 239 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
238 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 240 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
239 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); | 241 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); |
240 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 242 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
241 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 243 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
242 | #ifdef DESKTOP_VERSION | 244 | #ifdef DESKTOP_VERSION |
243 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 245 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
244 | #else | 246 | #else |
245 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 247 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
246 | #endif | 248 | #endif |
247 | addItemInt("Day Begins",&mDayBegins,7); | 249 | addItemInt("Day Begins",&mDayBegins,7); |
248 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 250 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
249 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 251 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
250 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 252 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
251 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 253 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
252 | 254 | ||
253 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 255 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
254 | addItemBool("Full View Month",&mFullViewMonth,true); | 256 | addItemBool("Full View Month",&mFullViewMonth,true); |
255 | addItemBool("Full View Todo",&mFullViewTodo,true); | 257 | addItemBool("Full View Todo",&mFullViewTodo,true); |
256 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 258 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
257 | 259 | ||
258 | addItemInt("Next X Days",&mNextXDays,3); | 260 | addItemInt("Next X Days",&mNextXDays,3); |
259 | 261 | ||
260 | KPrefs::setCurrentGroup("Printer"); | 262 | KPrefs::setCurrentGroup("Printer"); |
261 | 263 | ||
262 | KPrefs::setCurrentGroup("Layout"); | 264 | KPrefs::setCurrentGroup("Layout"); |
263 | 265 | ||
264 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 266 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
265 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 267 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
266 | 268 | ||
267 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 269 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
268 | 270 | ||
269 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 271 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
270 | 272 | ||
271 | KPrefs::setCurrentGroup("Group Scheduling"); | 273 | KPrefs::setCurrentGroup("Group Scheduling"); |
272 | 274 | ||
273 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 275 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
274 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 276 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
275 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 277 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
276 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 278 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
277 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 279 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
278 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 280 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
279 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 281 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
280 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 282 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
281 | 283 | ||
282 | KPrefs::setCurrentGroup( "Editors" ); | 284 | KPrefs::setCurrentGroup( "Editors" ); |
283 | 285 | ||
284 | addItemStringList( "EventTemplates", &mEventTemplates ); | 286 | addItemStringList( "EventTemplates", &mEventTemplates ); |
285 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 287 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
286 | 288 | ||
287 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 289 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
288 | 290 | ||
289 | 291 | ||
290 | 292 | ||
291 | } | 293 | } |
292 | 294 | ||
293 | 295 | ||
294 | KOPrefs::~KOPrefs() | 296 | KOPrefs::~KOPrefs() |
295 | { | 297 | { |
296 | if (mInstance == this) | 298 | if (mInstance == this) |
297 | mInstance = insd.setObject(0); | 299 | mInstance = insd.setObject(0); |
298 | 300 | ||
299 | //qDebug("KOPrefs::~KOPrefs() "); | 301 | //qDebug("KOPrefs::~KOPrefs() "); |
300 | } | 302 | } |
301 | 303 | ||
302 | 304 | ||
303 | KOPrefs *KOPrefs::instance() | 305 | KOPrefs *KOPrefs::instance() |
304 | { | 306 | { |
305 | if (!mInstance) { | 307 | if (!mInstance) { |
306 | mInstance = insd.setObject(new KOPrefs()); | 308 | mInstance = insd.setObject(new KOPrefs()); |
307 | mInstance->readConfig(); | 309 | mInstance->readConfig(); |
308 | } | 310 | } |
309 | 311 | ||
310 | return mInstance; | 312 | return mInstance; |
311 | } | 313 | } |
312 | 314 | ||
313 | void KOPrefs::usrSetDefaults() | 315 | void KOPrefs::usrSetDefaults() |
314 | { | 316 | { |
315 | 317 | ||
316 | } | 318 | } |
317 | 319 | ||
318 | void KOPrefs::fillMailDefaults() | 320 | void KOPrefs::fillMailDefaults() |
319 | { | 321 | { |
320 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 322 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
321 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 323 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
322 | } | 324 | } |
323 | 325 | ||
324 | void KOPrefs::setTimeZoneIdDefault() | 326 | void KOPrefs::setTimeZoneIdDefault() |
325 | { | 327 | { |
326 | ; | 328 | ; |
327 | } | 329 | } |
328 | 330 | ||
329 | void KOPrefs::setCategoryDefaults() | 331 | void KOPrefs::setCategoryDefaults() |
330 | { | 332 | { |
331 | mCustomCategories.clear(); | 333 | mCustomCategories.clear(); |
332 | mCustomCategories = getDefaultList(); | 334 | mCustomCategories = getDefaultList(); |
333 | 335 | ||
334 | QStringList::Iterator it; | 336 | QStringList::Iterator it; |
335 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 337 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
336 | setCategoryColor(*it,mDefaultCategoryColor); | 338 | setCategoryColor(*it,mDefaultCategoryColor); |
337 | } | 339 | } |
338 | } | 340 | } |
339 | 341 | ||
340 | QStringList KOPrefs::getDefaultList() | 342 | QStringList KOPrefs::getDefaultList() |
341 | { | 343 | { |
342 | QStringList retval ; | 344 | QStringList retval ; |
343 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 345 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
344 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 346 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
345 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 347 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
346 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 348 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
347 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 349 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
348 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 350 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
349 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 351 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
350 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 352 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
351 | retval.sort(); | 353 | retval.sort(); |
352 | return retval; | 354 | return retval; |
353 | } | 355 | } |
354 | 356 | ||
355 | void KOPrefs::usrReadConfig() | 357 | void KOPrefs::usrReadConfig() |
356 | { | 358 | { |
357 | config()->setGroup("General"); | 359 | config()->setGroup("General"); |
358 | 360 | ||
359 | mCustomCategories = config()->readListEntry("Custom Categories"); | 361 | mCustomCategories = config()->readListEntry("Custom Categories"); |
360 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { | 362 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { |
361 | mLocationDefaults.clear(); | 363 | mLocationDefaults.clear(); |
362 | mEventSummaryUser.clear(); | 364 | mEventSummaryUser.clear(); |
363 | mTodoSummaryUser.clear(); | 365 | mTodoSummaryUser.clear(); |
364 | } | 366 | } |
365 | mOldLoadedLanguage = mOldLanguage ; | 367 | mOldLoadedLanguage = mOldLanguage ; |
366 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 368 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
367 | if (mLocationDefaults.isEmpty()) { | 369 | if (mLocationDefaults.isEmpty()) { |
368 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 370 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
369 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 371 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
370 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 372 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
371 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 373 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
372 | mLocationDefaults.sort(); | 374 | mLocationDefaults.sort(); |
373 | } | 375 | } |
374 | 376 | ||
375 | if (mEventSummaryUser.isEmpty()) { | 377 | if (mEventSummaryUser.isEmpty()) { |
376 | mEventSummaryUser = getDefaultList() ; | 378 | mEventSummaryUser = getDefaultList() ; |
377 | } | 379 | } |
378 | if (mTodoSummaryUser.isEmpty()) { | 380 | if (mTodoSummaryUser.isEmpty()) { |
379 | mTodoSummaryUser = getDefaultList() ; | 381 | mTodoSummaryUser = getDefaultList() ; |
380 | } | 382 | } |
381 | 383 | ||
382 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 384 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
383 | 385 | ||
384 | config()->setGroup("Personal Settings"); | 386 | config()->setGroup("Personal Settings"); |
385 | mName = config()->readEntry("user_name",""); | 387 | mName = config()->readEntry("user_name",""); |
386 | mEmail = config()->readEntry("user_email",""); | 388 | mEmail = config()->readEntry("user_email",""); |
387 | fillMailDefaults(); | 389 | fillMailDefaults(); |
388 | 390 | ||
389 | config()->setGroup("Category Colors"); | 391 | config()->setGroup("Category Colors"); |
390 | QStringList::Iterator it; | 392 | QStringList::Iterator it; |
391 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 393 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
392 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 394 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
393 | 395 | ||
394 | } | 396 | } |
395 | 397 | ||
396 | KPimPrefs::usrReadConfig(); | 398 | KPimPrefs::usrReadConfig(); |
397 | } | 399 | } |
398 | 400 | ||
399 | 401 | ||
400 | void KOPrefs::usrWriteConfig() | 402 | void KOPrefs::usrWriteConfig() |
401 | { | 403 | { |
402 | config()->setGroup("General"); | 404 | config()->setGroup("General"); |
403 | config()->writeEntry("Custom Categories",mCustomCategories); | 405 | config()->writeEntry("Custom Categories",mCustomCategories); |
404 | 406 | ||
405 | config()->setGroup("Personal Settings"); | 407 | config()->setGroup("Personal Settings"); |
406 | config()->writeEntry("user_name",mName); | 408 | config()->writeEntry("user_name",mName); |
407 | config()->writeEntry("user_email",mEmail); | 409 | config()->writeEntry("user_email",mEmail); |
408 | 410 | ||
409 | config()->setGroup("Category Colors"); | 411 | config()->setGroup("Category Colors"); |
410 | QDictIterator<QColor> it(mCategoryColors); | 412 | QDictIterator<QColor> it(mCategoryColors); |
411 | while (it.current()) { | 413 | while (it.current()) { |
412 | config()->writeEntry(it.currentKey(),*(it.current())); | 414 | config()->writeEntry(it.currentKey(),*(it.current())); |
413 | ++it; | 415 | ++it; |
414 | } | 416 | } |
415 | 417 | ||
416 | 418 | ||
417 | KPimPrefs::usrWriteConfig(); | 419 | KPimPrefs::usrWriteConfig(); |
418 | } | 420 | } |
419 | 421 | ||
420 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 422 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
421 | { | 423 | { |
422 | mCategoryColors.replace(cat,new QColor(color)); | 424 | mCategoryColors.replace(cat,new QColor(color)); |
423 | } | 425 | } |
424 | 426 | ||
425 | QColor *KOPrefs::categoryColor(QString cat) | 427 | QColor *KOPrefs::categoryColor(QString cat) |
426 | { | 428 | { |
427 | QColor *color = 0; | 429 | QColor *color = 0; |
428 | 430 | ||
429 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 431 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
430 | 432 | ||
431 | if (color) return color; | 433 | if (color) return color; |
432 | else return &mDefaultCategoryColor; | 434 | else return &mDefaultCategoryColor; |
433 | } | 435 | } |
434 | 436 | ||
435 | void KOPrefs::setFullName(const QString &name) | 437 | void KOPrefs::setFullName(const QString &name) |
436 | { | 438 | { |
437 | mName = name; | 439 | mName = name; |
438 | } | 440 | } |
439 | 441 | ||
440 | void KOPrefs::setEmail(const QString &email) | 442 | void KOPrefs::setEmail(const QString &email) |
441 | { | 443 | { |
442 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 444 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
443 | mEmail = email; | 445 | mEmail = email; |
444 | } | 446 | } |
445 | 447 | ||
446 | QString KOPrefs::fullName() | 448 | QString KOPrefs::fullName() |
447 | { | 449 | { |
448 | if (mEmailControlCenter) { | 450 | if (mEmailControlCenter) { |
449 | KEMailSettings settings; | 451 | KEMailSettings settings; |
450 | return settings.getSetting(KEMailSettings::RealName); | 452 | return settings.getSetting(KEMailSettings::RealName); |
451 | } else { | 453 | } else { |
452 | return mName; | 454 | return mName; |
453 | } | 455 | } |
454 | } | 456 | } |
455 | 457 | ||
456 | QString KOPrefs::email() | 458 | QString KOPrefs::email() |
457 | { | 459 | { |
458 | if (mEmailControlCenter) { | 460 | if (mEmailControlCenter) { |
459 | KEMailSettings settings; | 461 | KEMailSettings settings; |
460 | return settings.getSetting(KEMailSettings::EmailAddress); | 462 | return settings.getSetting(KEMailSettings::EmailAddress); |
461 | } else { | 463 | } else { |
462 | return mEmail; | 464 | return mEmail; |
463 | } | 465 | } |
464 | } | 466 | } |
465 | KConfig* KOPrefs::getConfig() | 467 | KConfig* KOPrefs::getConfig() |
466 | { | 468 | { |
467 | return config(); | 469 | return config(); |
468 | } | 470 | } |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index f2fe77a..69722a1 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -1,274 +1,276 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOPREFS_H | 23 | #ifndef KOPREFS_H |
24 | #define KOPREFS_H | 24 | #define KOPREFS_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <libkdepim/kpimprefs.h> | 27 | #include <libkdepim/kpimprefs.h> |
28 | #include <qdict.h> | 28 | #include <qdict.h> |
29 | 29 | ||
30 | class KConfig; | 30 | class KConfig; |
31 | class QFont; | 31 | class QFont; |
32 | class QColor; | 32 | class QColor; |
33 | class QStringList; | 33 | class QStringList; |
34 | 34 | ||
35 | class KOPrefs : public KPimPrefs | 35 | class KOPrefs : public KPimPrefs |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | enum { FormatVCalendar, FormatICalendar }; | 38 | enum { FormatVCalendar, FormatICalendar }; |
39 | enum { MailClientKMail, MailClientSendmail }; | 39 | enum { MailClientKMail, MailClientSendmail }; |
40 | enum { IMIPDummy, IMIPKMail }; | 40 | enum { IMIPDummy, IMIPKMail }; |
41 | enum { IMIPOutbox, IMIPdirectsend }; | 41 | enum { IMIPOutbox, IMIPdirectsend }; |
42 | enum { neverAuto, addressbookAuto, selectedAuto }; | 42 | enum { neverAuto, addressbookAuto, selectedAuto }; |
43 | enum { standardDestination, askDestination }; | 43 | enum { standardDestination, askDestination }; |
44 | 44 | ||
45 | virtual ~KOPrefs(); | 45 | virtual ~KOPrefs(); |
46 | 46 | ||
47 | /** Get instance of KOPrefs. It is made sure that there is only one | 47 | /** Get instance of KOPrefs. It is made sure that there is only one |
48 | instance. */ | 48 | instance. */ |
49 | static KOPrefs *instance(); | 49 | static KOPrefs *instance(); |
50 | 50 | ||
51 | /** Set preferences to default values */ | 51 | /** Set preferences to default values */ |
52 | void usrSetDefaults(); | 52 | void usrSetDefaults(); |
53 | 53 | ||
54 | /** Read preferences from config file */ | 54 | /** Read preferences from config file */ |
55 | void usrReadConfig(); | 55 | void usrReadConfig(); |
56 | 56 | ||
57 | /** Write preferences to config file */ | 57 | /** Write preferences to config file */ |
58 | void usrWriteConfig(); | 58 | void usrWriteConfig(); |
59 | void setCategoryDefaults(); | 59 | void setCategoryDefaults(); |
60 | 60 | ||
61 | protected: | 61 | protected: |
62 | void setTimeZoneIdDefault(); | 62 | void setTimeZoneIdDefault(); |
63 | 63 | ||
64 | /** Fill empty mail fields with default values. */ | 64 | /** Fill empty mail fields with default values. */ |
65 | void fillMailDefaults(); | 65 | void fillMailDefaults(); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | /** Constructor disabled for public. Use instance() to create a KOPrefs | 68 | /** Constructor disabled for public. Use instance() to create a KOPrefs |
69 | object. */ | 69 | object. */ |
70 | KOPrefs(); | 70 | KOPrefs(); |
71 | 71 | ||
72 | static KOPrefs *mInstance; | 72 | static KOPrefs *mInstance; |
73 | QStringList getDefaultList(); | 73 | QStringList getDefaultList(); |
74 | public: | 74 | public: |
75 | // preferences data | 75 | // preferences data |
76 | KConfig* getConfig(); | 76 | KConfig* getConfig(); |
77 | void setFullName(const QString &); | 77 | void setFullName(const QString &); |
78 | QString fullName(); | 78 | QString fullName(); |
79 | void setEmail(const QString &); | 79 | void setEmail(const QString &); |
80 | QString email(); | 80 | QString email(); |
81 | 81 | ||
82 | QString mAdditional; | 82 | QString mAdditional; |
83 | 83 | ||
84 | bool mEmailControlCenter; | 84 | bool mEmailControlCenter; |
85 | 85 | ||
86 | bool mBcc; | 86 | bool mBcc; |
87 | bool mAutoSave; | 87 | bool mAutoSave; |
88 | int mAutoSaveInterval; | 88 | int mAutoSaveInterval; |
89 | bool mConfirm; | 89 | bool mConfirm; |
90 | 90 | ||
91 | bool mEnableGroupScheduling; | 91 | bool mEnableGroupScheduling; |
92 | bool mEnableProjectView; | 92 | bool mEnableProjectView; |
93 | 93 | ||
94 | int mDefaultFormat; | 94 | int mDefaultFormat; |
95 | int mMailClient; | 95 | int mMailClient; |
96 | 96 | ||
97 | int mStartTime; | 97 | int mStartTime; |
98 | int mDefaultDuration; | 98 | int mDefaultDuration; |
99 | int mAlarmTime; | 99 | int mAlarmTime; |
100 | 100 | ||
101 | int mWorkingHoursStart; | 101 | int mWorkingHoursStart; |
102 | int mWorkingHoursEnd; | 102 | int mWorkingHoursEnd; |
103 | bool mExcludeHolidays; | 103 | bool mExcludeHolidays; |
104 | bool mExcludeSaturdays; | 104 | bool mExcludeSaturdays; |
105 | bool mMarcusBainsShowSeconds; | 105 | bool mMarcusBainsShowSeconds; |
106 | 106 | ||
107 | QFont mTimeBarFont; | 107 | QFont mTimeBarFont; |
108 | QFont mMonthViewFont; | 108 | QFont mMonthViewFont; |
109 | QFont mAgendaViewFont; | 109 | QFont mAgendaViewFont; |
110 | QFont mMarcusBainsFont; | 110 | QFont mMarcusBainsFont; |
111 | QFont mTimeLabelsFont; | 111 | QFont mTimeLabelsFont; |
112 | QFont mTodoViewFont; | 112 | QFont mTodoViewFont; |
113 | QFont mListViewFont; | 113 | QFont mListViewFont; |
114 | QFont mDateNavigatorFont; | 114 | QFont mDateNavigatorFont; |
115 | QFont mEditBoxFont; | 115 | QFont mEditBoxFont; |
116 | QFont mJornalViewFont; | 116 | QFont mJornalViewFont; |
117 | QFont mWhatsNextFont; | 117 | QFont mWhatsNextFont; |
118 | QFont mEventViewFont; | 118 | QFont mEventViewFont; |
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | QColor mHolidayColor; | 123 | QColor mHolidayColor; |
124 | QColor mHighlightColor; | 124 | QColor mHighlightColor; |
125 | QColor mEventColor; | 125 | QColor mEventColor; |
126 | QColor mAgendaBgColor; | 126 | QColor mAgendaBgColor; |
127 | QColor mWorkingHoursColor; | 127 | QColor mWorkingHoursColor; |
128 | QColor mTodoDueTodayColor; | 128 | QColor mTodoDueTodayColor; |
129 | QColor mTodoOverdueColor; | 129 | QColor mTodoOverdueColor; |
130 | QColor mMonthViewEvenColor; | 130 | QColor mMonthViewEvenColor; |
131 | QColor mMonthViewOddColor; | 131 | QColor mMonthViewOddColor; |
132 | QColor mMonthViewHolidayColor; | 132 | QColor mMonthViewHolidayColor; |
133 | bool mMonthViewUsesDayColors; | 133 | bool mMonthViewUsesDayColors; |
134 | bool mMonthViewSatSunTog; | 134 | bool mMonthViewSatSunTog; |
135 | QColor mAppColor1; | 135 | QColor mAppColor1; |
136 | QColor mAppColor2; | 136 | QColor mAppColor2; |
137 | bool mUseAppColors; | 137 | bool mUseAppColors; |
138 | 138 | ||
139 | int mDayBegins; | 139 | int mDayBegins; |
140 | int mHourSize; | 140 | int mHourSize; |
141 | int mAllDaySize; | 141 | int mAllDaySize; |
142 | bool mShowFullMenu; | 142 | bool mShowFullMenu; |
143 | bool mDailyRecur; | 143 | bool mDailyRecur; |
144 | bool mWeeklyRecur; | 144 | bool mWeeklyRecur; |
145 | bool mMonthDailyRecur; | 145 | bool mMonthDailyRecur; |
146 | bool mMonthWeeklyRecur; | 146 | bool mMonthWeeklyRecur; |
147 | bool mMonthShowIcons; | 147 | bool mMonthShowIcons; |
148 | bool mMonthShowShort; | 148 | bool mMonthShowShort; |
149 | bool mEnableToolTips; | 149 | bool mEnableToolTips; |
150 | bool mEnableMonthScroll; | 150 | bool mEnableMonthScroll; |
151 | bool mFullViewMonth; | 151 | bool mFullViewMonth; |
152 | bool mMonthViewUsesCategoryColor; | 152 | bool mMonthViewUsesCategoryColor; |
153 | bool mFullViewTodo; | 153 | bool mFullViewTodo; |
154 | bool mShowCompletedTodo; | 154 | bool mShowCompletedTodo; |
155 | bool mMarcusBainsEnabled; | 155 | bool mMarcusBainsEnabled; |
156 | int mNextXDays; | 156 | int mNextXDays; |
157 | int mWhatsNextDays; | 157 | int mWhatsNextDays; |
158 | int mWhatsNextPrios; | 158 | int mWhatsNextPrios; |
159 | bool mEnableQuickTodo; | 159 | bool mEnableQuickTodo; |
160 | 160 | ||
161 | bool mCompactDialogs; | 161 | bool mCompactDialogs; |
162 | bool mVerticalScreen; | 162 | bool mVerticalScreen; |
163 | 163 | ||
164 | bool mShowIconNewTodo; | 164 | bool mShowIconNewTodo; |
165 | bool mShowIconNewEvent; | 165 | bool mShowIconNewEvent; |
166 | bool mShowIconSearch; | 166 | bool mShowIconSearch; |
167 | bool mShowIconList; | 167 | bool mShowIconList; |
168 | bool mShowIconDay1; | 168 | bool mShowIconDay1; |
169 | bool mShowIconDay5; | 169 | bool mShowIconDay5; |
170 | bool mShowIconDay7; | 170 | bool mShowIconDay7; |
171 | bool mShowIconMonth; | 171 | bool mShowIconMonth; |
172 | bool mShowIconTodoview; | 172 | bool mShowIconTodoview; |
173 | bool mShowIconBackFast; | 173 | bool mShowIconBackFast; |
174 | bool mShowIconBack; | 174 | bool mShowIconBack; |
175 | bool mShowIconToday; | 175 | bool mShowIconToday; |
176 | bool mShowIconForward; | 176 | bool mShowIconForward; |
177 | bool mShowIconForwardFast; | 177 | bool mShowIconForwardFast; |
178 | bool mShowIconWhatsThis; | 178 | bool mShowIconWhatsThis; |
179 | bool mShowIconNextDays; | 179 | bool mShowIconNextDays; |
180 | bool mShowIconNext; | 180 | bool mShowIconNext; |
181 | bool mShowIconJournal; | 181 | bool mShowIconJournal; |
182 | 182 | ||
183 | bool mShowIconStretch; | 183 | bool mShowIconStretch; |
184 | 184 | ||
185 | bool mToolBarHor; | 185 | bool mToolBarHor; |
186 | bool mToolBarUp; | 186 | bool mToolBarUp; |
187 | bool mToolBarMiniIcons; | 187 | bool mToolBarMiniIcons; |
188 | 188 | ||
189 | bool mAskForQuit; | 189 | bool mAskForQuit; |
190 | bool mUsePassWd; | 190 | bool mUsePassWd; |
191 | bool mShowSyncEvents; | 191 | bool mShowSyncEvents; |
192 | bool mShowTodoInAgenda; | 192 | bool mShowTodoInAgenda; |
193 | bool mShowTimeInAgenda; | ||
194 | bool mHideNonStartedTodos; | ||
193 | 195 | ||
194 | int mLastSyncTime; | 196 | int mLastSyncTime; |
195 | void setCategoryColor(QString cat,const QColor & color); | 197 | void setCategoryColor(QString cat,const QColor & color); |
196 | QColor *categoryColor(QString cat); | 198 | QColor *categoryColor(QString cat); |
197 | 199 | ||
198 | QString mArchiveFile; | 200 | QString mArchiveFile; |
199 | QString mHtmlExportFile; | 201 | QString mHtmlExportFile; |
200 | bool mHtmlWithSave; | 202 | bool mHtmlWithSave; |
201 | 203 | ||
202 | QStringList mSelectedPlugins; | 204 | QStringList mSelectedPlugins; |
203 | 205 | ||
204 | QString mLastImportFile; | 206 | QString mLastImportFile; |
205 | QString mLastVcalFile; | 207 | QString mLastVcalFile; |
206 | QString mLastSaveFile; | 208 | QString mLastSaveFile; |
207 | QString mLastLoadFile; | 209 | QString mLastLoadFile; |
208 | 210 | ||
209 | 211 | ||
210 | QString mDefaultAlarmFile; | 212 | QString mDefaultAlarmFile; |
211 | int mIMIPScheduler; | 213 | int mIMIPScheduler; |
212 | int mIMIPSend; | 214 | int mIMIPSend; |
213 | QStringList mAdditionalMails; | 215 | QStringList mAdditionalMails; |
214 | int mIMIPAutoRefresh; | 216 | int mIMIPAutoRefresh; |
215 | int mIMIPAutoInsertReply; | 217 | int mIMIPAutoInsertReply; |
216 | int mIMIPAutoInsertRequest; | 218 | int mIMIPAutoInsertRequest; |
217 | int mIMIPAutoFreeBusy; | 219 | int mIMIPAutoFreeBusy; |
218 | int mIMIPAutoFreeBusyReply; | 220 | int mIMIPAutoFreeBusyReply; |
219 | 221 | ||
220 | QStringList mTodoTemplates; | 222 | QStringList mTodoTemplates; |
221 | QStringList mEventTemplates; | 223 | QStringList mEventTemplates; |
222 | 224 | ||
223 | int mDestination; | 225 | int mDestination; |
224 | 226 | ||
225 | 227 | ||
226 | bool mEditOnDoubleClick; | 228 | bool mEditOnDoubleClick; |
227 | bool mViewChangeHoldFullscreen; | 229 | bool mViewChangeHoldFullscreen; |
228 | bool mViewChangeHoldNonFullscreen; | 230 | bool mViewChangeHoldNonFullscreen; |
229 | bool mCenterOnCurrentTime; | 231 | bool mCenterOnCurrentTime; |
230 | bool mSetTimeToDayStartAt; | 232 | bool mSetTimeToDayStartAt; |
231 | bool mHighlightCurrentDay; | 233 | bool mHighlightCurrentDay; |
232 | bool mUseHighlightLightColor; | 234 | bool mUseHighlightLightColor; |
233 | bool mListViewMonthTimespan; | 235 | bool mListViewMonthTimespan; |
234 | bool mWNViewShowsParents; | 236 | bool mWNViewShowsParents; |
235 | bool mWNViewShowsPast; | 237 | bool mWNViewShowsPast; |
236 | bool mWNViewShowLocation; | 238 | bool mWNViewShowLocation; |
237 | bool mTodoViewShowsPercentage; | 239 | bool mTodoViewShowsPercentage; |
238 | bool mTodoViewUsesCatColors; | 240 | bool mTodoViewUsesCatColors; |
239 | bool mTodoViewUsesSmallFont; | 241 | bool mTodoViewUsesSmallFont; |
240 | bool mTodoViewUsesForegroundColor; | 242 | bool mTodoViewUsesForegroundColor; |
241 | bool mMonthViewUsesForegroundColor; | 243 | bool mMonthViewUsesForegroundColor; |
242 | 244 | ||
243 | bool mHightlightDateTimeEdit; | 245 | bool mHightlightDateTimeEdit; |
244 | bool mShortDateInViewer; | 246 | bool mShortDateInViewer; |
245 | 247 | ||
246 | QStringList mLocationDefaults; | 248 | QStringList mLocationDefaults; |
247 | QStringList mEventSummaryUser; | 249 | QStringList mEventSummaryUser; |
248 | QStringList mTodoSummaryUser; | 250 | QStringList mTodoSummaryUser; |
249 | 251 | ||
250 | bool mUseInternalAlarmNotification; | 252 | bool mUseInternalAlarmNotification; |
251 | int mAlarmPlayBeeps; | 253 | int mAlarmPlayBeeps; |
252 | int mAlarmSuspendTime; | 254 | int mAlarmSuspendTime; |
253 | int mAlarmSuspendCount; | 255 | int mAlarmSuspendCount; |
254 | int mAlarmBeepInterval; | 256 | int mAlarmBeepInterval; |
255 | int mOldLanguage; | 257 | int mOldLanguage; |
256 | int mOldLoadedLanguage; | 258 | int mOldLoadedLanguage; |
257 | 259 | ||
258 | 260 | ||
259 | QString mActiveSyncPort; | 261 | QString mActiveSyncPort; |
260 | QString mActiveSyncIP; | 262 | QString mActiveSyncIP; |
261 | 263 | ||
262 | private: | 264 | private: |
263 | QDict<QColor> mCategoryColors; | 265 | QDict<QColor> mCategoryColors; |
264 | QColor mDefaultCategoryColor; | 266 | QColor mDefaultCategoryColor; |
265 | 267 | ||
266 | QFont mDefaultTimeBarFont; | 268 | QFont mDefaultTimeBarFont; |
267 | QFont mDefaultViewFont; | 269 | QFont mDefaultViewFont; |
268 | QFont mDefaultMonthViewFont; | 270 | QFont mDefaultMonthViewFont; |
269 | 271 | ||
270 | QString mName; | 272 | QString mName; |
271 | QString mEmail; | 273 | QString mEmail; |
272 | }; | 274 | }; |
273 | 275 | ||
274 | #endif | 276 | #endif |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 578c0e9..8aa24ee 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -1,1219 +1,1232 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | 44 | ||
45 | #include <kcolorbutton.h> | 45 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobal.h> | 48 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 49 | #include <kfontdialog.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <kmessagebox.h> | 51 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 52 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | #include <kemailsettings.h> | 54 | #include <kemailsettings.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | 56 | ||
57 | #include <kurlrequester.h> | 57 | #include <kurlrequester.h> |
58 | #include <klineedit.h> | 58 | #include <klineedit.h> |
59 | 59 | ||
60 | #if defined(USE_SOLARIS) | 60 | #if defined(USE_SOLARIS) |
61 | #include <sys/param.h> | 61 | #include <sys/param.h> |
62 | 62 | ||
63 | #define ZONEINFODIR "/usr/share/lib/zoneinfo" | 63 | #define ZONEINFODIR "/usr/share/lib/zoneinfo" |
64 | #define INITFILE "/etc/default/init" | 64 | #define INITFILE "/etc/default/init" |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #include "koprefs.h" | 67 | #include "koprefs.h" |
68 | 68 | ||
69 | #include "koprefsdialog.h" | 69 | #include "koprefsdialog.h" |
70 | #include "kpimglobalprefs.h" | 70 | #include "kpimglobalprefs.h" |
71 | 71 | ||
72 | 72 | ||
73 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 73 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
74 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 74 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
75 | { | 75 | { |
76 | 76 | ||
77 | setCaption( i18n("Preferences - some settings need a restart (nr)")); | 77 | setCaption( i18n("Preferences - some settings need a restart (nr)")); |
78 | mCategoryDict.setAutoDelete(true); | 78 | mCategoryDict.setAutoDelete(true); |
79 | 79 | ||
80 | KGlobal::locale()->insertCatalogue("timezones"); | 80 | KGlobal::locale()->insertCatalogue("timezones"); |
81 | 81 | ||
82 | setupGlobalTab(); | 82 | setupGlobalTab(); |
83 | setupMainTab(); | 83 | setupMainTab(); |
84 | // setupLocaleTab(); | 84 | // setupLocaleTab(); |
85 | //setupTimeZoneTab(); | 85 | //setupTimeZoneTab(); |
86 | setupTimeTab(); | 86 | setupTimeTab(); |
87 | //setupLocaleDateTab(); | 87 | //setupLocaleDateTab(); |
88 | setupFontsTab(); | 88 | setupFontsTab(); |
89 | setupColorsTab(); | 89 | setupColorsTab(); |
90 | setupViewsTab(); | 90 | setupViewsTab(); |
91 | //setupSyncTab(); | 91 | //setupSyncTab(); |
92 | //setupSyncAlgTab(); | 92 | //setupSyncAlgTab(); |
93 | //setupPrinterTab(); | 93 | //setupPrinterTab(); |
94 | //setupGroupSchedulingTab(); | 94 | //setupGroupSchedulingTab(); |
95 | //setupGroupAutomationTab(); | 95 | //setupGroupAutomationTab(); |
96 | |||
97 | if ( QApplication::desktop()->height() == 480 ) | ||
98 | hideButtons(); | ||
96 | } | 99 | } |
97 | 100 | ||
98 | 101 | ||
99 | KOPrefsDialog::~KOPrefsDialog() | 102 | KOPrefsDialog::~KOPrefsDialog() |
100 | { | 103 | { |
101 | } | 104 | } |
102 | void KOPrefsDialog::setupGlobalTab() | 105 | void KOPrefsDialog::setupGlobalTab() |
103 | { | 106 | { |
104 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 107 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
105 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 108 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
106 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 109 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
107 | topLayout->addWidget( kdelibcfg ); | 110 | topLayout->addWidget( kdelibcfg ); |
108 | 111 | ||
109 | 112 | ||
110 | } | 113 | } |
111 | void KOPrefsDialog::setupLocaleDateTab() | 114 | void KOPrefsDialog::setupLocaleDateTab() |
112 | { | 115 | { |
113 | #if 0 | 116 | #if 0 |
114 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 117 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
115 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 118 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
116 | topLayout->setSpacing(spacingHint()); | 119 | topLayout->setSpacing(spacingHint()); |
117 | topLayout->setMargin(marginHint()); | 120 | topLayout->setMargin(marginHint()); |
118 | int iii = 0; | 121 | int iii = 0; |
119 | 122 | ||
120 | 123 | ||
121 | KPrefsDialogWidRadios *syncPrefsGroup = | 124 | KPrefsDialogWidRadios *syncPrefsGroup = |
122 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 125 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
123 | QString format; | 126 | QString format; |
124 | if ( QApplication::desktop()->width() < 480 ) | 127 | if ( QApplication::desktop()->width() < 480 ) |
125 | format = "(%d.%m.%Y)"; | 128 | format = "(%d.%m.%Y)"; |
126 | else | 129 | else |
127 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 130 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
128 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 131 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
129 | if ( QApplication::desktop()->width() < 480 ) | 132 | if ( QApplication::desktop()->width() < 480 ) |
130 | format = "(%m.%d.%Y)"; | 133 | format = "(%m.%d.%Y)"; |
131 | else | 134 | else |
132 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 135 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
133 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 136 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
134 | if ( QApplication::desktop()->width() < 480 ) | 137 | if ( QApplication::desktop()->width() < 480 ) |
135 | format = "(%Y-%m-%d)"; | 138 | format = "(%Y-%m-%d)"; |
136 | else | 139 | else |
137 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 140 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
138 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 141 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
139 | syncPrefsGroup->addRadio(i18n("User defined")); | 142 | syncPrefsGroup->addRadio(i18n("User defined")); |
140 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 143 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
141 | ++iii; | 144 | ++iii; |
142 | ++iii; | 145 | ++iii; |
143 | QLabel * lab; | 146 | QLabel * lab; |
144 | mUserDateFormatLong = new QLineEdit(topFrame); | 147 | mUserDateFormatLong = new QLineEdit(topFrame); |
145 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 148 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
146 | topLayout->addWidget(lab ,iii,0); | 149 | topLayout->addWidget(lab ,iii,0); |
147 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 150 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
148 | ++iii; | 151 | ++iii; |
149 | mUserDateFormatShort = new QLineEdit(topFrame); | 152 | mUserDateFormatShort = new QLineEdit(topFrame); |
150 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 153 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
151 | topLayout->addWidget(lab ,iii,0); | 154 | topLayout->addWidget(lab ,iii,0); |
152 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 155 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
153 | ++iii; | 156 | ++iii; |
154 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 157 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
155 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 158 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
156 | ++iii; | 159 | ++iii; |
157 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 160 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
158 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 161 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
159 | ++iii; | 162 | ++iii; |
160 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 163 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
161 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 164 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
162 | ++iii; | 165 | ++iii; |
163 | #endif | 166 | #endif |
164 | 167 | ||
165 | } | 168 | } |
166 | 169 | ||
167 | void KOPrefsDialog::setupLocaleTab() | 170 | void KOPrefsDialog::setupLocaleTab() |
168 | { | 171 | { |
169 | #if 0 | 172 | #if 0 |
170 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 173 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
171 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 174 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
172 | topLayout->setSpacing(spacingHint()); | 175 | topLayout->setSpacing(spacingHint()); |
173 | topLayout->setMargin(marginHint()); | 176 | topLayout->setMargin(marginHint()); |
174 | int iii = 0; | 177 | int iii = 0; |
175 | KPrefsDialogWidRadios *syncPrefsGroup = | 178 | KPrefsDialogWidRadios *syncPrefsGroup = |
176 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 179 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
177 | syncPrefsGroup->addRadio(i18n("English")); | 180 | syncPrefsGroup->addRadio(i18n("English")); |
178 | syncPrefsGroup->addRadio(i18n("German")); | 181 | syncPrefsGroup->addRadio(i18n("German")); |
179 | syncPrefsGroup->addRadio(i18n("French")); | 182 | syncPrefsGroup->addRadio(i18n("French")); |
180 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 183 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
181 | if ( QApplication::desktop()->width() < 300 ) | 184 | if ( QApplication::desktop()->width() < 300 ) |
182 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 185 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
183 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 186 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
184 | ++iii; | 187 | ++iii; |
185 | 188 | ||
186 | syncPrefsGroup = | 189 | syncPrefsGroup = |
187 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 190 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
188 | if ( QApplication::desktop()->width() > 300 ) | 191 | if ( QApplication::desktop()->width() > 300 ) |
189 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 192 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
190 | syncPrefsGroup->addRadio(i18n("24:00")); | 193 | syncPrefsGroup->addRadio(i18n("24:00")); |
191 | syncPrefsGroup->addRadio(i18n("12:00am")); | 194 | syncPrefsGroup->addRadio(i18n("12:00am")); |
192 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 195 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
193 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 196 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
194 | ++iii; | 197 | ++iii; |
195 | KPrefsDialogWidBool *sb; | 198 | KPrefsDialogWidBool *sb; |
196 | if ( QApplication::desktop()->width() < 300 ) { | 199 | if ( QApplication::desktop()->width() < 300 ) { |
197 | sb = | 200 | sb = |
198 | addWidBool(i18n("Week starts on Sunday"), | 201 | addWidBool(i18n("Week starts on Sunday"), |
199 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 202 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
200 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 203 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
201 | ++iii; | 204 | ++iii; |
202 | sb = | 205 | sb = |
203 | addWidBool(i18n("Use short date in (WN/E) view"), | 206 | addWidBool(i18n("Use short date in (WN/E) view"), |
204 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 207 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
205 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 208 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
206 | } | 209 | } |
207 | else { | 210 | else { |
208 | QWidget * hb = new QWidget( topFrame ); | 211 | QWidget * hb = new QWidget( topFrame ); |
209 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 212 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
210 | sb = | 213 | sb = |
211 | addWidBool(i18n("Week starts on Sunday"), | 214 | addWidBool(i18n("Week starts on Sunday"), |
212 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 215 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
213 | hbLayout->addWidget(sb->checkBox() ); | 216 | hbLayout->addWidget(sb->checkBox() ); |
214 | sb = | 217 | sb = |
215 | addWidBool(i18n("Use short date in (WN/E) view"), | 218 | addWidBool(i18n("Use short date in (WN/E) view"), |
216 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 219 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
217 | hbLayout->addWidget(sb->checkBox() ); | 220 | hbLayout->addWidget(sb->checkBox() ); |
218 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 221 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
219 | 222 | ||
220 | } | 223 | } |
221 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION | 224 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION |
222 | #if 0 | 225 | #if 0 |
223 | ++iii; | 226 | ++iii; |
224 | sb = | 227 | sb = |
225 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 228 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
226 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 229 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
227 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 230 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
228 | #endif | 231 | #endif |
229 | #endif | 232 | #endif |
230 | } | 233 | } |
231 | void KOPrefsDialog::showSyncPage() | 234 | void KOPrefsDialog::showSyncPage() |
232 | { | 235 | { |
233 | showPage ( 0 ) ; | 236 | showPage ( 0 ) ; |
234 | kdelibcfg->showTimeZoneTab() ; | 237 | kdelibcfg->showTimeZoneTab() ; |
235 | 238 | ||
236 | } | 239 | } |
237 | void KOPrefsDialog::setupSyncAlgTab() | 240 | void KOPrefsDialog::setupSyncAlgTab() |
238 | { | 241 | { |
239 | #if 0 | 242 | #if 0 |
240 | QLabel * lab; | 243 | QLabel * lab; |
241 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 244 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
242 | mSetupSyncAlgTab = topFrame; | 245 | mSetupSyncAlgTab = topFrame; |
243 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 246 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
244 | topLayout->setSpacing(spacingHint()); | 247 | topLayout->setSpacing(spacingHint()); |
245 | topLayout->setMargin(marginHint()); | 248 | topLayout->setMargin(marginHint()); |
246 | int iii = 0; | 249 | int iii = 0; |
247 | 250 | ||
248 | KPrefsDialogWidBool *sb = | 251 | KPrefsDialogWidBool *sb = |
249 | addWidBool(i18n("Ask for preferences before syncing"), | 252 | addWidBool(i18n("Ask for preferences before syncing"), |
250 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 253 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
251 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 254 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
252 | 255 | ||
253 | ++iii; | 256 | ++iii; |
254 | 257 | ||
255 | KPrefsDialogWidRadios *syncPrefsGroup = | 258 | KPrefsDialogWidRadios *syncPrefsGroup = |
256 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 259 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
257 | topFrame); | 260 | topFrame); |
258 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 261 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
259 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 262 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
260 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 263 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
261 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 264 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
262 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 265 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
263 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 266 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
264 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 267 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
265 | ++iii; | 268 | ++iii; |
266 | sb = | 269 | sb = |
267 | addWidBool(i18n("Show summary after syncing"), | 270 | addWidBool(i18n("Show summary after syncing"), |
268 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 271 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
269 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 272 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
270 | 273 | ||
271 | ++iii; | 274 | ++iii; |
272 | #endif | 275 | #endif |
273 | 276 | ||
274 | 277 | ||
275 | 278 | ||
276 | } | 279 | } |
277 | 280 | ||
278 | 281 | ||
279 | void KOPrefsDialog::setupSyncTab() | 282 | void KOPrefsDialog::setupSyncTab() |
280 | { | 283 | { |
281 | #if 0 | 284 | #if 0 |
282 | QLabel * lab; | 285 | QLabel * lab; |
283 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 286 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
284 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 287 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
285 | topLayout->setSpacing(spacingHint()); | 288 | topLayout->setSpacing(spacingHint()); |
286 | topLayout->setMargin(marginHint()); | 289 | topLayout->setMargin(marginHint()); |
287 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 290 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
288 | int iii = 0; | 291 | int iii = 0; |
289 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 292 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
290 | ++iii; | 293 | ++iii; |
291 | 294 | ||
292 | mRemoteIPEdit = new QLineEdit(topFrame); | 295 | mRemoteIPEdit = new QLineEdit(topFrame); |
293 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 296 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
294 | topLayout->addWidget(lab ,iii,0); | 297 | topLayout->addWidget(lab ,iii,0); |
295 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 298 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
296 | ++iii; | 299 | ++iii; |
297 | mRemoteUser = new QLineEdit(topFrame); | 300 | mRemoteUser = new QLineEdit(topFrame); |
298 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 301 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
299 | topLayout->addWidget(lab ,iii,0); | 302 | topLayout->addWidget(lab ,iii,0); |
300 | topLayout->addWidget(mRemoteUser, iii,1); | 303 | topLayout->addWidget(mRemoteUser, iii,1); |
301 | ++iii; | 304 | ++iii; |
302 | 305 | ||
303 | mRemoteFile = new QLineEdit(topFrame); | 306 | mRemoteFile = new QLineEdit(topFrame); |
304 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 307 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
305 | topLayout->addWidget(lab ,iii,0); | 308 | topLayout->addWidget(lab ,iii,0); |
306 | topLayout->addWidget(mRemoteFile,iii,1); | 309 | topLayout->addWidget(mRemoteFile,iii,1); |
307 | ++iii; | 310 | ++iii; |
308 | 311 | ||
309 | mLocalTempFile = new QLineEdit(topFrame); | 312 | mLocalTempFile = new QLineEdit(topFrame); |
310 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 313 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
311 | topLayout->addWidget(lab ,iii,0); | 314 | topLayout->addWidget(lab ,iii,0); |
312 | topLayout->addWidget(mLocalTempFile,iii,1); | 315 | topLayout->addWidget(mLocalTempFile,iii,1); |
313 | ++iii; | 316 | ++iii; |
314 | 317 | ||
315 | KPrefsDialogWidBool *wb = | 318 | KPrefsDialogWidBool *wb = |
316 | addWidBool(i18n("Write back synced file"), | 319 | addWidBool(i18n("Write back synced file"), |
317 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 320 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
318 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 321 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
319 | ++iii; | 322 | ++iii; |
320 | wb = | 323 | wb = |
321 | addWidBool(i18n("Write back existing entries only"), | 324 | addWidBool(i18n("Write back existing entries only"), |
322 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 325 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
323 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 326 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
324 | ++iii; | 327 | ++iii; |
325 | 328 | ||
326 | #endif | 329 | #endif |
327 | } | 330 | } |
328 | 331 | ||
329 | void KOPrefsDialog::setupMainTab() | 332 | void KOPrefsDialog::setupMainTab() |
330 | { | 333 | { |
331 | QFrame *topFrame = addPage(i18n("General"),0,0); | 334 | QFrame *topFrame = addPage(i18n("General"),0,0); |
332 | // DesktopIcon("identity",KIcon::SizeMedium)); | 335 | // DesktopIcon("identity",KIcon::SizeMedium)); |
333 | 336 | ||
334 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 337 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
335 | topLayout->setSpacing(spacingHint()); | 338 | topLayout->setSpacing(spacingHint()); |
336 | topLayout->setMargin(marginHint()); | 339 | topLayout->setMargin(marginHint()); |
337 | 340 | ||
338 | // KPrefsDialogWidBool *emailControlCenter = | 341 | // KPrefsDialogWidBool *emailControlCenter = |
339 | // addWidBool(i18n("&Use email settings from Control Center"), | 342 | // addWidBool(i18n("&Use email settings from Control Center"), |
340 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 343 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
341 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 344 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
342 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 345 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
343 | // SLOT(toggleEmailSettings(bool))); | 346 | // SLOT(toggleEmailSettings(bool))); |
344 | 347 | ||
345 | mNameEdit = new QLineEdit(topFrame); | 348 | mNameEdit = new QLineEdit(topFrame); |
346 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 349 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
347 | topLayout->addWidget(mNameLabel,0,0); | 350 | topLayout->addWidget(mNameLabel,0,0); |
348 | topLayout->addWidget(mNameEdit,0,1); | 351 | topLayout->addWidget(mNameEdit,0,1); |
349 | 352 | ||
350 | mEmailEdit = new QLineEdit(topFrame); | 353 | mEmailEdit = new QLineEdit(topFrame); |
351 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 354 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
352 | topLayout->addWidget(mEmailLabel,1,0); | 355 | topLayout->addWidget(mEmailLabel,1,0); |
353 | topLayout->addWidget(mEmailEdit,1,1); | 356 | topLayout->addWidget(mEmailEdit,1,1); |
354 | KPrefsDialogWidBool *wb; | 357 | KPrefsDialogWidBool *wb; |
355 | QHBox *dummy; | 358 | QHBox *dummy; |
356 | if ( QApplication::desktop()->width() > 480 ) { | 359 | if ( QApplication::desktop()->width() > 480 ) { |
357 | dummy = new QHBox(topFrame); | 360 | dummy = new QHBox(topFrame); |
358 | } else { | 361 | } else { |
359 | dummy = new QVBox(topFrame); | 362 | dummy = new QVBox(topFrame); |
360 | } | 363 | } |
361 | 364 | ||
362 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | 365 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); |
363 | addWidBool(i18n("Full menu bar(nr)"), | 366 | addWidBool(i18n("Full menu bar(nr)"), |
364 | &(KOPrefs::instance()->mShowFullMenu),dummy); | 367 | &(KOPrefs::instance()->mShowFullMenu),dummy); |
365 | 368 | ||
366 | 369 | ||
367 | addWidBool(i18n("Mini icons in toolbar(nr)"), | 370 | addWidBool(i18n("Mini icons in toolbar(nr)"), |
368 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); | 371 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); |
369 | 372 | ||
370 | 373 | ||
371 | dummy = new QHBox(topFrame); | 374 | dummy = new QHBox(topFrame); |
372 | new QLabel(i18n("Days in What's Next:"),dummy); | 375 | new QLabel(i18n("Days in What's Next:"),dummy); |
373 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); | 376 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); |
374 | 377 | ||
375 | topLayout->addMultiCellWidget(dummy,3,3,0,1); | 378 | topLayout->addMultiCellWidget(dummy,3,3,0,1); |
376 | 379 | ||
377 | 380 | ||
378 | 381 | ||
379 | dummy = new QHBox(topFrame); | 382 | dummy = new QHBox(topFrame); |
380 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 383 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
381 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 384 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
382 | 385 | ||
383 | topLayout->addMultiCellWidget(dummy,4,4,0,1); | 386 | topLayout->addMultiCellWidget(dummy,4,4,0,1); |
384 | 387 | ||
385 | QHBox *prioBox = new QHBox(topFrame); | 388 | QHBox *prioBox = new QHBox(topFrame); |
386 | // intervalBox->setSpacing(spacingHint()); | 389 | // intervalBox->setSpacing(spacingHint()); |
387 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); | 390 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); |
388 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 391 | QString messa = i18n("Show topmost todo prios in What's Next:"); |
389 | 392 | ||
390 | if ( QApplication::desktop()->width() < 300 ) | 393 | if ( QApplication::desktop()->width() < 300 ) |
391 | messa = i18n("Show topmost todo prios in What's N.:"); | 394 | messa = i18n("Show topmost todo prios in What's N.:"); |
392 | QLabel *prioLabel = new QLabel(messa, prioBox); | 395 | QLabel *prioLabel = new QLabel(messa, prioBox); |
393 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 396 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
394 | if ( QApplication::desktop()->width() < 300 ) | 397 | if ( QApplication::desktop()->width() < 300 ) |
395 | mPrioSpin->setFixedWidth( 40 ); | 398 | mPrioSpin->setFixedWidth( 40 ); |
396 | 399 | ||
397 | // KPrefsDialogWidBool *bcc = | 400 | // KPrefsDialogWidBool *bcc = |
398 | // addWidBool(i18n("Send copy to owner when mailing events"), | 401 | // addWidBool(i18n("Send copy to owner when mailing events"), |
399 | // &(KOPrefs::instance()->mBcc),topFrame); | 402 | // &(KOPrefs::instance()->mBcc),topFrame); |
400 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 403 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
401 | 404 | ||
402 | 405 | ||
403 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 406 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
404 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 407 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
405 | 408 | ||
406 | // addWidBool(i18n("Enable automatic saving of calendar"), | 409 | // addWidBool(i18n("Enable automatic saving of calendar"), |
407 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 410 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
408 | 411 | ||
409 | QHBox *intervalBox = new QHBox(topFrame); | 412 | QHBox *intervalBox = new QHBox(topFrame); |
410 | // intervalBox->setSpacing(spacingHint()); | 413 | // intervalBox->setSpacing(spacingHint()); |
411 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 414 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
412 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 415 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
413 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 416 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
414 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 417 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
415 | /* | 418 | /* |
416 | QHBox * agendasize = new QHBox ( topFrame ); | 419 | QHBox * agendasize = new QHBox ( topFrame ); |
417 | 420 | ||
418 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 421 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
419 | 422 | ||
420 | 423 | ||
421 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 424 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
422 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 425 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
423 | */ | 426 | */ |
424 | KPrefsDialogWidBool *verticalScreen = | 427 | KPrefsDialogWidBool *verticalScreen = |
425 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 428 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
426 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 429 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
427 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 430 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
428 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); | 431 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); |
429 | 432 | ||
430 | KPrefsDialogWidBool *ask = | 433 | KPrefsDialogWidBool *ask = |
431 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 434 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
432 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 435 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
433 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); | 436 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); |
434 | 437 | ||
435 | 438 | ||
436 | /* | 439 | /* |
437 | KPrefsDialogWidBool *confirmCheck = | 440 | KPrefsDialogWidBool *confirmCheck = |
438 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 441 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
439 | topFrame); | 442 | topFrame); |
440 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 443 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
441 | 444 | ||
442 | 445 | ||
443 | mEnableGroupScheduling = | 446 | mEnableGroupScheduling = |
444 | addWidBool(i18n("Enable group scheduling"), | 447 | addWidBool(i18n("Enable group scheduling"), |
445 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 448 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
446 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 449 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
447 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 450 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
448 | SLOT(warningGroupScheduling())); | 451 | SLOT(warningGroupScheduling())); |
449 | 452 | ||
450 | mEnableProjectView = | 453 | mEnableProjectView = |
451 | addWidBool(i18n("Enable project view"), | 454 | addWidBool(i18n("Enable project view"), |
452 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 455 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
453 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 456 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
454 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 457 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
455 | SLOT(warningProjectView())); | 458 | SLOT(warningProjectView())); |
456 | 459 | ||
457 | // Can't be disabled anymore | 460 | // Can't be disabled anymore |
458 | mEnableGroupScheduling->checkBox()->hide(); | 461 | mEnableGroupScheduling->checkBox()->hide(); |
459 | 462 | ||
460 | // Disable setting, because this feature now becomes stable | 463 | // Disable setting, because this feature now becomes stable |
461 | mEnableProjectView->checkBox()->hide(); | 464 | mEnableProjectView->checkBox()->hide(); |
462 | 465 | ||
463 | KPrefsDialogWidRadios *defaultFormatGroup = | 466 | KPrefsDialogWidRadios *defaultFormatGroup = |
464 | addWidRadios(i18n("Default Calendar Format"), | 467 | addWidRadios(i18n("Default Calendar Format"), |
465 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 468 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
466 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 469 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
467 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 470 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
468 | 471 | ||
469 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 472 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
470 | 473 | ||
471 | // Default format unconditionally is iCalendar | 474 | // Default format unconditionally is iCalendar |
472 | defaultFormatGroup->groupBox()->hide(); | 475 | defaultFormatGroup->groupBox()->hide(); |
473 | 476 | ||
474 | KPrefsDialogWidRadios *mailClientGroup = | 477 | KPrefsDialogWidRadios *mailClientGroup = |
475 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 478 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
476 | topFrame); | 479 | topFrame); |
477 | mailClientGroup->addRadio(i18n("KMail")); | 480 | mailClientGroup->addRadio(i18n("KMail")); |
478 | mailClientGroup->addRadio(i18n("Sendmail")); | 481 | mailClientGroup->addRadio(i18n("Sendmail")); |
479 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 482 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
480 | 483 | ||
481 | KPrefsDialogWidBool *htmlsave = | 484 | KPrefsDialogWidBool *htmlsave = |
482 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 485 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
483 | topFrame); | 486 | topFrame); |
484 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 487 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
485 | 488 | ||
486 | KPrefsDialogWidRadios *destinationGroup = | 489 | KPrefsDialogWidRadios *destinationGroup = |
487 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 490 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
488 | topFrame); | 491 | topFrame); |
489 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 492 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
490 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 493 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
491 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 494 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
492 | 495 | ||
493 | topLayout->setRowStretch(14,1); | 496 | topLayout->setRowStretch(14,1); |
494 | */ | 497 | */ |
495 | } | 498 | } |
496 | 499 | ||
497 | 500 | ||
498 | void KOPrefsDialog::setupTimeTab() | 501 | void KOPrefsDialog::setupTimeTab() |
499 | { | 502 | { |
500 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 503 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
501 | // DesktopIcon("clock",KIcon::SizeMedium)); | 504 | // DesktopIcon("clock",KIcon::SizeMedium)); |
502 | 505 | ||
503 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 506 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
504 | topLayout->setSpacing(spacingHint()); | 507 | topLayout->setSpacing(spacingHint()); |
505 | topLayout->setMargin(marginHint()); | 508 | topLayout->setMargin(marginHint()); |
506 | 509 | ||
507 | QHBox *dummy = new QHBox(topFrame); | 510 | QHBox *dummy = new QHBox(topFrame); |
508 | KPrefsDialogWidTime *dayBegins = | 511 | KPrefsDialogWidTime *dayBegins = |
509 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 512 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
510 | dummy); | 513 | dummy); |
511 | //topLayout->addWidget(dayBegins->label(),2,0); | 514 | //topLayout->addWidget(dayBegins->label(),2,0); |
512 | 515 | ||
513 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 516 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
514 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 517 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
515 | 518 | ||
516 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 519 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
517 | topFrame),1,0); | 520 | topFrame),1,0); |
518 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 521 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
519 | mStartTimeSpin->setSuffix(":00"); | 522 | mStartTimeSpin->setSuffix(":00"); |
520 | topLayout->addWidget(mStartTimeSpin,1,1); | 523 | topLayout->addWidget(mStartTimeSpin,1,1); |
521 | 524 | ||
522 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 525 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
523 | topFrame),2,0); | 526 | topFrame),2,0); |
524 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 527 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
525 | mDefaultDurationSpin->setSuffix(":00"); | 528 | mDefaultDurationSpin->setSuffix(":00"); |
526 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 529 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
527 | 530 | ||
528 | QStringList alarmList; | 531 | QStringList alarmList; |
529 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 532 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
530 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 533 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
531 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 534 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
532 | 3,0); | 535 | 3,0); |
533 | mAlarmTimeCombo = new QComboBox(topFrame); | 536 | mAlarmTimeCombo = new QComboBox(topFrame); |
534 | mAlarmTimeCombo->insertStringList(alarmList); | 537 | mAlarmTimeCombo->insertStringList(alarmList); |
535 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 538 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
536 | 539 | ||
537 | 540 | ||
538 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 541 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
539 | i18n("Working Hours"), | 542 | i18n("Working Hours"), |
540 | topFrame); | 543 | topFrame); |
541 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 544 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
542 | workingHoursGroup->layout()->setSpacing( 0 ); | 545 | workingHoursGroup->layout()->setSpacing( 0 ); |
543 | workingHoursGroup->layout()->setMargin( 4 ); | 546 | workingHoursGroup->layout()->setMargin( 4 ); |
544 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 547 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
545 | // workStartBox->setMargin( 0 ); | 548 | // workStartBox->setMargin( 0 ); |
546 | addWidTime(i18n("Daily starting hour:"), | 549 | addWidTime(i18n("Daily starting hour:"), |
547 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 550 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
548 | 551 | ||
549 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 552 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
550 | //workEndBox->setMargin( 0 ); | 553 | //workEndBox->setMargin( 0 ); |
551 | addWidTime(i18n("Daily ending hour:"), | 554 | addWidTime(i18n("Daily ending hour:"), |
552 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 555 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
553 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 556 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
554 | //excludeBox->setMargin( 0 ); | 557 | //excludeBox->setMargin( 0 ); |
555 | addWidBool(i18n("Exclude holidays"), | 558 | addWidBool(i18n("Exclude holidays"), |
556 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 559 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
557 | 560 | ||
558 | addWidBool(i18n("Exclude Saturdays"), | 561 | addWidBool(i18n("Exclude Saturdays"), |
559 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 562 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
560 | 563 | ||
561 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 564 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
562 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 565 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
563 | // topFrame); | 566 | // topFrame); |
564 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 567 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
565 | 568 | ||
566 | // topLayout->setRowStretch(6,1); | 569 | // topLayout->setRowStretch(6,1); |
567 | } | 570 | } |
568 | 571 | ||
569 | 572 | ||
570 | void KOPrefsDialog::setupViewsTab() | 573 | void KOPrefsDialog::setupViewsTab() |
571 | { | 574 | { |
572 | 575 | ||
573 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 576 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
574 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 577 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
575 | 578 | ||
576 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 579 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
577 | topLayout->setSpacing(spacingHint()); | 580 | topLayout->setSpacing(spacingHint()); |
578 | topLayout->setMargin(marginHint()); | 581 | topLayout->setMargin(marginHint()); |
579 | 582 | ||
580 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 583 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
581 | // topLayout->addLayout(dayBeginsLayout,0,0); | 584 | // topLayout->addLayout(dayBeginsLayout,0,0); |
582 | 585 | ||
583 | // KPrefsDialogWidTime *dayBegins = | 586 | // KPrefsDialogWidTime *dayBegins = |
584 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 587 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
585 | // topFrame); | 588 | // topFrame); |
586 | // dayBeginsLayout->addWidget(dayBegins->label()); | 589 | // dayBeginsLayout->addWidget(dayBegins->label()); |
587 | // dayBeginsLayout->addStretch(1); | 590 | // dayBeginsLayout->addStretch(1); |
588 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 591 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
589 | 592 | ||
590 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 593 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
591 | // topLayout->addLayout(nextDaysLayout,1,0); | 594 | // topLayout->addLayout(nextDaysLayout,1,0); |
592 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 595 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
593 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 596 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
594 | // nextDaysLayout->addStretch(1); | 597 | // nextDaysLayout->addStretch(1); |
595 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 598 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
596 | 599 | ||
597 | 600 | ||
598 | int ii = 0; | 601 | int ii = 0; |
599 | KPrefsDialogWidBool *dummy = | 602 | KPrefsDialogWidBool *dummy = |
600 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 603 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
601 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 604 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
602 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 605 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
606 | |||
607 | dummy = | ||
608 | addWidBool(i18n("Show time in agenda items"), | ||
609 | &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); | ||
610 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
603 | 611 | ||
604 | dummy = | 612 | dummy = |
605 | addWidBool(i18n("Highlight current day in agenda"), | 613 | addWidBool(i18n("Highlight current day in agenda"), |
606 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 614 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
607 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 615 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
608 | 616 | ||
609 | dummy = | 617 | dummy = |
610 | addWidBool(i18n("Use light color for highlight current day"), | 618 | addWidBool(i18n("Use light color for highlight current day"), |
611 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 619 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
612 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 620 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
613 | 621 | ||
614 | KPrefsDialogWidBool *dailyRecur = | 622 | KPrefsDialogWidBool *dailyRecur = |
615 | addWidBool(i18n("Show events that recur daily in date nav."), | 623 | addWidBool(i18n("Show events that recur daily in date nav."), |
616 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 624 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
617 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 625 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
618 | 626 | ||
619 | KPrefsDialogWidBool *weeklyRecur = | 627 | KPrefsDialogWidBool *weeklyRecur = |
620 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 628 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
621 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 629 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
622 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 630 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
623 | if ( QApplication::desktop()->width() > 640 ) { | 631 | if ( QApplication::desktop()->width() > 640 ) { |
624 | 632 | ||
625 | KPrefsDialogWidBool *enableToolTips = | 633 | KPrefsDialogWidBool *enableToolTips = |
626 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 634 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
627 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 635 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
628 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 636 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
629 | 637 | ||
630 | } | 638 | } |
631 | 639 | ||
632 | KPrefsDialogWidBool *marcusBainsEnabled = | 640 | KPrefsDialogWidBool *marcusBainsEnabled = |
633 | addWidBool(i18n("Show Marcus Bains line"), | 641 | addWidBool(i18n("Show Marcus Bains line"), |
634 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 642 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
635 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 643 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
636 | 644 | ||
637 | 645 | ||
638 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 646 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
639 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 647 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
640 | //topLayout->setRowStretch(11,1); | 648 | //topLayout->setRowStretch(11,1); |
641 | 649 | ||
642 | 650 | ||
643 | 651 | ||
644 | 652 | ||
645 | 653 | ||
646 | 654 | ||
647 | topFrame = addPage(i18n("ViewChange"),0,0); | 655 | topFrame = addPage(i18n("ViewChange"),0,0); |
648 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 656 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
649 | 657 | ||
650 | topLayout = new QGridLayout(topFrame,6,1); | 658 | topLayout = new QGridLayout(topFrame,6,1); |
651 | topLayout->setSpacing(spacingHint()); | 659 | topLayout->setSpacing(spacingHint()); |
652 | topLayout->setMargin(marginHint()); | 660 | topLayout->setMargin(marginHint()); |
653 | ii = 0; | 661 | ii = 0; |
654 | 662 | ||
655 | 663 | ||
656 | dummy = | 664 | dummy = |
657 | addWidBool(i18n("Hold fullscreen on view change"), | 665 | addWidBool(i18n("Hold fullscreen on view change"), |
658 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 666 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
659 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 667 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
660 | 668 | ||
661 | dummy = | 669 | dummy = |
662 | addWidBool(i18n("Hold non-fullscreen on view change"), | 670 | addWidBool(i18n("Hold non-fullscreen on view change"), |
663 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 671 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
664 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 672 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
665 | 673 | ||
666 | 674 | ||
667 | KPrefsDialogWidBool *fullViewTodo = | 675 | KPrefsDialogWidBool *fullViewTodo = |
668 | addWidBool(i18n("Event list view uses full window"), | 676 | addWidBool(i18n("Event list view uses full window"), |
669 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 677 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
670 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 678 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
671 | 679 | ||
672 | KPrefsDialogWidBool *fullViewMonth = | 680 | KPrefsDialogWidBool *fullViewMonth = |
673 | addWidBool(i18n("Next days view uses full window"), | 681 | addWidBool(i18n("Next days view uses full window"), |
674 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 682 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
675 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 683 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
676 | 684 | ||
677 | dummy = | 685 | dummy = |
678 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 686 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
679 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 687 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
680 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 688 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
681 | 689 | ||
682 | dummy = | 690 | dummy = |
683 | addWidBool(i18n("Set agenda to current time on change"), | 691 | addWidBool(i18n("Set agenda to current time on change"), |
684 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 692 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
685 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 693 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
686 | 694 | ||
687 | dummy = | 695 | dummy = |
688 | addWidBool(i18n("Listview uses monthly timespan"), | 696 | addWidBool(i18n("Listview uses monthly timespan"), |
689 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 697 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
690 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 698 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
691 | dummy = | 699 | dummy = |
692 | addWidBool(i18n("Highlight selection in Time Edit"), | 700 | addWidBool(i18n("Highlight selection in Time Edit"), |
693 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 701 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
694 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 702 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
695 | 703 | ||
696 | 704 | ||
697 | 705 | ||
698 | 706 | ||
699 | 707 | ||
700 | topFrame = addPage(i18n("Month View"),0,0); | 708 | topFrame = addPage(i18n("Month View"),0,0); |
701 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 709 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
702 | 710 | ||
703 | topLayout = new QGridLayout(topFrame,5,1); | 711 | topLayout = new QGridLayout(topFrame,5,1); |
704 | topLayout->setSpacing(spacingHint()); | 712 | topLayout->setSpacing(spacingHint()); |
705 | topLayout->setMargin(marginHint()); | 713 | topLayout->setMargin(marginHint()); |
706 | ii = 0; | 714 | ii = 0; |
707 | QLabel *lab; | 715 | QLabel *lab; |
708 | QHBox *habo = new QHBox( topFrame ); | 716 | QHBox *habo = new QHBox( topFrame ); |
709 | if ( QApplication::desktop()->width() < 320 ) { | 717 | if ( QApplication::desktop()->width() < 320 ) { |
710 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 718 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
711 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 719 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
712 | ii++; | 720 | ii++; |
713 | 721 | ||
714 | } else { | 722 | } else { |
715 | new QLabel ( i18n("Show events that recur "), habo ); | 723 | new QLabel ( i18n("Show events that recur "), habo ); |
716 | 724 | ||
717 | } | 725 | } |
718 | dailyRecur = | 726 | dailyRecur = |
719 | addWidBool(i18n("daily"), | 727 | addWidBool(i18n("daily"), |
720 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 728 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
721 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 729 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
722 | 730 | ||
723 | weeklyRecur = | 731 | weeklyRecur = |
724 | addWidBool(i18n("weekly"), | 732 | addWidBool(i18n("weekly"), |
725 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 733 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
726 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 734 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
727 | ii++; | 735 | ii++; |
728 | 736 | ||
729 | 737 | ||
730 | habo = new QHBox( topFrame ); | 738 | habo = new QHBox( topFrame ); |
731 | if ( QApplication::desktop()->width() < 320 ) { | 739 | if ( QApplication::desktop()->width() < 320 ) { |
732 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 740 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
733 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 741 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
734 | ii++; | 742 | ii++; |
735 | 743 | ||
736 | } else { | 744 | } else { |
737 | new QLabel ( i18n("Show in every cell "), habo ); | 745 | new QLabel ( i18n("Show in every cell "), habo ); |
738 | } | 746 | } |
739 | weeklyRecur = | 747 | weeklyRecur = |
740 | addWidBool(i18n("short month"), | 748 | addWidBool(i18n("short month"), |
741 | &(KOPrefs::instance()->mMonthShowShort),habo); | 749 | &(KOPrefs::instance()->mMonthShowShort),habo); |
742 | weeklyRecur = | 750 | weeklyRecur = |
743 | addWidBool(i18n("icons"), | 751 | addWidBool(i18n("icons"), |
744 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 752 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
745 | 753 | ||
746 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 754 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
747 | ii++; | 755 | ii++; |
748 | #ifdef DESKTOP_VERSION | 756 | #ifdef DESKTOP_VERSION |
749 | KPrefsDialogWidBool *enableMonthScroll = | 757 | KPrefsDialogWidBool *enableMonthScroll = |
750 | addWidBool(i18n("Enable scrollbars in month view cells"), | 758 | addWidBool(i18n("Enable scrollbars in month view cells"), |
751 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 759 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
752 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 760 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
753 | #endif | 761 | #endif |
754 | 762 | ||
755 | dummy = | 763 | dummy = |
756 | addWidBool(i18n("Show Sat/Sun together"), | 764 | addWidBool(i18n("Show Sat/Sun together"), |
757 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 765 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
758 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 766 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
759 | 767 | ||
760 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 768 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
761 | addWidBool(i18n("Month view uses category colors"), | 769 | addWidBool(i18n("Month view uses category colors"), |
762 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 770 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
763 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 771 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
764 | 772 | ||
765 | dummy = | 773 | dummy = |
766 | addWidBool(i18n("Categorie colors are applied to text"), | 774 | addWidBool(i18n("Categorie colors are applied to text"), |
767 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 775 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
768 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 776 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
769 | coloredCategoriesInMonthView = | 777 | coloredCategoriesInMonthView = |
770 | addWidBool(i18n("Month view uses day colors"), | 778 | addWidBool(i18n("Month view uses day colors"), |
771 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 779 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
772 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 780 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
773 | 781 | ||
774 | KPrefsDialogWidColor *holidayColor = | 782 | KPrefsDialogWidColor *holidayColor = |
775 | addWidColor(i18n("Day color odd months"), | 783 | addWidColor(i18n("Day color odd months"), |
776 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 784 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
777 | topLayout->addWidget(holidayColor->label(),ii,0); | 785 | topLayout->addWidget(holidayColor->label(),ii,0); |
778 | topLayout->addWidget(holidayColor->button(),ii++,1); | 786 | topLayout->addWidget(holidayColor->button(),ii++,1); |
779 | 787 | ||
780 | holidayColor = | 788 | holidayColor = |
781 | addWidColor(i18n("Day color even months"), | 789 | addWidColor(i18n("Day color even months"), |
782 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 790 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
783 | topLayout->addWidget(holidayColor->label(),ii,0); | 791 | topLayout->addWidget(holidayColor->label(),ii,0); |
784 | topLayout->addWidget(holidayColor->button(),ii++,1); | 792 | topLayout->addWidget(holidayColor->button(),ii++,1); |
785 | 793 | ||
786 | 794 | ||
787 | holidayColor = | 795 | holidayColor = |
788 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 796 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
789 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 797 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
790 | topLayout->addWidget(holidayColor->label(),ii,0); | 798 | topLayout->addWidget(holidayColor->label(),ii,0); |
791 | topLayout->addWidget(holidayColor->button(),ii++,1); | 799 | topLayout->addWidget(holidayColor->button(),ii++,1); |
792 | // *********************** What'sNext View | 800 | // *********************** What'sNext View |
793 | topFrame = addPage(i18n("What's Next View"),0,0); | 801 | topFrame = addPage(i18n("What's Next View"),0,0); |
794 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 802 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
795 | 803 | ||
796 | topLayout = new QGridLayout(topFrame,4,1); | 804 | topLayout = new QGridLayout(topFrame,4,1); |
797 | topLayout->setSpacing(spacingHint()); | 805 | topLayout->setSpacing(spacingHint()); |
798 | topLayout->setMargin(marginHint()); | 806 | topLayout->setMargin(marginHint()); |
799 | ii = 0; | 807 | ii = 0; |
800 | KPrefsDialogWidBool *passwdk = | 808 | KPrefsDialogWidBool *passwdk = |
801 | 809 | ||
802 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), | 810 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), |
803 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); | 811 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); |
804 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 812 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
805 | passwdk = | 813 | passwdk = |
806 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 814 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
807 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 815 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
808 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 816 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
809 | 817 | ||
810 | passwdk = | 818 | passwdk = |
811 | addWidBool(i18n("Show location in What's Next view"), | 819 | addWidBool(i18n("Show location in What's Next view"), |
812 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 820 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
813 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 821 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
814 | 822 | ||
815 | passwdk = | 823 | passwdk = |
816 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), | 824 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), |
817 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 825 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
818 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 826 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
819 | passwdk = | 827 | passwdk = |
820 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), | 828 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), |
821 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 829 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
822 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 830 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
823 | 831 | ||
824 | 832 | ||
825 | 833 | ||
826 | 834 | ||
827 | // *********************** Todo View | 835 | // *********************** Todo View |
828 | 836 | ||
829 | topFrame = addPage(i18n("Todo View"),0,0); | 837 | topFrame = addPage(i18n("Todo View"),0,0); |
830 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 838 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
831 | 839 | ||
832 | topLayout = new QGridLayout(topFrame,4,1); | 840 | topLayout = new QGridLayout(topFrame,4,1); |
833 | topLayout->setSpacing(spacingHint()); | 841 | topLayout->setSpacing(spacingHint()); |
834 | topLayout->setMargin(marginHint()); | 842 | topLayout->setMargin(marginHint()); |
835 | ii = 0; | 843 | ii = 0; |
844 | dummy = | ||
845 | addWidBool(i18n("Hide not running Todos in To-do view"), | ||
846 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | ||
847 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
848 | |||
836 | 849 | ||
837 | KPrefsDialogWidBool *showCompletedTodo = | 850 | KPrefsDialogWidBool *showCompletedTodo = |
838 | addWidBool(i18n("To-do view shows completed Todos"), | 851 | addWidBool(i18n("To-do view shows completed Todos"), |
839 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 852 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
840 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 853 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
841 | dummy = | 854 | dummy = |
842 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 855 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
843 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 856 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
844 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 857 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
845 | 858 | ||
846 | dummy = | 859 | dummy = |
847 | addWidBool(i18n("Small To-do view uses smaller font"), | 860 | addWidBool(i18n("Small To-do view uses smaller font"), |
848 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 861 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
849 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 862 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
850 | 863 | ||
851 | 864 | ||
852 | 865 | ||
853 | dummy = | 866 | dummy = |
854 | addWidBool(i18n("Todo view uses category colors"), | 867 | addWidBool(i18n("Todo view uses category colors"), |
855 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 868 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
856 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 869 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
857 | 870 | ||
858 | 871 | ||
859 | QWidget* wid = new QWidget( topFrame ); | 872 | QWidget* wid = new QWidget( topFrame ); |
860 | // Todo due today color | 873 | // Todo due today color |
861 | KPrefsDialogWidColor *todoDueTodayColor = | 874 | KPrefsDialogWidColor *todoDueTodayColor = |
862 | addWidColor(i18n("Todo due today color:"), | 875 | addWidColor(i18n("Todo due today color:"), |
863 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 876 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
864 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 877 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
865 | widLayout->addWidget( todoDueTodayColor->label() ); | 878 | widLayout->addWidget( todoDueTodayColor->label() ); |
866 | widLayout->addWidget( todoDueTodayColor->button() ); | 879 | widLayout->addWidget( todoDueTodayColor->button() ); |
867 | topLayout->addWidget(wid,ii++,0); | 880 | topLayout->addWidget(wid,ii++,0); |
868 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 881 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
869 | 882 | ||
870 | // Todo overdue color | 883 | // Todo overdue color |
871 | wid = new QWidget( topFrame ); | 884 | wid = new QWidget( topFrame ); |
872 | widLayout = new QHBoxLayout(wid); | 885 | widLayout = new QHBoxLayout(wid); |
873 | KPrefsDialogWidColor *todoOverdueColor = | 886 | KPrefsDialogWidColor *todoOverdueColor = |
874 | addWidColor(i18n("Todo overdue color:"), | 887 | addWidColor(i18n("Todo overdue color:"), |
875 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 888 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
876 | widLayout->addWidget(todoOverdueColor->label()); | 889 | widLayout->addWidget(todoOverdueColor->label()); |
877 | widLayout->addWidget(todoOverdueColor->button()); | 890 | widLayout->addWidget(todoOverdueColor->button()); |
878 | topLayout->addWidget(wid,ii++,0); | 891 | topLayout->addWidget(wid,ii++,0); |
879 | 892 | ||
880 | dummy = | 893 | dummy = |
881 | addWidBool(i18n("Colors are applied to text"), | 894 | addWidBool(i18n("Colors are applied to text"), |
882 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 895 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
883 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 896 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
884 | 897 | ||
885 | dummy = | 898 | dummy = |
886 | addWidBool(i18n("Allday Agenda view shows todos"), | 899 | addWidBool(i18n("Allday Agenda view shows todos"), |
887 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 900 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
888 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 901 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
889 | 902 | ||
890 | 903 | ||
891 | 904 | ||
892 | 905 | ||
893 | topFrame = addPage(i18n("Alarm"),0,0); | 906 | topFrame = addPage(i18n("Alarm"),0,0); |
894 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 907 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
895 | 908 | ||
896 | topLayout = new QGridLayout(topFrame,2,1); | 909 | topLayout = new QGridLayout(topFrame,2,1); |
897 | topLayout->setSpacing(spacingHint()); | 910 | topLayout->setSpacing(spacingHint()); |
898 | topLayout->setMargin(marginHint()); | 911 | topLayout->setMargin(marginHint()); |
899 | int iii = 0; | 912 | int iii = 0; |
900 | 913 | ||
901 | dummy = | 914 | dummy = |
902 | addWidBool(i18n("Use internal alarm notification"), | 915 | addWidBool(i18n("Use internal alarm notification"), |
903 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | 916 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); |
904 | topLayout->addWidget(dummy->checkBox(),iii++,0); | 917 | topLayout->addWidget(dummy->checkBox(),iii++,0); |
905 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | 918 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); |
906 | 919 | ||
907 | topLayout->addWidget(lab ,iii++,0); | 920 | topLayout->addWidget(lab ,iii++,0); |
908 | #ifndef DESKTOP_VERSION | 921 | #ifndef DESKTOP_VERSION |
909 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 922 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
910 | #else | 923 | #else |
911 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 924 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
912 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 925 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
913 | #endif | 926 | #endif |
914 | 927 | ||
915 | QHBox* dummyBox = new QHBox(topFrame); | 928 | QHBox* dummyBox = new QHBox(topFrame); |
916 | new QLabel(i18n("Play beeps count:"),dummyBox); | 929 | new QLabel(i18n("Play beeps count:"),dummyBox); |
917 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 930 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
918 | topLayout->addWidget(dummyBox,iii++,0); | 931 | topLayout->addWidget(dummyBox,iii++,0); |
919 | 932 | ||
920 | dummyBox = new QHBox(topFrame); | 933 | dummyBox = new QHBox(topFrame); |
921 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 934 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
922 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 935 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
923 | topLayout->addWidget(dummyBox,iii++,0); | 936 | topLayout->addWidget(dummyBox,iii++,0); |
924 | 937 | ||
925 | dummyBox = new QHBox(topFrame); | 938 | dummyBox = new QHBox(topFrame); |
926 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 939 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
927 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 940 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
928 | topLayout->addWidget(dummyBox,iii++,0); | 941 | topLayout->addWidget(dummyBox,iii++,0); |
929 | 942 | ||
930 | dummyBox = new QHBox(topFrame); | 943 | dummyBox = new QHBox(topFrame); |
931 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 944 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
932 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 945 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
933 | topLayout->addWidget(dummyBox,iii++,0); | 946 | topLayout->addWidget(dummyBox,iii++,0); |
934 | 947 | ||
935 | 948 | ||
936 | 949 | ||
937 | 950 | ||
938 | 951 | ||
939 | 952 | ||
940 | 953 | ||
941 | QHBox* hbo = new QHBox ( topFrame ); | 954 | QHBox* hbo = new QHBox ( topFrame ); |
942 | mDefaultAlarmFile = new QLineEdit(hbo); | 955 | mDefaultAlarmFile = new QLineEdit(hbo); |
943 | QPushButton * loadTemplate = new QPushButton(hbo); | 956 | QPushButton * loadTemplate = new QPushButton(hbo); |
944 | QPixmap icon; | 957 | QPixmap icon; |
945 | if ( QApplication::desktop()->width() < 321 ) | 958 | if ( QApplication::desktop()->width() < 321 ) |
946 | icon = SmallIcon("fileimport16"); | 959 | icon = SmallIcon("fileimport16"); |
947 | else | 960 | else |
948 | icon = SmallIcon("fileimport"); | 961 | icon = SmallIcon("fileimport"); |
949 | loadTemplate->setIconSet (icon ) ; | 962 | loadTemplate->setIconSet (icon ) ; |
950 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | 963 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); |
951 | int size = loadTemplate->sizeHint().height(); | 964 | int size = loadTemplate->sizeHint().height(); |
952 | loadTemplate->setFixedSize( size, size ); | 965 | loadTemplate->setFixedSize( size, size ); |
953 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | 966 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); |
954 | // topLayout->addWidget(lab ,iii++,0); | 967 | // topLayout->addWidget(lab ,iii++,0); |
955 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); | 968 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); |
956 | topLayout->addWidget(lab ,iii++,0); | 969 | topLayout->addWidget(lab ,iii++,0); |
957 | topLayout->addWidget(hbo,iii++,0); | 970 | topLayout->addWidget(hbo,iii++,0); |
958 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); | 971 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); |
959 | 972 | ||
960 | // topLayout->addWidget(lab ,iii++,0); | 973 | // topLayout->addWidget(lab ,iii++,0); |
961 | // #ifndef DESKTOP_VERSION | 974 | // #ifndef DESKTOP_VERSION |
962 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 975 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
963 | // #else | 976 | // #else |
964 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 977 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
965 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 978 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
966 | // #endif | 979 | // #endif |
967 | 980 | ||
968 | 981 | ||
969 | } | 982 | } |
970 | 983 | ||
971 | void KOPrefsDialog::selectSoundFile() | 984 | void KOPrefsDialog::selectSoundFile() |
972 | { | 985 | { |
973 | QString fileName = mDefaultAlarmFile->text(); | 986 | QString fileName = mDefaultAlarmFile->text(); |
974 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); | 987 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); |
975 | if ( fileName.length() > 0 ) | 988 | if ( fileName.length() > 0 ) |
976 | mDefaultAlarmFile->setText( fileName ); | 989 | mDefaultAlarmFile->setText( fileName ); |
977 | } | 990 | } |
978 | void KOPrefsDialog::setupFontsTab() | 991 | void KOPrefsDialog::setupFontsTab() |
979 | { | 992 | { |
980 | 993 | ||
981 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 994 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
982 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 995 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
983 | 996 | ||
984 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 997 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
985 | topLayout->setSpacing(1); | 998 | topLayout->setSpacing(1); |
986 | topLayout->setMargin(3); | 999 | topLayout->setMargin(3); |
987 | KPrefsDialogWidFont * tVFont; | 1000 | KPrefsDialogWidFont * tVFont; |
988 | int i = 0; | 1001 | int i = 0; |
989 | KPrefsDialogWidFont *timeLabelsFont = | 1002 | KPrefsDialogWidFont *timeLabelsFont = |
990 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | 1003 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), |
991 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); | 1004 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); |
992 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1005 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
993 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1006 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
994 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1007 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
995 | ++i; | 1008 | ++i; |
996 | 1009 | ||
997 | 1010 | ||
998 | timeLabelsFont = | 1011 | timeLabelsFont = |
999 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), | 1012 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), |
1000 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); | 1013 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); |
1001 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1014 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1002 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1015 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1003 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1016 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1004 | ++i; | 1017 | ++i; |
1005 | 1018 | ||
1006 | KPrefsDialogWidFont *timeBarFont = | 1019 | KPrefsDialogWidFont *timeBarFont = |
1007 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), | 1020 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), |
1008 | &(KOPrefs::instance()->mTimeBarFont),topFrame); | 1021 | &(KOPrefs::instance()->mTimeBarFont),topFrame); |
1009 | topLayout->addWidget(timeBarFont->label(),i,0); | 1022 | topLayout->addWidget(timeBarFont->label(),i,0); |
1010 | topLayout->addWidget(timeBarFont->preview(),i,1); | 1023 | topLayout->addWidget(timeBarFont->preview(),i,1); |
1011 | topLayout->addWidget(timeBarFont->button(),i,2); | 1024 | topLayout->addWidget(timeBarFont->button(),i,2); |
1012 | ++i; | 1025 | ++i; |
1013 | 1026 | ||
1014 | 1027 | ||
1015 | KPrefsDialogWidFont *marcusBainsFont = | 1028 | KPrefsDialogWidFont *marcusBainsFont = |
1016 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), | 1029 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), |
1017 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); | 1030 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); |
1018 | topLayout->addWidget(marcusBainsFont->label(),i,0); | 1031 | topLayout->addWidget(marcusBainsFont->label(),i,0); |
1019 | topLayout->addWidget(marcusBainsFont->preview(),i,1); | 1032 | topLayout->addWidget(marcusBainsFont->preview(),i,1); |
1020 | topLayout->addWidget(marcusBainsFont->button(),i,2); | 1033 | topLayout->addWidget(marcusBainsFont->button(),i,2); |
1021 | ++i; | 1034 | ++i; |
1022 | 1035 | ||
1023 | tVFont = | 1036 | tVFont = |
1024 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), | 1037 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), |
1025 | &(KOPrefs::instance()->mEventViewFont),topFrame); | 1038 | &(KOPrefs::instance()->mEventViewFont),topFrame); |
1026 | topLayout->addWidget(tVFont->label(),i,0); | 1039 | topLayout->addWidget(tVFont->label(),i,0); |
1027 | topLayout->addWidget(tVFont->preview(),i,1); | 1040 | topLayout->addWidget(tVFont->preview(),i,1); |
1028 | topLayout->addWidget(tVFont->button(),i,2); | 1041 | topLayout->addWidget(tVFont->button(),i,2); |
1029 | ++i; | 1042 | ++i; |
1030 | 1043 | ||
1031 | 1044 | ||
1032 | 1045 | ||
1033 | tVFont = | 1046 | tVFont = |
1034 | addWidFont(i18n("Details"),i18n("EditorBox:"), | 1047 | addWidFont(i18n("Details"),i18n("EditorBox:"), |
1035 | &(KOPrefs::instance()->mEditBoxFont),topFrame); | 1048 | &(KOPrefs::instance()->mEditBoxFont),topFrame); |
1036 | topLayout->addWidget(tVFont->label(),i,0); | 1049 | topLayout->addWidget(tVFont->label(),i,0); |
1037 | topLayout->addWidget(tVFont->preview(),i,1); | 1050 | topLayout->addWidget(tVFont->preview(),i,1); |
1038 | topLayout->addWidget(tVFont->button(),i,2); | 1051 | topLayout->addWidget(tVFont->button(),i,2); |
1039 | ++i; | 1052 | ++i; |
1040 | 1053 | ||
1041 | 1054 | ||
1042 | 1055 | ||
1043 | topLayout->setColStretch(1,1); | 1056 | topLayout->setColStretch(1,1); |
1044 | topLayout->setRowStretch(4,1); | 1057 | topLayout->setRowStretch(4,1); |
1045 | 1058 | ||
1046 | 1059 | ||
1047 | i = 0; | 1060 | i = 0; |
1048 | topFrame = addPage(i18n("View Fonts"),0, | 1061 | topFrame = addPage(i18n("View Fonts"),0, |
1049 | DesktopIcon("fonts",KIcon::SizeMedium)); | 1062 | DesktopIcon("fonts",KIcon::SizeMedium)); |
1050 | 1063 | ||
1051 | topLayout = new QGridLayout(topFrame,7,3); | 1064 | topLayout = new QGridLayout(topFrame,7,3); |
1052 | topLayout->setSpacing(1); | 1065 | topLayout->setSpacing(1); |
1053 | topLayout->setMargin(3); | 1066 | topLayout->setMargin(3); |
1054 | 1067 | ||
1055 | tVFont = | 1068 | tVFont = |
1056 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | 1069 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), |
1057 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | 1070 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); |
1058 | topLayout->addWidget(tVFont->label(),i,0); | 1071 | topLayout->addWidget(tVFont->label(),i,0); |
1059 | topLayout->addWidget(tVFont->preview(),i,1); | 1072 | topLayout->addWidget(tVFont->preview(),i,1); |
1060 | topLayout->addWidget(tVFont->button(),i,2); | 1073 | topLayout->addWidget(tVFont->button(),i,2); |
1061 | ++i; | 1074 | ++i; |
1062 | KPrefsDialogWidFont *agendaViewFont = | 1075 | KPrefsDialogWidFont *agendaViewFont = |
1063 | addWidFont(i18n("Event text"),i18n("Agenda view:"), | 1076 | addWidFont(i18n("Event text"),i18n("Agenda view:"), |
1064 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); | 1077 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); |
1065 | topLayout->addWidget(agendaViewFont->label(),i,0); | 1078 | topLayout->addWidget(agendaViewFont->label(),i,0); |
1066 | topLayout->addWidget(agendaViewFont->preview(),i,1); | 1079 | topLayout->addWidget(agendaViewFont->preview(),i,1); |
1067 | topLayout->addWidget(agendaViewFont->button(),i,2); | 1080 | topLayout->addWidget(agendaViewFont->button(),i,2); |
1068 | ++i; | 1081 | ++i; |
1069 | 1082 | ||
1070 | 1083 | ||
1071 | KPrefsDialogWidFont *monthViewFont = | 1084 | KPrefsDialogWidFont *monthViewFont = |
1072 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), | 1085 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), |
1073 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); | 1086 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); |
1074 | topLayout->addWidget(monthViewFont->label(),i,0); | 1087 | topLayout->addWidget(monthViewFont->label(),i,0); |
1075 | topLayout->addWidget(monthViewFont->preview(),i,1); | 1088 | topLayout->addWidget(monthViewFont->preview(),i,1); |
1076 | topLayout->addWidget(monthViewFont->button(),i,2); | 1089 | topLayout->addWidget(monthViewFont->button(),i,2); |
1077 | ++i; | 1090 | ++i; |
1078 | 1091 | ||
1079 | 1092 | ||
1080 | KPrefsDialogWidFont *lVFont = | 1093 | KPrefsDialogWidFont *lVFont = |
1081 | addWidFont(i18n("Event"),i18n("List View:"), | 1094 | addWidFont(i18n("Event"),i18n("List View:"), |
1082 | &(KOPrefs::instance()->mListViewFont),topFrame); | 1095 | &(KOPrefs::instance()->mListViewFont),topFrame); |
1083 | topLayout->addWidget(lVFont->label(),i,0); | 1096 | topLayout->addWidget(lVFont->label(),i,0); |
1084 | topLayout->addWidget(lVFont->preview(),i,1); | 1097 | topLayout->addWidget(lVFont->preview(),i,1); |
1085 | topLayout->addWidget(lVFont->button(),i,2); | 1098 | topLayout->addWidget(lVFont->button(),i,2); |
1086 | ++i; | 1099 | ++i; |
1087 | 1100 | ||
1088 | 1101 | ||
1089 | tVFont = | 1102 | tVFont = |
1090 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), | 1103 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), |
1091 | &(KOPrefs::instance()->mTodoViewFont),topFrame); | 1104 | &(KOPrefs::instance()->mTodoViewFont),topFrame); |
1092 | topLayout->addWidget(tVFont->label(),i,0); | 1105 | topLayout->addWidget(tVFont->label(),i,0); |
1093 | topLayout->addWidget(tVFont->preview(),i,1); | 1106 | topLayout->addWidget(tVFont->preview(),i,1); |
1094 | topLayout->addWidget(tVFont->button(),i,2); | 1107 | topLayout->addWidget(tVFont->button(),i,2); |
1095 | ++i; | 1108 | ++i; |
1096 | 1109 | ||
1097 | 1110 | ||
1098 | tVFont = | 1111 | tVFont = |
1099 | addWidFont(i18n("Today"),i18n("JournalView:"), | 1112 | addWidFont(i18n("Today"),i18n("JournalView:"), |
1100 | &(KOPrefs::instance()->mJornalViewFont),topFrame); | 1113 | &(KOPrefs::instance()->mJornalViewFont),topFrame); |
1101 | topLayout->addWidget(tVFont->label(),i,0); | 1114 | topLayout->addWidget(tVFont->label(),i,0); |
1102 | topLayout->addWidget(tVFont->preview(),i,1); | 1115 | topLayout->addWidget(tVFont->preview(),i,1); |
1103 | topLayout->addWidget(tVFont->button(),i,2); | 1116 | topLayout->addWidget(tVFont->button(),i,2); |
1104 | ++i; | 1117 | ++i; |
1105 | 1118 | ||
1106 | 1119 | ||
1107 | 1120 | ||
1108 | 1121 | ||
1109 | topLayout->setColStretch(1,1); | 1122 | topLayout->setColStretch(1,1); |
1110 | topLayout->setRowStretch(4,1); | 1123 | topLayout->setRowStretch(4,1); |
1111 | 1124 | ||
1112 | 1125 | ||
1113 | 1126 | ||
1114 | 1127 | ||
1115 | } | 1128 | } |
1116 | 1129 | ||
1117 | void KOPrefsDialog::setupColorsTab() | 1130 | void KOPrefsDialog::setupColorsTab() |
1118 | { | 1131 | { |
1119 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | 1132 | QFrame *topFrame = addPage(i18n("Colors"),0,0); |
1120 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1133 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1121 | 1134 | ||
1122 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1135 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
1123 | // topLayout->setSpacing(spacingHint()); | 1136 | // topLayout->setSpacing(spacingHint()); |
1124 | // topLayout->setMargin(marginHint()); | 1137 | // topLayout->setMargin(marginHint()); |
1125 | 1138 | ||
1126 | topLayout->setSpacing(2); | 1139 | topLayout->setSpacing(2); |
1127 | topLayout->setMargin(3); | 1140 | topLayout->setMargin(3); |
1128 | 1141 | ||
1129 | int ii = 1; | 1142 | int ii = 1; |
1130 | QGroupBox *categoryGroup ; | 1143 | QGroupBox *categoryGroup ; |
1131 | 1144 | ||
1132 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | 1145 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), |
1133 | topFrame); | 1146 | topFrame); |
1134 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | 1147 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); |
1135 | 1148 | ||
1136 | mCategoryCombo = new QComboBox(categoryGroup); | 1149 | mCategoryCombo = new QComboBox(categoryGroup); |
1137 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1150 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1138 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | 1151 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); |
1139 | 1152 | ||
1140 | mCategoryButton = new KColorButton(categoryGroup); | 1153 | mCategoryButton = new KColorButton(categoryGroup); |
1141 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); | 1154 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); |
1142 | updateCategoryColor(); | 1155 | updateCategoryColor(); |
1143 | 1156 | ||
1144 | 1157 | ||
1145 | // Holiday Color | 1158 | // Holiday Color |
1146 | 1159 | ||
1147 | KPrefsDialogWidColor *holidayColor = | 1160 | KPrefsDialogWidColor *holidayColor = |
1148 | addWidColor(i18n("Holiday color:"), | 1161 | addWidColor(i18n("Holiday color:"), |
1149 | &(KOPrefs::instance()->mHolidayColor),topFrame); | 1162 | &(KOPrefs::instance()->mHolidayColor),topFrame); |
1150 | topLayout->addWidget(holidayColor->label(),ii,0); | 1163 | topLayout->addWidget(holidayColor->label(),ii,0); |
1151 | topLayout->addWidget(holidayColor->button(),ii++,1); | 1164 | topLayout->addWidget(holidayColor->button(),ii++,1); |
1152 | 1165 | ||
1153 | // Highlight Color | 1166 | // Highlight Color |
1154 | KPrefsDialogWidColor *highlightColor = | 1167 | KPrefsDialogWidColor *highlightColor = |
1155 | addWidColor(i18n("Highlight color:"), | 1168 | addWidColor(i18n("Highlight color:"), |
1156 | &(KOPrefs::instance()->mHighlightColor),topFrame); | 1169 | &(KOPrefs::instance()->mHighlightColor),topFrame); |
1157 | topLayout->addWidget(highlightColor->label(),ii,0); | 1170 | topLayout->addWidget(highlightColor->label(),ii,0); |
1158 | topLayout->addWidget(highlightColor->button(),ii++,1); | 1171 | topLayout->addWidget(highlightColor->button(),ii++,1); |
1159 | 1172 | ||
1160 | // Event color | 1173 | // Event color |
1161 | KPrefsDialogWidColor *eventColor = | 1174 | KPrefsDialogWidColor *eventColor = |
1162 | addWidColor(i18n("Default event color:"), | 1175 | addWidColor(i18n("Default event color:"), |
1163 | &(KOPrefs::instance()->mEventColor),topFrame); | 1176 | &(KOPrefs::instance()->mEventColor),topFrame); |
1164 | topLayout->addWidget(eventColor->label(),ii,0); | 1177 | topLayout->addWidget(eventColor->label(),ii,0); |
1165 | topLayout->addWidget(eventColor->button(),ii++,1); | 1178 | topLayout->addWidget(eventColor->button(),ii++,1); |
1166 | 1179 | ||
1167 | // agenda view background color | 1180 | // agenda view background color |
1168 | KPrefsDialogWidColor *agendaBgColor = | 1181 | KPrefsDialogWidColor *agendaBgColor = |
1169 | addWidColor(i18n("Agenda view background color:"), | 1182 | addWidColor(i18n("Agenda view background color:"), |
1170 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); | 1183 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); |
1171 | topLayout->addWidget(agendaBgColor->label(),ii,0); | 1184 | topLayout->addWidget(agendaBgColor->label(),ii,0); |
1172 | topLayout->addWidget(agendaBgColor->button(),ii++,1); | 1185 | topLayout->addWidget(agendaBgColor->button(),ii++,1); |
1173 | 1186 | ||
1174 | // working hours color | 1187 | // working hours color |
1175 | KPrefsDialogWidColor *workingHoursColor = | 1188 | KPrefsDialogWidColor *workingHoursColor = |
1176 | addWidColor(i18n("Working hours color:"), | 1189 | addWidColor(i18n("Working hours color:"), |
1177 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); | 1190 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); |
1178 | topLayout->addWidget(workingHoursColor->label(),ii,0); | 1191 | topLayout->addWidget(workingHoursColor->label(),ii,0); |
1179 | topLayout->addWidget(workingHoursColor->button(),ii++,1); | 1192 | topLayout->addWidget(workingHoursColor->button(),ii++,1); |
1180 | 1193 | ||
1181 | KPrefsDialogWidBool *sb = | 1194 | KPrefsDialogWidBool *sb = |
1182 | addWidBool(i18n("Use colors for application:"), | 1195 | addWidBool(i18n("Use colors for application:"), |
1183 | &(KOPrefs::instance()->mUseAppColors),topFrame); | 1196 | &(KOPrefs::instance()->mUseAppColors),topFrame); |
1184 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); | 1197 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); |
1185 | 1198 | ||
1186 | ii++; | 1199 | ii++; |
1187 | KPrefsDialogWidColor * workingHoursColor1 = | 1200 | KPrefsDialogWidColor * workingHoursColor1 = |
1188 | addWidColor(i18n("Buttons, menus, etc.:"), | 1201 | addWidColor(i18n("Buttons, menus, etc.:"), |
1189 | &(KOPrefs::instance()->mAppColor1),topFrame); | 1202 | &(KOPrefs::instance()->mAppColor1),topFrame); |
1190 | topLayout->addWidget(workingHoursColor1->label(),ii,0); | 1203 | topLayout->addWidget(workingHoursColor1->label(),ii,0); |
1191 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); | 1204 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); |
1192 | 1205 | ||
1193 | KPrefsDialogWidColor * workingHoursColor2 = | 1206 | KPrefsDialogWidColor * workingHoursColor2 = |
1194 | addWidColor(i18n("Frames, labels, etc.:"), | 1207 | addWidColor(i18n("Frames, labels, etc.:"), |
1195 | &(KOPrefs::instance()->mAppColor2),topFrame); | 1208 | &(KOPrefs::instance()->mAppColor2),topFrame); |
1196 | topLayout->addWidget(workingHoursColor2->label(),ii,0); | 1209 | topLayout->addWidget(workingHoursColor2->label(),ii,0); |
1197 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); | 1210 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); |
1198 | 1211 | ||
1199 | 1212 | ||
1200 | 1213 | ||
1201 | } | 1214 | } |
1202 | 1215 | ||
1203 | void KOPrefsDialog::setCategoryColor() | 1216 | void KOPrefsDialog::setCategoryColor() |
1204 | { | 1217 | { |
1205 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); | 1218 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); |
1206 | } | 1219 | } |
1207 | 1220 | ||
1208 | void KOPrefsDialog::updateCategoryColor() | 1221 | void KOPrefsDialog::updateCategoryColor() |
1209 | { | 1222 | { |
1210 | QString cat = mCategoryCombo->currentText(); | 1223 | QString cat = mCategoryCombo->currentText(); |
1211 | QColor *color = mCategoryDict.find(cat); | 1224 | QColor *color = mCategoryDict.find(cat); |
1212 | if (!color) { | 1225 | if (!color) { |
1213 | color = KOPrefs::instance()->categoryColor(cat); | 1226 | color = KOPrefs::instance()->categoryColor(cat); |
1214 | } | 1227 | } |
1215 | if (color) { | 1228 | if (color) { |
1216 | mCategoryButton->setColor(*color); | 1229 | mCategoryButton->setColor(*color); |
1217 | } | 1230 | } |
1218 | } | 1231 | } |
1219 | 1232 | ||
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 9cafc60..5d7b066 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1,1119 +1,1153 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qcursor.h> | 26 | #include <qcursor.h> |
27 | 27 | ||
28 | #include <qvbox.h> | 28 | #include <qvbox.h> |
29 | #include <kdebug.h> | 29 | #include <kdebug.h> |
30 | #include "koprefs.h" | 30 | #include "koprefs.h" |
31 | #include <klocale.h> | 31 | #include <klocale.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | #include <kiconloader.h> | 33 | #include <kiconloader.h> |
34 | #include <kmessagebox.h> | 34 | #include <kmessagebox.h> |
35 | 35 | ||
36 | #include <libkcal/icaldrag.h> | 36 | #include <libkcal/icaldrag.h> |
37 | #include <libkcal/vcaldrag.h> | 37 | #include <libkcal/vcaldrag.h> |
38 | #include <libkcal/calfilter.h> | 38 | #include <libkcal/calfilter.h> |
39 | #include <libkcal/dndfactory.h> | 39 | #include <libkcal/dndfactory.h> |
40 | #include <libkcal/calendarresources.h> | 40 | #include <libkcal/calendarresources.h> |
41 | #include <libkcal/resourcecalendar.h> | 41 | #include <libkcal/resourcecalendar.h> |
42 | #include <kresources/resourceselectdialog.h> | 42 | #include <kresources/resourceselectdialog.h> |
43 | #ifndef DESKTOP_VERSION | 43 | #ifndef DESKTOP_VERSION |
44 | #include <qpe/qpeapplication.h> | 44 | #include <qpe/qpeapplication.h> |
45 | #else | 45 | #else |
46 | #include <qapplication.h> | 46 | #include <qapplication.h> |
47 | #endif | 47 | #endif |
48 | #ifndef KORG_NOPRINTER | 48 | #ifndef KORG_NOPRINTER |
49 | #include "calprinter.h" | 49 | #include "calprinter.h" |
50 | #endif | 50 | #endif |
51 | #include "docprefs.h" | 51 | #include "docprefs.h" |
52 | 52 | ||
53 | #include "kotodoview.h" | 53 | #include "kotodoview.h" |
54 | using namespace KOrg; | 54 | using namespace KOrg; |
55 | 55 | ||
56 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, | 56 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, |
57 | const char *name) : | 57 | const char *name) : |
58 | KListView(parent,name) | 58 | KListView(parent,name) |
59 | { | 59 | { |
60 | mName = QString ( name ); | 60 | mName = QString ( name ); |
61 | mCalendar = calendar; | 61 | mCalendar = calendar; |
62 | #ifndef DESKTOP_VERSION | 62 | #ifndef DESKTOP_VERSION |
63 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 63 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
64 | #endif | 64 | #endif |
65 | mOldCurrent = 0; | 65 | mOldCurrent = 0; |
66 | mMousePressed = false; | 66 | mMousePressed = false; |
67 | 67 | ||
68 | setAcceptDrops(true); | 68 | setAcceptDrops(true); |
69 | viewport()->setAcceptDrops(true); | 69 | viewport()->setAcceptDrops(true); |
70 | int size = 16; | 70 | int size = 16; |
71 | if (qApp->desktop()->width() < 300 ) | 71 | if (qApp->desktop()->width() < 300 ) |
72 | size = 12; | 72 | size = 12; |
73 | setTreeStepSize( size + 6 ); | 73 | setTreeStepSize( size + 6 ); |
74 | 74 | ||
75 | } | 75 | } |
76 | 76 | ||
77 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) | 77 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) |
78 | { | 78 | { |
79 | #ifndef KORG_NODND | 79 | #ifndef KORG_NODND |
80 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; | 80 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; |
81 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 81 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
82 | !QTextDrag::canDecode( e ) ) { | 82 | !QTextDrag::canDecode( e ) ) { |
83 | e->ignore(); | 83 | e->ignore(); |
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | 86 | ||
87 | mOldCurrent = currentItem(); | 87 | mOldCurrent = currentItem(); |
88 | #endif | 88 | #endif |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) | 92 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) |
93 | { | 93 | { |
94 | #ifndef KORG_NODND | 94 | #ifndef KORG_NODND |
95 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; | 95 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; |
96 | 96 | ||
97 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 97 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
98 | !QTextDrag::canDecode( e ) ) { | 98 | !QTextDrag::canDecode( e ) ) { |
99 | e->ignore(); | 99 | e->ignore(); |
100 | return; | 100 | return; |
101 | } | 101 | } |
102 | 102 | ||
103 | e->accept(); | 103 | e->accept(); |
104 | #endif | 104 | #endif |
105 | } | 105 | } |
106 | 106 | ||
107 | void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) | 107 | void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) |
108 | { | 108 | { |
109 | #ifndef KORG_NODND | 109 | #ifndef KORG_NODND |
110 | // kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; | 110 | // kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; |
111 | 111 | ||
112 | setCurrentItem(mOldCurrent); | 112 | setCurrentItem(mOldCurrent); |
113 | setSelected(mOldCurrent,true); | 113 | setSelected(mOldCurrent,true); |
114 | #endif | 114 | #endif |
115 | } | 115 | } |
116 | 116 | ||
117 | void KOTodoListView::contentsDropEvent(QDropEvent *e) | 117 | void KOTodoListView::contentsDropEvent(QDropEvent *e) |
118 | { | 118 | { |
119 | #ifndef KORG_NODND | 119 | #ifndef KORG_NODND |
120 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; | 120 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; |
121 | 121 | ||
122 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 122 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
123 | !QTextDrag::canDecode( e ) ) { | 123 | !QTextDrag::canDecode( e ) ) { |
124 | e->ignore(); | 124 | e->ignore(); |
125 | return; | 125 | return; |
126 | } | 126 | } |
127 | 127 | ||
128 | DndFactory factory( mCalendar ); | 128 | DndFactory factory( mCalendar ); |
129 | Todo *todo = factory.createDropTodo(e); | 129 | Todo *todo = factory.createDropTodo(e); |
130 | 130 | ||
131 | if (todo) { | 131 | if (todo) { |
132 | e->acceptAction(); | 132 | e->acceptAction(); |
133 | 133 | ||
134 | KOTodoViewItem *destination = | 134 | KOTodoViewItem *destination = |
135 | (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); | 135 | (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); |
136 | Todo *destinationEvent = 0; | 136 | Todo *destinationEvent = 0; |
137 | if (destination) destinationEvent = destination->todo(); | 137 | if (destination) destinationEvent = destination->todo(); |
138 | 138 | ||
139 | Todo *existingTodo = mCalendar->todo(todo->uid()); | 139 | Todo *existingTodo = mCalendar->todo(todo->uid()); |
140 | 140 | ||
141 | if(existingTodo) { | 141 | if(existingTodo) { |
142 | // kdDebug() << "Drop existing Todo" << endl; | 142 | // kdDebug() << "Drop existing Todo" << endl; |
143 | Incidence *to = destinationEvent; | 143 | Incidence *to = destinationEvent; |
144 | while(to) { | 144 | while(to) { |
145 | if (to->uid() == todo->uid()) { | 145 | if (to->uid() == todo->uid()) { |
146 | KMessageBox::sorry(this, | 146 | KMessageBox::sorry(this, |
147 | i18n("Cannot move To-Do to itself or a child of itself"), | 147 | i18n("Cannot move To-Do to itself or a child of itself"), |
148 | i18n("Drop To-Do")); | 148 | i18n("Drop To-Do")); |
149 | delete todo; | 149 | delete todo; |
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | to = to->relatedTo(); | 152 | to = to->relatedTo(); |
153 | } | 153 | } |
154 | existingTodo->setRelatedTo(destinationEvent); | 154 | existingTodo->setRelatedTo(destinationEvent); |
155 | emit todoDropped(todo); | 155 | emit todoDropped(todo); |
156 | delete todo; | 156 | delete todo; |
157 | } else { | 157 | } else { |
158 | // kdDebug() << "Drop new Todo" << endl; | 158 | // kdDebug() << "Drop new Todo" << endl; |
159 | todo->setRelatedTo(destinationEvent); | 159 | todo->setRelatedTo(destinationEvent); |
160 | mCalendar->addTodo(todo); | 160 | mCalendar->addTodo(todo); |
161 | 161 | ||
162 | emit todoDropped(todo); | 162 | emit todoDropped(todo); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | else { | 165 | else { |
166 | QString text; | 166 | QString text; |
167 | if (QTextDrag::decode(e,text)) { | 167 | if (QTextDrag::decode(e,text)) { |
168 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); | 168 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); |
169 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); | 169 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); |
170 | kdDebug() << "Dropped : " << text << endl; | 170 | kdDebug() << "Dropped : " << text << endl; |
171 | QStringList emails = QStringList::split(",",text); | 171 | QStringList emails = QStringList::split(",",text); |
172 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 172 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
173 | kdDebug() << " Email: " << (*it) << endl; | 173 | kdDebug() << " Email: " << (*it) << endl; |
174 | int pos = (*it).find("<"); | 174 | int pos = (*it).find("<"); |
175 | QString name = (*it).left(pos); | 175 | QString name = (*it).left(pos); |
176 | QString email = (*it).mid(pos); | 176 | QString email = (*it).mid(pos); |
177 | if (!email.isEmpty() && todoi) { | 177 | if (!email.isEmpty() && todoi) { |
178 | todoi->todo()->addAttendee(new Attendee(name,email)); | 178 | todoi->todo()->addAttendee(new Attendee(name,email)); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | } | 181 | } |
182 | else { | 182 | else { |
183 | kdDebug() << "KOTodoListView::contentsDropEvent(): Todo from drop not decodable" << endl; | 183 | kdDebug() << "KOTodoListView::contentsDropEvent(): Todo from drop not decodable" << endl; |
184 | e->ignore(); | 184 | e->ignore(); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | #endif | 187 | #endif |
188 | } | 188 | } |
189 | 189 | ||
190 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | 190 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) |
191 | { | 191 | { |
192 | QListView::contentsMousePressEvent(e); | 192 | QListView::contentsMousePressEvent(e); |
193 | #ifndef KORG_NODND | 193 | #ifndef KORG_NODND |
194 | QPoint p(contentsToViewport(e->pos())); | 194 | QPoint p(contentsToViewport(e->pos())); |
195 | QListViewItem *i = itemAt(p); | 195 | QListViewItem *i = itemAt(p); |
196 | if (i) { | 196 | if (i) { |
197 | // if the user clicked into the root decoration of the item, don't | 197 | // if the user clicked into the root decoration of the item, don't |
198 | // try to start a drag! | 198 | // try to start a drag! |
199 | if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + | 199 | if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + |
200 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + | 200 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + |
201 | itemMargin() || | 201 | itemMargin() || |
202 | p.x() < header()->sectionPos(header()->mapToIndex(0))) { | 202 | p.x() < header()->sectionPos(header()->mapToIndex(0))) { |
203 | if (e->button()==Qt::LeftButton) { | 203 | if (e->button()==Qt::LeftButton) { |
204 | mPressPos = e->pos(); | 204 | mPressPos = e->pos(); |
205 | mMousePressed = true; | 205 | mMousePressed = true; |
206 | } | 206 | } |
207 | } | 207 | } |
208 | } | 208 | } |
209 | #endif | 209 | #endif |
210 | } | 210 | } |
211 | 211 | ||
212 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | 212 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) |
213 | { | 213 | { |
214 | 214 | ||
215 | #ifndef KORG_NODND | 215 | #ifndef KORG_NODND |
216 | // kdDebug() << "KOTodoListView::contentsMouseMoveEvent()" << endl; | 216 | // kdDebug() << "KOTodoListView::contentsMouseMoveEvent()" << endl; |
217 | QListView::contentsMouseMoveEvent(e); | 217 | QListView::contentsMouseMoveEvent(e); |
218 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > | 218 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > |
219 | QApplication::startDragDistance()) { | 219 | QApplication::startDragDistance()) { |
220 | mMousePressed = false; | 220 | mMousePressed = false; |
221 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); | 221 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); |
222 | if (item) { | 222 | if (item) { |
223 | // kdDebug() << "Start Drag for item " << item->text(0) << endl; | 223 | // kdDebug() << "Start Drag for item " << item->text(0) << endl; |
224 | DndFactory factory( mCalendar ); | 224 | DndFactory factory( mCalendar ); |
225 | ICalDrag *vd = factory.createDragTodo( | 225 | ICalDrag *vd = factory.createDragTodo( |
226 | ((KOTodoViewItem *)item)->todo(),viewport()); | 226 | ((KOTodoViewItem *)item)->todo(),viewport()); |
227 | if (vd->drag()) { | 227 | if (vd->drag()) { |
228 | kdDebug() << "KOTodoListView::contentsMouseMoveEvent(): Delete drag source" << endl; | 228 | kdDebug() << "KOTodoListView::contentsMouseMoveEvent(): Delete drag source" << endl; |
229 | } | 229 | } |
230 | /* | 230 | /* |
231 | QString source = fullPath(item); | 231 | QString source = fullPath(item); |
232 | if ( QFile::exists(source) ) { | 232 | if ( QFile::exists(source) ) { |
233 | QUriDrag* ud = new QUriDrag(viewport()); | 233 | QUriDrag* ud = new QUriDrag(viewport()); |
234 | ud->setFilenames( source ); | 234 | ud->setFilenames( source ); |
235 | if ( ud->drag() ) | 235 | if ( ud->drag() ) |
236 | QMessageBox::information( this, "Drag source", | 236 | QMessageBox::information( this, "Drag source", |
237 | QString("Delete ")+source, "Not implemented" ); | 237 | QString("Delete ")+source, "Not implemented" ); |
238 | */ | 238 | */ |
239 | } | 239 | } |
240 | } | 240 | } |
241 | #endif | 241 | #endif |
242 | } | 242 | } |
243 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | 243 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) |
244 | { | 244 | { |
245 | 245 | ||
246 | QListViewItem* cn; | 246 | QListViewItem* cn; |
247 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { | 247 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { |
248 | cn = currentItem(); | 248 | cn = currentItem(); |
249 | if ( cn ) { | 249 | if ( cn ) { |
250 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 250 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
251 | if ( ci ){ | 251 | if ( ci ){ |
252 | if ( e->state() == ShiftButton ) | 252 | if ( e->state() == ShiftButton ) |
253 | ci->setOn( false ); | 253 | ci->setOn( false ); |
254 | else | 254 | else |
255 | ci->setOn( true ); | 255 | ci->setOn( true ); |
256 | cn = cn->nextSibling(); | 256 | cn = cn->nextSibling(); |
257 | if ( cn ) { | 257 | if ( cn ) { |
258 | setCurrentItem ( cn ); | 258 | setCurrentItem ( cn ); |
259 | ensureItemVisible ( cn ); | 259 | ensureItemVisible ( cn ); |
260 | } | 260 | } |
261 | 261 | ||
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||
265 | return; | 265 | return; |
266 | } | 266 | } |
267 | 267 | ||
268 | // qDebug("KOTodoListView::keyPressEvent "); | 268 | // qDebug("KOTodoListView::keyPressEvent "); |
269 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 269 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
270 | switch ( e->key() ) { | 270 | switch ( e->key() ) { |
271 | case Qt::Key_Down: | 271 | case Qt::Key_Down: |
272 | case Qt::Key_Up: | 272 | case Qt::Key_Up: |
273 | QListView::keyPressEvent ( e ); | 273 | QListView::keyPressEvent ( e ); |
274 | break; | 274 | break; |
275 | case Qt::Key_Left: | 275 | case Qt::Key_Left: |
276 | case Qt::Key_Right: | 276 | case Qt::Key_Right: |
277 | QListView::keyPressEvent ( e ); | 277 | QListView::keyPressEvent ( e ); |
278 | e->accept(); | 278 | e->accept(); |
279 | return; | 279 | return; |
280 | break; | 280 | break; |
281 | default: | 281 | default: |
282 | e->ignore(); | 282 | e->ignore(); |
283 | break; | 283 | break; |
284 | } | 284 | } |
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | e->ignore(); | 287 | e->ignore(); |
288 | } | 288 | } |
289 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 289 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
290 | { | 290 | { |
291 | QListView::contentsMouseReleaseEvent(e); | 291 | QListView::contentsMouseReleaseEvent(e); |
292 | mMousePressed = false; | 292 | mMousePressed = false; |
293 | } | 293 | } |
294 | 294 | ||
295 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 295 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
296 | { | 296 | { |
297 | if (!e) return; | 297 | if (!e) return; |
298 | 298 | ||
299 | QPoint vp = contentsToViewport(e->pos()); | 299 | QPoint vp = contentsToViewport(e->pos()); |
300 | 300 | ||
301 | QListViewItem *item = itemAt(vp); | 301 | QListViewItem *item = itemAt(vp); |
302 | 302 | ||
303 | emit double_Clicked(item); | 303 | emit double_Clicked(item); |
304 | if (!item) return; | 304 | if (!item) return; |
305 | 305 | ||
306 | emit doubleClicked(item,vp,0); | 306 | emit doubleClicked(item,vp,0); |
307 | } | 307 | } |
308 | 308 | ||
309 | ///////////////////////////////////////////////////////////////////////////// | 309 | ///////////////////////////////////////////////////////////////////////////// |
310 | 310 | ||
311 | KOQuickTodo::KOQuickTodo(QWidget *parent) : | 311 | KOQuickTodo::KOQuickTodo(QWidget *parent) : |
312 | QLineEdit(parent) | 312 | QLineEdit(parent) |
313 | { | 313 | { |
314 | setText(i18n("Click to add a new Todo")); | 314 | setText(i18n("Click to add a new Todo")); |
315 | } | 315 | } |
316 | 316 | ||
317 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) | 317 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) |
318 | { | 318 | { |
319 | if ( text()==i18n("Click to add a new Todo") ) | 319 | if ( text()==i18n("Click to add a new Todo") ) |
320 | setText(""); | 320 | setText(""); |
321 | QLineEdit::focusInEvent(ev); | 321 | QLineEdit::focusInEvent(ev); |
322 | } | 322 | } |
323 | 323 | ||
324 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 324 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
325 | { | 325 | { |
326 | setText(i18n("Click to add a new Todo")); | 326 | setText(i18n("Click to add a new Todo")); |
327 | QLineEdit::focusOutEvent(ev); | 327 | QLineEdit::focusOutEvent(ev); |
328 | } | 328 | } |
329 | 329 | ||
330 | ///////////////////////////////////////////////////////////////////////////// | 330 | ///////////////////////////////////////////////////////////////////////////// |
331 | 331 | ||
332 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 332 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
333 | KOrg::BaseView(calendar,parent,name) | 333 | KOrg::BaseView(calendar,parent,name) |
334 | { | 334 | { |
335 | mNavigator = 0; | ||
335 | QBoxLayout *topLayout = new QVBoxLayout(this); | 336 | QBoxLayout *topLayout = new QVBoxLayout(this); |
336 | mName = QString ( name ); | 337 | mName = QString ( name ); |
337 | mBlockUpdate = false; | 338 | mBlockUpdate = false; |
338 | mQuickAdd = new KOQuickTodo(this); | 339 | mQuickAdd = new KOQuickTodo(this); |
339 | topLayout->addWidget(mQuickAdd); | 340 | topLayout->addWidget(mQuickAdd); |
340 | 341 | ||
341 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); | 342 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); |
342 | 343 | ||
343 | mTodoListView = new KOTodoListView(calendar,this, name ); | 344 | mTodoListView = new KOTodoListView(calendar,this, name ); |
344 | topLayout->addWidget(mTodoListView); | 345 | topLayout->addWidget(mTodoListView); |
345 | //mTodoListView->header()->setMaximumHeight(30); | 346 | //mTodoListView->header()->setMaximumHeight(30); |
346 | mTodoListView->setRootIsDecorated(true); | 347 | mTodoListView->setRootIsDecorated(true); |
347 | mTodoListView->setAllColumnsShowFocus(true); | 348 | mTodoListView->setAllColumnsShowFocus(true); |
348 | 349 | ||
349 | mTodoListView->setShowSortIndicator(true); | 350 | mTodoListView->setShowSortIndicator(true); |
350 | 351 | ||
351 | mTodoListView->addColumn(i18n("Todo")); | 352 | mTodoListView->addColumn(i18n("Todo")); |
352 | mTodoListView->addColumn(i18n("Prio")); | 353 | mTodoListView->addColumn(i18n("Prio")); |
353 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 354 | mTodoListView->setColumnAlignment(1,AlignHCenter); |
354 | mTodoListView->addColumn(i18n("Complete")); | 355 | mTodoListView->addColumn(i18n("Complete")); |
355 | mTodoListView->setColumnAlignment(2,AlignHCenter); | 356 | mTodoListView->setColumnAlignment(2,AlignCenter); |
357 | |||
356 | mTodoListView->addColumn(i18n("Due Date")); | 358 | mTodoListView->addColumn(i18n("Due Date")); |
357 | mTodoListView->setColumnAlignment(3,AlignLeft); | 359 | mTodoListView->setColumnAlignment(3,AlignLeft); |
358 | mTodoListView->addColumn(i18n("Due Time")); | 360 | mTodoListView->addColumn(i18n("Due Time")); |
359 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 361 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
362 | |||
363 | mTodoListView->addColumn(i18n("Start Date")); | ||
364 | mTodoListView->setColumnAlignment(5,AlignLeft); | ||
365 | mTodoListView->addColumn(i18n("Start Time")); | ||
366 | mTodoListView->setColumnAlignment(6,AlignHCenter); | ||
367 | |||
360 | mTodoListView->addColumn(i18n("Cancelled")); | 368 | mTodoListView->addColumn(i18n("Cancelled")); |
361 | mTodoListView->addColumn(i18n("Categories")); | 369 | mTodoListView->addColumn(i18n("Categories")); |
362 | #if 0 | 370 | #if 0 |
363 | mTodoListView->addColumn(i18n("Sort Id")); | 371 | mTodoListView->addColumn(i18n("Sort Id")); |
364 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 372 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
365 | #endif | 373 | #endif |
366 | 374 | ||
367 | mTodoListView->setMinimumHeight( 60 ); | 375 | mTodoListView->setMinimumHeight( 60 ); |
368 | mTodoListView->setItemsRenameable( true ); | 376 | mTodoListView->setItemsRenameable( true ); |
369 | mTodoListView->setRenameable( 0 ); | 377 | mTodoListView->setRenameable( 0 ); |
370 | mTodoListView->setColumnWidth( 0, 120 ); | 378 | mTodoListView->setColumnWidth( 0, 120 ); |
371 | mTodoListView->setColumnWidthMode(0, QListView::Manual); | 379 | mTodoListView->setColumnWidthMode(0, QListView::Manual); |
372 | mTodoListView->setColumnWidthMode(1, QListView::Manual); | 380 | mTodoListView->setColumnWidthMode(1, QListView::Manual); |
373 | mTodoListView->setColumnWidthMode(2, QListView::Manual); | 381 | mTodoListView->setColumnWidthMode(2, QListView::Manual); |
374 | mTodoListView->setColumnWidthMode(3, QListView::Manual); | 382 | mTodoListView->setColumnWidthMode(3, QListView::Manual); |
375 | mTodoListView->setColumnWidthMode(4, QListView::Manual); | 383 | mTodoListView->setColumnWidthMode(4, QListView::Manual); |
376 | mTodoListView->setColumnWidthMode(5, QListView::Manual); | 384 | mTodoListView->setColumnWidthMode(5, QListView::Manual); |
377 | mTodoListView->setColumnWidthMode(6, QListView::Manual); | 385 | mTodoListView->setColumnWidthMode(6, QListView::Manual); |
378 | mTodoListView->setColumnAlignment( 2, AlignCenter ); | 386 | mTodoListView->setColumnWidthMode(7, QListView::Manual); |
379 | #if 0 | 387 | mTodoListView->setColumnWidthMode(8, QListView::Manual); |
380 | mTodoListView->setColumnWidthMode(6, QListView::Manual); | 388 | |
381 | #endif | ||
382 | 389 | ||
383 | mPriorityPopupMenu = new QPopupMenu(this); | 390 | mPriorityPopupMenu = new QPopupMenu(this); |
384 | for (int i = 1; i <= 5; i++) { | 391 | for (int i = 1; i <= 5; i++) { |
385 | QString label = QString ("%1").arg (i); | 392 | QString label = QString ("%1").arg (i); |
386 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 393 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
387 | } | 394 | } |
388 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 395 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
389 | 396 | ||
390 | mPercentageCompletedPopupMenu = new QPopupMenu(this); | 397 | mPercentageCompletedPopupMenu = new QPopupMenu(this); |
391 | for (int i = 0; i <= 100; i+=20) { | 398 | for (int i = 0; i <= 100; i+=20) { |
392 | QString label = QString ("%1 %").arg (i); | 399 | QString label = QString ("%1 %").arg (i); |
393 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; | 400 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; |
394 | } | 401 | } |
395 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); | 402 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); |
396 | 403 | ||
397 | 404 | ||
398 | 405 | ||
399 | mItemPopupMenu = new QPopupMenu(this); | 406 | mItemPopupMenu = new QPopupMenu(this); |
400 | mItemPopupMenu->insertItem(i18n("Show..."), this, | 407 | mItemPopupMenu->insertItem(i18n("Show..."), this, |
401 | SLOT (showTodo())); | 408 | SLOT (showTodo())); |
402 | mItemPopupMenu->insertItem(i18n("Edit..."), this, | 409 | mItemPopupMenu->insertItem(i18n("Edit..."), this, |
403 | SLOT (editTodo())); | 410 | SLOT (editTodo())); |
404 | mItemPopupMenu->insertItem( i18n("Delete"), this, | 411 | mItemPopupMenu->insertItem( i18n("Delete"), this, |
405 | SLOT (deleteTodo())); | 412 | SLOT (deleteTodo())); |
406 | mItemPopupMenu->insertItem( i18n("Clone..."), this, | 413 | mItemPopupMenu->insertItem( i18n("Clone..."), this, |
407 | SLOT (cloneTodo())); | 414 | SLOT (cloneTodo())); |
408 | mItemPopupMenu->insertItem( i18n("Move..."), this, | 415 | mItemPopupMenu->insertItem( i18n("Move..."), this, |
409 | SLOT (moveTodo())); | 416 | SLOT (moveTodo())); |
410 | mItemPopupMenu->insertItem( i18n("Beam..."), this, | 417 | mItemPopupMenu->insertItem( i18n("Beam..."), this, |
411 | SLOT (beamTodo())); | 418 | SLOT (beamTodo())); |
412 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, | 419 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, |
413 | SLOT (cancelTodo())); | 420 | SLOT (cancelTodo())); |
414 | mItemPopupMenu->insertSeparator(); | 421 | mItemPopupMenu->insertSeparator(); |
415 | 422 | ||
416 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, | 423 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, |
417 | SLOT (newTodo())); | 424 | SLOT (newTodo())); |
418 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, | 425 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, |
419 | SLOT (newSubTodo())); | 426 | SLOT (newSubTodo())); |
420 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, | 427 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, |
421 | SLOT (unparentTodo()),0,21); | 428 | SLOT (unparentTodo()),0,21); |
422 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, | 429 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, |
423 | SLOT (reparentTodo()),0,22); | 430 | SLOT (reparentTodo()),0,22); |
424 | mItemPopupMenu->insertSeparator(); | 431 | mItemPopupMenu->insertSeparator(); |
425 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), | 432 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), |
426 | this, SLOT( purgeCompleted() ) ); | 433 | this, SLOT( purgeCompleted() ) ); |
427 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), | 434 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), |
428 | this, SLOT( toggleCompleted() ),0, 33 ); | 435 | this, SLOT( toggleCompleted() ),0, 33 ); |
429 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 436 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
430 | this, SLOT( toggleQuickTodo() ),0, 34 ); | 437 | this, SLOT( toggleQuickTodo() ),0, 34 ); |
438 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | ||
439 | this, SLOT( toggleRunning() ),0, 35 ); | ||
431 | 440 | ||
432 | mPopupMenu = new QPopupMenu(this); | 441 | mPopupMenu = new QPopupMenu(this); |
433 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, | 442 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, |
434 | SLOT (newTodo()),0,1); | 443 | SLOT (newTodo()),0,1); |
435 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), | 444 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), |
436 | this, SLOT(purgeCompleted()),0,2); | 445 | this, SLOT(purgeCompleted()),0,2); |
437 | mPopupMenu->insertItem(i18n("Show Completed"), | 446 | mPopupMenu->insertItem(i18n("Show Completed"), |
438 | this, SLOT( toggleCompleted() ),0,3 ); | 447 | this, SLOT( toggleCompleted() ),0,3 ); |
439 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 448 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
440 | this, SLOT( toggleQuickTodo() ),0,4 ); | 449 | this, SLOT( toggleQuickTodo() ),0,4 ); |
450 | mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | ||
451 | this, SLOT( toggleRunning() ),0,5 ); | ||
441 | mDocPrefs = new DocPrefs( name ); | 452 | mDocPrefs = new DocPrefs( name ); |
442 | 453 | ||
443 | mPopupMenu->setCheckable( true ); | 454 | mPopupMenu->setCheckable( true ); |
444 | mItemPopupMenu->setCheckable( true ); | 455 | mItemPopupMenu->setCheckable( true ); |
456 | |||
457 | |||
458 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | ||
459 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | ||
460 | |||
461 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | ||
462 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | ||
463 | |||
464 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | ||
465 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | ||
466 | |||
467 | |||
445 | // Double clicking conflicts with opening/closing the subtree | 468 | // Double clicking conflicts with opening/closing the subtree |
446 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), | 469 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), |
447 | SLOT( editItem( QListViewItem *) ) ); | 470 | SLOT( editItem( QListViewItem *) ) ); |
448 | /* | 471 | /* |
449 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, | 472 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, |
450 | const QPoint &,int ) ), | 473 | const QPoint &,int ) ), |
451 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 474 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
452 | */ | 475 | */ |
453 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, | 476 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, |
454 | const QPoint &,int ) ), | 477 | const QPoint &,int ) ), |
455 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 478 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
456 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), | 479 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), |
457 | SLOT( itemClicked( QListViewItem * ) ) ); | 480 | SLOT( itemClicked( QListViewItem * ) ) ); |
458 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), | 481 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), |
459 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); | 482 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); |
460 | connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ), | 483 | connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ), |
461 | SLOT( updateView() ) ); | 484 | SLOT( updateView() ) ); |
462 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), | 485 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), |
463 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 486 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
464 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 487 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), |
465 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 488 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
466 | 489 | ||
467 | #if 0 | 490 | #if 0 |
468 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), | 491 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), |
469 | SLOT(selectionChanged(QListViewItem *))); | 492 | SLOT(selectionChanged(QListViewItem *))); |
470 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), | 493 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), |
471 | SLOT(selectionChanged(QListViewItem *))); | 494 | SLOT(selectionChanged(QListViewItem *))); |
472 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), | 495 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), |
473 | SLOT(selectionChanged(QListViewItem *))); | 496 | SLOT(selectionChanged(QListViewItem *))); |
474 | #endif | 497 | #endif |
475 | connect( mTodoListView, SIGNAL(selectionChanged() ), | 498 | connect( mTodoListView, SIGNAL(selectionChanged() ), |
476 | SLOT( processSelectionChange() ) ); | 499 | SLOT( processSelectionChange() ) ); |
477 | connect( mQuickAdd, SIGNAL( returnPressed () ), | 500 | connect( mQuickAdd, SIGNAL( returnPressed () ), |
478 | SLOT( addQuickTodo() ) ); | 501 | SLOT( addQuickTodo() ) ); |
479 | // if ( QApplication::desktop()->width() < 480 ) { | ||
480 | // setNarrow(); | ||
481 | // mTodoListView->setColumnWidth( 0, 100 ); | ||
482 | |||
483 | // } | ||
484 | 502 | ||
485 | } | 503 | } |
486 | 504 | ||
487 | KOTodoView::~KOTodoView() | 505 | KOTodoView::~KOTodoView() |
488 | { | 506 | { |
489 | delete mDocPrefs; | 507 | delete mDocPrefs; |
490 | } | 508 | } |
491 | 509 | ||
492 | void KOTodoView::jumpToDate () | 510 | void KOTodoView::jumpToDate () |
493 | { | 511 | { |
494 | // if (mActiveItem) { | 512 | // if (mActiveItem) { |
495 | // mActiveItem->todo()); | 513 | // mActiveItem->todo()); |
496 | // if ( mActiveItem->todo()->hasDueDate() ) | 514 | // if ( mActiveItem->todo()->hasDueDate() ) |
497 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 515 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
498 | } | 516 | } |
499 | 517 | ||
500 | void KOTodoView::setNarrow() | ||
501 | { | ||
502 | //mTodoListView->setColumnWidth( 0, 120 ); | ||
503 | mTodoListView->setColumnWidth( 1, 35 ); | ||
504 | mTodoListView->setColumnWidth( 2, 40 ); | ||
505 | mTodoListView->setColumnWidth( 3, 80 ); | ||
506 | mTodoListView->setColumnWidth( 4, 40 ); | ||
507 | mTodoListView->setColumnWidth( 5, 90 ); | ||
508 | |||
509 | } | ||
510 | void KOTodoView::updateView() | 518 | void KOTodoView::updateView() |
511 | { | 519 | { |
512 | pendingSubtodo = 0; | 520 | pendingSubtodo = 0; |
513 | if ( mBlockUpdate ) { | 521 | if ( mBlockUpdate ) { |
514 | //qDebug("blocked "); | 522 | //qDebug("blocked "); |
515 | return; | 523 | return; |
516 | } | 524 | } |
517 | //qDebug("update "); | 525 | //qDebug("update "); |
518 | // kdDebug() << "KOTodoView::updateView()" << endl; | 526 | // kdDebug() << "KOTodoView::updateView()" << endl; |
519 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 527 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
520 | mTodoListView->clear(); | 528 | mTodoListView->clear(); |
521 | if ( mName == "todolistsmall" ) { | 529 | if ( mName == "todolistsmall" ) { |
522 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 530 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
523 | int ps = fo.pointSize() -2; | 531 | int ps = fo.pointSize() -2; |
524 | if ( ps > 12 ) | 532 | if ( ps > 12 ) |
525 | ps -= 2; | 533 | ps -= 2; |
526 | fo.setPointSize( ps ); | 534 | fo.setPointSize( ps ); |
527 | } | 535 | } |
528 | } | 536 | } |
529 | 537 | ||
530 | mTodoListView->setFont( fo ); | 538 | mTodoListView->setFont( fo ); |
531 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); | 539 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); |
532 | //mTodoListView->header()->setMaximumHeight(fm.height()); | 540 | //mTodoListView->header()->setMaximumHeight(fm.height()); |
533 | QPtrList<Todo> todoList = calendar()->todos(); | 541 | QPtrList<Todo> todoList = calendar()->todos(); |
534 | 542 | ||
535 | /* | 543 | /* |
536 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; | 544 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; |
537 | Event *t; | 545 | Event *t; |
538 | for(t = todoList.first(); t; t = todoList.next()) { | 546 | for(t = todoList.first(); t; t = todoList.next()) { |
539 | kdDebug() << " " << t->getSummary() << endl; | 547 | kdDebug() << " " << t->getSummary() << endl; |
540 | 548 | ||
541 | if (t->getRelatedTo()) { | 549 | if (t->getRelatedTo()) { |
542 | kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; | 550 | kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; |
543 | } | 551 | } |
544 | 552 | ||
545 | QPtrList<Event> l = t->getRelations(); | 553 | QPtrList<Event> l = t->getRelations(); |
546 | Event *c; | 554 | Event *c; |
547 | for(c=l.first();c;c=l.next()) { | 555 | for(c=l.first();c;c=l.next()) { |
548 | kdDebug() << " - relation: " << c->getSummary() << endl; | 556 | kdDebug() << " - relation: " << c->getSummary() << endl; |
549 | } | 557 | } |
550 | } | 558 | } |
551 | */ | 559 | */ |
552 | 560 | ||
553 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a | 561 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a |
554 | // specific order of events. That means that we have to generate parent items | 562 | // specific order of events. That means that we have to generate parent items |
555 | // recursively for proper hierarchical display of Todos. | 563 | // recursively for proper hierarchical display of Todos. |
556 | mTodoMap.clear(); | 564 | mTodoMap.clear(); |
557 | Todo *todo; | 565 | Todo *todo; |
558 | todo = todoList.first();// todo; todo = todoList.next()) { | 566 | todo = todoList.first();// todo; todo = todoList.next()) { |
559 | while ( todo ) { | 567 | while ( todo ) { |
560 | bool next = true; | 568 | bool next = true; |
561 | // qDebug("todo %s ", todo->summary().latin1()); | 569 | // qDebug("todo %s ", todo->summary().latin1()); |
562 | Incidence *incidence = todo->relatedTo(); | 570 | Incidence *incidence = todo->relatedTo(); |
563 | while ( incidence ) { | 571 | while ( incidence ) { |
564 | if ( incidence->type() == "Todo") { | 572 | if ( incidence->type() == "Todo") { |
565 | //qDebug("related %s ",incidence->summary().latin1() ); | 573 | //qDebug("related %s ",incidence->summary().latin1() ); |
566 | if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { | 574 | if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { |
567 | //qDebug("related not found "); | 575 | //qDebug("related not found "); |
568 | todoList.remove( ); | 576 | todoList.remove( ); |
569 | todo = todoList.current(); | 577 | todo = todoList.current(); |
570 | next = false; | 578 | next = false; |
571 | incidence = 0; | 579 | incidence = 0; |
572 | 580 | ||
573 | } else { | 581 | } else { |
574 | //qDebug("related found "); | 582 | //qDebug("related found "); |
575 | incidence = incidence->relatedTo(); | 583 | incidence = incidence->relatedTo(); |
576 | } | 584 | } |
577 | } else | 585 | } else |
578 | incidence = 0; | 586 | incidence = 0; |
579 | } | 587 | } |
580 | if ( next ) | 588 | if ( next ) |
581 | todo = todoList.next(); | 589 | todo = todoList.next(); |
582 | } | 590 | } |
583 | // qDebug("again .... "); | 591 | // qDebug("again .... "); |
584 | // for(todo = todoList.first(); todo; todo = todoList.next()) { | 592 | // for(todo = todoList.first(); todo; todo = todoList.next()) { |
585 | 593 | ||
586 | // qDebug("yytodo %s ", todo->summary().latin1()); | 594 | // qDebug("yytodo %s ", todo->summary().latin1()); |
587 | // } | 595 | // } |
588 | //qDebug("for "); | 596 | //qDebug("for "); |
589 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 597 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
590 | if (!mTodoMap.contains(todo) && ( KOPrefs::instance()->mShowCompletedTodo || !todo->isCompleted() ) ) | 598 | if (!mTodoMap.contains(todo) && checkTodo( todo ) ) |
591 | { | 599 | { |
592 | insertTodoItem(todo); | 600 | insertTodoItem(todo); |
593 | } | 601 | } |
594 | } | 602 | } |
595 | //qDebug("for end "); | 603 | //qDebug("for end "); |
596 | // Restore opened/closed state | 604 | // Restore opened/closed state |
597 | mTodoListView->blockSignals( true ); | 605 | mTodoListView->blockSignals( true ); |
598 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); | 606 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); |
599 | mTodoListView->blockSignals( false ); | 607 | mTodoListView->blockSignals( false ); |
600 | mTodoListView->setFocus(); | 608 | mTodoListView->setFocus(); |
601 | processSelectionChange(); | 609 | processSelectionChange(); |
602 | } | 610 | } |
603 | 611 | ||
612 | bool KOTodoView::checkTodo( Todo * todo ) | ||
613 | { | ||
614 | |||
615 | if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) | ||
616 | return false; | ||
617 | if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { | ||
618 | if ( todo->hasStartDate() ) | ||
619 | if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) | ||
620 | return false; | ||
621 | if ( todo->hasDueDate() ) | ||
622 | if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) | ||
623 | return false; | ||
624 | } | ||
625 | return true; | ||
626 | } | ||
627 | |||
604 | void KOTodoView::restoreItemState( QListViewItem *item ) | 628 | void KOTodoView::restoreItemState( QListViewItem *item ) |
605 | { | 629 | { |
606 | pendingSubtodo = 0; | 630 | pendingSubtodo = 0; |
607 | while( item ) { | 631 | while( item ) { |
608 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 632 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
609 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); | 633 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); |
610 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); | 634 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); |
611 | item = item->nextSibling(); | 635 | item = item->nextSibling(); |
612 | } | 636 | } |
613 | } | 637 | } |
614 | 638 | ||
615 | 639 | ||
616 | QMap<Todo *,KOTodoViewItem *>::ConstIterator | 640 | QMap<Todo *,KOTodoViewItem *>::ConstIterator |
617 | KOTodoView::insertTodoItem(Todo *todo) | 641 | KOTodoView::insertTodoItem(Todo *todo) |
618 | { | 642 | { |
643 | |||
619 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; | 644 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; |
620 | // TODO: Check, if dynmaic cast is necessary | 645 | // TODO: Check, if dynmaic cast is necessary |
621 | 646 | ||
622 | pendingSubtodo = 0; | 647 | pendingSubtodo = 0; |
623 | Incidence *incidence = todo->relatedTo(); | 648 | Incidence *incidence = todo->relatedTo(); |
624 | if (incidence && incidence->type() == "Todo") { | 649 | if (incidence && incidence->type() == "Todo") { |
625 | Todo *relatedTodo = static_cast<Todo *>(incidence); | 650 | Todo *relatedTodo = static_cast<Todo *>(incidence); |
626 | 651 | ||
627 | // kdDebug() << " has Related" << endl; | 652 | // kdDebug() << " has Related" << endl; |
628 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 653 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
629 | itemIterator = mTodoMap.find(relatedTodo); | 654 | itemIterator = mTodoMap.find(relatedTodo); |
630 | if (itemIterator == mTodoMap.end()) { | 655 | if (itemIterator == mTodoMap.end()) { |
631 | // kdDebug() << " related not yet in list" << endl; | 656 | // kdDebug() << " related not yet in list" << endl; |
632 | itemIterator = insertTodoItem (relatedTodo); | 657 | itemIterator = insertTodoItem (relatedTodo); |
633 | } | 658 | } |
634 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem | 659 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem |
635 | // and one into the map. Sure finding is more easy but why? -zecke | 660 | // and one into the map. Sure finding is more easy but why? -zecke |
636 | KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); | 661 | KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); |
637 | return mTodoMap.insert(todo,todoItem); | 662 | return mTodoMap.insert(todo,todoItem); |
638 | } else { | 663 | } else { |
639 | // kdDebug() << " no Related" << endl; | 664 | // kdDebug() << " no Related" << endl; |
640 | // see above -zecke | 665 | // see above -zecke |
641 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 666 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
642 | return mTodoMap.insert(todo,todoItem); | 667 | return mTodoMap.insert(todo,todoItem); |
643 | } | 668 | } |
644 | } | 669 | } |
645 | 670 | ||
646 | 671 | ||
647 | void KOTodoView::updateConfig() | 672 | void KOTodoView::updateConfig() |
648 | { | 673 | { |
649 | updateView(); | 674 | updateView(); |
650 | mTodoListView->repaintContents(); | 675 | mTodoListView->repaintContents(); |
651 | } | 676 | } |
652 | 677 | ||
653 | QPtrList<Incidence> KOTodoView::selectedIncidences() | 678 | QPtrList<Incidence> KOTodoView::selectedIncidences() |
654 | { | 679 | { |
655 | QPtrList<Incidence> selected; | 680 | QPtrList<Incidence> selected; |
656 | 681 | ||
657 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 682 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
658 | // if (!item) item = mActiveItem; | 683 | // if (!item) item = mActiveItem; |
659 | if (item) selected.append(item->todo()); | 684 | if (item) selected.append(item->todo()); |
660 | 685 | ||
661 | return selected; | 686 | return selected; |
662 | } | 687 | } |
663 | 688 | ||
664 | QPtrList<Todo> KOTodoView::selectedTodos() | 689 | QPtrList<Todo> KOTodoView::selectedTodos() |
665 | { | 690 | { |
666 | QPtrList<Todo> selected; | 691 | QPtrList<Todo> selected; |
667 | 692 | ||
668 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 693 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
669 | // if (!item) item = mActiveItem; | 694 | // if (!item) item = mActiveItem; |
670 | if (item) selected.append(item->todo()); | 695 | if (item) selected.append(item->todo()); |
671 | 696 | ||
672 | return selected; | 697 | return selected; |
673 | } | 698 | } |
674 | 699 | ||
675 | void KOTodoView::changeEventDisplay(Event *, int) | 700 | void KOTodoView::changeEventDisplay(Event *, int) |
676 | { | 701 | { |
677 | updateView(); | 702 | updateView(); |
678 | } | 703 | } |
679 | 704 | ||
680 | void KOTodoView::showDates(const QDate &, const QDate &) | 705 | void KOTodoView::showDates(const QDate &, const QDate &) |
681 | { | 706 | { |
682 | } | 707 | } |
683 | 708 | ||
684 | void KOTodoView::showEvents(QPtrList<Event>) | 709 | void KOTodoView::showEvents(QPtrList<Event>) |
685 | { | 710 | { |
686 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; | 711 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; |
687 | } | 712 | } |
688 | 713 | ||
689 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 714 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
690 | const QDate &td) | 715 | const QDate &td) |
691 | { | 716 | { |
692 | #ifndef KORG_NOPRINTER | 717 | #ifndef KORG_NOPRINTER |
693 | calPrinter->preview(CalPrinter::Todolist, fd, td); | 718 | calPrinter->preview(CalPrinter::Todolist, fd, td); |
694 | #endif | 719 | #endif |
695 | } | 720 | } |
696 | 721 | ||
697 | void KOTodoView::editItem(QListViewItem *item ) | 722 | void KOTodoView::editItem(QListViewItem *item ) |
698 | { | 723 | { |
699 | // qDebug("editItem(QListViewItem *item ) "); | 724 | // qDebug("editItem(QListViewItem *item ) "); |
700 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 725 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); |
701 | } | 726 | } |
702 | 727 | ||
703 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 728 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) |
704 | { | 729 | { |
705 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 730 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); |
706 | } | 731 | } |
707 | 732 | ||
708 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) | 733 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) |
709 | { | 734 | { |
710 | pendingSubtodo = 0; | 735 | pendingSubtodo = 0; |
711 | mActiveItem = (KOTodoViewItem *)item; | 736 | mActiveItem = (KOTodoViewItem *)item; |
712 | if (item) { | 737 | if (item) { |
713 | switch (column){ | 738 | switch (column){ |
714 | case 1: | 739 | case 1: |
715 | mPriorityPopupMenu->popup(QCursor::pos ()); break; | 740 | mPriorityPopupMenu->popup(QCursor::pos ()); break; |
716 | case 2: | 741 | case 2: |
717 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; | 742 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; |
718 | case 3: | 743 | case 3: |
719 | moveTodo(); | 744 | moveTodo(); |
720 | break; | 745 | break; |
721 | case 6: | 746 | case 8: |
722 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; | 747 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; |
723 | default: | 748 | default: |
724 | mItemPopupMenu->popup(QCursor::pos()); | 749 | mItemPopupMenu->popup(QCursor::pos()); |
725 | } | 750 | } |
726 | } else mPopupMenu->popup(QCursor::pos()); | 751 | } else mPopupMenu->popup(QCursor::pos()); |
727 | } | 752 | } |
728 | void KOTodoView::newTodo() | 753 | void KOTodoView::newTodo() |
729 | { | 754 | { |
730 | emit newTodoSignal(); | 755 | emit newTodoSignal(); |
731 | } | 756 | } |
732 | 757 | ||
733 | void KOTodoView::newSubTodo() | 758 | void KOTodoView::newSubTodo() |
734 | { | 759 | { |
735 | if (mActiveItem) { | 760 | if (mActiveItem) { |
736 | emit newSubTodoSignal(mActiveItem->todo()); | 761 | emit newSubTodoSignal(mActiveItem->todo()); |
737 | } | 762 | } |
738 | } | 763 | } |
739 | void KOTodoView::unparentTodo() | 764 | void KOTodoView::unparentTodo() |
740 | { | 765 | { |
741 | if (mActiveItem) { | 766 | if (mActiveItem) { |
742 | emit unparentTodoSignal(mActiveItem->todo()); | 767 | emit unparentTodoSignal(mActiveItem->todo()); |
743 | } | 768 | } |
744 | } | 769 | } |
745 | 770 | ||
746 | void KOTodoView::reparentTodo() | 771 | void KOTodoView::reparentTodo() |
747 | { | 772 | { |
748 | if (mActiveItem) { | 773 | if (mActiveItem) { |
749 | qDebug("KOTodoView::reparentTodo() "); | 774 | qDebug("KOTodoView::reparentTodo() "); |
750 | topLevelWidget()->setCaption(i18n("Click on new parent item")); | 775 | topLevelWidget()->setCaption(i18n("Click on new parent item")); |
751 | pendingSubtodo = mActiveItem; | 776 | pendingSubtodo = mActiveItem; |
752 | } | 777 | } |
753 | } | 778 | } |
754 | void KOTodoView::editTodo() | 779 | void KOTodoView::editTodo() |
755 | { | 780 | { |
756 | if (mActiveItem) { | 781 | if (mActiveItem) { |
757 | emit editTodoSignal(mActiveItem->todo()); | 782 | emit editTodoSignal(mActiveItem->todo()); |
758 | } | 783 | } |
759 | } | 784 | } |
760 | void KOTodoView::cloneTodo() | 785 | void KOTodoView::cloneTodo() |
761 | { | 786 | { |
762 | if (mActiveItem) { | 787 | if (mActiveItem) { |
763 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); | 788 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); |
764 | } | 789 | } |
765 | } | 790 | } |
766 | void KOTodoView::cancelTodo() | 791 | void KOTodoView::cancelTodo() |
767 | { | 792 | { |
768 | if (mActiveItem) { | 793 | if (mActiveItem) { |
769 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); | 794 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); |
770 | } | 795 | } |
771 | } | 796 | } |
772 | void KOTodoView::moveTodo() | 797 | void KOTodoView::moveTodo() |
773 | { | 798 | { |
774 | if (mActiveItem) { | 799 | if (mActiveItem) { |
775 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); | 800 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); |
776 | } | 801 | } |
777 | } | 802 | } |
778 | void KOTodoView::beamTodo() | 803 | void KOTodoView::beamTodo() |
779 | { | 804 | { |
780 | if (mActiveItem) { | 805 | if (mActiveItem) { |
781 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); | 806 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); |
782 | } | 807 | } |
783 | } | 808 | } |
784 | 809 | ||
785 | 810 | ||
786 | void KOTodoView::showTodo() | 811 | void KOTodoView::showTodo() |
787 | { | 812 | { |
788 | if (mActiveItem) { | 813 | if (mActiveItem) { |
789 | emit showTodoSignal(mActiveItem->todo()); | 814 | emit showTodoSignal(mActiveItem->todo()); |
790 | } | 815 | } |
791 | } | 816 | } |
792 | 817 | ||
793 | void KOTodoView::deleteTodo() | 818 | void KOTodoView::deleteTodo() |
794 | { | 819 | { |
795 | if (mActiveItem) { | 820 | if (mActiveItem) { |
796 | if (mActiveItem->childCount()) { | 821 | if (mActiveItem->childCount()) { |
797 | KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."), | 822 | KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."), |
798 | i18n("Delete To-Do")); | 823 | i18n("Delete To-Do")); |
799 | } else { | 824 | } else { |
800 | emit deleteTodoSignal(mActiveItem->todo()); | 825 | emit deleteTodoSignal(mActiveItem->todo()); |
801 | } | 826 | } |
802 | } | 827 | } |
803 | } | 828 | } |
804 | 829 | ||
805 | void KOTodoView::setNewPriority(int index) | 830 | void KOTodoView::setNewPriority(int index) |
806 | { | 831 | { |
807 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 832 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
808 | mActiveItem->todo()->setPriority(mPriority[index]); | 833 | mActiveItem->todo()->setPriority(mPriority[index]); |
809 | mActiveItem->construct(); | 834 | mActiveItem->construct(); |
810 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); | 835 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); |
811 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 836 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
812 | } | 837 | } |
813 | } | 838 | } |
814 | 839 | ||
815 | void KOTodoView::setNewPercentage(int index) | 840 | void KOTodoView::setNewPercentage(int index) |
816 | { | 841 | { |
817 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 842 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
818 | if (mPercentage[index] == 100) { | 843 | if (mPercentage[index] == 100) { |
819 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); | 844 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); |
820 | } else { | 845 | } else { |
821 | mActiveItem->todo()->setCompleted(false); | 846 | mActiveItem->todo()->setCompleted(false); |
822 | } | 847 | } |
823 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); | 848 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); |
824 | mActiveItem->construct(); | 849 | mActiveItem->construct(); |
825 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); | 850 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); |
826 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 851 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
827 | } | 852 | } |
828 | } | 853 | } |
829 | 854 | ||
830 | 855 | ||
831 | QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) | 856 | QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) |
832 | { | 857 | { |
833 | QPopupMenu* tempMenu = new QPopupMenu (this); | 858 | QPopupMenu* tempMenu = new QPopupMenu (this); |
834 | QStringList checkedCategories = todoItem->todo()->categories (); | 859 | QStringList checkedCategories = todoItem->todo()->categories (); |
835 | 860 | ||
836 | tempMenu->setCheckable (true); | 861 | tempMenu->setCheckable (true); |
837 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 862 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
838 | it != KOPrefs::instance()->mCustomCategories.end (); | 863 | it != KOPrefs::instance()->mCustomCategories.end (); |
839 | ++it) { | 864 | ++it) { |
840 | int index = tempMenu->insertItem (*it); | 865 | int index = tempMenu->insertItem (*it); |
841 | mCategory[index] = *it; | 866 | mCategory[index] = *it; |
842 | if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true); | 867 | if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true); |
843 | } | 868 | } |
844 | 869 | ||
845 | connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); | 870 | connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); |
846 | return tempMenu; | 871 | return tempMenu; |
847 | 872 | ||
848 | 873 | ||
849 | } | 874 | } |
850 | void KOTodoView::changedCategories(int index) | 875 | void KOTodoView::changedCategories(int index) |
851 | { | 876 | { |
852 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 877 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
853 | QStringList categories = mActiveItem->todo()->categories (); | 878 | QStringList categories = mActiveItem->todo()->categories (); |
854 | if (categories.find (mCategory[index]) != categories.end ()) | 879 | if (categories.find (mCategory[index]) != categories.end ()) |
855 | categories.remove (mCategory[index]); | 880 | categories.remove (mCategory[index]); |
856 | else | 881 | else |
857 | categories.insert (categories.end(), mCategory[index]); | 882 | categories.insert (categories.end(), mCategory[index]); |
858 | categories.sort (); | 883 | categories.sort (); |
859 | mActiveItem->todo()->setCategories (categories); | 884 | mActiveItem->todo()->setCategories (categories); |
860 | mActiveItem->construct(); | 885 | mActiveItem->construct(); |
861 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 886 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
862 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); | 887 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); |
863 | } | 888 | } |
864 | } | 889 | } |
865 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 890 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
866 | { | 891 | { |
867 | if ( pendingSubtodo != 0 ) { | 892 | if ( pendingSubtodo != 0 ) { |
868 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 893 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
869 | } | 894 | } |
870 | pendingSubtodo = 0; | 895 | pendingSubtodo = 0; |
871 | if (!item) { | 896 | if (!item) { |
872 | newTodo(); | 897 | newTodo(); |
873 | return; | 898 | return; |
874 | } | 899 | } |
875 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 900 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
876 | editItem( item ); | 901 | editItem( item ); |
877 | else | 902 | else |
878 | showItem( item , QPoint(), 0 ); | 903 | showItem( item , QPoint(), 0 ); |
879 | } | 904 | } |
880 | void KOTodoView::itemClicked(QListViewItem *item) | 905 | void KOTodoView::itemClicked(QListViewItem *item) |
881 | { | 906 | { |
882 | 907 | ||
883 | if (!item) { | 908 | if (!item) { |
884 | if ( pendingSubtodo != 0 ) { | 909 | if ( pendingSubtodo != 0 ) { |
885 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 910 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
886 | } | 911 | } |
887 | pendingSubtodo = 0; | 912 | pendingSubtodo = 0; |
888 | return; | 913 | return; |
889 | } | 914 | } |
890 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 915 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
891 | if ( pendingSubtodo != 0 ) { | 916 | if ( pendingSubtodo != 0 ) { |
892 | bool allowReparent = true; | 917 | bool allowReparent = true; |
893 | QListViewItem *par = item; | 918 | QListViewItem *par = item; |
894 | while ( par ) { | 919 | while ( par ) { |
895 | if ( par == pendingSubtodo ) { | 920 | if ( par == pendingSubtodo ) { |
896 | allowReparent = false; | 921 | allowReparent = false; |
897 | break; | 922 | break; |
898 | } | 923 | } |
899 | par = par->parent(); | 924 | par = par->parent(); |
900 | } | 925 | } |
901 | if ( !allowReparent ) { | 926 | if ( !allowReparent ) { |
902 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); | 927 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); |
903 | qDebug("Recursive reparenting not possible "); | 928 | qDebug("Recursive reparenting not possible "); |
904 | pendingSubtodo = 0; | 929 | pendingSubtodo = 0; |
905 | } else { | 930 | } else { |
906 | Todo* newParent = todoItem->todo(); | 931 | Todo* newParent = todoItem->todo(); |
907 | Todo* newSub = pendingSubtodo->todo(); | 932 | Todo* newSub = pendingSubtodo->todo(); |
908 | pendingSubtodo = 0; | 933 | pendingSubtodo = 0; |
909 | emit reparentTodoSignal( newParent,newSub ); | 934 | emit reparentTodoSignal( newParent,newSub ); |
910 | return; | 935 | return; |
911 | } | 936 | } |
912 | } | 937 | } |
913 | int completed = todoItem->todo()->isCompleted(); // Completed or not? | 938 | int completed = todoItem->todo()->isCompleted(); // Completed or not? |
914 | 939 | ||
915 | if (todoItem->isOn()) { | 940 | if (todoItem->isOn()) { |
916 | if (!completed) { | 941 | if (!completed) { |
917 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); | 942 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); |
918 | } | 943 | } |
919 | } else { | 944 | } else { |
920 | if (completed) { | 945 | if (completed) { |
921 | todoItem->todo()->setCompleted(false); | 946 | todoItem->todo()->setCompleted(false); |
922 | } | 947 | } |
923 | } | 948 | } |
924 | } | 949 | } |
925 | 950 | ||
926 | void KOTodoView::setDocumentId( const QString &id ) | 951 | void KOTodoView::setDocumentId( const QString &id ) |
927 | { | 952 | { |
928 | kdDebug() << "KOTodoView::setDocumentId()" << endl; | 953 | kdDebug() << "KOTodoView::setDocumentId()" << endl; |
929 | 954 | ||
930 | mDocPrefs->setDoc( id ); | 955 | mDocPrefs->setDoc( id ); |
931 | } | 956 | } |
932 | 957 | ||
933 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 958 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
934 | { | 959 | { |
935 | if (!item) return; | 960 | if (!item) return; |
936 | 961 | ||
937 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 962 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
938 | 963 | ||
939 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 964 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
940 | 965 | ||
941 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 966 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
942 | } | 967 | } |
943 | 968 | ||
944 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 969 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
945 | { | 970 | { |
946 | mTodoListView->saveLayout(config,group); | 971 | mTodoListView->saveLayout(config,group); |
947 | } | 972 | } |
948 | 973 | ||
949 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 974 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
950 | { | 975 | { |
951 | mTodoListView->restoreLayout(config,group); | 976 | mTodoListView->restoreLayout(config,group); |
952 | } | 977 | } |
953 | 978 | ||
954 | void KOTodoView::processSelectionChange() | 979 | void KOTodoView::processSelectionChange() |
955 | { | 980 | { |
956 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 981 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
957 | 982 | ||
958 | KOTodoViewItem *item = | 983 | KOTodoViewItem *item = |
959 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 984 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
960 | 985 | ||
961 | if ( !item ) { | 986 | if ( !item ) { |
962 | emit incidenceSelected( 0 ); | 987 | emit incidenceSelected( 0 ); |
963 | } else { | 988 | } else { |
964 | emit incidenceSelected( item->todo() ); | 989 | emit incidenceSelected( item->todo() ); |
965 | } | 990 | } |
966 | } | 991 | } |
967 | 992 | ||
968 | void KOTodoView::modified(bool b) | 993 | void KOTodoView::modified(bool b) |
969 | { | 994 | { |
970 | emit isModified(b); | 995 | emit isModified(b); |
971 | } | 996 | } |
972 | void KOTodoView::setTodoModified( Todo* todo ) | 997 | void KOTodoView::setTodoModified( Todo* todo ) |
973 | { | 998 | { |
974 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 999 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
975 | } | 1000 | } |
976 | void KOTodoView::clearSelection() | 1001 | void KOTodoView::clearSelection() |
977 | { | 1002 | { |
978 | mTodoListView->selectAll( false ); | 1003 | mTodoListView->selectAll( false ); |
979 | } | 1004 | } |
980 | 1005 | ||
981 | void KOTodoView::purgeCompleted() | 1006 | void KOTodoView::purgeCompleted() |
982 | { | 1007 | { |
983 | emit purgeCompletedSignal(); | 1008 | emit purgeCompletedSignal(); |
984 | } | 1009 | } |
985 | void KOTodoView::toggleQuickTodo() | 1010 | void KOTodoView::toggleQuickTodo() |
986 | { | 1011 | { |
987 | if ( mQuickAdd->isVisible() ) { | 1012 | if ( mQuickAdd->isVisible() ) { |
988 | mQuickAdd->hide(); | 1013 | mQuickAdd->hide(); |
989 | KOPrefs::instance()->mEnableQuickTodo = false; | 1014 | KOPrefs::instance()->mEnableQuickTodo = false; |
990 | } | 1015 | } |
991 | else { | 1016 | else { |
992 | mQuickAdd->show(); | 1017 | mQuickAdd->show(); |
993 | KOPrefs::instance()->mEnableQuickTodo = true; | 1018 | KOPrefs::instance()->mEnableQuickTodo = true; |
994 | } | 1019 | } |
995 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1020 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
996 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1021 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
997 | } | 1022 | } |
1023 | |||
1024 | void KOTodoView::toggleRunning() | ||
1025 | { | ||
1026 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | ||
1027 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | ||
1028 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | ||
1029 | updateView(); | ||
1030 | } | ||
1031 | |||
998 | void KOTodoView::toggleCompleted() | 1032 | void KOTodoView::toggleCompleted() |
999 | { | 1033 | { |
1000 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1034 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1001 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1035 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1002 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1036 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1003 | updateView(); | 1037 | updateView(); |
1004 | } | 1038 | } |
1005 | 1039 | ||
1006 | void KOTodoView::addQuickTodo() | 1040 | void KOTodoView::addQuickTodo() |
1007 | { | 1041 | { |
1008 | Todo *todo = new Todo(); | 1042 | Todo *todo = new Todo(); |
1009 | todo->setSummary(mQuickAdd->text()); | 1043 | todo->setSummary(mQuickAdd->text()); |
1010 | todo->setOrganizer(KOPrefs::instance()->email()); | 1044 | todo->setOrganizer(KOPrefs::instance()->email()); |
1011 | CalFilter * cf = mCalendar->filter(); | 1045 | CalFilter * cf = mCalendar->filter(); |
1012 | if ( cf ) { | 1046 | if ( cf ) { |
1013 | if ( cf->isEnabled()&& cf->showCategories()) { | 1047 | if ( cf->isEnabled()&& cf->showCategories()) { |
1014 | todo->setCategories(cf->categoryList()); | 1048 | todo->setCategories(cf->categoryList()); |
1015 | } | 1049 | } |
1016 | if ( cf->isEnabled() ) | 1050 | if ( cf->isEnabled() ) |
1017 | todo->setSecrecy( cf->getSecrecy()); | 1051 | todo->setSecrecy( cf->getSecrecy()); |
1018 | } | 1052 | } |
1019 | mCalendar->addTodo(todo); | 1053 | mCalendar->addTodo(todo); |
1020 | mQuickAdd->setText(""); | 1054 | mQuickAdd->setText(""); |
1021 | todoModified (todo, KOGlobals::EVENTADDED ); | 1055 | todoModified (todo, KOGlobals::EVENTADDED ); |
1022 | updateView(); | 1056 | updateView(); |
1023 | } | 1057 | } |
1024 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1058 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1025 | { | 1059 | { |
1026 | // e->ignore(); | 1060 | // e->ignore(); |
1027 | //return; | 1061 | //return; |
1028 | //qDebug("KOTodoView::keyPressEvent "); | 1062 | //qDebug("KOTodoView::keyPressEvent "); |
1029 | switch ( e->key() ) { | 1063 | switch ( e->key() ) { |
1030 | case Qt::Key_Down: | 1064 | case Qt::Key_Down: |
1031 | case Qt::Key_Up: | 1065 | case Qt::Key_Up: |
1032 | QWidget::keyPressEvent ( e ); | 1066 | QWidget::keyPressEvent ( e ); |
1033 | break; | 1067 | break; |
1034 | 1068 | ||
1035 | case Qt::Key_Q: | 1069 | case Qt::Key_Q: |
1036 | toggleQuickTodo(); | 1070 | toggleQuickTodo(); |
1037 | break; | 1071 | break; |
1038 | case Qt::Key_U: | 1072 | case Qt::Key_U: |
1039 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1073 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1040 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1074 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1041 | unparentTodo(); | 1075 | unparentTodo(); |
1042 | e->accept(); | 1076 | e->accept(); |
1043 | } else | 1077 | } else |
1044 | e->ignore(); | 1078 | e->ignore(); |
1045 | break; | 1079 | break; |
1046 | case Qt::Key_S: | 1080 | case Qt::Key_S: |
1047 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1081 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1048 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1082 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1049 | reparentTodo(); | 1083 | reparentTodo(); |
1050 | e->accept(); | 1084 | e->accept(); |
1051 | } else | 1085 | } else |
1052 | e->ignore(); | 1086 | e->ignore(); |
1053 | break; | 1087 | break; |
1054 | case Qt::Key_P: | 1088 | case Qt::Key_P: |
1055 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1089 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1056 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1090 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1057 | if ( pendingSubtodo ) | 1091 | if ( pendingSubtodo ) |
1058 | itemClicked(mActiveItem); | 1092 | itemClicked(mActiveItem); |
1059 | e->accept(); | 1093 | e->accept(); |
1060 | } else | 1094 | } else |
1061 | e->ignore(); | 1095 | e->ignore(); |
1062 | break; | 1096 | break; |
1063 | case Qt::Key_Escape: | 1097 | case Qt::Key_Escape: |
1064 | if ( pendingSubtodo ) { | 1098 | if ( pendingSubtodo ) { |
1065 | itemClicked(0); | 1099 | itemClicked(0); |
1066 | e->accept(); | 1100 | e->accept(); |
1067 | } else | 1101 | } else |
1068 | e->ignore(); | 1102 | e->ignore(); |
1069 | break; | 1103 | break; |
1070 | default: | 1104 | default: |
1071 | e->ignore(); | 1105 | e->ignore(); |
1072 | } | 1106 | } |
1073 | 1107 | ||
1074 | if ( true ) { | 1108 | if ( true ) { |
1075 | if ( e->key() == Qt::Key_I ) { | 1109 | if ( e->key() == Qt::Key_I ) { |
1076 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 1110 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
1077 | if ( cn ) { | 1111 | if ( cn ) { |
1078 | mActiveItem = cn; | 1112 | mActiveItem = cn; |
1079 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 1113 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
1080 | if ( ci ){ | 1114 | if ( ci ){ |
1081 | showTodo(); | 1115 | showTodo(); |
1082 | cn = (KOTodoViewItem*)cn->itemBelow(); | 1116 | cn = (KOTodoViewItem*)cn->itemBelow(); |
1083 | if ( cn ) { | 1117 | if ( cn ) { |
1084 | mTodoListView->setCurrentItem ( cn ); | 1118 | mTodoListView->setCurrentItem ( cn ); |
1085 | mTodoListView->ensureItemVisible ( cn ); | 1119 | mTodoListView->ensureItemVisible ( cn ); |
1086 | } | 1120 | } |
1087 | 1121 | ||
1088 | } | 1122 | } |
1089 | } | 1123 | } |
1090 | e->accept(); | 1124 | e->accept(); |
1091 | 1125 | ||
1092 | } | 1126 | } |
1093 | 1127 | ||
1094 | } | 1128 | } |
1095 | 1129 | ||
1096 | } | 1130 | } |
1097 | void KOTodoView::updateTodo( Todo * t, int type ) | 1131 | void KOTodoView::updateTodo( Todo * t, int type ) |
1098 | { | 1132 | { |
1099 | if ( mBlockUpdate) | 1133 | if ( mBlockUpdate) |
1100 | return; | 1134 | return; |
1101 | 1135 | ||
1102 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1136 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1103 | itemIterator = mTodoMap.find(t); | 1137 | itemIterator = mTodoMap.find(t); |
1104 | if (itemIterator != mTodoMap.end()) { | 1138 | if (itemIterator != mTodoMap.end()) { |
1105 | (*itemIterator)->construct(); | 1139 | (*itemIterator)->construct(); |
1106 | } else { | 1140 | } else { |
1107 | if ( type == KOGlobals::EVENTADDED ) { | 1141 | if ( type == KOGlobals::EVENTADDED ) { |
1108 | insertTodoItem( t ); | 1142 | insertTodoItem( t ); |
1109 | } | 1143 | } |
1110 | } | 1144 | } |
1111 | 1145 | ||
1112 | } | 1146 | } |
1113 | 1147 | ||
1114 | void KOTodoView::todoModified(Todo * t , int p ) | 1148 | void KOTodoView::todoModified(Todo * t , int p ) |
1115 | { | 1149 | { |
1116 | mBlockUpdate = true; | 1150 | mBlockUpdate = true; |
1117 | emit todoModifiedSignal ( t, p ); | 1151 | emit todoModifiedSignal ( t, p ); |
1118 | mBlockUpdate = false; | 1152 | mBlockUpdate = false; |
1119 | } | 1153 | } |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 0c08677..5ca0362 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -1,234 +1,239 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOTODOVIEW_H | 23 | #ifndef KOTODOVIEW_H |
24 | #define KOTODOVIEW_H | 24 | #define KOTODOVIEW_H |
25 | 25 | ||
26 | #include <qfont.h> | 26 | #include <qfont.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qptrlist.h> | 29 | #include <qptrlist.h> |
30 | #include <qstrlist.h> | 30 | #include <qstrlist.h> |
31 | #include <qlistbox.h> | 31 | #include <qlistbox.h> |
32 | #include <qpopupmenu.h> | 32 | #include <qpopupmenu.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | #include <qlistview.h> | 35 | #include <qlistview.h> |
36 | #include <klistview.h> | 36 | #include <klistview.h> |
37 | 37 | ||
38 | #include <libkcal/calendar.h> | 38 | #include <libkcal/calendar.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | 40 | ||
41 | #include <korganizer/baseview.h> | 41 | #include <korganizer/baseview.h> |
42 | 42 | ||
43 | #include "kotodoviewitem.h" | 43 | #include "kotodoviewitem.h" |
44 | #include "koprefs.h" | 44 | #include "koprefs.h" |
45 | #include "koglobals.h" | 45 | #include "koglobals.h" |
46 | #include "datenavigator.h" | ||
46 | 47 | ||
47 | class QDragEnterEvent; | 48 | class QDragEnterEvent; |
48 | class QDragMoveEvent; | 49 | class QDragMoveEvent; |
49 | class QDragLeaveEvent; | 50 | class QDragLeaveEvent; |
50 | class QDropEvent; | 51 | class QDropEvent; |
51 | 52 | ||
52 | class DocPrefs; | 53 | class DocPrefs; |
53 | 54 | ||
54 | class KOTodoListView : public KListView | 55 | class KOTodoListView : public KListView |
55 | { | 56 | { |
56 | Q_OBJECT | 57 | Q_OBJECT |
57 | public: | 58 | public: |
58 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 59 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
59 | virtual ~KOTodoListView() {} | 60 | virtual ~KOTodoListView() {} |
60 | 61 | ||
61 | signals: | 62 | signals: |
62 | void todoDropped(Todo *); | 63 | void todoDropped(Todo *); |
63 | void double_Clicked(QListViewItem *item); | 64 | void double_Clicked(QListViewItem *item); |
64 | 65 | ||
65 | protected: | 66 | protected: |
66 | void contentsDragEnterEvent(QDragEnterEvent *); | 67 | void contentsDragEnterEvent(QDragEnterEvent *); |
67 | void contentsDragMoveEvent(QDragMoveEvent *); | 68 | void contentsDragMoveEvent(QDragMoveEvent *); |
68 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 69 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
69 | void contentsDropEvent(QDropEvent *); | 70 | void contentsDropEvent(QDropEvent *); |
70 | 71 | ||
71 | void contentsMousePressEvent(QMouseEvent *); | 72 | void contentsMousePressEvent(QMouseEvent *); |
72 | void contentsMouseMoveEvent(QMouseEvent *); | 73 | void contentsMouseMoveEvent(QMouseEvent *); |
73 | void contentsMouseReleaseEvent(QMouseEvent *); | 74 | void contentsMouseReleaseEvent(QMouseEvent *); |
74 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 75 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
75 | 76 | ||
76 | private: | 77 | private: |
77 | QString mName; | 78 | QString mName; |
78 | Calendar *mCalendar; | 79 | Calendar *mCalendar; |
79 | QPoint mPressPos; | 80 | QPoint mPressPos; |
80 | bool mMousePressed; | 81 | bool mMousePressed; |
81 | QListViewItem *mOldCurrent; | 82 | QListViewItem *mOldCurrent; |
82 | void keyPressEvent ( QKeyEvent * ) ; | 83 | void keyPressEvent ( QKeyEvent * ) ; |
83 | }; | 84 | }; |
84 | 85 | ||
85 | 86 | ||
86 | /** | 87 | /** |
87 | This is the line-edit on top of the todoview for fast addition of new todos | 88 | This is the line-edit on top of the todoview for fast addition of new todos |
88 | */ | 89 | */ |
89 | class KOQuickTodo : public QLineEdit | 90 | class KOQuickTodo : public QLineEdit |
90 | { | 91 | { |
91 | public: | 92 | public: |
92 | KOQuickTodo(QWidget *parent=0); | 93 | KOQuickTodo(QWidget *parent=0); |
93 | protected: | 94 | protected: |
94 | void focusInEvent(QFocusEvent *ev); | 95 | void focusInEvent(QFocusEvent *ev); |
95 | void focusOutEvent(QFocusEvent *ev); | 96 | void focusOutEvent(QFocusEvent *ev); |
96 | }; | 97 | }; |
97 | 98 | ||
98 | 99 | ||
99 | /** | 100 | /** |
100 | This class provides a multi-column list view of todo events. | 101 | This class provides a multi-column list view of todo events. |
101 | 102 | ||
102 | @short multi-column list view of todo events. | 103 | @short multi-column list view of todo events. |
103 | @author Cornelius Schumacher <schumacher@kde.org> | 104 | @author Cornelius Schumacher <schumacher@kde.org> |
104 | */ | 105 | */ |
105 | class KOTodoView : public KOrg::BaseView | 106 | class KOTodoView : public KOrg::BaseView |
106 | { | 107 | { |
107 | Q_OBJECT | 108 | Q_OBJECT |
108 | public: | 109 | public: |
109 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 110 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
110 | ~KOTodoView(); | 111 | ~KOTodoView(); |
111 | 112 | ||
112 | QPtrList<Incidence> selectedIncidences(); | 113 | QPtrList<Incidence> selectedIncidences(); |
113 | QPtrList<Todo> selectedTodos(); | 114 | QPtrList<Todo> selectedTodos(); |
114 | 115 | ||
115 | DateList selectedDates() | 116 | DateList selectedDates() |
116 | {DateList q; | 117 | {DateList q; |
117 | return q;} | 118 | return q;} |
118 | 119 | ||
119 | /** Return number of shown dates. TodoView does not show dates, */ | 120 | /** Return number of shown dates. TodoView does not show dates, */ |
120 | int currentDateCount() { return 0; } | 121 | int currentDateCount() { return 0; } |
121 | void setNarrow(); | ||
122 | 122 | ||
123 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); | 123 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); |
124 | 124 | ||
125 | void setDocumentId( const QString & ); | 125 | void setDocumentId( const QString & ); |
126 | 126 | ||
127 | void saveLayout(KConfig *config, const QString &group) const; | 127 | void saveLayout(KConfig *config, const QString &group) const; |
128 | void restoreLayout(KConfig *config, const QString &group); | 128 | void restoreLayout(KConfig *config, const QString &group); |
129 | /** Create a popup menu to set categories */ | 129 | /** Create a popup menu to set categories */ |
130 | QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); | 130 | QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); |
131 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} | ||
131 | 132 | ||
132 | public slots: | 133 | public slots: |
133 | void updateView(); | 134 | void updateView(); |
134 | void updateConfig(); | 135 | void updateConfig(); |
135 | 136 | ||
136 | void changeEventDisplay(Event *, int); | 137 | void changeEventDisplay(Event *, int); |
137 | 138 | ||
138 | void showDates(const QDate &start, const QDate &end); | 139 | void showDates(const QDate &start, const QDate &end); |
139 | void showEvents(QPtrList<Event> eventList); | 140 | void showEvents(QPtrList<Event> eventList); |
140 | 141 | ||
141 | void clearSelection(); | 142 | void clearSelection(); |
142 | void jumpToDate (); | 143 | void jumpToDate (); |
143 | 144 | ||
144 | void editItem(QListViewItem *item); | 145 | void editItem(QListViewItem *item); |
145 | void showItem(QListViewItem *item,const QPoint &,int); | 146 | void showItem(QListViewItem *item,const QPoint &,int); |
146 | void popupMenu(QListViewItem *item,const QPoint &,int); | 147 | void popupMenu(QListViewItem *item,const QPoint &,int); |
147 | void newTodo(); | 148 | void newTodo(); |
148 | void newSubTodo(); | 149 | void newSubTodo(); |
149 | void unparentTodo(); | 150 | void unparentTodo(); |
150 | void reparentTodo(); | 151 | void reparentTodo(); |
151 | void showTodo(); | 152 | void showTodo(); |
152 | void editTodo(); | 153 | void editTodo(); |
153 | void cloneTodo(); | 154 | void cloneTodo(); |
154 | void cancelTodo(); | 155 | void cancelTodo(); |
155 | void moveTodo(); | 156 | void moveTodo(); |
156 | void beamTodo(); | 157 | void beamTodo(); |
157 | void deleteTodo(); | 158 | void deleteTodo(); |
158 | 159 | ||
159 | void setNewPriority(int); | 160 | void setNewPriority(int); |
160 | void setNewPercentage(int); | 161 | void setNewPercentage(int); |
161 | void changedCategories(int); | 162 | void changedCategories(int); |
162 | 163 | ||
163 | void purgeCompleted(); | 164 | void purgeCompleted(); |
164 | void toggleCompleted(); | 165 | void toggleCompleted(); |
166 | void toggleRunning(); | ||
165 | void toggleQuickTodo(); | 167 | void toggleQuickTodo(); |
166 | void updateTodo( Todo *, int ); | 168 | void updateTodo( Todo *, int ); |
167 | 169 | ||
168 | void itemClicked(QListViewItem *); | 170 | void itemClicked(QListViewItem *); |
169 | void itemStateChanged(QListViewItem *); | 171 | void itemStateChanged(QListViewItem *); |
170 | void modified(bool); | 172 | void modified(bool); |
171 | void itemDoubleClicked(QListViewItem *item); | 173 | void itemDoubleClicked(QListViewItem *item); |
172 | 174 | ||
173 | signals: | 175 | signals: |
174 | void newTodoSignal(); | 176 | void newTodoSignal(); |
175 | void newSubTodoSignal(Todo *); | 177 | void newSubTodoSignal(Todo *); |
176 | void unparentTodoSignal(Todo *); | 178 | void unparentTodoSignal(Todo *); |
177 | void reparentTodoSignal( Todo *,Todo * ); | 179 | void reparentTodoSignal( Todo *,Todo * ); |
178 | void showTodoSignal(Todo *); | 180 | void showTodoSignal(Todo *); |
179 | 181 | ||
180 | void editTodoSignal(Todo *); | 182 | void editTodoSignal(Todo *); |
181 | void deleteTodoSignal(Todo *); | 183 | void deleteTodoSignal(Todo *); |
182 | void todoModifiedSignal (Todo *, int); | 184 | void todoModifiedSignal (Todo *, int); |
183 | 185 | ||
184 | void isModified(bool); | 186 | void isModified(bool); |
185 | void cloneTodoSignal( Incidence * ); | 187 | void cloneTodoSignal( Incidence * ); |
186 | void cancelTodoSignal( Incidence * ); | 188 | void cancelTodoSignal( Incidence * ); |
187 | void moveTodoSignal( Incidence * ); | 189 | void moveTodoSignal( Incidence * ); |
188 | void beamTodoSignal( Incidence * ); | 190 | void beamTodoSignal( Incidence * ); |
189 | void purgeCompletedSignal(); | 191 | void purgeCompletedSignal(); |
190 | 192 | ||
191 | protected slots: | 193 | protected slots: |
192 | void processSelectionChange(); | 194 | void processSelectionChange(); |
193 | void addQuickTodo(); | 195 | void addQuickTodo(); |
194 | 196 | ||
195 | private: | 197 | private: |
196 | /* | 198 | /* |
197 | * the TodoEditor approach is rather unscaling in the long | 199 | * the TodoEditor approach is rather unscaling in the long |
198 | * run. | 200 | * run. |
199 | * Korganizer keeps it in memory and we need to update | 201 | * Korganizer keeps it in memory and we need to update |
200 | * 1. make KOTodoViewItem a QObject again? | 202 | * 1. make KOTodoViewItem a QObject again? |
201 | * 2. add a public method for setting one todo modified? | 203 | * 2. add a public method for setting one todo modified? |
202 | * 3. add a private method for setting a todo modified + friend here? | 204 | * 3. add a private method for setting a todo modified + friend here? |
203 | * -- zecke 2002-07-08 | 205 | * -- zecke 2002-07-08 |
204 | */ | 206 | */ |
205 | friend class KOTodoViewItem; | 207 | friend class KOTodoViewItem; |
206 | void setTodoModified( Todo* ); | 208 | void setTodoModified( Todo* ); |
207 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 209 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
208 | void restoreItemState( QListViewItem * ); | 210 | void restoreItemState( QListViewItem * ); |
209 | 211 | ||
212 | bool checkTodo( Todo * ); | ||
213 | |||
210 | KOTodoListView *mTodoListView; | 214 | KOTodoListView *mTodoListView; |
211 | QPopupMenu *mItemPopupMenu; | 215 | QPopupMenu *mItemPopupMenu; |
212 | QPopupMenu *mPopupMenu; | 216 | QPopupMenu *mPopupMenu; |
213 | QPopupMenu *mPriorityPopupMenu; | 217 | QPopupMenu *mPriorityPopupMenu; |
214 | QPopupMenu *mPercentageCompletedPopupMenu; | 218 | QPopupMenu *mPercentageCompletedPopupMenu; |
215 | QPopupMenu *mCategoryPopupMenu; | 219 | QPopupMenu *mCategoryPopupMenu; |
216 | 220 | ||
217 | QMap<int, int> mPercentage; | 221 | QMap<int, int> mPercentage; |
218 | QMap<int, int> mPriority; | 222 | QMap<int, int> mPriority; |
219 | QMap<int, QString> mCategory; | 223 | QMap<int, QString> mCategory; |
220 | KOTodoViewItem *mActiveItem; | 224 | KOTodoViewItem *mActiveItem; |
221 | 225 | ||
222 | QMap<Todo *,KOTodoViewItem *> mTodoMap; | 226 | QMap<Todo *,KOTodoViewItem *> mTodoMap; |
223 | QString mName; | 227 | QString mName; |
224 | 228 | ||
225 | DocPrefs *mDocPrefs; | 229 | DocPrefs *mDocPrefs; |
226 | QString mCurrentDoc; | 230 | QString mCurrentDoc; |
227 | KOQuickTodo *mQuickAdd; | 231 | KOQuickTodo *mQuickAdd; |
228 | bool mBlockUpdate; | 232 | bool mBlockUpdate; |
229 | void todoModified(Todo *, int ); | 233 | void todoModified(Todo *, int ); |
230 | void keyPressEvent ( QKeyEvent * ) ; | 234 | void keyPressEvent ( QKeyEvent * ) ; |
231 | KOTodoViewItem * pendingSubtodo; | 235 | KOTodoViewItem * pendingSubtodo; |
236 | DateNavigator* mNavigator; | ||
232 | }; | 237 | }; |
233 | 238 | ||
234 | #endif | 239 | #endif |
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ae0b334..347d982 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -1,432 +1,457 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <kdebug.h> | 21 | #include <kdebug.h> |
22 | #include <qapp.h> | 22 | #include <qapp.h> |
23 | 23 | ||
24 | #include <kiconloader.h> | 24 | #include <kiconloader.h> |
25 | #include "kotodoviewitem.h" | 25 | #include "kotodoviewitem.h" |
26 | #include "kotodoview.h" | 26 | #include "kotodoview.h" |
27 | #include "koprefs.h" | 27 | #include "koprefs.h" |
28 | 28 | ||
29 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) | 29 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) |
30 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 30 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
31 | { | 31 | { |
32 | construct(); | 32 | construct(); |
33 | } | 33 | } |
34 | 34 | ||
35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) | 35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) |
36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
37 | { | 37 | { |
38 | construct(); | 38 | construct(); |
39 | } | 39 | } |
40 | 40 | ||
41 | QString KOTodoViewItem::key(int column,bool) const | 41 | QString KOTodoViewItem::key(int column,bool) const |
42 | { | 42 | { |
43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); | 43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); |
44 | if (it == mKeyMap.end()) { | 44 | if (it == mKeyMap.end()) { |
45 | return text(column).lower(); | 45 | return text(column).lower(); |
46 | } else { | 46 | } else { |
47 | return *it; | 47 | return *it; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void KOTodoViewItem:: setup() | 51 | void KOTodoViewItem:: setup() |
52 | { | 52 | { |
53 | 53 | ||
54 | int h = 20; | 54 | int h = 20; |
55 | if ( listView () ) { | 55 | if ( listView () ) { |
56 | QFontMetrics fm ( listView ()->font () ); | 56 | QFontMetrics fm ( listView ()->font () ); |
57 | h = fm.height(); | 57 | h = fm.height(); |
58 | } | 58 | } |
59 | setHeight( h ); | 59 | setHeight( h ); |
60 | 60 | ||
61 | } | 61 | } |
62 | void KOTodoViewItem::setSortKey(int column,const QString &key) | 62 | void KOTodoViewItem::setSortKey(int column,const QString &key) |
63 | { | 63 | { |
64 | mKeyMap.insert(column,key); | 64 | mKeyMap.insert(column,key); |
65 | } | 65 | } |
66 | 66 | ||
67 | #if QT_VERSION >= 300 | 67 | #if QT_VERSION >= 300 |
68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, | 68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, |
69 | int y,int h) | 69 | int y,int h) |
70 | { | 70 | { |
71 | QListViewItem::paintBranches(p,cg,w,y,h); | 71 | QListViewItem::paintBranches(p,cg,w,y,h); |
72 | } | 72 | } |
73 | #else | 73 | #else |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | void KOTodoViewItem::construct() | 76 | void KOTodoViewItem::construct() |
77 | { | 77 | { |
78 | // qDebug("KOTodoViewItem::construct() "); | 78 | // qDebug("KOTodoViewItem::construct() "); |
79 | m_init = true; | 79 | m_init = true; |
80 | QString keyd = "=="; | 80 | QString keyd = "=="; |
81 | QString keyt = "=="; | 81 | QString keyt = "=="; |
82 | QString skeyd = "=="; | ||
83 | QString skeyt = "=="; | ||
82 | 84 | ||
83 | setOn(mTodo->isCompleted()); | 85 | setOn(mTodo->isCompleted()); |
84 | setText(0,mTodo->summary()); | 86 | setText(0,mTodo->summary()); |
85 | setText(1,QString::number(mTodo->priority())); | 87 | setText(1,QString::number(mTodo->priority())); |
86 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); | 88 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); |
87 | if (mTodo->percentComplete()<100) { | 89 | if (mTodo->percentComplete()<100) { |
88 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 90 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
89 | else setSortKey(2,QString::number(mTodo->percentComplete())); | 91 | else setSortKey(2,QString::number(mTodo->percentComplete())); |
90 | } | 92 | } |
91 | else { | 93 | else { |
92 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 94 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
93 | else setSortKey(2,QString::number(99)); | 95 | else setSortKey(2,QString::number(99)); |
94 | } | 96 | } |
95 | if (mTodo->hasDueDate()) { | 97 | if (mTodo->hasDueDate()) { |
96 | setText(3, mTodo->dtDueDateStr()); | 98 | setText(3, mTodo->dtDueDateStr()); |
97 | QDate d = mTodo->dtDue().date(); | 99 | QDate d = mTodo->dtDue().date(); |
98 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 100 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
99 | setSortKey(3,keyd); | 101 | // setSortKey(3,keyd); |
100 | if (mTodo->doesFloat()) { | 102 | if (mTodo->doesFloat()) { |
101 | setText(4,""); | 103 | setText(4,""); |
102 | } | 104 | } |
103 | else { | 105 | else { |
104 | setText(4,mTodo->dtDueTimeStr()); | 106 | setText(4,mTodo->dtDueTimeStr()); |
105 | QTime t = mTodo->dtDue().time(); | 107 | QTime t = mTodo->dtDue().time(); |
106 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); | 108 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); |
107 | setSortKey(4,keyt); | 109 | //setSortKey(4,keyt); |
108 | } | 110 | } |
109 | } else { | 111 | } else { |
110 | setText(3,""); | 112 | setText(3,""); |
111 | setText(4,""); | 113 | setText(4,""); |
112 | } | 114 | } |
113 | setSortKey(3,keyd); | 115 | setSortKey(3,keyd); |
114 | setSortKey(4,keyt); | 116 | setSortKey(4,keyt); |
115 | 117 | ||
116 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); | 118 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); |
117 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 119 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
118 | 120 | ||
119 | setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | 121 | |
120 | setText(6,mTodo->categoriesStr()); | 122 | |
123 | if (mTodo->hasStartDate()) { | ||
124 | setText(5, mTodo->dtStartDateStr()); | ||
125 | QDate d = mTodo->dtStart().date(); | ||
126 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | ||
127 | |||
128 | if (mTodo->doesFloat()) { | ||
129 | setText(6,""); | ||
130 | } | ||
131 | else { | ||
132 | setText(6,mTodo->dtStartTimeStr()); | ||
133 | QTime t = mTodo->dtStart().time(); | ||
134 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); | ||
135 | |||
136 | } | ||
137 | } else { | ||
138 | setText(5,""); | ||
139 | setText(6,""); | ||
140 | } | ||
141 | setSortKey(5,skeyd); | ||
142 | setSortKey(6,skeyt); | ||
143 | |||
144 | setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | ||
145 | setText(8,mTodo->categoriesStr()); | ||
121 | 146 | ||
122 | #if 0 | 147 | #if 0 |
123 | // Find sort id in description. It's the text behind the last '#' character | 148 | // Find sort id in description. It's the text behind the last '#' character |
124 | // found in the description. White spaces are removed from beginning and end | 149 | // found in the description. White spaces are removed from beginning and end |
125 | // of sort id. | 150 | // of sort id. |
126 | int pos = mTodo->description().findRev('#'); | 151 | int pos = mTodo->description().findRev('#'); |
127 | if (pos < 0) { | 152 | if (pos < 0) { |
128 | setText(6,""); | 153 | setText(6,""); |
129 | } else { | 154 | } else { |
130 | QString str = mTodo->description().mid(pos+1); | 155 | QString str = mTodo->description().mid(pos+1); |
131 | str.stripWhiteSpace(); | 156 | str.stripWhiteSpace(); |
132 | setText(6,str); | 157 | setText(6,str); |
133 | } | 158 | } |
134 | #endif | 159 | #endif |
135 | 160 | ||
136 | m_known = false; | 161 | m_known = false; |
137 | m_init = false; | 162 | m_init = false; |
138 | 163 | ||
139 | setMyPixmap(); | 164 | setMyPixmap(); |
140 | 165 | ||
141 | } | 166 | } |
142 | void KOTodoViewItem::setMyPixmap() | 167 | void KOTodoViewItem::setMyPixmap() |
143 | { | 168 | { |
144 | int size = 5; | 169 | int size = 5; |
145 | QPixmap pixi = QPixmap( 1, 1 ); | 170 | QPixmap pixi = QPixmap( 1, 1 ); |
146 | // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { | 171 | // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { |
147 | // pixi = SmallIcon("redcross16"); | 172 | // pixi = SmallIcon("redcross16"); |
148 | // } else { | 173 | // } else { |
149 | QPainter p; | 174 | QPainter p; |
150 | 175 | ||
151 | int pixSize = 0; | 176 | int pixSize = 0; |
152 | QPixmap pPix = QPixmap( size, size ); | 177 | QPixmap pPix = QPixmap( size, size ); |
153 | if ( mTodo->description().length() > 0 ) { | 178 | if ( mTodo->description().length() > 0 ) { |
154 | pixi.resize(size, pixSize+size); | 179 | pixi.resize(size, pixSize+size); |
155 | pPix.fill( Qt::darkGreen ); | 180 | pPix.fill( Qt::darkGreen ); |
156 | p.begin( &pixi ); | 181 | p.begin( &pixi ); |
157 | p. drawPixmap ( 0, pixSize, pPix); | 182 | p. drawPixmap ( 0, pixSize, pPix); |
158 | p.end(); | 183 | p.end(); |
159 | pixSize += size; | 184 | pixSize += size; |
160 | } | 185 | } |
161 | if ( mTodo->isAlarmEnabled() ) { | 186 | if ( mTodo->isAlarmEnabled() ) { |
162 | pixi.resize(size, pixSize+size); | 187 | pixi.resize(size, pixSize+size); |
163 | pPix.fill( Qt::red ); | 188 | pPix.fill( Qt::red ); |
164 | p.begin( &pixi ); | 189 | p.begin( &pixi ); |
165 | p. drawPixmap ( 0, pixSize, pPix); | 190 | p. drawPixmap ( 0, pixSize, pPix); |
166 | p.end(); | 191 | p.end(); |
167 | pixSize += size; | 192 | pixSize += size; |
168 | } | 193 | } |
169 | // } | 194 | // } |
170 | if ( pixi.width() > 1 ) { | 195 | if ( pixi.width() > 1 ) { |
171 | setPixmap ( 0,pixi ) ; | 196 | setPixmap ( 0,pixi ) ; |
172 | } | 197 | } |
173 | 198 | ||
174 | 199 | ||
175 | } | 200 | } |
176 | void KOTodoViewItem::stateChange(bool state) | 201 | void KOTodoViewItem::stateChange(bool state) |
177 | { | 202 | { |
178 | // qDebug("KOTodoViewItem::stateChange "); | 203 | // qDebug("KOTodoViewItem::stateChange "); |
179 | // do not change setting on startup | 204 | // do not change setting on startup |
180 | if ( m_init ) return; | 205 | if ( m_init ) return; |
181 | 206 | ||
182 | kdDebug() << "State changed, modified " << state << endl; | 207 | kdDebug() << "State changed, modified " << state << endl; |
183 | QString keyd = "=="; | 208 | QString keyd = "=="; |
184 | QString keyt = "=="; | 209 | QString keyt = "=="; |
185 | 210 | ||
186 | if (state) mTodo->setCompleted(state); | 211 | if (state) mTodo->setCompleted(state); |
187 | else mTodo->setPercentComplete(0); | 212 | else mTodo->setPercentComplete(0); |
188 | if (isOn()!=state) { | 213 | if (isOn()!=state) { |
189 | setOn(state); | 214 | setOn(state); |
190 | } | 215 | } |
191 | 216 | ||
192 | if (mTodo->hasDueDate()) { | 217 | if (mTodo->hasDueDate()) { |
193 | setText(3, mTodo->dtDueDateStr()); | 218 | setText(3, mTodo->dtDueDateStr()); |
194 | QDate d = mTodo->dtDue().date(); | 219 | QDate d = mTodo->dtDue().date(); |
195 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 220 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
196 | setSortKey(3,keyd); | 221 | setSortKey(3,keyd); |
197 | if (mTodo->doesFloat()) { | 222 | if (mTodo->doesFloat()) { |
198 | setText(4,""); | 223 | setText(4,""); |
199 | } | 224 | } |
200 | else { | 225 | else { |
201 | setText(4,mTodo->dtDueTimeStr()); | 226 | setText(4,mTodo->dtDueTimeStr()); |
202 | QTime t = mTodo->dtDue().time(); | 227 | QTime t = mTodo->dtDue().time(); |
203 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); | 228 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); |
204 | setSortKey(4,keyt); | 229 | setSortKey(4,keyt); |
205 | } | 230 | } |
206 | } | 231 | } |
207 | if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); | 232 | if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); |
208 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 233 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
209 | 234 | ||
210 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); | 235 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); |
211 | if (mTodo->percentComplete()<100) { | 236 | if (mTodo->percentComplete()<100) { |
212 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 237 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
213 | else setSortKey(2,QString::number(mTodo->percentComplete())); | 238 | else setSortKey(2,QString::number(mTodo->percentComplete())); |
214 | } | 239 | } |
215 | else { | 240 | else { |
216 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 241 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
217 | else setSortKey(2,QString::number(99)); | 242 | else setSortKey(2,QString::number(99)); |
218 | } | 243 | } |
219 | QListViewItem * myChild = firstChild(); | 244 | QListViewItem * myChild = firstChild(); |
220 | KOTodoViewItem *item; | 245 | KOTodoViewItem *item; |
221 | while( myChild ) { | 246 | while( myChild ) { |
222 | item = static_cast<KOTodoViewItem*>(myChild); | 247 | item = static_cast<KOTodoViewItem*>(myChild); |
223 | item->stateChange(state); | 248 | item->stateChange(state); |
224 | myChild = myChild->nextSibling(); | 249 | myChild = myChild->nextSibling(); |
225 | } | 250 | } |
226 | mTodoView->modified(true); | 251 | mTodoView->modified(true); |
227 | mTodoView->setTodoModified( mTodo ); | 252 | mTodoView->setTodoModified( mTodo ); |
228 | setMyPixmap(); | 253 | setMyPixmap(); |
229 | } | 254 | } |
230 | 255 | ||
231 | bool KOTodoViewItem::isAlternate() | 256 | bool KOTodoViewItem::isAlternate() |
232 | { | 257 | { |
233 | #ifndef KORG_NOLVALTERNATION | 258 | #ifndef KORG_NOLVALTERNATION |
234 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); | 259 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); |
235 | if (lv && lv->alternateBackground().isValid()) | 260 | if (lv && lv->alternateBackground().isValid()) |
236 | { | 261 | { |
237 | KOTodoViewItem *above = 0; | 262 | KOTodoViewItem *above = 0; |
238 | above = dynamic_cast<KOTodoViewItem *>(itemAbove()); | 263 | above = dynamic_cast<KOTodoViewItem *>(itemAbove()); |
239 | m_known = above ? above->m_known : true; | 264 | m_known = above ? above->m_known : true; |
240 | if (m_known) | 265 | if (m_known) |
241 | { | 266 | { |
242 | m_odd = above ? !above->m_odd : false; | 267 | m_odd = above ? !above->m_odd : false; |
243 | } | 268 | } |
244 | else | 269 | else |
245 | { | 270 | { |
246 | KOTodoViewItem *item; | 271 | KOTodoViewItem *item; |
247 | bool previous = true; | 272 | bool previous = true; |
248 | if (QListViewItem::parent()) | 273 | if (QListViewItem::parent()) |
249 | { | 274 | { |
250 | item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()); | 275 | item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()); |
251 | if (item) | 276 | if (item) |
252 | previous = item->m_odd; | 277 | previous = item->m_odd; |
253 | item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); | 278 | item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); |
254 | } | 279 | } |
255 | else | 280 | else |
256 | { | 281 | { |
257 | item = dynamic_cast<KOTodoViewItem *>(lv->firstChild()); | 282 | item = dynamic_cast<KOTodoViewItem *>(lv->firstChild()); |
258 | } | 283 | } |
259 | 284 | ||
260 | while(item) | 285 | while(item) |
261 | { | 286 | { |
262 | item->m_odd = previous = !previous; | 287 | item->m_odd = previous = !previous; |
263 | item->m_known = true; | 288 | item->m_known = true; |
264 | item = dynamic_cast<KOTodoViewItem *>(item->nextSibling()); | 289 | item = dynamic_cast<KOTodoViewItem *>(item->nextSibling()); |
265 | } | 290 | } |
266 | } | 291 | } |
267 | return m_odd; | 292 | return m_odd; |
268 | } | 293 | } |
269 | return false; | 294 | return false; |
270 | #else | 295 | #else |
271 | return false; | 296 | return false; |
272 | #endif | 297 | #endif |
273 | } | 298 | } |
274 | 299 | ||
275 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | 300 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) |
276 | { | 301 | { |
277 | QColorGroup _cg = cg; | 302 | QColorGroup _cg = cg; |
278 | QColorGroup::ColorRole role; | 303 | QColorGroup::ColorRole role; |
279 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) | 304 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) |
280 | role = QColorGroup::Text; | 305 | role = QColorGroup::Text; |
281 | else | 306 | else |
282 | role = QColorGroup::Base; | 307 | role = QColorGroup::Base; |
283 | //#ifndef KORG_NOLVALTERNATION | 308 | //#ifndef KORG_NOLVALTERNATION |
284 | // if (isAlternate()) | 309 | // if (isAlternate()) |
285 | // _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); | 310 | // _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); |
286 | bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; | 311 | bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; |
287 | QColor colorToSet; | 312 | QColor colorToSet; |
288 | if ( setColor ) { | 313 | if ( setColor ) { |
289 | QStringList categories = mTodo->categories(); | 314 | QStringList categories = mTodo->categories(); |
290 | QString cat = categories.first(); | 315 | QString cat = categories.first(); |
291 | if ( !cat.isEmpty()) { | 316 | if ( !cat.isEmpty()) { |
292 | colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); | 317 | colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); |
293 | } else | 318 | } else |
294 | setColor = false; | 319 | setColor = false; |
295 | } | 320 | } |
296 | if (mTodo->hasDueDate()) { | 321 | if (mTodo->hasDueDate()) { |
297 | if (mTodo->dtDue().date()==QDate::currentDate() && | 322 | if (mTodo->dtDue().date()==QDate::currentDate() && |
298 | !mTodo->isCompleted()) { | 323 | !mTodo->isCompleted()) { |
299 | //_cg.setColor( role , KOPrefs::instance()->mTodoDueTodayColor); | 324 | //_cg.setColor( role , KOPrefs::instance()->mTodoDueTodayColor); |
300 | colorToSet = KOPrefs::instance()->mTodoDueTodayColor; | 325 | colorToSet = KOPrefs::instance()->mTodoDueTodayColor; |
301 | setColor = true; | 326 | setColor = true; |
302 | } | 327 | } |
303 | if (mTodo->dtDue().date() < QDate::currentDate() && | 328 | if (mTodo->dtDue().date() < QDate::currentDate() && |
304 | !mTodo->isCompleted()) { | 329 | !mTodo->isCompleted()) { |
305 | //_cg.setColor( role, KOPrefs::instance()->mTodoOverdueColor); | 330 | //_cg.setColor( role, KOPrefs::instance()->mTodoOverdueColor); |
306 | colorToSet = KOPrefs::instance()->mTodoOverdueColor; | 331 | colorToSet = KOPrefs::instance()->mTodoOverdueColor; |
307 | setColor = true; | 332 | setColor = true; |
308 | } | 333 | } |
309 | } | 334 | } |
310 | 335 | ||
311 | if ( setColor ) { | 336 | if ( setColor ) { |
312 | _cg.setColor(role,colorToSet ); | 337 | _cg.setColor(role,colorToSet ); |
313 | if ( role == QColorGroup::Base) { | 338 | if ( role == QColorGroup::Base) { |
314 | int rgb = colorToSet.red(); | 339 | int rgb = colorToSet.red(); |
315 | rgb += colorToSet.blue()/2; | 340 | rgb += colorToSet.blue()/2; |
316 | rgb += colorToSet.green(); | 341 | rgb += colorToSet.green(); |
317 | if ( rgb < 200 ) | 342 | if ( rgb < 200 ) |
318 | _cg.setColor(QColorGroup::Text,Qt::white ); | 343 | _cg.setColor(QColorGroup::Text,Qt::white ); |
319 | } | 344 | } |
320 | } | 345 | } |
321 | //#endif | 346 | //#endif |
322 | if ( column > 0 ){ | 347 | if ( column > 0 ){ |
323 | if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { | 348 | if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { |
324 | p->save(); | 349 | p->save(); |
325 | int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); | 350 | int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); |
326 | 351 | ||
327 | p->fillRect( 0, 0, width, height(), _cg.base() ); // background | 352 | p->fillRect( 0, 0, width, height(), _cg.base() ); // background |
328 | // p->setPen(Qt::black ); //border | 353 | // p->setPen(Qt::black ); //border |
329 | // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling | 354 | // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling |
330 | QColor fc = KOPrefs::instance()->mHighlightColor; | 355 | QColor fc = KOPrefs::instance()->mHighlightColor; |
331 | if ( mTodo->percentComplete() == 100 ) | 356 | if ( mTodo->percentComplete() == 100 ) |
332 | fc = darkGreen; | 357 | fc = darkGreen; |
333 | p->drawRect( 2, 2, width-4, height()-4); | 358 | p->drawRect( 2, 2, width-4, height()-4); |
334 | p->fillRect( 3, 3, progress, height()-6, | 359 | p->fillRect( 3, 3, progress, height()-6, |
335 | fc ); | 360 | fc ); |
336 | p->restore(); | 361 | p->restore(); |
337 | } else { | 362 | } else { |
338 | QCheckListItem::paintCell(p, _cg, column, width, alignment); | 363 | QCheckListItem::paintCell(p, _cg, column, width, alignment); |
339 | } | 364 | } |
340 | return; | 365 | return; |
341 | } | 366 | } |
342 | 367 | ||
343 | int align = alignment; | 368 | int align = alignment; |
344 | 369 | ||
345 | if ( !p ) | 370 | if ( !p ) |
346 | return; | 371 | return; |
347 | 372 | ||
348 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); | 373 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); |
349 | 374 | ||
350 | QListView *lv = listView(); | 375 | QListView *lv = listView(); |
351 | if ( !lv ) | 376 | if ( !lv ) |
352 | return; | 377 | return; |
353 | int marg = 2;//lv->itemMargin(); | 378 | int marg = 2;//lv->itemMargin(); |
354 | int r = 0; | 379 | int r = 0; |
355 | QCheckListItem::Type myType = QCheckListItem::CheckBox; | 380 | QCheckListItem::Type myType = QCheckListItem::CheckBox; |
356 | int BoxSize = 20; | 381 | int BoxSize = 20; |
357 | int boxOffset = 2; | 382 | int boxOffset = 2; |
358 | int xOffset = 2; | 383 | int xOffset = 2; |
359 | if (qApp->desktop()->width() < 300 ) { | 384 | if (qApp->desktop()->width() < 300 ) { |
360 | BoxSize = 14; | 385 | BoxSize = 14; |
361 | boxOffset = -1; | 386 | boxOffset = -1; |
362 | xOffset = 1; | 387 | xOffset = 1; |
363 | // marg = 0; | 388 | // marg = 0; |
364 | } | 389 | } |
365 | if ( height() < BoxSize ) { | 390 | if ( height() < BoxSize ) { |
366 | boxOffset = boxOffset - ((BoxSize - height())/2) ; | 391 | boxOffset = boxOffset - ((BoxSize - height())/2) ; |
367 | // qDebug("boxOffset %d height %d", boxOffset, height() ); | 392 | // qDebug("boxOffset %d height %d", boxOffset, height() ); |
368 | BoxSize = height(); | 393 | BoxSize = height(); |
369 | 394 | ||
370 | } | 395 | } |
371 | //bool winStyle = lv->style() == WindowsStyle; | 396 | //bool winStyle = lv->style() == WindowsStyle; |
372 | 397 | ||
373 | int lineStart = 5; | 398 | int lineStart = 5; |
374 | if ( myType == Controller ) { | 399 | if ( myType == Controller ) { |
375 | if ( !pixmap( 0 ) ) | 400 | if ( !pixmap( 0 ) ) |
376 | r += BoxSize + 4; | 401 | r += BoxSize + 4; |
377 | } else { | 402 | } else { |
378 | ASSERT( lv ); //### | 403 | ASSERT( lv ); //### |
379 | //QFontMetrics fm( lv->font() ); | 404 | //QFontMetrics fm( lv->font() ); |
380 | //int d = fm.height(); | 405 | //int d = fm.height(); |
381 | int x = 0; | 406 | int x = 0; |
382 | int y = (height() - BoxSize) / 2; | 407 | int y = (height() - BoxSize) / 2; |
383 | //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); | 408 | //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); |
384 | if ( myType == CheckBox ) { | 409 | if ( myType == CheckBox ) { |
385 | if ( isEnabled() ) | 410 | if ( isEnabled() ) |
386 | p->setPen( QPen( _cg.text(), 1 ) ); | 411 | p->setPen( QPen( _cg.text(), 1 ) ); |
387 | else | 412 | else |
388 | p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); | 413 | p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); |
389 | p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); | 414 | p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); |
390 | lineStart = x+marg; | 415 | lineStart = x+marg; |
391 | ///////////////////// | 416 | ///////////////////// |
392 | x++; | 417 | x++; |
393 | y++; | 418 | y++; |
394 | if ( isOn() ) { | 419 | if ( isOn() ) { |
395 | QPointArray a( 7*2 ); | 420 | QPointArray a( 7*2 ); |
396 | int i, xx, yy; | 421 | int i, xx, yy; |
397 | xx = x+xOffset+marg+(boxOffset/2); | 422 | xx = x+xOffset+marg+(boxOffset/2); |
398 | yy = y+5+boxOffset; | 423 | yy = y+5+boxOffset; |
399 | for ( i=0; i<3; i++ ) { | 424 | for ( i=0; i<3; i++ ) { |
400 | a.setPoint( 2*i, xx, yy ); | 425 | a.setPoint( 2*i, xx, yy ); |
401 | a.setPoint( 2*i+1, xx, yy+2 ); | 426 | a.setPoint( 2*i+1, xx, yy+2 ); |
402 | // qDebug(" "); | 427 | // qDebug(" "); |
403 | xx++; yy++; | 428 | xx++; yy++; |
404 | } | 429 | } |
405 | yy -= 2; | 430 | yy -= 2; |
406 | for ( i=3; i<7; i++ ) { | 431 | for ( i=3; i<7; i++ ) { |
407 | a.setPoint( 2*i, xx, yy ); | 432 | a.setPoint( 2*i, xx, yy ); |
408 | a.setPoint( 2*i+1, xx, yy+2 ); | 433 | a.setPoint( 2*i+1, xx, yy+2 ); |
409 | xx++; yy--; | 434 | xx++; yy--; |
410 | } | 435 | } |
411 | p->setPen( darkGreen ); | 436 | p->setPen( darkGreen ); |
412 | p->drawLineSegments( a ); | 437 | p->drawLineSegments( a ); |
413 | } | 438 | } |
414 | //////////////////////// | 439 | //////////////////////// |
415 | } | 440 | } |
416 | r += BoxSize + 4; | 441 | r += BoxSize + 4; |
417 | } | 442 | } |
418 | 443 | ||
419 | p->translate( r, 0 ); | 444 | p->translate( r, 0 ); |
420 | p->setPen( QPen( _cg.text() ) ); | 445 | p->setPen( QPen( _cg.text() ) ); |
421 | QListViewItem::paintCell( p, _cg, column, width - r, align ); | 446 | QListViewItem::paintCell( p, _cg, column, width - r, align ); |
422 | if ( mTodo->cancelled () ) { | 447 | if ( mTodo->cancelled () ) { |
423 | p->setPen( black ); | 448 | p->setPen( black ); |
424 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); | 449 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); |
425 | int wid = br.width() +lineStart; | 450 | int wid = br.width() +lineStart; |
426 | if ( wid > width-3 ) | 451 | if ( wid > width-3 ) |
427 | wid = width-3; | 452 | wid = width-3; |
428 | p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); | 453 | p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); |
429 | 454 | ||
430 | } | 455 | } |
431 | 456 | ||
432 | } | 457 | } |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 6e151f9..b2dd266 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -128,453 +128,454 @@ void KOViewManager::writeSettings(KConfig *config) | |||
128 | 128 | ||
129 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 129 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
130 | { | 130 | { |
131 | 131 | ||
132 | //mFlagShowNextxDays = false; | 132 | //mFlagShowNextxDays = false; |
133 | //if(view == mCurrentView) return; | 133 | //if(view == mCurrentView) return; |
134 | if ( view == 0 ) { | 134 | if ( view == 0 ) { |
135 | view = mCurrentView; | 135 | view = mCurrentView; |
136 | if ( view == 0 ) | 136 | if ( view == 0 ) |
137 | return; | 137 | return; |
138 | } | 138 | } |
139 | bool full = fullScreen; | 139 | bool full = fullScreen; |
140 | if(view == mCurrentView && view != mWhatsNextView ) { | 140 | if(view == mCurrentView && view != mWhatsNextView ) { |
141 | if ( mCurrentAgendaView < 0 ) | 141 | if ( mCurrentAgendaView < 0 ) |
142 | return; | 142 | return; |
143 | full = mMainView->leftFrame()->isVisible(); | 143 | full = mMainView->leftFrame()->isVisible(); |
144 | } else { | 144 | } else { |
145 | mCurrentView = view; | 145 | mCurrentView = view; |
146 | 146 | ||
147 | // bool full = fullScreen; | 147 | // bool full = fullScreen; |
148 | bool isFull = !mMainView->leftFrame()->isVisible(); | 148 | bool isFull = !mMainView->leftFrame()->isVisible(); |
149 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 149 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
150 | full = true; | 150 | full = true; |
151 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 151 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
152 | full = false; | 152 | full = false; |
153 | } | 153 | } |
154 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 154 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
155 | raiseCurrentView( full ); | 155 | raiseCurrentView( full ); |
156 | mMainView->processIncidenceSelection( 0 ); | 156 | mMainView->processIncidenceSelection( 0 ); |
157 | mMainView->updateView(); | 157 | mMainView->updateView(); |
158 | mMainView->adaptNavigationUnits(); | 158 | mMainView->adaptNavigationUnits(); |
159 | } | 159 | } |
160 | 160 | ||
161 | void KOViewManager::raiseCurrentView( bool fullScreen ) | 161 | void KOViewManager::raiseCurrentView( bool fullScreen ) |
162 | { | 162 | { |
163 | //qDebug("raiseCurrentView "); | 163 | //qDebug("raiseCurrentView "); |
164 | mCurrentAgendaView = 0; | 164 | mCurrentAgendaView = 0; |
165 | int wid = mMainView->width() ; | 165 | int wid = mMainView->width() ; |
166 | int hei = mMainView->height(); | 166 | int hei = mMainView->height(); |
167 | if ( mCurrentView == mMonthView ) { | 167 | if ( mCurrentView == mMonthView ) { |
168 | mMainView->navigatorBar()->show(); | 168 | mMainView->navigatorBar()->show(); |
169 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 169 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
170 | //mMainView->navigatorBar()->hide(); | 170 | //mMainView->navigatorBar()->hide(); |
171 | } else { | 171 | } else { |
172 | mMainView->navigatorBar()->hide(); | 172 | mMainView->navigatorBar()->hide(); |
173 | } | 173 | } |
174 | if ( fullScreen ) { | 174 | if ( fullScreen ) { |
175 | mMainView->leftFrame()->hide(); | 175 | mMainView->leftFrame()->hide(); |
176 | } else { | 176 | } else { |
177 | mMainView->leftFrame()->show(); | 177 | mMainView->leftFrame()->show(); |
178 | if ( KOPrefs::instance()->mVerticalScreen ) | 178 | if ( KOPrefs::instance()->mVerticalScreen ) |
179 | hei -= mMainView->leftFrame()->height(); | 179 | hei -= mMainView->leftFrame()->height(); |
180 | else | 180 | else |
181 | wid -= mMainView->leftFrame()->width(); | 181 | wid -= mMainView->leftFrame()->width(); |
182 | } | 182 | } |
183 | 183 | ||
184 | if ( globalFlagBlockAgenda == 5 ) { | 184 | if ( globalFlagBlockAgenda == 5 ) { |
185 | globalFlagBlockAgenda = 4; | 185 | globalFlagBlockAgenda = 4; |
186 | globalFlagBlockAgendaItemPaint = 1; | 186 | globalFlagBlockAgendaItemPaint = 1; |
187 | } | 187 | } |
188 | mMainView->viewStack()->raiseWidget(mCurrentView); | 188 | mMainView->viewStack()->raiseWidget(mCurrentView); |
189 | if ( globalFlagBlockAgenda == 4 ) { | 189 | if ( globalFlagBlockAgenda == 4 ) { |
190 | if ( mCurrentView == mAgendaView ) { | 190 | if ( mCurrentView == mAgendaView ) { |
191 | //globalFlagBlockAgenda =1 ; | 191 | //globalFlagBlockAgenda =1 ; |
192 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 192 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
193 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 193 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
194 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 194 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
195 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 195 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
196 | qApp->processEvents(); | 196 | qApp->processEvents(); |
197 | //qDebug("qApp->processEvents() "); | 197 | //qDebug("qApp->processEvents() "); |
198 | globalFlagBlockAgenda = 0; | 198 | globalFlagBlockAgenda = 0; |
199 | mAgendaView->repaintAgenda(); | 199 | mAgendaView->repaintAgenda(); |
200 | 200 | ||
201 | } | 201 | } |
202 | globalFlagBlockAgenda = 0; | 202 | globalFlagBlockAgenda = 0; |
203 | } | 203 | } |
204 | //qDebug("raiseCurrentView ende "); | 204 | //qDebug("raiseCurrentView ende "); |
205 | } | 205 | } |
206 | 206 | ||
207 | void KOViewManager::updateView() | 207 | void KOViewManager::updateView() |
208 | { | 208 | { |
209 | // qDebug("KOViewManager::updateView() "); | 209 | // qDebug("KOViewManager::updateView() "); |
210 | // if we are updating mTodoView, we get endless recursion | 210 | // if we are updating mTodoView, we get endless recursion |
211 | if ( mTodoView == mCurrentView ) | 211 | if ( mTodoView == mCurrentView ) |
212 | return; | 212 | return; |
213 | if ( mCurrentView ) mCurrentView->updateView(); | 213 | if ( mCurrentView ) mCurrentView->updateView(); |
214 | 214 | ||
215 | } | 215 | } |
216 | 216 | ||
217 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 217 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
218 | { | 218 | { |
219 | // kdDebug() << "KOViewManager::updateView()" << endl; | 219 | // kdDebug() << "KOViewManager::updateView()" << endl; |
220 | 220 | ||
221 | if (mCurrentView) mCurrentView->showDates(start, end); | 221 | if (mCurrentView) mCurrentView->showDates(start, end); |
222 | 222 | ||
223 | if (mTodoView) mTodoView->updateView(); | 223 | if (mTodoView) mTodoView->updateView(); |
224 | } | 224 | } |
225 | 225 | ||
226 | 226 | ||
227 | void KOViewManager::updateWNview() | 227 | void KOViewManager::updateWNview() |
228 | { | 228 | { |
229 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 229 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
230 | mWhatsNextView->updateView(); | 230 | mWhatsNextView->updateView(); |
231 | 231 | ||
232 | } | 232 | } |
233 | void KOViewManager::showWhatsNextView() | 233 | void KOViewManager::showWhatsNextView() |
234 | { | 234 | { |
235 | if (!mWhatsNextView) { | 235 | if (!mWhatsNextView) { |
236 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 236 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
237 | "KOViewManager::WhatsNextView"); | 237 | "KOViewManager::WhatsNextView"); |
238 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 238 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
239 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 239 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
240 | addView(mWhatsNextView); | 240 | addView(mWhatsNextView); |
241 | } | 241 | } |
242 | globalFlagBlockAgenda = 1; | 242 | globalFlagBlockAgenda = 1; |
243 | showView(mWhatsNextView, true ); | 243 | showView(mWhatsNextView, true ); |
244 | //mWhatsNextView->updateView(); | 244 | //mWhatsNextView->updateView(); |
245 | 245 | ||
246 | } | 246 | } |
247 | 247 | ||
248 | void KOViewManager::showListView() | 248 | void KOViewManager::showListView() |
249 | { | 249 | { |
250 | if (!mListView) { | 250 | if (!mListView) { |
251 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 251 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
252 | addView(mListView); | 252 | addView(mListView); |
253 | 253 | ||
254 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 254 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
255 | mMainView, SLOT(showIncidence(Incidence *))); | 255 | mMainView, SLOT(showIncidence(Incidence *))); |
256 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 256 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
257 | mMainView, SLOT(editIncidence(Incidence *))); | 257 | mMainView, SLOT(editIncidence(Incidence *))); |
258 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 258 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
259 | mMainView, SLOT(deleteIncidence(Incidence *))); | 259 | mMainView, SLOT(deleteIncidence(Incidence *))); |
260 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 260 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
261 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 261 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
262 | connect( mListView, SIGNAL( signalNewEvent() ), | 262 | connect( mListView, SIGNAL( signalNewEvent() ), |
263 | mMainView, SLOT( newEvent() ) ); | 263 | mMainView, SLOT( newEvent() ) ); |
264 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 264 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
265 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 265 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
266 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 266 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
267 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 267 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
268 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 268 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
269 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 269 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
270 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 270 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
271 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 271 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
272 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 272 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
273 | } | 273 | } |
274 | // bool temp = mFlagShowNextxDays; | 274 | // bool temp = mFlagShowNextxDays; |
275 | //globalFlagBlockPainting = true; | 275 | //globalFlagBlockPainting = true; |
276 | globalFlagBlockAgenda = 1; | 276 | globalFlagBlockAgenda = 1; |
277 | if ( KOPrefs::instance()->mListViewMonthTimespan ) | 277 | if ( KOPrefs::instance()->mListViewMonthTimespan ) |
278 | mMainView->dateNavigator()->selectMonth(); | 278 | mMainView->dateNavigator()->selectMonth(); |
279 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 279 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
280 | //mFlagShowNextxDays = temp; | 280 | //mFlagShowNextxDays = temp; |
281 | } | 281 | } |
282 | 282 | ||
283 | void KOViewManager::showAgendaView( bool fullScreen ) | 283 | void KOViewManager::showAgendaView( bool fullScreen ) |
284 | { | 284 | { |
285 | 285 | ||
286 | mMainView->dialogManager()->hideSearchDialog(); | 286 | mMainView->dialogManager()->hideSearchDialog(); |
287 | // qDebug("KOViewManager::showAgendaView "); | 287 | // qDebug("KOViewManager::showAgendaView "); |
288 | bool full; | 288 | bool full; |
289 | full = fullScreen; | 289 | full = fullScreen; |
290 | if (!mAgendaView) { | 290 | if (!mAgendaView) { |
291 | full = false; | 291 | full = false; |
292 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 292 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
293 | addView(mAgendaView); | 293 | addView(mAgendaView); |
294 | #ifndef DESKTOP_VERSION | 294 | #ifndef DESKTOP_VERSION |
295 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 295 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
296 | #endif | 296 | #endif |
297 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 297 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
298 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 298 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
299 | 299 | ||
300 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 300 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
301 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 301 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
302 | mMainView, SLOT(newEvent(QDateTime))); | 302 | mMainView, SLOT(newEvent(QDateTime))); |
303 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 303 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
304 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 304 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
305 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 305 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
306 | mMainView, SLOT(newEvent(QDate))); | 306 | mMainView, SLOT(newEvent(QDate))); |
307 | 307 | ||
308 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 308 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
309 | mMainView, SLOT(editIncidence(Incidence *))); | 309 | mMainView, SLOT(editIncidence(Incidence *))); |
310 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 310 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
311 | mMainView, SLOT(showIncidence(Incidence *))); | 311 | mMainView, SLOT(showIncidence(Incidence *))); |
312 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 312 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
313 | mMainView, SLOT(deleteIncidence(Incidence *))); | 313 | mMainView, SLOT(deleteIncidence(Incidence *))); |
314 | 314 | ||
315 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 315 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
316 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 316 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
317 | 317 | ||
318 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 318 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
319 | mMainView, SLOT( toggleExpand() ) ); | 319 | mMainView, SLOT( toggleExpand() ) ); |
320 | 320 | ||
321 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 321 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
322 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 322 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
323 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 323 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
324 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 324 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
325 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 325 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
326 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 326 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
327 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 327 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
328 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 328 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
329 | SLOT( updateTodo( Todo *, int ) ) ); | 329 | SLOT( updateTodo( Todo *, int ) ) ); |
330 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 330 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
331 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 331 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
332 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 332 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
333 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 333 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
334 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 334 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
335 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 335 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
336 | mAgendaView->readSettings(); | 336 | mAgendaView->readSettings(); |
337 | mAgendaView->updateConfig(); | 337 | mAgendaView->updateConfig(); |
338 | } | 338 | } |
339 | 339 | ||
340 | showView( mAgendaView, full); | 340 | showView( mAgendaView, full); |
341 | 341 | ||
342 | } | 342 | } |
343 | 343 | ||
344 | void KOViewManager::showDayView() | 344 | void KOViewManager::showDayView() |
345 | { | 345 | { |
346 | mFlagShowNextxDays = false; | 346 | mFlagShowNextxDays = false; |
347 | globalFlagBlockLabel = 1; | 347 | globalFlagBlockLabel = 1; |
348 | globalFlagBlockAgenda = 1; | 348 | globalFlagBlockAgenda = 1; |
349 | if ( mCurrentAgendaView != 1 ) | 349 | if ( mCurrentAgendaView != 1 ) |
350 | mCurrentAgendaView = -1; | 350 | mCurrentAgendaView = -1; |
351 | showAgendaView(); | 351 | showAgendaView(); |
352 | qApp->processEvents(); | 352 | qApp->processEvents(); |
353 | globalFlagBlockAgenda = 2; | 353 | globalFlagBlockAgenda = 2; |
354 | globalFlagBlockLabel = 0; | 354 | globalFlagBlockLabel = 0; |
355 | mMainView->dateNavigator()->selectDates( 1 ); | 355 | mMainView->dateNavigator()->selectDates( 1 ); |
356 | mCurrentAgendaView = 1 ; | 356 | mCurrentAgendaView = 1 ; |
357 | 357 | ||
358 | } | 358 | } |
359 | 359 | ||
360 | void KOViewManager::showWorkWeekView() | 360 | void KOViewManager::showWorkWeekView() |
361 | { | 361 | { |
362 | mFlagShowNextxDays = false; | 362 | mFlagShowNextxDays = false; |
363 | globalFlagBlockAgenda = 1; | 363 | globalFlagBlockAgenda = 1; |
364 | globalFlagBlockLabel = 1; | 364 | globalFlagBlockLabel = 1; |
365 | if ( mCurrentAgendaView != 5 ) | 365 | if ( mCurrentAgendaView != 5 ) |
366 | mCurrentAgendaView = -1; | 366 | mCurrentAgendaView = -1; |
367 | showAgendaView(); | 367 | showAgendaView(); |
368 | qApp->processEvents(); | 368 | qApp->processEvents(); |
369 | globalFlagBlockAgenda = 2; | 369 | globalFlagBlockAgenda = 2; |
370 | globalFlagBlockLabel = 0; | 370 | globalFlagBlockLabel = 0; |
371 | mMainView->dateNavigator()->selectWorkWeek(); | 371 | mMainView->dateNavigator()->selectWorkWeek(); |
372 | mCurrentAgendaView = 5 ; | 372 | mCurrentAgendaView = 5 ; |
373 | 373 | ||
374 | } | 374 | } |
375 | 375 | ||
376 | void KOViewManager::showWeekView() | 376 | void KOViewManager::showWeekView() |
377 | { | 377 | { |
378 | /* | 378 | /* |
379 | globalFlagBlockAgenda = 2; | 379 | globalFlagBlockAgenda = 2; |
380 | qDebug("4globalFlagBlockAgenda = 2; "); | 380 | qDebug("4globalFlagBlockAgenda = 2; "); |
381 | //globalFlagBlockPainting = true; | 381 | //globalFlagBlockPainting = true; |
382 | mMainView->dateNavigator()->selectWeek(); | 382 | mMainView->dateNavigator()->selectWeek(); |
383 | showAgendaView(); | 383 | showAgendaView(); |
384 | */ | 384 | */ |
385 | 385 | ||
386 | 386 | ||
387 | mFlagShowNextxDays = false; | 387 | mFlagShowNextxDays = false; |
388 | globalFlagBlockAgenda = 1; | 388 | globalFlagBlockAgenda = 1; |
389 | globalFlagBlockLabel = 1; | 389 | globalFlagBlockLabel = 1; |
390 | if ( mCurrentAgendaView != 7 ) | 390 | if ( mCurrentAgendaView != 7 ) |
391 | mCurrentAgendaView = -1; | 391 | mCurrentAgendaView = -1; |
392 | showAgendaView(); | 392 | showAgendaView(); |
393 | qApp->processEvents(); | 393 | qApp->processEvents(); |
394 | globalFlagBlockAgenda = 2; | 394 | globalFlagBlockAgenda = 2; |
395 | globalFlagBlockLabel = 0; | 395 | globalFlagBlockLabel = 0; |
396 | mMainView->dateNavigator()->selectWeek(); | 396 | mMainView->dateNavigator()->selectWeek(); |
397 | mCurrentAgendaView = 7 ; | 397 | mCurrentAgendaView = 7 ; |
398 | } | 398 | } |
399 | 399 | ||
400 | void KOViewManager::showNextXView() | 400 | void KOViewManager::showNextXView() |
401 | { | 401 | { |
402 | 402 | ||
403 | globalFlagBlockAgenda = 1; | 403 | globalFlagBlockAgenda = 1; |
404 | if ( mCurrentAgendaView != 3 ) | 404 | if ( mCurrentAgendaView != 3 ) |
405 | mCurrentAgendaView = -1; | 405 | mCurrentAgendaView = -1; |
406 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 406 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
407 | globalFlagBlockAgenda = 2; | 407 | globalFlagBlockAgenda = 2; |
408 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 408 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
409 | KOPrefs::instance()->mNextXDays ); | 409 | KOPrefs::instance()->mNextXDays ); |
410 | mFlagShowNextxDays = true; | 410 | mFlagShowNextxDays = true; |
411 | mCurrentAgendaView = 3 ; | 411 | mCurrentAgendaView = 3 ; |
412 | } | 412 | } |
413 | bool KOViewManager::showsNextDays() | 413 | bool KOViewManager::showsNextDays() |
414 | { | 414 | { |
415 | return mFlagShowNextxDays; | 415 | return mFlagShowNextxDays; |
416 | } | 416 | } |
417 | void KOViewManager::showMonthView() | 417 | void KOViewManager::showMonthView() |
418 | { | 418 | { |
419 | if (!mMonthView) { | 419 | if (!mMonthView) { |
420 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 420 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
421 | 421 | ||
422 | addView(mMonthView); | 422 | addView(mMonthView); |
423 | // mMonthView->show(); | 423 | // mMonthView->show(); |
424 | // SIGNALS/SLOTS FOR MONTH VIEW | 424 | // SIGNALS/SLOTS FOR MONTH VIEW |
425 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 425 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
426 | mMainView, SLOT(newEvent(QDateTime))); | 426 | mMainView, SLOT(newEvent(QDateTime))); |
427 | 427 | ||
428 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 428 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
429 | mMainView, SLOT(showIncidence(Incidence *))); | 429 | mMainView, SLOT(showIncidence(Incidence *))); |
430 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 430 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
431 | mMainView, SLOT(editIncidence(Incidence *))); | 431 | mMainView, SLOT(editIncidence(Incidence *))); |
432 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 432 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
433 | mMainView, SLOT(deleteIncidence(Incidence *))); | 433 | mMainView, SLOT(deleteIncidence(Incidence *))); |
434 | 434 | ||
435 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 435 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
436 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 436 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
437 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 437 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
438 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 438 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
439 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 439 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
440 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 440 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
441 | 441 | ||
442 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 442 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
443 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 443 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
444 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 444 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
445 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 445 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
446 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 446 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
447 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 447 | mMainView, SLOT ( selectWeekNum( int ) ) ); |
448 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 448 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
449 | mMainView, SLOT ( showDay( QDate ) ) ); | 449 | mMainView, SLOT ( showDay( QDate ) ) ); |
450 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 450 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
451 | mMonthView->updateConfig(); | 451 | mMonthView->updateConfig(); |
452 | } | 452 | } |
453 | 453 | ||
454 | globalFlagBlockAgenda = 1; | 454 | globalFlagBlockAgenda = 1; |
455 | //mFlagShowNextxDays = false; | 455 | //mFlagShowNextxDays = false; |
456 | // if(mMonthView == mCurrentView) return; | 456 | // if(mMonthView == mCurrentView) return; |
457 | mMainView->dateNavigator()->selectMonth(); | 457 | mMainView->dateNavigator()->selectMonth(); |
458 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); | 458 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); |
459 | //mMonthView->showDates(tmpList.first(), tmpList.last()); | 459 | //mMonthView->showDates(tmpList.first(), tmpList.last()); |
460 | 460 | ||
461 | showView(mMonthView, true ); | 461 | showView(mMonthView, true ); |
462 | 462 | ||
463 | } | 463 | } |
464 | 464 | ||
465 | void KOViewManager::showTodoView() | 465 | void KOViewManager::showTodoView() |
466 | { | 466 | { |
467 | //mFlagShowNextxDays = false; | 467 | //mFlagShowNextxDays = false; |
468 | if ( !mTodoView ) { | 468 | if ( !mTodoView ) { |
469 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 469 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
470 | "KOViewManager::TodoView" ); | 470 | "KOViewManager::TodoView" ); |
471 | 471 | ||
472 | addView( mTodoView ); | 472 | addView( mTodoView ); |
473 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 473 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
474 | 474 | ||
475 | // SIGNALS/SLOTS FOR TODO VIEW | 475 | // SIGNALS/SLOTS FOR TODO VIEW |
476 | connect( mTodoView, SIGNAL( newTodoSignal() ), | 476 | connect( mTodoView, SIGNAL( newTodoSignal() ), |
477 | mMainView, SLOT( newTodo() ) ); | 477 | mMainView, SLOT( newTodo() ) ); |
478 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), | 478 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), |
479 | mMainView, SLOT( newSubTodo( Todo *) ) ); | 479 | mMainView, SLOT( newSubTodo( Todo *) ) ); |
480 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), | 480 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), |
481 | mMainView, SLOT( showTodo( Todo * ) ) ); | 481 | mMainView, SLOT( showTodo( Todo * ) ) ); |
482 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), | 482 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |
483 | mMainView, SLOT( editTodo( Todo * ) ) ); | 483 | mMainView, SLOT( editTodo( Todo * ) ) ); |
484 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 484 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
485 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 485 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
486 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), | 486 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), |
487 | mMainView, SLOT( purgeCompleted() ) ); | 487 | mMainView, SLOT( purgeCompleted() ) ); |
488 | 488 | ||
489 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), | 489 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), |
490 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 490 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
491 | 491 | ||
492 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, | 492 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, |
493 | SLOT( updateConfig() ) ); | 493 | SLOT( updateConfig() ) ); |
494 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, | 494 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, |
495 | SLOT( updateTodo( Todo *, int ) ) ); | 495 | SLOT( updateTodo( Todo *, int ) ) ); |
496 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 496 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
497 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); | 497 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); |
498 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), | 498 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), |
499 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 499 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
500 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), | 500 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), |
501 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 501 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
502 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), | 502 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), |
503 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); | 503 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); |
504 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 504 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
505 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); | 505 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); |
506 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), | 506 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), |
507 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 507 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
508 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), | 508 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), |
509 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 509 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
510 | KConfig *config = KOGlobals::config(); | 510 | KConfig *config = KOGlobals::config(); |
511 | mTodoView->restoreLayout(config,"Todo View"); | 511 | mTodoView->restoreLayout(config,"Todo View"); |
512 | mTodoView->setNavigator( mMainView->dateNavigator() ); | ||
512 | } | 513 | } |
513 | 514 | ||
514 | globalFlagBlockAgenda = 1; | 515 | globalFlagBlockAgenda = 1; |
515 | showView( mTodoView, true ); | 516 | showView( mTodoView, true ); |
516 | 517 | ||
517 | } | 518 | } |
518 | 519 | ||
519 | void KOViewManager::showJournalView() | 520 | void KOViewManager::showJournalView() |
520 | { | 521 | { |
521 | //mFlagShowNextxDays = false; | 522 | //mFlagShowNextxDays = false; |
522 | if (!mJournalView) { | 523 | if (!mJournalView) { |
523 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 524 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
524 | "KOViewManager::JournalView"); | 525 | "KOViewManager::JournalView"); |
525 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 526 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
526 | SLOT( updateConfig() ) ); | 527 | SLOT( updateConfig() ) ); |
527 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 528 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
528 | addView(mJournalView); | 529 | addView(mJournalView); |
529 | } | 530 | } |
530 | 531 | ||
531 | showView(mJournalView); | 532 | showView(mJournalView); |
532 | } | 533 | } |
533 | 534 | ||
534 | void KOViewManager::showTimeSpanView() | 535 | void KOViewManager::showTimeSpanView() |
535 | { | 536 | { |
536 | //mFlagShowNextxDays = false; | 537 | //mFlagShowNextxDays = false; |
537 | if (!mTimeSpanView) { | 538 | if (!mTimeSpanView) { |
538 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 539 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
539 | "KOViewManager::TimeSpanView"); | 540 | "KOViewManager::TimeSpanView"); |
540 | addView(mTimeSpanView); | 541 | addView(mTimeSpanView); |
541 | 542 | ||
542 | mTimeSpanView->readSettings(); | 543 | mTimeSpanView->readSettings(); |
543 | } | 544 | } |
544 | 545 | ||
545 | showView(mTimeSpanView); | 546 | showView(mTimeSpanView); |
546 | } | 547 | } |
547 | 548 | ||
548 | Incidence *KOViewManager::currentSelection() | 549 | Incidence *KOViewManager::currentSelection() |
549 | { | 550 | { |
550 | if (!mCurrentView) return 0; | 551 | if (!mCurrentView) return 0; |
551 | if ( mCurrentView == mListView ) { | 552 | if ( mCurrentView == mListView ) { |
552 | if ( mListView->currentItem() ) | 553 | if ( mListView->currentItem() ) |
553 | return mListView->currentItem(); | 554 | return mListView->currentItem(); |
554 | } | 555 | } |
555 | return mCurrentView->selectedIncidences().first(); | 556 | return mCurrentView->selectedIncidences().first(); |
556 | } | 557 | } |
557 | 558 | ||
558 | QDate KOViewManager::currentSelectionDate() | 559 | QDate KOViewManager::currentSelectionDate() |
559 | { | 560 | { |
560 | QDate qd; | 561 | QDate qd; |
561 | if (mCurrentView) { | 562 | if (mCurrentView) { |
562 | DateList qvl = mCurrentView->selectedDates(); | 563 | DateList qvl = mCurrentView->selectedDates(); |
563 | if (!qvl.isEmpty()) qd = qvl.first(); | 564 | if (!qvl.isEmpty()) qd = qvl.first(); |
564 | } | 565 | } |
565 | return qd; | 566 | return qd; |
566 | } | 567 | } |
567 | 568 | ||
568 | void KOViewManager::addView(KOrg::BaseView *view) | 569 | void KOViewManager::addView(KOrg::BaseView *view) |
569 | { | 570 | { |
570 | #if QT_VERSION >= 300 | 571 | #if QT_VERSION >= 300 |
571 | mMainView->viewStack()->addWidget( view ); | 572 | mMainView->viewStack()->addWidget( view ); |
572 | #else | 573 | #else |
573 | mMainView->viewStack()->addWidget( view, 1 ); | 574 | mMainView->viewStack()->addWidget( view, 1 ); |
574 | #endif | 575 | #endif |
575 | } | 576 | } |
576 | 577 | ||
577 | void KOViewManager::setDocumentId( const QString &id ) | 578 | void KOViewManager::setDocumentId( const QString &id ) |
578 | { | 579 | { |
579 | if (mTodoView) mTodoView->setDocumentId( id ); | 580 | if (mTodoView) mTodoView->setDocumentId( id ); |
580 | } | 581 | } |
@@ -1 +1 @@ | |||
version = "1.9.15"; | version = "1.9.16"; | ||