-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 19 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
5 files changed, 40 insertions, 5 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index ac70a55..3dbbbb6 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,527 +1,530 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.2 ************ | 3 | ********** VERSION 2.0.2 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed the layout problem of the day label buttons | 6 | Fixed the layout problem of the day label buttons |
7 | of the agenda view introduced in version 2.0.1. | 7 | of the agenda view introduced in version 2.0.1. |
8 | 8 | ||
9 | Added WhatsThis support for the todo view and the list view. | 9 | Added WhatsThis support for the todo view and the list view. |
10 | 10 | ||
11 | Added a quite useful feature to the montview. | 11 | Added a quite useful feature to the montview. |
12 | Just click on the week numbers on the left. | 12 | Just click on the week numbers on the left. |
13 | And on top of the week numbers there is now a "week view quick selector". | 13 | And in the top right corner of month view/agenda view |
14 | there is now a "week number quick selector". | ||
14 | (Click on the black triangle). | 15 | (Click on the black triangle). |
15 | 16 | ||
17 | Made the quite difficult timezone change in KO/Pi easy. | ||
18 | |||
16 | 19 | ||
17 | ********** VERSION 2.0.1 ************ | 20 | ********** VERSION 2.0.1 ************ |
18 | 21 | ||
19 | Oooops ... I forgot to test on the Zaurus 5500 ... | 22 | Oooops ... I forgot to test on the Zaurus 5500 ... |
20 | 23 | ||
21 | Fixed many problems of new (english) strings (and german translations) | 24 | Fixed many problems of new (english) strings (and german translations) |
22 | introduced in the latest versions, where the text was not fitting on the | 25 | introduced in the latest versions, where the text was not fitting on the |
23 | 240x320 display of the Zaurus 5500. | 26 | 240x320 display of the Zaurus 5500. |
24 | 27 | ||
25 | KO/Pi: | 28 | KO/Pi: |
26 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 29 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
27 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 30 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
28 | 31 | ||
29 | Added items to the todolist popup menu for: | 32 | Added items to the todolist popup menu for: |
30 | Display all opened, all closed or all todos flat. | 33 | Display all opened, all closed or all todos flat. |
31 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 34 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
32 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 35 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
33 | Fixed several bugs in setting the completed datetime for todos. | 36 | Fixed several bugs in setting the completed datetime for todos. |
34 | Added info about completed datetime of todos to the todo viewer. | 37 | Added info about completed datetime of todos to the todo viewer. |
35 | Now displaying a completed todo (with completed datetime set) in the agenda view | 38 | Now displaying a completed todo (with completed datetime set) in the agenda view |
36 | at the time of the completion. Such that now it is possible to see in the agenda view | 39 | at the time of the completion. Such that now it is possible to see in the agenda view |
37 | when what todo was completed. | 40 | when what todo was completed. |
38 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 41 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
39 | Now the behaviour is: | 42 | Now the behaviour is: |
40 | Setting a parent to complete sets all (sub)childs to complete. | 43 | Setting a parent to complete sets all (sub)childs to complete. |
41 | Setting a parent to uncomplete does not change the childs. | 44 | Setting a parent to uncomplete does not change the childs. |
42 | Setting a child to uncomplete sets all parent to uncomplete. | 45 | Setting a child to uncomplete sets all parent to uncomplete. |
43 | Setting a child to complete does not change the parents. | 46 | Setting a child to complete does not change the parents. |
44 | 47 | ||
45 | Smart updating and double buffering of the daymatrix. | 48 | Smart updating and double buffering of the daymatrix. |
46 | Showing holidays in the day matrix. | 49 | Showing holidays in the day matrix. |
47 | Many other small performance updates. | 50 | Many other small performance updates. |
48 | 51 | ||
49 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 52 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
50 | 53 | ||
51 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 54 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
52 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. | 55 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. |
53 | 56 | ||
54 | 57 | ||
55 | ********** VERSION 2.0.0 ************ | 58 | ********** VERSION 2.0.0 ************ |
56 | 59 | ||
57 | Stable release 2.0.0! | 60 | Stable release 2.0.0! |
58 | 61 | ||
59 | KO/Pi: | 62 | KO/Pi: |
60 | Fixed problem in edit dialog recreation at startup. | 63 | Fixed problem in edit dialog recreation at startup. |
61 | Made "toggle view*" menu items enabled context sensitive. | 64 | Made "toggle view*" menu items enabled context sensitive. |
62 | Changed agenda size menu to items 1-10. | 65 | Changed agenda size menu to items 1-10. |
63 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 66 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
64 | Usebility enhancements in the KO/Pi menus. | 67 | Usebility enhancements in the KO/Pi menus. |
65 | Birthday import now adds year to summary. | 68 | Birthday import now adds year to summary. |
66 | What's Next view shows age in years for birthday. | 69 | What's Next view shows age in years for birthday. |
67 | 70 | ||
68 | OM/Pi: | 71 | OM/Pi: |
69 | Added three info lines to display subject, from and to of selected mails. | 72 | Added three info lines to display subject, from and to of selected mails. |
70 | 73 | ||
71 | KA/Pi: | 74 | KA/Pi: |
72 | Fixed jump bar behaviour on Zaurus. | 75 | Fixed jump bar behaviour on Zaurus. |
73 | Now KA/Pi search field supports searching for a range of starting characters. | 76 | Now KA/Pi search field supports searching for a range of starting characters. |
74 | E.g. to search for all contact beginning with b to n, type | 77 | E.g. to search for all contact beginning with b to n, type |
75 | b-n | 78 | b-n |
76 | in the search field. | 79 | in the search field. |
77 | 80 | ||
78 | ********** VERSION 1.9.20 ************ | 81 | ********** VERSION 1.9.20 ************ |
79 | 82 | ||
80 | KO/Pi: | 83 | KO/Pi: |
81 | Added for the "dislplay one day" agenda mode | 84 | Added for the "dislplay one day" agenda mode |
82 | info in the caption and in the day lables: | 85 | info in the caption and in the day lables: |
83 | Now it is displayed, if the selected day is from "day before yesterday" | 86 | Now it is displayed, if the selected day is from "day before yesterday" |
84 | to "day after tomorrow". | 87 | to "day after tomorrow". |
85 | Made it possible to delete a Todo, which has sub-todos. | 88 | Made it possible to delete a Todo, which has sub-todos. |
86 | Fixed two small problems in the todo view. | 89 | Fixed two small problems in the todo view. |
87 | Added missing German translation for filter edit and print dialog. | 90 | Added missing German translation for filter edit and print dialog. |
88 | Made search dialog closeable by cancel key. | 91 | Made search dialog closeable by cancel key. |
89 | 92 | ||
90 | Made it possible to select in the date picker the (ligt grey ) | 93 | Made it possible to select in the date picker the (ligt grey ) |
91 | dates of the prev./next month with the mouse. | 94 | dates of the prev./next month with the mouse. |
92 | 95 | ||
93 | OM/Pi: | 96 | OM/Pi: |
94 | "Delete mail" icon in main window now deletes all selected mails. | 97 | "Delete mail" icon in main window now deletes all selected mails. |
95 | Fixed the problem, that the state flag of imap mails was ignored. | 98 | Fixed the problem, that the state flag of imap mails was ignored. |
96 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view | 99 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view |
97 | to indecate that they are already seen. | 100 | to indecate that they are already seen. |
98 | Fixed the problem that the body of some mails was not displayed in the | 101 | Fixed the problem that the body of some mails was not displayed in the |
99 | mail viewer when fetching them from the imap server directly to read them. | 102 | mail viewer when fetching them from the imap server directly to read them. |
100 | Made it (configurable) possible to show the "To:" field in the list view. | 103 | Made it (configurable) possible to show the "To:" field in the list view. |
101 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | 104 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. |
102 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the | 105 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the |
103 | local storage folder (specified in account settings) of the account of the mail. | 106 | local storage folder (specified in account settings) of the account of the mail. |
104 | Removed some memory leaks in OM/Pi. | 107 | Removed some memory leaks in OM/Pi. |
105 | 108 | ||
106 | 109 | ||
107 | ********** VERSION 1.9.19 ************ | 110 | ********** VERSION 1.9.19 ************ |
108 | 111 | ||
109 | Added a lot of missing translations to KA/Pi, | 112 | Added a lot of missing translations to KA/Pi, |
110 | Added some missing translations to KO/Pi and OM/Pi. | 113 | Added some missing translations to KO/Pi and OM/Pi. |
111 | 114 | ||
112 | Fixed some minor problems in KA/Pi + KO/Pi. | 115 | Fixed some minor problems in KA/Pi + KO/Pi. |
113 | 116 | ||
114 | Fixed a crash when closing PwM/Pi. | 117 | Fixed a crash when closing PwM/Pi. |
115 | Added German translation for PwM/Pi. | 118 | Added German translation for PwM/Pi. |
116 | 119 | ||
117 | Made view change and Month View update faster in KO/Pi. | 120 | Made view change and Month View update faster in KO/Pi. |
118 | 121 | ||
119 | 122 | ||
120 | ********** VERSION 1.9.18 ************ | 123 | ********** VERSION 1.9.18 ************ |
121 | 124 | ||
122 | FYI: The VERSION 1.9.17 was a testing release only. | 125 | FYI: The VERSION 1.9.17 was a testing release only. |
123 | Please read the changelog of VERSION 1.9.17 as well. | 126 | Please read the changelog of VERSION 1.9.17 as well. |
124 | 127 | ||
125 | Cleaned up the syncing config dialog. | 128 | Cleaned up the syncing config dialog. |
126 | Added sync config options for date range for events. | 129 | Added sync config options for date range for events. |
127 | Added sync config options for filters on incoming data. | 130 | Added sync config options for filters on incoming data. |
128 | Added sync config options for filters on outgoing data. | 131 | Added sync config options for filters on outgoing data. |
129 | Please read the updated SyncHowTo about the new filter settings. | 132 | Please read the updated SyncHowTo about the new filter settings. |
130 | These filter settings make it now possible to sync with shared | 133 | These filter settings make it now possible to sync with shared |
131 | calendars without writing back private or confidential data | 134 | calendars without writing back private or confidential data |
132 | (via the outgoing filters). | 135 | (via the outgoing filters). |
133 | To sync only with particular parts of a shared calendar, | 136 | To sync only with particular parts of a shared calendar, |
134 | the incoming filter settings can be used. | 137 | the incoming filter settings can be used. |
135 | An example can be found in the SyncHowTo. | 138 | An example can be found in the SyncHowTo. |
136 | Same for shared addressbooks. | 139 | Same for shared addressbooks. |
137 | 140 | ||
138 | Added a setting for the global kdepim data storage. | 141 | Added a setting for the global kdepim data storage. |
139 | Usually the data is stored in (yourhomedir/kdepim). | 142 | Usually the data is stored in (yourhomedir/kdepim). |
140 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" | 143 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" |
141 | a directory where all the kdepim data is stored. | 144 | a directory where all the kdepim data is stored. |
142 | That makes it easy to save all kdepim data on a SD card on the Z, for example. | 145 | That makes it easy to save all kdepim data on a SD card on the Z, for example. |
143 | 146 | ||
144 | KO/Pi: | 147 | KO/Pi: |
145 | The timeedit input has a pulldown list for times. | 148 | The timeedit input has a pulldown list for times. |
146 | If opened, this pulldown list should now has the right time highlighted. | 149 | If opened, this pulldown list should now has the right time highlighted. |
147 | Added the possibility to exclude events/todos/journals in a filter. | 150 | Added the possibility to exclude events/todos/journals in a filter. |
148 | You should exclude journals, if you do not want them to sync with a public calendar. | 151 | You should exclude journals, if you do not want them to sync with a public calendar. |
149 | 152 | ||
150 | KA/Pi: | 153 | KA/Pi: |
151 | Added the possibility to in/exclude public/private/confidential contacts to a filter. | 154 | Added the possibility to in/exclude public/private/confidential contacts to a filter. |
152 | If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... | 155 | If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... |
153 | Added printing of card view and details view on desktop. | 156 | Added printing of card view and details view on desktop. |
154 | Printing of list view is not working... | 157 | Printing of list view is not working... |
155 | Added button for removing pictures in contact editor. | 158 | Added button for removing pictures in contact editor. |
156 | Parsing data fix of KA/Pi version 1.9.17. | 159 | Parsing data fix of KA/Pi version 1.9.17. |
157 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. | 160 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. |
158 | Fixed some syncing merging problems. | 161 | Fixed some syncing merging problems. |
159 | 162 | ||
160 | 163 | ||
161 | ********** VERSION 1.9.17 ************ | 164 | ********** VERSION 1.9.17 ************ |
162 | 165 | ||
163 | KO/Pi: | 166 | KO/Pi: |
164 | Fixed that tooltips were not updated after moving an item in agenda view. | 167 | Fixed that tooltips were not updated after moving an item in agenda view. |
165 | Fixed a bug in sorting start date for recurring events in list view. | 168 | Fixed a bug in sorting start date for recurring events in list view. |
166 | Changed the left button in todo viewer from "Agenda" to "Set completed". | 169 | Changed the left button in todo viewer from "Agenda" to "Set completed". |
167 | This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. | 170 | This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. |
168 | Added more info in the todo viewer: Startdate, parent/sub todos. | 171 | Added more info in the todo viewer: Startdate, parent/sub todos. |
169 | 172 | ||
170 | 173 | ||
171 | KA/Pi: | 174 | KA/Pi: |
172 | All fields search does now actually search all the (possible) fields, | 175 | All fields search does now actually search all the (possible) fields, |
173 | not only those listed in the contact list. | 176 | not only those listed in the contact list. |
174 | Made is possible to inline a picture in a vcard on the Z. | 177 | Made is possible to inline a picture in a vcard on the Z. |
175 | This was only possible on the desktop, now is it possible on the Z as well. | 178 | This was only possible on the desktop, now is it possible on the Z as well. |
176 | Fixed of missing save settings after filter configuration. | 179 | Fixed of missing save settings after filter configuration. |
177 | Made saving of addressbook much faster. | 180 | Made saving of addressbook much faster. |
178 | Fixed extension widget layout problem. | 181 | Fixed extension widget layout problem. |
179 | Fixed saving of default formatted name settings. | 182 | Fixed saving of default formatted name settings. |
180 | Fixed formatted name handling in edit dialog. | 183 | Fixed formatted name handling in edit dialog. |
181 | Added an option for changing formatted names of many contacts | 184 | Added an option for changing formatted names of many contacts |
182 | (menu: File - Change - Set formatted name). | 185 | (menu: File - Change - Set formatted name). |
183 | 186 | ||
184 | QWhatsThis was not working on the Z ( only black rectangle was shown). | 187 | QWhatsThis was not working on the Z ( only black rectangle was shown). |
185 | This is Fixed. | 188 | This is Fixed. |
186 | 189 | ||
187 | KDE-Sync: | 190 | KDE-Sync: |
188 | Now readonly KDE resources are synced as well. | 191 | Now readonly KDE resources are synced as well. |
189 | (They are not changed in KDE itself, of course). | 192 | (They are not changed in KDE itself, of course). |
190 | 193 | ||
191 | 194 | ||
192 | 195 | ||
193 | ********** VERSION 1.9.16 ************ | 196 | ********** VERSION 1.9.16 ************ |
194 | 197 | ||
195 | KO/Pi: | 198 | KO/Pi: |
196 | Fixed search dialog size on Z 6000 (480x640 display). | 199 | Fixed search dialog size on Z 6000 (480x640 display). |
197 | Added setting to hide/show time in agenda items. | 200 | Added setting to hide/show time in agenda items. |
198 | Added setting to hide not running todos in todo view. | 201 | Added setting to hide not running todos in todo view. |
199 | Added columns for start date/time in todo view. | 202 | Added columns for start date/time in todo view. |
200 | Replaced the solid half-hour lines in agenda view by dot lines. | 203 | Replaced the solid half-hour lines in agenda view by dot lines. |
201 | Added possibility of printing the What's Next View on the desktop | 204 | Added possibility of printing the What's Next View on the desktop |
202 | (i.e. Windows and Linux). | 205 | (i.e. Windows and Linux). |
203 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. | 206 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. |
204 | Added tooltips in month view.(Tooltips only available on desktop) | 207 | Added tooltips in month view.(Tooltips only available on desktop) |
205 | 208 | ||
206 | Fixed a strange problem in KO/Pi alarm applet. | 209 | Fixed a strange problem in KO/Pi alarm applet. |
207 | Did not find the actual problem, | 210 | Did not find the actual problem, |
208 | such that now Qtopia reboots again if deinstalling the alarm applet. | 211 | such that now Qtopia reboots again if deinstalling the alarm applet. |
209 | But the alarm applet should work again. | 212 | But the alarm applet should work again. |
210 | 213 | ||
211 | KA/Pi: | 214 | KA/Pi: |
212 | Fixed the problem, that internal pictures were not saved. | 215 | Fixed the problem, that internal pictures were not saved. |
213 | 216 | ||
214 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. | 217 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. |
215 | 218 | ||
216 | Fixed some minor problems. (Like word wrap in help text windows). | 219 | Fixed some minor problems. (Like word wrap in help text windows). |
217 | 220 | ||
218 | Fixed a compiling problem in microkde/kresources. | 221 | Fixed a compiling problem in microkde/kresources. |
219 | 222 | ||
220 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. | 223 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. |
221 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) | 224 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) |
222 | such that now syncing KO/Pi with Sharp DTM should work on the | 225 | such that now syncing KO/Pi with Sharp DTM should work on the |
223 | Zaurus C 3000 model. | 226 | Zaurus C 3000 model. |
224 | 227 | ||
225 | ********** VERSION 1.9.15 ************ | 228 | ********** VERSION 1.9.15 ************ |
226 | 229 | ||
227 | Usebilty enhancements in KO/Pi: | 230 | Usebilty enhancements in KO/Pi: |
228 | When clicking on the date in a month view cell, the day view is shown. | 231 | When clicking on the date in a month view cell, the day view is shown. |
229 | Old behaviour was, that the "new event" dialog popped up. | 232 | Old behaviour was, that the "new event" dialog popped up. |
230 | 233 | ||
231 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | 234 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). |
232 | That means, you can restore the latest | 235 | That means, you can restore the latest |
233 | event/todo/journal you have deleted. | 236 | event/todo/journal you have deleted. |
234 | A journal is deleted, if you clear all the text of the journal. | 237 | A journal is deleted, if you clear all the text of the journal. |
235 | 238 | ||
236 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. | 239 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. |
237 | 240 | ||
238 | KA/Pi starting in 480x640 resolution: | 241 | KA/Pi starting in 480x640 resolution: |
239 | Hide the filter action in toolbar | 242 | Hide the filter action in toolbar |
240 | and added icons for undo/delete/redo in toolbar. | 243 | and added icons for undo/delete/redo in toolbar. |
241 | 244 | ||
242 | Change in OM/Pi ViewMail dialog: | 245 | Change in OM/Pi ViewMail dialog: |
243 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. | 246 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. |
244 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). | 247 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). |
245 | 248 | ||
246 | Fixed a crash when deleting mail-accounts in OM/Pi. | 249 | Fixed a crash when deleting mail-accounts in OM/Pi. |
247 | 250 | ||
248 | 251 | ||
249 | ********** VERSION 1.9.14 ************ | 252 | ********** VERSION 1.9.14 ************ |
250 | 253 | ||
251 | Fixed some problems with the dialog sizes when switching | 254 | Fixed some problems with the dialog sizes when switching |
252 | portrait/landscape mode on 640x480 PDA display. | 255 | portrait/landscape mode on 640x480 PDA display. |
253 | 256 | ||
254 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 257 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
255 | 258 | ||
256 | Fixed an ugly bug in KOpieMail: | 259 | Fixed an ugly bug in KOpieMail: |
257 | KOpieMail was not able to write files (mails) to MSDOS file system, | 260 | KOpieMail was not able to write files (mails) to MSDOS file system, |
258 | like on an usual preformatted SD card. That should work now. | 261 | like on an usual preformatted SD card. That should work now. |
259 | To save your mail data on the Sd card do the following: | 262 | To save your mail data on the Sd card do the following: |
260 | Create a dir on the SD card: | 263 | Create a dir on the SD card: |
261 | mkdir /mnt/card/localmail | 264 | mkdir /mnt/card/localmail |
262 | Go to your home dir: | 265 | Go to your home dir: |
263 | cd | 266 | cd |
264 | Go to kopiemail data storage dir: | 267 | Go to kopiemail data storage dir: |
265 | cd kdepim/apps/kopiemail | 268 | cd kdepim/apps/kopiemail |
266 | Create a symlink to the SD card: | 269 | Create a symlink to the SD card: |
267 | ls -s /mnt/card/localmail | 270 | ls -s /mnt/card/localmail |
268 | Now KOpieMail will store all mails on the SD card. | 271 | Now KOpieMail will store all mails on the SD card. |
269 | 272 | ||
270 | KO/Pi Monthview: | 273 | KO/Pi Monthview: |
271 | Now "Go to Today" selects the current month from day 1-end, | 274 | Now "Go to Today" selects the current month from day 1-end, |
272 | not the current date + some days. | 275 | not the current date + some days. |
273 | I.e. "Go to Today" shows now always | 276 | I.e. "Go to Today" shows now always |
274 | the current month with first day of month in the first row. | 277 | the current month with first day of month in the first row. |
275 | 278 | ||
276 | Added missing German translation. | 279 | Added missing German translation. |
277 | 280 | ||
278 | Fixed icons of executeable on Wintendo. | 281 | Fixed icons of executeable on Wintendo. |
279 | 282 | ||
280 | Added a "Show next Mail" button to the OM/Pi | 283 | Added a "Show next Mail" button to the OM/Pi |
281 | mail viewer such that the mail below the current mail | 284 | mail viewer such that the mail below the current mail |
282 | in the mail list view of the current folder | 285 | in the mail list view of the current folder |
283 | can be read with a single click. | 286 | can be read with a single click. |
284 | 287 | ||
285 | 288 | ||
286 | ********** VERSION 1.9.13 ************ | 289 | ********** VERSION 1.9.13 ************ |
287 | 290 | ||
288 | Fixed nasty PwM/Pi file reading bug, when | 291 | Fixed nasty PwM/Pi file reading bug, when |
289 | the used hash algo of file is different then the global | 292 | the used hash algo of file is different then the global |
290 | hash algo. | 293 | hash algo. |
291 | 294 | ||
292 | Added KA/Pi support for opie mailit mailapplication. | 295 | Added KA/Pi support for opie mailit mailapplication. |
293 | 296 | ||
294 | Fixed some bugs in OM/Pi. | 297 | Fixed some bugs in OM/Pi. |
295 | Now character conversion tables are available for the Zaurus | 298 | Now character conversion tables are available for the Zaurus |
296 | to make OM/Pi working properly. | 299 | to make OM/Pi working properly. |
297 | To get the character conversion in OM/Pi working, please download | 300 | To get the character conversion in OM/Pi working, please download |
298 | at the sourceforge project site the package | 301 | at the sourceforge project site the package |
299 | sr-character-conversion_SharpROM_arm.ipk.zip | 302 | sr-character-conversion_SharpROM_arm.ipk.zip |
300 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 303 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
301 | from the section "general files for KDE/Pim" | 304 | from the section "general files for KDE/Pim" |
302 | Instructions how to install this package are in a ReadMe in this file. | 305 | Instructions how to install this package are in a ReadMe in this file. |
303 | 306 | ||
304 | 307 | ||
305 | Fixed the orientation change problem in KA/Pi when switching | 308 | Fixed the orientation change problem in KA/Pi when switching |
306 | portrait/landscape mode. | 309 | portrait/landscape mode. |
307 | 310 | ||
308 | French translation available for KA/Pi and OM/Pi. | 311 | French translation available for KA/Pi and OM/Pi. |
309 | 312 | ||
310 | Fixed some problems with categories in KO/Pi in DTM sync. | 313 | Fixed some problems with categories in KO/Pi in DTM sync. |
311 | 314 | ||
312 | Added selection dialog for export to phone in KA/Pi. | 315 | Added selection dialog for export to phone in KA/Pi. |
313 | 316 | ||
314 | If in KO/Pi is an attendee selected to add to a meeting and this | 317 | If in KO/Pi is an attendee selected to add to a meeting and this |
315 | attendee is already in the list of attendees, this person is not added | 318 | attendee is already in the list of attendees, this person is not added |
316 | again. | 319 | again. |
317 | 320 | ||
318 | Some menu cleanup in KA/Pi. | 321 | Some menu cleanup in KA/Pi. |
319 | 322 | ||
320 | ********** VERSION 1.9.12 ************ | 323 | ********** VERSION 1.9.12 ************ |
321 | 324 | ||
322 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 325 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
323 | 326 | ||
324 | Bugfix: Licence file is now shown again. | 327 | Bugfix: Licence file is now shown again. |
325 | 328 | ||
326 | OM/Pi now supports Unicode (utf8 charset). | 329 | OM/Pi now supports Unicode (utf8 charset). |
327 | Fixed some bugs in OM/Pi. | 330 | Fixed some bugs in OM/Pi. |
328 | 331 | ||
329 | KA/Pi has more German translation. | 332 | KA/Pi has more German translation. |
330 | 333 | ||
331 | 334 | ||
332 | ********** VERSION 1.9.11 ************ | 335 | ********** VERSION 1.9.11 ************ |
333 | 336 | ||
334 | Fixed several problems in PWM/Pi, like | 337 | Fixed several problems in PWM/Pi, like |
335 | asking the user, if unsaved changed are pending | 338 | asking the user, if unsaved changed are pending |
336 | when closing the app. | 339 | when closing the app. |
337 | And PwM/Pi handles now different texts for the | 340 | And PwM/Pi handles now different texts for the |
338 | fields Description, Username, Password, configurable per category. | 341 | fields Description, Username, Password, configurable per category. |
339 | 342 | ||
340 | Fixed a crash in KO/Pi , when importing/loading vcs files | 343 | Fixed a crash in KO/Pi , when importing/loading vcs files |
341 | which have an entry with an attendee with state: | 344 | which have an entry with an attendee with state: |
342 | NEEDS ACTION | 345 | NEEDS ACTION |
343 | 346 | ||
344 | Fixed some problems in the German translation of OM/Pi, | 347 | Fixed some problems in the German translation of OM/Pi, |
345 | which makes some dialogs not fitting on the screen | 348 | which makes some dialogs not fitting on the screen |
346 | of the Z 5500. | 349 | of the Z 5500. |
347 | 350 | ||
348 | Fixed Qtopia crash, when disabling/deinstalling | 351 | Fixed Qtopia crash, when disabling/deinstalling |
349 | KO/Pi alarm applet. | 352 | KO/Pi alarm applet. |
350 | 353 | ||
351 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 354 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
352 | on Linux desktop. | 355 | on Linux desktop. |
353 | 356 | ||
354 | Added feature "remove sync info" to sync menu. | 357 | Added feature "remove sync info" to sync menu. |
355 | 358 | ||
356 | Tweaked the KO/Pi What's next view a bit, added | 359 | Tweaked the KO/Pi What's next view a bit, added |
357 | setting to hide events that are done. | 360 | setting to hide events that are done. |
358 | 361 | ||
359 | Disabled "beam receive enabled" on startup to | 362 | Disabled "beam receive enabled" on startup to |
360 | avoid problems if Fastload is enabled. | 363 | avoid problems if Fastload is enabled. |
361 | Please set "beam receive enabled", | 364 | Please set "beam receive enabled", |
362 | if you want to receive data via IR. | 365 | if you want to receive data via IR. |
363 | 366 | ||
364 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 367 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
365 | on Linux desktop. | 368 | on Linux desktop. |
366 | 369 | ||
367 | Made in KA/Pi scrolling possible, if details view is selected. | 370 | Made in KA/Pi scrolling possible, if details view is selected. |
368 | (The keyboard focus is set automatically to the search line) | 371 | (The keyboard focus is set automatically to the search line) |
369 | 372 | ||
370 | Fixed a bug in DMT sync, that a new entry in DTM was added | 373 | Fixed a bug in DMT sync, that a new entry in DTM was added |
371 | on every sync to Kx/Pi. | 374 | on every sync to Kx/Pi. |
372 | 375 | ||
373 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 376 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
374 | 377 | ||
375 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 378 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
376 | non-latin1 characters. | 379 | non-latin1 characters. |
377 | 380 | ||
378 | Rearranged package contents of Sharp-ipks and made all | 381 | Rearranged package contents of Sharp-ipks and made all |
379 | packages installable on SD again. | 382 | packages installable on SD again. |
380 | 383 | ||
381 | Fixed the writing of addressbook data in DTM sync. | 384 | Fixed the writing of addressbook data in DTM sync. |
382 | Empty fields in KA/Pi were not removed. | 385 | Empty fields in KA/Pi were not removed. |
383 | 386 | ||
384 | Added better category handling in KA/Pi: | 387 | Added better category handling in KA/Pi: |
385 | Added item | 388 | Added item |
386 | Edit Categories and | 389 | Edit Categories and |
387 | Manage new categories | 390 | Manage new categories |
388 | to the settings menu. | 391 | to the settings menu. |
389 | Possible to configure a view to display categories. | 392 | Possible to configure a view to display categories. |
390 | 393 | ||
391 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 394 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
392 | 395 | ||
393 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 396 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
394 | 397 | ||
395 | ... and many other bugfixes. | 398 | ... and many other bugfixes. |
396 | 399 | ||
397 | ********** VERSION 1.9.10 ************ | 400 | ********** VERSION 1.9.10 ************ |
398 | 401 | ||
399 | Many internal small bugfixes. | 402 | Many internal small bugfixes. |
400 | And fix of the "big" bug in KO/Pi, | 403 | And fix of the "big" bug in KO/Pi, |
401 | that after Syncing the appointments had an offset by several hours. | 404 | that after Syncing the appointments had an offset by several hours. |
402 | That was a problem with the internal timezone setting, | 405 | That was a problem with the internal timezone setting, |
403 | introduced by the changed timezone configuration settings. | 406 | introduced by the changed timezone configuration settings. |
404 | 407 | ||
405 | German translation for OM/Pi is now available. | 408 | German translation for OM/Pi is now available. |
406 | 409 | ||
407 | 410 | ||
408 | ********** VERSION 1.9.9 ************ | 411 | ********** VERSION 1.9.9 ************ |
409 | 412 | ||
410 | KDE-Pim/Pi has a new Member! | 413 | KDE-Pim/Pi has a new Member! |
411 | It is called PWM/Pi (Passwordmanager/platform-independent) | 414 | It is called PWM/Pi (Passwordmanager/platform-independent) |
412 | and it is available for the Zaurus. | 415 | and it is available for the Zaurus. |
413 | It is planned, that it will be available later for Windows. | 416 | It is planned, that it will be available later for Windows. |
414 | (And for Linux, of course). | 417 | (And for Linux, of course). |
415 | It is a port of the Passwordmanager of KDE. | 418 | It is a port of the Passwordmanager of KDE. |
416 | It will need the MicroKDElibs to run. | 419 | It will need the MicroKDElibs to run. |
417 | 420 | ||
418 | Made loading of addressbooks in KA/Pi up to 7 times faster! | 421 | Made loading of addressbooks in KA/Pi up to 7 times faster! |
419 | The bigger your addressbook file, the more starting speed | 422 | The bigger your addressbook file, the more starting speed |
420 | will you gain. (relatively) | 423 | will you gain. (relatively) |
421 | 424 | ||
422 | The Qtopia addressbook connector is now platform independend | 425 | The Qtopia addressbook connector is now platform independend |
423 | as well and should work on any platform for importing/exporting | 426 | as well and should work on any platform for importing/exporting |
424 | Qtopia and Opie XML files. | 427 | Qtopia and Opie XML files. |
425 | 428 | ||
426 | Added a +30min feature to the timezone settings to make | 429 | Added a +30min feature to the timezone settings to make |
427 | KDE-Pim/Pi useable in Australia and other parts on the | 430 | KDE-Pim/Pi useable in Australia and other parts on the |
428 | world with strange timezones ;-) | 431 | world with strange timezones ;-) |
429 | 432 | ||
430 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. | 433 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. |
431 | 434 | ||
432 | It is now possible to disable the | 435 | It is now possible to disable the |
433 | "receive data via infrared" feature, such that syncing with | 436 | "receive data via infrared" feature, such that syncing with |
434 | Outlook is now possible again with Kx/Pi runing. | 437 | Outlook is now possible again with Kx/Pi runing. |
435 | Please disable it, before syncing Sharp DTM with Outlook. | 438 | Please disable it, before syncing Sharp DTM with Outlook. |
436 | For your convenience, the "receive data via infrared" feature | 439 | For your convenience, the "receive data via infrared" feature |
437 | is disabled automatically, if you sync Kx/Pi with DTM. | 440 | is disabled automatically, if you sync Kx/Pi with DTM. |
438 | You have to enable it again manually after syncing. | 441 | You have to enable it again manually after syncing. |
439 | Enabling this feature makes it impossible to start the | 442 | Enabling this feature makes it impossible to start the |
440 | Sharp DTM apps. If this feature is enabled, you will only get the | 443 | Sharp DTM apps. If this feature is enabled, you will only get the |
441 | alarm notification from KO/Pi and not from the Sharp calendar. | 444 | alarm notification from KO/Pi and not from the Sharp calendar. |
442 | This is very useful if you sync KO/Pi with Sharp DTM, | 445 | This is very useful if you sync KO/Pi with Sharp DTM, |
443 | because after syncing you usually would get notified about | 446 | because after syncing you usually would get notified about |
444 | an alarm by KO/Pi and the Sharp Calendar. | 447 | an alarm by KO/Pi and the Sharp Calendar. |
445 | 448 | ||
446 | Together with the Linux desktop version of KO/Pi | 449 | Together with the Linux desktop version of KO/Pi |
447 | it is now possible to sync KO/Pi on the Zaurus | 450 | it is now possible to sync KO/Pi on the Zaurus |
448 | with the complete KDE-desktop (3.3 or later) | 451 | with the complete KDE-desktop (3.3 or later) |
449 | calendar data easily. | 452 | calendar data easily. |
450 | That makes it possible to sync the Z with one | 453 | That makes it possible to sync the Z with one |
451 | click of a mouse with the KDE-Desktop. | 454 | click of a mouse with the KDE-Desktop. |
452 | This feature it available for all Zaurus platforms KO/Pi | 455 | This feature it available for all Zaurus platforms KO/Pi |
453 | is running on. | 456 | is running on. |
454 | The only thing needed is a running KO/Pi on Linux and | 457 | The only thing needed is a running KO/Pi on Linux and |
455 | a compiled version of the small | 458 | a compiled version of the small |
456 | KDE-Pim/Pi<->KDE-Desktop access command line program, | 459 | KDE-Pim/Pi<->KDE-Desktop access command line program, |
457 | which is in the KDE-Pim/Pi sources available. | 460 | which is in the KDE-Pim/Pi sources available. |
458 | 461 | ||
459 | The "KDE-desktop" syncing feature for KA/Pi will follow | 462 | The "KDE-desktop" syncing feature for KA/Pi will follow |
460 | in the next releases. | 463 | in the next releases. |
461 | 464 | ||
462 | Fixed the vcard export bug, which had the version 1.9.8. | 465 | Fixed the vcard export bug, which had the version 1.9.8. |
463 | 466 | ||
464 | Added missing GERMAN translation to KO/Pi. | 467 | Added missing GERMAN translation to KO/Pi. |
465 | Hi PsionX, could you add the missing french translation?Thx! | 468 | Hi PsionX, could you add the missing french translation?Thx! |
466 | 469 | ||
467 | Translation files for KA/Pi are available as well. | 470 | Translation files for KA/Pi are available as well. |
468 | GERMAN translation will be available in the next release. | 471 | GERMAN translation will be available in the next release. |
469 | PsionX ( yres, you again ;-) ), could you start translating | 472 | PsionX ( yres, you again ;-) ), could you start translating |
470 | KA/Pi? Thx! | 473 | KA/Pi? Thx! |
471 | 474 | ||
472 | You can download the version 1.9.9 at | 475 | You can download the version 1.9.9 at |
473 | 476 | ||
474 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 | 477 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 |
475 | 478 | ||
476 | Note: | 479 | Note: |
477 | To run the mail program OM/Pi you need libopenssl. | 480 | To run the mail program OM/Pi you need libopenssl. |
478 | A link to a download loaction is available at | 481 | A link to a download loaction is available at |
479 | ZSI at www.killefiz.de | 482 | ZSI at www.killefiz.de |
480 | 483 | ||
481 | 484 | ||
482 | ********** VERSION 1.9.8 ************ | 485 | ********** VERSION 1.9.8 ************ |
483 | 486 | ||
484 | Fixed character decoding in OM/Pi. | 487 | Fixed character decoding in OM/Pi. |
485 | (e.g. German "Umlaute" were not displayed properly.) | 488 | (e.g. German "Umlaute" were not displayed properly.) |
486 | 489 | ||
487 | Made is possible to reparent todos in KO/Pi. | 490 | Made is possible to reparent todos in KO/Pi. |
488 | Use contextmenu or keys (look at Help-Keys + Colors) for that. | 491 | Use contextmenu or keys (look at Help-Keys + Colors) for that. |
489 | 492 | ||
490 | Added the missing Sync-Howto and WhatsNew to the packages. | 493 | Added the missing Sync-Howto and WhatsNew to the packages. |
491 | 494 | ||
492 | KO/Pi on Linux desktop can now sync with KDE desktop. | 495 | KO/Pi on Linux desktop can now sync with KDE desktop. |
493 | That means: When using KO/Pi on Linux desktop for syncing with | 496 | That means: When using KO/Pi on Linux desktop for syncing with |
494 | KDE desktop and the Zaurus, the Zaurus can be synced now | 497 | KDE desktop and the Zaurus, the Zaurus can be synced now |
495 | with all KDE-Calendar resources, not only with one local file. | 498 | with all KDE-Calendar resources, not only with one local file. |
496 | (That makes it possible to sync the Zaurus with the | 499 | (That makes it possible to sync the Zaurus with the |
497 | calendar data on a Kolab server) | 500 | calendar data on a Kolab server) |
498 | 501 | ||
499 | KA/Pi syncing with KDE desktop will be available in the next version. | 502 | KA/Pi syncing with KDE desktop will be available in the next version. |
500 | 503 | ||
501 | 504 | ||
502 | ********** VERSION 1.9.7 ************ | 505 | ********** VERSION 1.9.7 ************ |
503 | 506 | ||
504 | KO/Pi - KA/Pi on Windows: | 507 | KO/Pi - KA/Pi on Windows: |
505 | Now a directory can be defined by the user, where the | 508 | Now a directory can be defined by the user, where the |
506 | application/config data should be saved. | 509 | application/config data should be saved. |
507 | Define your desired path in the evironment variable | 510 | Define your desired path in the evironment variable |
508 | MICROKDEHOME | 511 | MICROKDEHOME |
509 | before starting KO/Pi or KA/Pi. | 512 | before starting KO/Pi or KA/Pi. |
510 | 513 | ||
511 | An easy Kx/Pi to Kx/Pi syncing is now possible | 514 | An easy Kx/Pi to Kx/Pi syncing is now possible |
512 | (it is called Pi-Sync) via network. | 515 | (it is called Pi-Sync) via network. |
513 | Please look at the Sync Howto. | 516 | Please look at the Sync Howto. |
514 | 517 | ||
515 | Exporting of calendar data and contacts to mobile phones is now possible. | 518 | Exporting of calendar data and contacts to mobile phones is now possible. |
516 | The SyncHowto is updated with information howto | 519 | The SyncHowto is updated with information howto |
517 | access/sync mobile phones. | 520 | access/sync mobile phones. |
518 | Please look at the Sync Howto. | 521 | Please look at the Sync Howto. |
519 | 522 | ||
520 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | 523 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. |
521 | Please disable Fastload for the original contact/calendar applications | 524 | Please disable Fastload for the original contact/calendar applications |
522 | and close them. | 525 | and close them. |
523 | KO/Pi and KA/Pi must be running in order to receive the data. | 526 | KO/Pi and KA/Pi must be running in order to receive the data. |
524 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | 527 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) |
525 | 528 | ||
526 | In the KA/Pi details view are now the preferred tel. numbers displayed on top | 529 | In the KA/Pi details view are now the preferred tel. numbers displayed on top |
527 | of the other data ( emails/tel.numbers/addresses) | 530 | of the other data ( emails/tel.numbers/addresses) |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e0380fa..77de94f 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1742,1026 +1742,1042 @@ bool CalendarView::checkFileVersion(QString fn) | |||
1742 | syncCalendar( fn, 3 ); | 1742 | syncCalendar( fn, 3 ); |
1743 | Event * e = getLastSyncEvent(); | 1743 | Event * e = getLastSyncEvent(); |
1744 | mCalendar->deleteEvent ( e ); | 1744 | mCalendar->deleteEvent ( e ); |
1745 | updateView(); | 1745 | updateView(); |
1746 | return true; | 1746 | return true; |
1747 | } | 1747 | } |
1748 | 1748 | ||
1749 | bool CalendarView::saveCalendar( QString filename ) | 1749 | bool CalendarView::saveCalendar( QString filename ) |
1750 | { | 1750 | { |
1751 | 1751 | ||
1752 | // Store back all unsaved data into calendar object | 1752 | // Store back all unsaved data into calendar object |
1753 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); | 1753 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); |
1754 | if ( mViewManager->currentView() ) | 1754 | if ( mViewManager->currentView() ) |
1755 | mViewManager->currentView()->flushView(); | 1755 | mViewManager->currentView()->flushView(); |
1756 | 1756 | ||
1757 | 1757 | ||
1758 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); | 1758 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); |
1759 | mStorage->setSaveFormat( new ICalFormat() ); | 1759 | mStorage->setSaveFormat( new ICalFormat() ); |
1760 | mStorage->setFileName( filename ); | 1760 | mStorage->setFileName( filename ); |
1761 | bool success; | 1761 | bool success; |
1762 | success = mStorage->save(); | 1762 | success = mStorage->save(); |
1763 | if ( !success ) { | 1763 | if ( !success ) { |
1764 | return false; | 1764 | return false; |
1765 | } | 1765 | } |
1766 | if ( filename == MainWindow::defaultFileName() ) { | 1766 | if ( filename == MainWindow::defaultFileName() ) { |
1767 | setLoadedFileVersion( lfv ); | 1767 | setLoadedFileVersion( lfv ); |
1768 | watchSavedFile(); | 1768 | watchSavedFile(); |
1769 | } | 1769 | } |
1770 | return true; | 1770 | return true; |
1771 | } | 1771 | } |
1772 | 1772 | ||
1773 | void CalendarView::closeCalendar() | 1773 | void CalendarView::closeCalendar() |
1774 | { | 1774 | { |
1775 | 1775 | ||
1776 | // child windows no longer valid | 1776 | // child windows no longer valid |
1777 | emit closingDown(); | 1777 | emit closingDown(); |
1778 | 1778 | ||
1779 | mCalendar->close(); | 1779 | mCalendar->close(); |
1780 | setModified(false); | 1780 | setModified(false); |
1781 | updateView(); | 1781 | updateView(); |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | void CalendarView::archiveCalendar() | 1784 | void CalendarView::archiveCalendar() |
1785 | { | 1785 | { |
1786 | mDialogManager->showArchiveDialog(); | 1786 | mDialogManager->showArchiveDialog(); |
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | 1789 | ||
1790 | void CalendarView::readSettings() | 1790 | void CalendarView::readSettings() |
1791 | { | 1791 | { |
1792 | 1792 | ||
1793 | 1793 | ||
1794 | // mViewManager->showAgendaView(); | 1794 | // mViewManager->showAgendaView(); |
1795 | QString str; | 1795 | QString str; |
1796 | //qDebug("CalendarView::readSettings() "); | 1796 | //qDebug("CalendarView::readSettings() "); |
1797 | // read settings from the KConfig, supplying reasonable | 1797 | // read settings from the KConfig, supplying reasonable |
1798 | // defaults where none are to be found | 1798 | // defaults where none are to be found |
1799 | KConfig *config = KOGlobals::config(); | 1799 | KConfig *config = KOGlobals::config(); |
1800 | #ifndef KORG_NOSPLITTER | 1800 | #ifndef KORG_NOSPLITTER |
1801 | config->setGroup("KOrganizer Geometry"); | 1801 | config->setGroup("KOrganizer Geometry"); |
1802 | 1802 | ||
1803 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1803 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1804 | if (sizes.count() != 2) { | 1804 | if (sizes.count() != 2) { |
1805 | sizes << mDateNavigator->minimumSizeHint().width(); | 1805 | sizes << mDateNavigator->minimumSizeHint().width(); |
1806 | sizes << 300; | 1806 | sizes << 300; |
1807 | } | 1807 | } |
1808 | mPanner->setSizes(sizes); | 1808 | mPanner->setSizes(sizes); |
1809 | 1809 | ||
1810 | sizes = config->readIntListEntry("Separator2"); | 1810 | sizes = config->readIntListEntry("Separator2"); |
1811 | if ( ( mResourceView && sizes.count() == 4 ) || | 1811 | if ( ( mResourceView && sizes.count() == 4 ) || |
1812 | ( !mResourceView && sizes.count() == 3 ) ) { | 1812 | ( !mResourceView && sizes.count() == 3 ) ) { |
1813 | mLeftSplitter->setSizes(sizes); | 1813 | mLeftSplitter->setSizes(sizes); |
1814 | } | 1814 | } |
1815 | #endif | 1815 | #endif |
1816 | globalFlagBlockAgenda = 1; | 1816 | globalFlagBlockAgenda = 1; |
1817 | mViewManager->showAgendaView(); | 1817 | mViewManager->showAgendaView(); |
1818 | //mViewManager->readSettings( config ); | 1818 | //mViewManager->readSettings( config ); |
1819 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1819 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1820 | readFilterSettings(config); | 1820 | readFilterSettings(config); |
1821 | config->setGroup( "Views" ); | 1821 | config->setGroup( "Views" ); |
1822 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1822 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1823 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1823 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1824 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1824 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1825 | else mNavigator->selectDates( dateCount ); | 1825 | else mNavigator->selectDates( dateCount ); |
1826 | // mViewManager->readSettings( config ); | 1826 | // mViewManager->readSettings( config ); |
1827 | updateConfig(); | 1827 | updateConfig(); |
1828 | globalFlagBlockAgenda = 2; | 1828 | globalFlagBlockAgenda = 2; |
1829 | mViewManager->readSettings( config ); | 1829 | mViewManager->readSettings( config ); |
1830 | #ifdef DESKTOP_VERSION | 1830 | #ifdef DESKTOP_VERSION |
1831 | config->setGroup("WidgetLayout"); | 1831 | config->setGroup("WidgetLayout"); |
1832 | QStringList list; | 1832 | QStringList list; |
1833 | list = config->readListEntry("MainLayout"); | 1833 | list = config->readListEntry("MainLayout"); |
1834 | int x,y,w,h; | 1834 | int x,y,w,h; |
1835 | if ( ! list.isEmpty() ) { | 1835 | if ( ! list.isEmpty() ) { |
1836 | x = list[0].toInt(); | 1836 | x = list[0].toInt(); |
1837 | y = list[1].toInt(); | 1837 | y = list[1].toInt(); |
1838 | w = list[2].toInt(); | 1838 | w = list[2].toInt(); |
1839 | h = list[3].toInt(); | 1839 | h = list[3].toInt(); |
1840 | topLevelWidget()->setGeometry(x,y,w,h); | 1840 | topLevelWidget()->setGeometry(x,y,w,h); |
1841 | 1841 | ||
1842 | } else { | 1842 | } else { |
1843 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1843 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1844 | } | 1844 | } |
1845 | list = config->readListEntry("EditEventLayout"); | 1845 | list = config->readListEntry("EditEventLayout"); |
1846 | if ( ! list.isEmpty() ) { | 1846 | if ( ! list.isEmpty() ) { |
1847 | x = list[0].toInt(); | 1847 | x = list[0].toInt(); |
1848 | y = list[1].toInt(); | 1848 | y = list[1].toInt(); |
1849 | w = list[2].toInt(); | 1849 | w = list[2].toInt(); |
1850 | h = list[3].toInt(); | 1850 | h = list[3].toInt(); |
1851 | mEventEditor->setGeometry(x,y,w,h); | 1851 | mEventEditor->setGeometry(x,y,w,h); |
1852 | 1852 | ||
1853 | } | 1853 | } |
1854 | list = config->readListEntry("EditTodoLayout"); | 1854 | list = config->readListEntry("EditTodoLayout"); |
1855 | if ( ! list.isEmpty() ) { | 1855 | if ( ! list.isEmpty() ) { |
1856 | x = list[0].toInt(); | 1856 | x = list[0].toInt(); |
1857 | y = list[1].toInt(); | 1857 | y = list[1].toInt(); |
1858 | w = list[2].toInt(); | 1858 | w = list[2].toInt(); |
1859 | h = list[3].toInt(); | 1859 | h = list[3].toInt(); |
1860 | mTodoEditor->setGeometry(x,y,w,h); | 1860 | mTodoEditor->setGeometry(x,y,w,h); |
1861 | 1861 | ||
1862 | } | 1862 | } |
1863 | list = config->readListEntry("ViewerLayout"); | 1863 | list = config->readListEntry("ViewerLayout"); |
1864 | if ( ! list.isEmpty() ) { | 1864 | if ( ! list.isEmpty() ) { |
1865 | x = list[0].toInt(); | 1865 | x = list[0].toInt(); |
1866 | y = list[1].toInt(); | 1866 | y = list[1].toInt(); |
1867 | w = list[2].toInt(); | 1867 | w = list[2].toInt(); |
1868 | h = list[3].toInt(); | 1868 | h = list[3].toInt(); |
1869 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1869 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1870 | } | 1870 | } |
1871 | #endif | 1871 | #endif |
1872 | 1872 | ||
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | 1875 | ||
1876 | void CalendarView::writeSettings() | 1876 | void CalendarView::writeSettings() |
1877 | { | 1877 | { |
1878 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1878 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1879 | 1879 | ||
1880 | KConfig *config = KOGlobals::config(); | 1880 | KConfig *config = KOGlobals::config(); |
1881 | 1881 | ||
1882 | #ifndef KORG_NOSPLITTER | 1882 | #ifndef KORG_NOSPLITTER |
1883 | config->setGroup("KOrganizer Geometry"); | 1883 | config->setGroup("KOrganizer Geometry"); |
1884 | 1884 | ||
1885 | QValueList<int> list = mPanner->sizes(); | 1885 | QValueList<int> list = mPanner->sizes(); |
1886 | config->writeEntry("Separator1",list); | 1886 | config->writeEntry("Separator1",list); |
1887 | 1887 | ||
1888 | list = mLeftSplitter->sizes(); | 1888 | list = mLeftSplitter->sizes(); |
1889 | config->writeEntry("Separator2",list); | 1889 | config->writeEntry("Separator2",list); |
1890 | #endif | 1890 | #endif |
1891 | 1891 | ||
1892 | mViewManager->writeSettings( config ); | 1892 | mViewManager->writeSettings( config ); |
1893 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1893 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1894 | mDialogManager->writeSettings( config ); | 1894 | mDialogManager->writeSettings( config ); |
1895 | //KOPrefs::instance()->usrWriteConfig(); | 1895 | //KOPrefs::instance()->usrWriteConfig(); |
1896 | KOPrefs::instance()->writeConfig(); | 1896 | KOPrefs::instance()->writeConfig(); |
1897 | 1897 | ||
1898 | writeFilterSettings(config); | 1898 | writeFilterSettings(config); |
1899 | 1899 | ||
1900 | config->setGroup( "Views" ); | 1900 | config->setGroup( "Views" ); |
1901 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1901 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1902 | 1902 | ||
1903 | #ifdef DESKTOP_VERSION | 1903 | #ifdef DESKTOP_VERSION |
1904 | config->setGroup("WidgetLayout"); | 1904 | config->setGroup("WidgetLayout"); |
1905 | QStringList list ;//= config->readListEntry("MainLayout"); | 1905 | QStringList list ;//= config->readListEntry("MainLayout"); |
1906 | int x,y,w,h; | 1906 | int x,y,w,h; |
1907 | QWidget* wid; | 1907 | QWidget* wid; |
1908 | wid = topLevelWidget(); | 1908 | wid = topLevelWidget(); |
1909 | x = wid->geometry().x(); | 1909 | x = wid->geometry().x(); |
1910 | y = wid->geometry().y(); | 1910 | y = wid->geometry().y(); |
1911 | w = wid->width(); | 1911 | w = wid->width(); |
1912 | h = wid->height(); | 1912 | h = wid->height(); |
1913 | list.clear(); | 1913 | list.clear(); |
1914 | list << QString::number( x ); | 1914 | list << QString::number( x ); |
1915 | list << QString::number( y ); | 1915 | list << QString::number( y ); |
1916 | list << QString::number( w ); | 1916 | list << QString::number( w ); |
1917 | list << QString::number( h ); | 1917 | list << QString::number( h ); |
1918 | config->writeEntry("MainLayout",list ); | 1918 | config->writeEntry("MainLayout",list ); |
1919 | 1919 | ||
1920 | wid = mEventEditor; | 1920 | wid = mEventEditor; |
1921 | x = wid->geometry().x(); | 1921 | x = wid->geometry().x(); |
1922 | y = wid->geometry().y(); | 1922 | y = wid->geometry().y(); |
1923 | w = wid->width(); | 1923 | w = wid->width(); |
1924 | h = wid->height(); | 1924 | h = wid->height(); |
1925 | list.clear(); | 1925 | list.clear(); |
1926 | list << QString::number( x ); | 1926 | list << QString::number( x ); |
1927 | list << QString::number( y ); | 1927 | list << QString::number( y ); |
1928 | list << QString::number( w ); | 1928 | list << QString::number( w ); |
1929 | list << QString::number( h ); | 1929 | list << QString::number( h ); |
1930 | config->writeEntry("EditEventLayout",list ); | 1930 | config->writeEntry("EditEventLayout",list ); |
1931 | 1931 | ||
1932 | wid = mTodoEditor; | 1932 | wid = mTodoEditor; |
1933 | x = wid->geometry().x(); | 1933 | x = wid->geometry().x(); |
1934 | y = wid->geometry().y(); | 1934 | y = wid->geometry().y(); |
1935 | w = wid->width(); | 1935 | w = wid->width(); |
1936 | h = wid->height(); | 1936 | h = wid->height(); |
1937 | list.clear(); | 1937 | list.clear(); |
1938 | list << QString::number( x ); | 1938 | list << QString::number( x ); |
1939 | list << QString::number( y ); | 1939 | list << QString::number( y ); |
1940 | list << QString::number( w ); | 1940 | list << QString::number( w ); |
1941 | list << QString::number( h ); | 1941 | list << QString::number( h ); |
1942 | config->writeEntry("EditTodoLayout",list ); | 1942 | config->writeEntry("EditTodoLayout",list ); |
1943 | wid = getEventViewerDialog(); | 1943 | wid = getEventViewerDialog(); |
1944 | x = wid->geometry().x(); | 1944 | x = wid->geometry().x(); |
1945 | y = wid->geometry().y(); | 1945 | y = wid->geometry().y(); |
1946 | w = wid->width(); | 1946 | w = wid->width(); |
1947 | h = wid->height(); | 1947 | h = wid->height(); |
1948 | list.clear(); | 1948 | list.clear(); |
1949 | list << QString::number( x ); | 1949 | list << QString::number( x ); |
1950 | list << QString::number( y ); | 1950 | list << QString::number( y ); |
1951 | list << QString::number( w ); | 1951 | list << QString::number( w ); |
1952 | list << QString::number( h ); | 1952 | list << QString::number( h ); |
1953 | config->writeEntry("ViewerLayout",list ); | 1953 | config->writeEntry("ViewerLayout",list ); |
1954 | wid = mDialogManager->getSearchDialog(); | 1954 | wid = mDialogManager->getSearchDialog(); |
1955 | if ( wid ) { | 1955 | if ( wid ) { |
1956 | x = wid->geometry().x(); | 1956 | x = wid->geometry().x(); |
1957 | y = wid->geometry().y(); | 1957 | y = wid->geometry().y(); |
1958 | w = wid->width(); | 1958 | w = wid->width(); |
1959 | h = wid->height(); | 1959 | h = wid->height(); |
1960 | list.clear(); | 1960 | list.clear(); |
1961 | list << QString::number( x ); | 1961 | list << QString::number( x ); |
1962 | list << QString::number( y ); | 1962 | list << QString::number( y ); |
1963 | list << QString::number( w ); | 1963 | list << QString::number( w ); |
1964 | list << QString::number( h ); | 1964 | list << QString::number( h ); |
1965 | config->writeEntry("SearchLayout",list ); | 1965 | config->writeEntry("SearchLayout",list ); |
1966 | } | 1966 | } |
1967 | #endif | 1967 | #endif |
1968 | 1968 | ||
1969 | 1969 | ||
1970 | config->sync(); | 1970 | config->sync(); |
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | void CalendarView::readFilterSettings(KConfig *config) | 1973 | void CalendarView::readFilterSettings(KConfig *config) |
1974 | { | 1974 | { |
1975 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 1975 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
1976 | 1976 | ||
1977 | mFilters.clear(); | 1977 | mFilters.clear(); |
1978 | 1978 | ||
1979 | config->setGroup("General"); | 1979 | config->setGroup("General"); |
1980 | QStringList filterList = config->readListEntry("CalendarFilters"); | 1980 | QStringList filterList = config->readListEntry("CalendarFilters"); |
1981 | 1981 | ||
1982 | QStringList::ConstIterator it = filterList.begin(); | 1982 | QStringList::ConstIterator it = filterList.begin(); |
1983 | QStringList::ConstIterator end = filterList.end(); | 1983 | QStringList::ConstIterator end = filterList.end(); |
1984 | while(it != end) { | 1984 | while(it != end) { |
1985 | // kdDebug() << " filter: " << (*it) << endl; | 1985 | // kdDebug() << " filter: " << (*it) << endl; |
1986 | 1986 | ||
1987 | CalFilter *filter; | 1987 | CalFilter *filter; |
1988 | filter = new CalFilter(*it); | 1988 | filter = new CalFilter(*it); |
1989 | config->setGroup("Filter_" + (*it)); | 1989 | config->setGroup("Filter_" + (*it)); |
1990 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 1990 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
1991 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 1991 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
1992 | filter->setCategoryList(config->readListEntry("CategoryList")); | 1992 | filter->setCategoryList(config->readListEntry("CategoryList")); |
1993 | mFilters.append(filter); | 1993 | mFilters.append(filter); |
1994 | 1994 | ||
1995 | ++it; | 1995 | ++it; |
1996 | } | 1996 | } |
1997 | 1997 | ||
1998 | if (mFilters.count() == 0) { | 1998 | if (mFilters.count() == 0) { |
1999 | CalFilter *filter = new CalFilter(i18n("Default")); | 1999 | CalFilter *filter = new CalFilter(i18n("Default")); |
2000 | mFilters.append(filter); | 2000 | mFilters.append(filter); |
2001 | } | 2001 | } |
2002 | mFilterView->updateFilters(); | 2002 | mFilterView->updateFilters(); |
2003 | config->setGroup("FilterView"); | 2003 | config->setGroup("FilterView"); |
2004 | 2004 | ||
2005 | mFilterView->blockSignals(true); | 2005 | mFilterView->blockSignals(true); |
2006 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 2006 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
2007 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 2007 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
2008 | mFilterView->blockSignals(false); | 2008 | mFilterView->blockSignals(false); |
2009 | // We do it manually to avoid it being done twice by the above calls | 2009 | // We do it manually to avoid it being done twice by the above calls |
2010 | updateFilter(); | 2010 | updateFilter(); |
2011 | } | 2011 | } |
2012 | 2012 | ||
2013 | void CalendarView::writeFilterSettings(KConfig *config) | 2013 | void CalendarView::writeFilterSettings(KConfig *config) |
2014 | { | 2014 | { |
2015 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 2015 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
2016 | 2016 | ||
2017 | QStringList filterList; | 2017 | QStringList filterList; |
2018 | 2018 | ||
2019 | CalFilter *filter = mFilters.first(); | 2019 | CalFilter *filter = mFilters.first(); |
2020 | while(filter) { | 2020 | while(filter) { |
2021 | // kdDebug() << " fn: " << filter->name() << endl; | 2021 | // kdDebug() << " fn: " << filter->name() << endl; |
2022 | filterList << filter->name(); | 2022 | filterList << filter->name(); |
2023 | config->setGroup("Filter_" + filter->name()); | 2023 | config->setGroup("Filter_" + filter->name()); |
2024 | config->writeEntry("Criteria",filter->criteria()); | 2024 | config->writeEntry("Criteria",filter->criteria()); |
2025 | config->writeEntry("CategoryList",filter->categoryList()); | 2025 | config->writeEntry("CategoryList",filter->categoryList()); |
2026 | filter = mFilters.next(); | 2026 | filter = mFilters.next(); |
2027 | } | 2027 | } |
2028 | config->setGroup("General"); | 2028 | config->setGroup("General"); |
2029 | config->writeEntry("CalendarFilters",filterList); | 2029 | config->writeEntry("CalendarFilters",filterList); |
2030 | 2030 | ||
2031 | config->setGroup("FilterView"); | 2031 | config->setGroup("FilterView"); |
2032 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 2032 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
2033 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2033 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2034 | } | 2034 | } |
2035 | 2035 | ||
2036 | 2036 | ||
2037 | void CalendarView::goToday() | 2037 | void CalendarView::goToday() |
2038 | { | 2038 | { |
2039 | if ( mViewManager->currentView()->isMonthView() ) | 2039 | if ( mViewManager->currentView()->isMonthView() ) |
2040 | mNavigator->selectTodayMonth(); | 2040 | mNavigator->selectTodayMonth(); |
2041 | else | 2041 | else |
2042 | mNavigator->selectToday(); | 2042 | mNavigator->selectToday(); |
2043 | } | 2043 | } |
2044 | 2044 | ||
2045 | void CalendarView::goNext() | 2045 | void CalendarView::goNext() |
2046 | { | 2046 | { |
2047 | mNavigator->selectNext(); | 2047 | mNavigator->selectNext(); |
2048 | } | 2048 | } |
2049 | 2049 | ||
2050 | void CalendarView::goPrevious() | 2050 | void CalendarView::goPrevious() |
2051 | { | 2051 | { |
2052 | mNavigator->selectPrevious(); | 2052 | mNavigator->selectPrevious(); |
2053 | } | 2053 | } |
2054 | void CalendarView::goNextMonth() | 2054 | void CalendarView::goNextMonth() |
2055 | { | 2055 | { |
2056 | mNavigator->selectNextMonth(); | 2056 | mNavigator->selectNextMonth(); |
2057 | } | 2057 | } |
2058 | 2058 | ||
2059 | void CalendarView::goPreviousMonth() | 2059 | void CalendarView::goPreviousMonth() |
2060 | { | 2060 | { |
2061 | mNavigator->selectPreviousMonth(); | 2061 | mNavigator->selectPreviousMonth(); |
2062 | } | 2062 | } |
2063 | void CalendarView::writeLocale() | 2063 | void CalendarView::writeLocale() |
2064 | { | 2064 | { |
2065 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 2065 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
2066 | #if 0 | 2066 | #if 0 |
2067 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); | 2067 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); |
2068 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); | 2068 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); |
2069 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2069 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2070 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2070 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2071 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2071 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2072 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2072 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2073 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2073 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2074 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2074 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2075 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2075 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2076 | KOPrefs::instance()->mDaylightsavingStart, | 2076 | KOPrefs::instance()->mDaylightsavingStart, |
2077 | KOPrefs::instance()->mDaylightsavingEnd ); | 2077 | KOPrefs::instance()->mDaylightsavingEnd ); |
2078 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2078 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2079 | #endif | 2079 | #endif |
2080 | } | 2080 | } |
2081 | void CalendarView::updateConfig() | 2081 | void CalendarView::updateConfig() |
2082 | { | 2082 | { |
2083 | writeLocale(); | 2083 | writeLocale(); |
2084 | if ( KOPrefs::instance()->mUseAppColors ) | 2084 | if ( KOPrefs::instance()->mUseAppColors ) |
2085 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2085 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2086 | emit configChanged(); | 2086 | emit configChanged(); |
2087 | mTodoList->updateConfig(); | 2087 | mTodoList->updateConfig(); |
2088 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2088 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2089 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2089 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2090 | // To make the "fill window" configurations work | 2090 | // To make the "fill window" configurations work |
2091 | //mViewManager->raiseCurrentView(); | 2091 | //mViewManager->raiseCurrentView(); |
2092 | } | 2092 | } |
2093 | 2093 | ||
2094 | 2094 | ||
2095 | void CalendarView::eventChanged(Event *event) | 2095 | void CalendarView::eventChanged(Event *event) |
2096 | { | 2096 | { |
2097 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2097 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2098 | //updateUnmanagedViews(); | 2098 | //updateUnmanagedViews(); |
2099 | } | 2099 | } |
2100 | 2100 | ||
2101 | void CalendarView::eventAdded(Event *event) | 2101 | void CalendarView::eventAdded(Event *event) |
2102 | { | 2102 | { |
2103 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2103 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2104 | } | 2104 | } |
2105 | 2105 | ||
2106 | void CalendarView::eventToBeDeleted(Event *) | 2106 | void CalendarView::eventToBeDeleted(Event *) |
2107 | { | 2107 | { |
2108 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2108 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2109 | } | 2109 | } |
2110 | 2110 | ||
2111 | void CalendarView::eventDeleted() | 2111 | void CalendarView::eventDeleted() |
2112 | { | 2112 | { |
2113 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2113 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2114 | } | 2114 | } |
2115 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2115 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2116 | { | 2116 | { |
2117 | changeIncidenceDisplay((Incidence *)which, action); | 2117 | changeIncidenceDisplay((Incidence *)which, action); |
2118 | mDateNavigator->updateView(); //LR | 2118 | mDateNavigator->updateView(); //LR |
2119 | //mDialogManager->updateSearchDialog(); | 2119 | //mDialogManager->updateSearchDialog(); |
2120 | 2120 | ||
2121 | if (which) { | 2121 | if (which) { |
2122 | mViewManager->updateWNview(); | 2122 | mViewManager->updateWNview(); |
2123 | //mTodoList->updateView(); | 2123 | //mTodoList->updateView(); |
2124 | } | 2124 | } |
2125 | 2125 | ||
2126 | } | 2126 | } |
2127 | 2127 | ||
2128 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2128 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2129 | { | 2129 | { |
2130 | updateUnmanagedViews(); | 2130 | updateUnmanagedViews(); |
2131 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2131 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2132 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2132 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2133 | mCalendar->checkAlarmForIncidence( 0, true ); | 2133 | mCalendar->checkAlarmForIncidence( 0, true ); |
2134 | if ( mEventViewerDialog ) | 2134 | if ( mEventViewerDialog ) |
2135 | mEventViewerDialog->hide(); | 2135 | mEventViewerDialog->hide(); |
2136 | } | 2136 | } |
2137 | else | 2137 | else |
2138 | mCalendar->checkAlarmForIncidence( which , false ); | 2138 | mCalendar->checkAlarmForIncidence( which , false ); |
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | // most of the changeEventDisplays() right now just call the view's | 2141 | // most of the changeEventDisplays() right now just call the view's |
2142 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2142 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2143 | void CalendarView::changeEventDisplay(Event *which, int action) | 2143 | void CalendarView::changeEventDisplay(Event *which, int action) |
2144 | { | 2144 | { |
2145 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2145 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2146 | changeIncidenceDisplay((Incidence *)which, action); | 2146 | changeIncidenceDisplay((Incidence *)which, action); |
2147 | mDateNavigator->updateView(); | 2147 | mDateNavigator->updateView(); |
2148 | //mDialogManager->updateSearchDialog(); | 2148 | //mDialogManager->updateSearchDialog(); |
2149 | 2149 | ||
2150 | if (which) { | 2150 | if (which) { |
2151 | // If there is an event view visible update the display | 2151 | // If there is an event view visible update the display |
2152 | mViewManager->currentView()->changeEventDisplay(which,action); | 2152 | mViewManager->currentView()->changeEventDisplay(which,action); |
2153 | // TODO: check, if update needed | 2153 | // TODO: check, if update needed |
2154 | // if (which->getTodoStatus()) { | 2154 | // if (which->getTodoStatus()) { |
2155 | mTodoList->updateView(); | 2155 | mTodoList->updateView(); |
2156 | // } | 2156 | // } |
2157 | } else { | 2157 | } else { |
2158 | mViewManager->currentView()->updateView(); | 2158 | mViewManager->currentView()->updateView(); |
2159 | } | 2159 | } |
2160 | } | 2160 | } |
2161 | 2161 | ||
2162 | 2162 | ||
2163 | void CalendarView::updateTodoViews() | 2163 | void CalendarView::updateTodoViews() |
2164 | { | 2164 | { |
2165 | mTodoList->updateView(); | 2165 | mTodoList->updateView(); |
2166 | mViewManager->currentView()->updateView(); | 2166 | mViewManager->currentView()->updateView(); |
2167 | 2167 | ||
2168 | } | 2168 | } |
2169 | 2169 | ||
2170 | 2170 | ||
2171 | void CalendarView::updateView(const QDate &start, const QDate &end) | 2171 | void CalendarView::updateView(const QDate &start, const QDate &end) |
2172 | { | 2172 | { |
2173 | mTodoList->updateView(); | 2173 | mTodoList->updateView(); |
2174 | mViewManager->updateView(start, end); | 2174 | mViewManager->updateView(start, end); |
2175 | //mDateNavigator->updateView(); | 2175 | //mDateNavigator->updateView(); |
2176 | } | 2176 | } |
2177 | 2177 | ||
2178 | void CalendarView::updateView() | 2178 | void CalendarView::updateView() |
2179 | { | 2179 | { |
2180 | DateList tmpList = mNavigator->selectedDates(); | 2180 | DateList tmpList = mNavigator->selectedDates(); |
2181 | 2181 | ||
2182 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2182 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2183 | mTodoList->updateView(); | 2183 | mTodoList->updateView(); |
2184 | // We assume that the navigator only selects consecutive days. | 2184 | // We assume that the navigator only selects consecutive days. |
2185 | updateView( tmpList.first(), tmpList.last() ); | 2185 | updateView( tmpList.first(), tmpList.last() ); |
2186 | } | 2186 | } |
2187 | 2187 | ||
2188 | void CalendarView::updateUnmanagedViews() | 2188 | void CalendarView::updateUnmanagedViews() |
2189 | { | 2189 | { |
2190 | mDateNavigator->updateDayMatrix(); | 2190 | mDateNavigator->updateDayMatrix(); |
2191 | } | 2191 | } |
2192 | 2192 | ||
2193 | int CalendarView::msgItemDelete(const QString name) | 2193 | int CalendarView::msgItemDelete(const QString name) |
2194 | { | 2194 | { |
2195 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2195 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2196 | i18n("This item will be\npermanently deleted."), | 2196 | i18n("This item will be\npermanently deleted."), |
2197 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2197 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2198 | } | 2198 | } |
2199 | 2199 | ||
2200 | 2200 | ||
2201 | void CalendarView::edit_cut() | 2201 | void CalendarView::edit_cut() |
2202 | { | 2202 | { |
2203 | Event *anEvent=0; | 2203 | Event *anEvent=0; |
2204 | 2204 | ||
2205 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2205 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2206 | 2206 | ||
2207 | if (mViewManager->currentView()->isEventView()) { | 2207 | if (mViewManager->currentView()->isEventView()) { |
2208 | if ( incidence && incidence->type() == "Event" ) { | 2208 | if ( incidence && incidence->type() == "Event" ) { |
2209 | anEvent = static_cast<Event *>(incidence); | 2209 | anEvent = static_cast<Event *>(incidence); |
2210 | } | 2210 | } |
2211 | } | 2211 | } |
2212 | 2212 | ||
2213 | if (!anEvent) { | 2213 | if (!anEvent) { |
2214 | KNotifyClient::beep(); | 2214 | KNotifyClient::beep(); |
2215 | return; | 2215 | return; |
2216 | } | 2216 | } |
2217 | DndFactory factory( mCalendar ); | 2217 | DndFactory factory( mCalendar ); |
2218 | factory.cutIncidence(anEvent); | 2218 | factory.cutIncidence(anEvent); |
2219 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2219 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2220 | } | 2220 | } |
2221 | 2221 | ||
2222 | void CalendarView::edit_copy() | 2222 | void CalendarView::edit_copy() |
2223 | { | 2223 | { |
2224 | Event *anEvent=0; | 2224 | Event *anEvent=0; |
2225 | 2225 | ||
2226 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2226 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2227 | 2227 | ||
2228 | if (mViewManager->currentView()->isEventView()) { | 2228 | if (mViewManager->currentView()->isEventView()) { |
2229 | if ( incidence && incidence->type() == "Event" ) { | 2229 | if ( incidence && incidence->type() == "Event" ) { |
2230 | anEvent = static_cast<Event *>(incidence); | 2230 | anEvent = static_cast<Event *>(incidence); |
2231 | } | 2231 | } |
2232 | } | 2232 | } |
2233 | 2233 | ||
2234 | if (!anEvent) { | 2234 | if (!anEvent) { |
2235 | KNotifyClient::beep(); | 2235 | KNotifyClient::beep(); |
2236 | return; | 2236 | return; |
2237 | } | 2237 | } |
2238 | DndFactory factory( mCalendar ); | 2238 | DndFactory factory( mCalendar ); |
2239 | factory.copyIncidence(anEvent); | 2239 | factory.copyIncidence(anEvent); |
2240 | } | 2240 | } |
2241 | 2241 | ||
2242 | void CalendarView::edit_paste() | 2242 | void CalendarView::edit_paste() |
2243 | { | 2243 | { |
2244 | QDate date = mNavigator->selectedDates().first(); | 2244 | QDate date = mNavigator->selectedDates().first(); |
2245 | 2245 | ||
2246 | DndFactory factory( mCalendar ); | 2246 | DndFactory factory( mCalendar ); |
2247 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); | 2247 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); |
2248 | 2248 | ||
2249 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2249 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2250 | } | 2250 | } |
2251 | 2251 | ||
2252 | void CalendarView::edit_options() | 2252 | void CalendarView::edit_options() |
2253 | { | 2253 | { |
2254 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; | ||
2255 | emit save(); | ||
2256 | emit saveStopTimer(); | ||
2254 | mDialogManager->showOptionsDialog(); | 2257 | mDialogManager->showOptionsDialog(); |
2255 | //writeSettings(); | 2258 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { |
2259 | emit saveStopTimer(); | ||
2260 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), | ||
2261 | i18n("Timezone settings"),i18n("Reload"))) { | ||
2262 | qDebug("KO: TZ reload cancelled "); | ||
2263 | return; | ||
2264 | } | ||
2265 | qDebug("KO: Timezone change "); | ||
2266 | openCalendar( MainWindow::defaultFileName() ); | ||
2267 | setModified(true); | ||
2268 | } | ||
2269 | else | ||
2270 | qDebug("KO: No tz change "); | ||
2271 | |||
2256 | } | 2272 | } |
2257 | 2273 | ||
2258 | 2274 | ||
2259 | void CalendarView::slotSelectPickerDate( QDate d) | 2275 | void CalendarView::slotSelectPickerDate( QDate d) |
2260 | { | 2276 | { |
2261 | mDateFrame->hide(); | 2277 | mDateFrame->hide(); |
2262 | if ( mDatePickerMode == 1 ) { | 2278 | if ( mDatePickerMode == 1 ) { |
2263 | mNavigator->slotDaySelect( d ); | 2279 | mNavigator->slotDaySelect( d ); |
2264 | } else if ( mDatePickerMode == 2 ) { | 2280 | } else if ( mDatePickerMode == 2 ) { |
2265 | if ( mMoveIncidence->type() == "Todo" ) { | 2281 | if ( mMoveIncidence->type() == "Todo" ) { |
2266 | Todo * to = (Todo *) mMoveIncidence; | 2282 | Todo * to = (Todo *) mMoveIncidence; |
2267 | QTime tim; | 2283 | QTime tim; |
2268 | if ( to->hasDueDate() ) | 2284 | if ( to->hasDueDate() ) |
2269 | tim = to->dtDue().time(); | 2285 | tim = to->dtDue().time(); |
2270 | else { | 2286 | else { |
2271 | tim = QTime ( 0,0,0 ); | 2287 | tim = QTime ( 0,0,0 ); |
2272 | to->setFloats( true ); | 2288 | to->setFloats( true ); |
2273 | to->setHasDueDate( true ); | 2289 | to->setHasDueDate( true ); |
2274 | } | 2290 | } |
2275 | QDateTime dt ( d,tim ); | 2291 | QDateTime dt ( d,tim ); |
2276 | to->setDtDue( dt ); | 2292 | to->setDtDue( dt ); |
2277 | todoChanged( to ); | 2293 | todoChanged( to ); |
2278 | } else { | 2294 | } else { |
2279 | if ( mMoveIncidence->doesRecur() ) { | 2295 | if ( mMoveIncidence->doesRecur() ) { |
2280 | #if 0 | 2296 | #if 0 |
2281 | // PENDING implement this | 2297 | // PENDING implement this |
2282 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | 2298 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); |
2283 | mCalendar()->addIncidence( newInc ); | 2299 | mCalendar()->addIncidence( newInc ); |
2284 | if ( mMoveIncidence->type() == "Todo" ) | 2300 | if ( mMoveIncidence->type() == "Todo" ) |
2285 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | 2301 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); |
2286 | else | 2302 | else |
2287 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | 2303 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); |
2288 | mMoveIncidence = newInc; | 2304 | mMoveIncidence = newInc; |
2289 | 2305 | ||
2290 | #endif | 2306 | #endif |
2291 | } | 2307 | } |
2292 | QTime tim = mMoveIncidence->dtStart().time(); | 2308 | QTime tim = mMoveIncidence->dtStart().time(); |
2293 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2309 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2294 | QDateTime dt ( d,tim ); | 2310 | QDateTime dt ( d,tim ); |
2295 | mMoveIncidence->setDtStart( dt ); | 2311 | mMoveIncidence->setDtStart( dt ); |
2296 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2312 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2297 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2313 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2298 | } | 2314 | } |
2299 | 2315 | ||
2300 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2316 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2301 | } | 2317 | } |
2302 | } | 2318 | } |
2303 | 2319 | ||
2304 | void CalendarView::removeCategories() | 2320 | void CalendarView::removeCategories() |
2305 | { | 2321 | { |
2306 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2322 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2307 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2323 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2308 | QStringList catIncList; | 2324 | QStringList catIncList; |
2309 | QStringList newCatList; | 2325 | QStringList newCatList; |
2310 | Incidence* inc = incList.first(); | 2326 | Incidence* inc = incList.first(); |
2311 | int i; | 2327 | int i; |
2312 | int count = 0; | 2328 | int count = 0; |
2313 | while ( inc ) { | 2329 | while ( inc ) { |
2314 | newCatList.clear(); | 2330 | newCatList.clear(); |
2315 | catIncList = inc->categories() ; | 2331 | catIncList = inc->categories() ; |
2316 | for( i = 0; i< catIncList.count(); ++i ) { | 2332 | for( i = 0; i< catIncList.count(); ++i ) { |
2317 | if ( catList.contains (catIncList[i])) | 2333 | if ( catList.contains (catIncList[i])) |
2318 | newCatList.append( catIncList[i] ); | 2334 | newCatList.append( catIncList[i] ); |
2319 | } | 2335 | } |
2320 | newCatList.sort(); | 2336 | newCatList.sort(); |
2321 | inc->setCategories( newCatList.join(",") ); | 2337 | inc->setCategories( newCatList.join(",") ); |
2322 | inc = incList.next(); | 2338 | inc = incList.next(); |
2323 | } | 2339 | } |
2324 | } | 2340 | } |
2325 | 2341 | ||
2326 | int CalendarView::addCategories() | 2342 | int CalendarView::addCategories() |
2327 | { | 2343 | { |
2328 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2344 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2329 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2345 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2330 | QStringList catIncList; | 2346 | QStringList catIncList; |
2331 | Incidence* inc = incList.first(); | 2347 | Incidence* inc = incList.first(); |
2332 | int i; | 2348 | int i; |
2333 | int count = 0; | 2349 | int count = 0; |
2334 | while ( inc ) { | 2350 | while ( inc ) { |
2335 | catIncList = inc->categories() ; | 2351 | catIncList = inc->categories() ; |
2336 | for( i = 0; i< catIncList.count(); ++i ) { | 2352 | for( i = 0; i< catIncList.count(); ++i ) { |
2337 | if ( !catList.contains (catIncList[i])) { | 2353 | if ( !catList.contains (catIncList[i])) { |
2338 | catList.append( catIncList[i] ); | 2354 | catList.append( catIncList[i] ); |
2339 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2355 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2340 | ++count; | 2356 | ++count; |
2341 | } | 2357 | } |
2342 | } | 2358 | } |
2343 | inc = incList.next(); | 2359 | inc = incList.next(); |
2344 | } | 2360 | } |
2345 | catList.sort(); | 2361 | catList.sort(); |
2346 | KOPrefs::instance()->mCustomCategories = catList; | 2362 | KOPrefs::instance()->mCustomCategories = catList; |
2347 | return count; | 2363 | return count; |
2348 | } | 2364 | } |
2349 | 2365 | ||
2350 | void CalendarView::manageCategories() | 2366 | void CalendarView::manageCategories() |
2351 | { | 2367 | { |
2352 | KOCatPrefs* cp = new KOCatPrefs(); | 2368 | KOCatPrefs* cp = new KOCatPrefs(); |
2353 | cp->show(); | 2369 | cp->show(); |
2354 | int w =cp->sizeHint().width() ; | 2370 | int w =cp->sizeHint().width() ; |
2355 | int h = cp->sizeHint().height() ; | 2371 | int h = cp->sizeHint().height() ; |
2356 | int dw = QApplication::desktop()->width(); | 2372 | int dw = QApplication::desktop()->width(); |
2357 | int dh = QApplication::desktop()->height(); | 2373 | int dh = QApplication::desktop()->height(); |
2358 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2374 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2359 | if ( !cp->exec() ) { | 2375 | if ( !cp->exec() ) { |
2360 | delete cp; | 2376 | delete cp; |
2361 | return; | 2377 | return; |
2362 | } | 2378 | } |
2363 | int count = 0; | 2379 | int count = 0; |
2364 | if ( cp->addCat() ) { | 2380 | if ( cp->addCat() ) { |
2365 | count = addCategories(); | 2381 | count = addCategories(); |
2366 | if ( count ) { | 2382 | if ( count ) { |
2367 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2383 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2368 | writeSettings(); | 2384 | writeSettings(); |
2369 | } else | 2385 | } else |
2370 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | 2386 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); |
2371 | } else { | 2387 | } else { |
2372 | removeCategories(); | 2388 | removeCategories(); |
2373 | updateView(); | 2389 | updateView(); |
2374 | } | 2390 | } |
2375 | delete cp; | 2391 | delete cp; |
2376 | } | 2392 | } |
2377 | 2393 | ||
2378 | void CalendarView::beamIncidence(Incidence * Inc) | 2394 | void CalendarView::beamIncidence(Incidence * Inc) |
2379 | { | 2395 | { |
2380 | QPtrList<Incidence> delSel ; | 2396 | QPtrList<Incidence> delSel ; |
2381 | delSel.append(Inc); | 2397 | delSel.append(Inc); |
2382 | beamIncidenceList( delSel ); | 2398 | beamIncidenceList( delSel ); |
2383 | } | 2399 | } |
2384 | void CalendarView::beamCalendar() | 2400 | void CalendarView::beamCalendar() |
2385 | { | 2401 | { |
2386 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 2402 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2387 | //qDebug("beamCalendar() "); | 2403 | //qDebug("beamCalendar() "); |
2388 | beamIncidenceList( delSel ); | 2404 | beamIncidenceList( delSel ); |
2389 | } | 2405 | } |
2390 | void CalendarView::beamFilteredCalendar() | 2406 | void CalendarView::beamFilteredCalendar() |
2391 | { | 2407 | { |
2392 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 2408 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2393 | //qDebug("beamFilteredCalendar() "); | 2409 | //qDebug("beamFilteredCalendar() "); |
2394 | beamIncidenceList( delSel ); | 2410 | beamIncidenceList( delSel ); |
2395 | } | 2411 | } |
2396 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 2412 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2397 | { | 2413 | { |
2398 | if ( beamDialog->exec () == QDialog::Rejected ) | 2414 | if ( beamDialog->exec () == QDialog::Rejected ) |
2399 | return; | 2415 | return; |
2400 | #ifdef DESKTOP_VERSION | 2416 | #ifdef DESKTOP_VERSION |
2401 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 2417 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2402 | #else | 2418 | #else |
2403 | QString fn = "/tmp/kopibeamfile"; | 2419 | QString fn = "/tmp/kopibeamfile"; |
2404 | #endif | 2420 | #endif |
2405 | QString mes; | 2421 | QString mes; |
2406 | bool createbup = true; | 2422 | bool createbup = true; |
2407 | if ( createbup ) { | 2423 | if ( createbup ) { |
2408 | QString description = "\n"; | 2424 | QString description = "\n"; |
2409 | CalendarLocal* cal = new CalendarLocal(); | 2425 | CalendarLocal* cal = new CalendarLocal(); |
2410 | if ( beamDialog->beamLocal() ) | 2426 | if ( beamDialog->beamLocal() ) |
2411 | cal->setLocalTime(); | 2427 | cal->setLocalTime(); |
2412 | else | 2428 | else |
2413 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2429 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2414 | Incidence *incidence = delSel.first(); | 2430 | Incidence *incidence = delSel.first(); |
2415 | bool addText = false; | 2431 | bool addText = false; |
2416 | if ( delSel.count() < 10 ) | 2432 | if ( delSel.count() < 10 ) |
2417 | addText = true; | 2433 | addText = true; |
2418 | else { | 2434 | else { |
2419 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 2435 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2420 | } | 2436 | } |
2421 | while ( incidence ) { | 2437 | while ( incidence ) { |
2422 | Incidence *in = incidence->clone(); | 2438 | Incidence *in = incidence->clone(); |
2423 | if ( ! in->summary().isEmpty() ) { | 2439 | if ( ! in->summary().isEmpty() ) { |
2424 | in->setDescription(""); | 2440 | in->setDescription(""); |
2425 | } else { | 2441 | } else { |
2426 | in->setSummary( in->description().left(20)); | 2442 | in->setSummary( in->description().left(20)); |
2427 | in->setDescription(""); | 2443 | in->setDescription(""); |
2428 | } | 2444 | } |
2429 | if ( addText ) | 2445 | if ( addText ) |
2430 | description += in->summary() + "\n"; | 2446 | description += in->summary() + "\n"; |
2431 | cal->addIncidence( in ); | 2447 | cal->addIncidence( in ); |
2432 | incidence = delSel.next(); | 2448 | incidence = delSel.next(); |
2433 | } | 2449 | } |
2434 | if ( beamDialog->beamVcal() ) { | 2450 | if ( beamDialog->beamVcal() ) { |
2435 | fn += ".vcs"; | 2451 | fn += ".vcs"; |
2436 | FileStorage storage( cal, fn, new VCalFormat ); | 2452 | FileStorage storage( cal, fn, new VCalFormat ); |
2437 | storage.save(); | 2453 | storage.save(); |
2438 | } else { | 2454 | } else { |
2439 | fn += ".ics"; | 2455 | fn += ".ics"; |
2440 | FileStorage storage( cal, fn, new ICalFormat( ) ); | 2456 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2441 | storage.save(); | 2457 | storage.save(); |
2442 | } | 2458 | } |
2443 | delete cal; | 2459 | delete cal; |
2444 | mes = i18n("KO/Pi: Ready for beaming"); | 2460 | mes = i18n("KO/Pi: Ready for beaming"); |
2445 | topLevelWidget()->setCaption(mes); | 2461 | topLevelWidget()->setCaption(mes); |
2446 | KApplication::convert2latin1( fn ); | 2462 | KApplication::convert2latin1( fn ); |
2447 | #ifndef DESKTOP_VERSION | 2463 | #ifndef DESKTOP_VERSION |
2448 | Ir *ir = new Ir( this ); | 2464 | Ir *ir = new Ir( this ); |
2449 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 2465 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
2450 | ir->send( fn, description, "text/x-vCalendar" ); | 2466 | ir->send( fn, description, "text/x-vCalendar" ); |
2451 | #endif | 2467 | #endif |
2452 | } | 2468 | } |
2453 | } | 2469 | } |
2454 | void CalendarView::beamDone( Ir *ir ) | 2470 | void CalendarView::beamDone( Ir *ir ) |
2455 | { | 2471 | { |
2456 | #ifndef DESKTOP_VERSION | 2472 | #ifndef DESKTOP_VERSION |
2457 | delete ir; | 2473 | delete ir; |
2458 | #endif | 2474 | #endif |
2459 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2475 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2460 | topLevelWidget()->raise(); | 2476 | topLevelWidget()->raise(); |
2461 | } | 2477 | } |
2462 | 2478 | ||
2463 | void CalendarView::moveIncidence(Incidence * inc ) | 2479 | void CalendarView::moveIncidence(Incidence * inc ) |
2464 | { | 2480 | { |
2465 | if ( !inc ) return; | 2481 | if ( !inc ) return; |
2466 | // qDebug("showDatePickerForIncidence( ) "); | 2482 | // qDebug("showDatePickerForIncidence( ) "); |
2467 | if ( mDateFrame->isVisible() ) | 2483 | if ( mDateFrame->isVisible() ) |
2468 | mDateFrame->hide(); | 2484 | mDateFrame->hide(); |
2469 | else { | 2485 | else { |
2470 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; | 2486 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; |
2471 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; | 2487 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; |
2472 | int dw = QApplication::desktop()->width(); | 2488 | int dw = QApplication::desktop()->width(); |
2473 | int dh = QApplication::desktop()->height(); | 2489 | int dh = QApplication::desktop()->height(); |
2474 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2490 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2475 | mDateFrame->show(); | 2491 | mDateFrame->show(); |
2476 | } | 2492 | } |
2477 | mDatePickerMode = 2; | 2493 | mDatePickerMode = 2; |
2478 | mMoveIncidence = inc ; | 2494 | mMoveIncidence = inc ; |
2479 | QDate da; | 2495 | QDate da; |
2480 | if ( mMoveIncidence->type() == "Todo" ) { | 2496 | if ( mMoveIncidence->type() == "Todo" ) { |
2481 | Todo * to = (Todo *) mMoveIncidence; | 2497 | Todo * to = (Todo *) mMoveIncidence; |
2482 | if ( to->hasDueDate() ) | 2498 | if ( to->hasDueDate() ) |
2483 | da = to->dtDue().date(); | 2499 | da = to->dtDue().date(); |
2484 | else | 2500 | else |
2485 | da = QDate::currentDate(); | 2501 | da = QDate::currentDate(); |
2486 | } else { | 2502 | } else { |
2487 | da = mMoveIncidence->dtStart().date(); | 2503 | da = mMoveIncidence->dtStart().date(); |
2488 | } | 2504 | } |
2489 | //PENDING set date for recurring incidence to date of recurrence | 2505 | //PENDING set date for recurring incidence to date of recurrence |
2490 | //mMoveIncidenceOldDate; | 2506 | //mMoveIncidenceOldDate; |
2491 | mDatePicker->setDate( da ); | 2507 | mDatePicker->setDate( da ); |
2492 | } | 2508 | } |
2493 | void CalendarView::showDatePicker( ) | 2509 | void CalendarView::showDatePicker( ) |
2494 | { | 2510 | { |
2495 | //qDebug("CalendarView::showDatePicker( ) "); | 2511 | //qDebug("CalendarView::showDatePicker( ) "); |
2496 | if ( mDateFrame->isVisible() ) | 2512 | if ( mDateFrame->isVisible() ) |
2497 | mDateFrame->hide(); | 2513 | mDateFrame->hide(); |
2498 | else { | 2514 | else { |
2499 | int w =mDatePicker->sizeHint().width() ; | 2515 | int w =mDatePicker->sizeHint().width() ; |
2500 | int h = mDatePicker->sizeHint().height() ; | 2516 | int h = mDatePicker->sizeHint().height() ; |
2501 | int dw = QApplication::desktop()->width(); | 2517 | int dw = QApplication::desktop()->width(); |
2502 | int dh = QApplication::desktop()->height(); | 2518 | int dh = QApplication::desktop()->height(); |
2503 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2519 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2504 | mDateFrame->show(); | 2520 | mDateFrame->show(); |
2505 | } | 2521 | } |
2506 | mDatePickerMode = 1; | 2522 | mDatePickerMode = 1; |
2507 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2523 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2508 | } | 2524 | } |
2509 | 2525 | ||
2510 | void CalendarView::showEventEditor() | 2526 | void CalendarView::showEventEditor() |
2511 | { | 2527 | { |
2512 | #ifdef DESKTOP_VERSION | 2528 | #ifdef DESKTOP_VERSION |
2513 | mEventEditor->show(); | 2529 | mEventEditor->show(); |
2514 | #else | 2530 | #else |
2515 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2531 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2516 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2532 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2517 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2533 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2518 | qApp->processEvents(); | 2534 | qApp->processEvents(); |
2519 | delete mEventEditor; | 2535 | delete mEventEditor; |
2520 | mEventEditor = mDialogManager->getEventEditor(); | 2536 | mEventEditor = mDialogManager->getEventEditor(); |
2521 | topLevelWidget()->setCaption( i18n("") ); | 2537 | topLevelWidget()->setCaption( i18n("") ); |
2522 | } | 2538 | } |
2523 | mEventEditor->showMaximized(); | 2539 | mEventEditor->showMaximized(); |
2524 | #endif | 2540 | #endif |
2525 | } | 2541 | } |
2526 | void CalendarView::showTodoEditor() | 2542 | void CalendarView::showTodoEditor() |
2527 | { | 2543 | { |
2528 | #ifdef DESKTOP_VERSION | 2544 | #ifdef DESKTOP_VERSION |
2529 | mTodoEditor->show(); | 2545 | mTodoEditor->show(); |
2530 | #else | 2546 | #else |
2531 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2547 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2532 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2548 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2533 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2549 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2534 | qApp->processEvents(); | 2550 | qApp->processEvents(); |
2535 | delete mTodoEditor; | 2551 | delete mTodoEditor; |
2536 | mTodoEditor = mDialogManager->getTodoEditor(); | 2552 | mTodoEditor = mDialogManager->getTodoEditor(); |
2537 | topLevelWidget()->setCaption( i18n("") ); | 2553 | topLevelWidget()->setCaption( i18n("") ); |
2538 | } | 2554 | } |
2539 | mTodoEditor->showMaximized(); | 2555 | mTodoEditor->showMaximized(); |
2540 | #endif | 2556 | #endif |
2541 | } | 2557 | } |
2542 | 2558 | ||
2543 | void CalendarView::cloneIncidence() | 2559 | void CalendarView::cloneIncidence() |
2544 | { | 2560 | { |
2545 | Incidence *incidence = currentSelection(); | 2561 | Incidence *incidence = currentSelection(); |
2546 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2562 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2547 | if ( incidence ) { | 2563 | if ( incidence ) { |
2548 | cloneIncidence(incidence); | 2564 | cloneIncidence(incidence); |
2549 | } | 2565 | } |
2550 | } | 2566 | } |
2551 | void CalendarView::moveIncidence() | 2567 | void CalendarView::moveIncidence() |
2552 | { | 2568 | { |
2553 | Incidence *incidence = currentSelection(); | 2569 | Incidence *incidence = currentSelection(); |
2554 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2570 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2555 | if ( incidence ) { | 2571 | if ( incidence ) { |
2556 | moveIncidence(incidence); | 2572 | moveIncidence(incidence); |
2557 | } | 2573 | } |
2558 | } | 2574 | } |
2559 | void CalendarView::beamIncidence() | 2575 | void CalendarView::beamIncidence() |
2560 | { | 2576 | { |
2561 | Incidence *incidence = currentSelection(); | 2577 | Incidence *incidence = currentSelection(); |
2562 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2578 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2563 | if ( incidence ) { | 2579 | if ( incidence ) { |
2564 | beamIncidence(incidence); | 2580 | beamIncidence(incidence); |
2565 | } | 2581 | } |
2566 | } | 2582 | } |
2567 | void CalendarView::toggleCancelIncidence() | 2583 | void CalendarView::toggleCancelIncidence() |
2568 | { | 2584 | { |
2569 | Incidence *incidence = currentSelection(); | 2585 | Incidence *incidence = currentSelection(); |
2570 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2586 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2571 | if ( incidence ) { | 2587 | if ( incidence ) { |
2572 | cancelIncidence(incidence); | 2588 | cancelIncidence(incidence); |
2573 | } | 2589 | } |
2574 | } | 2590 | } |
2575 | 2591 | ||
2576 | 2592 | ||
2577 | void CalendarView::cancelIncidence(Incidence * inc ) | 2593 | void CalendarView::cancelIncidence(Incidence * inc ) |
2578 | { | 2594 | { |
2579 | inc->setCancelled( ! inc->cancelled() ); | 2595 | inc->setCancelled( ! inc->cancelled() ); |
2580 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2596 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2581 | updateView(); | 2597 | updateView(); |
2582 | } | 2598 | } |
2583 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2599 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2584 | { | 2600 | { |
2585 | Incidence * newInc = orgInc->clone(); | 2601 | Incidence * newInc = orgInc->clone(); |
2586 | newInc->recreate(); | 2602 | newInc->recreate(); |
2587 | 2603 | ||
2588 | if ( newInc->type() == "Todo" ) { | 2604 | if ( newInc->type() == "Todo" ) { |
2589 | Todo* t = (Todo*) newInc; | 2605 | Todo* t = (Todo*) newInc; |
2590 | showTodoEditor(); | 2606 | showTodoEditor(); |
2591 | mTodoEditor->editTodo( t ); | 2607 | mTodoEditor->editTodo( t ); |
2592 | if ( mTodoEditor->exec() ) { | 2608 | if ( mTodoEditor->exec() ) { |
2593 | mCalendar->addTodo( t ); | 2609 | mCalendar->addTodo( t ); |
2594 | updateView(); | 2610 | updateView(); |
2595 | } else { | 2611 | } else { |
2596 | delete t; | 2612 | delete t; |
2597 | } | 2613 | } |
2598 | } | 2614 | } |
2599 | else { | 2615 | else { |
2600 | Event* e = (Event*) newInc; | 2616 | Event* e = (Event*) newInc; |
2601 | showEventEditor(); | 2617 | showEventEditor(); |
2602 | mEventEditor->editEvent( e ); | 2618 | mEventEditor->editEvent( e ); |
2603 | if ( mEventEditor->exec() ) { | 2619 | if ( mEventEditor->exec() ) { |
2604 | mCalendar->addEvent( e ); | 2620 | mCalendar->addEvent( e ); |
2605 | updateView(); | 2621 | updateView(); |
2606 | } else { | 2622 | } else { |
2607 | delete e; | 2623 | delete e; |
2608 | } | 2624 | } |
2609 | } | 2625 | } |
2610 | } | 2626 | } |
2611 | 2627 | ||
2612 | void CalendarView::newEvent() | 2628 | void CalendarView::newEvent() |
2613 | { | 2629 | { |
2614 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 2630 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
2615 | KOAgendaView *aView = mViewManager->agendaView(); | 2631 | KOAgendaView *aView = mViewManager->agendaView(); |
2616 | if (aView) { | 2632 | if (aView) { |
2617 | if (aView->selectionStart().isValid()) { | 2633 | if (aView->selectionStart().isValid()) { |
2618 | if (aView->selectedIsAllDay()) { | 2634 | if (aView->selectedIsAllDay()) { |
2619 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 2635 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
2620 | } else { | 2636 | } else { |
2621 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 2637 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
2622 | } | 2638 | } |
2623 | return; | 2639 | return; |
2624 | } | 2640 | } |
2625 | } | 2641 | } |
2626 | 2642 | ||
2627 | QDate date = mNavigator->selectedDates().first(); | 2643 | QDate date = mNavigator->selectedDates().first(); |
2628 | QDateTime current = QDateTime::currentDateTime(); | 2644 | QDateTime current = QDateTime::currentDateTime(); |
2629 | if ( date <= current.date() ) { | 2645 | if ( date <= current.date() ) { |
2630 | int hour = current.time().hour() +1; | 2646 | int hour = current.time().hour() +1; |
2631 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 2647 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
2632 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2648 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2633 | } else | 2649 | } else |
2634 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 2650 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
2635 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 2651 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
2636 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2652 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2637 | } | 2653 | } |
2638 | 2654 | ||
2639 | void CalendarView::newEvent(QDateTime fh) | 2655 | void CalendarView::newEvent(QDateTime fh) |
2640 | { | 2656 | { |
2641 | newEvent(fh, | 2657 | newEvent(fh, |
2642 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 2658 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
2643 | } | 2659 | } |
2644 | 2660 | ||
2645 | void CalendarView::newEvent(QDate dt) | 2661 | void CalendarView::newEvent(QDate dt) |
2646 | { | 2662 | { |
2647 | newEvent(QDateTime(dt, QTime(0,0,0)), | 2663 | newEvent(QDateTime(dt, QTime(0,0,0)), |
2648 | QDateTime(dt, QTime(0,0,0)), true); | 2664 | QDateTime(dt, QTime(0,0,0)), true); |
2649 | } | 2665 | } |
2650 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | 2666 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) |
2651 | { | 2667 | { |
2652 | newEvent(fromHint, toHint, false); | 2668 | newEvent(fromHint, toHint, false); |
2653 | } | 2669 | } |
2654 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 2670 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
2655 | { | 2671 | { |
2656 | 2672 | ||
2657 | showEventEditor(); | 2673 | showEventEditor(); |
2658 | mEventEditor->newEvent(fromHint,toHint,allDay); | 2674 | mEventEditor->newEvent(fromHint,toHint,allDay); |
2659 | if ( mFilterView->filtersEnabled() ) { | 2675 | if ( mFilterView->filtersEnabled() ) { |
2660 | CalFilter *filter = mFilterView->selectedFilter(); | 2676 | CalFilter *filter = mFilterView->selectedFilter(); |
2661 | if (filter && filter->showCategories()) { | 2677 | if (filter && filter->showCategories()) { |
2662 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 2678 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
2663 | } | 2679 | } |
2664 | if ( filter ) | 2680 | if ( filter ) |
2665 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 2681 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
2666 | } | 2682 | } |
2667 | } | 2683 | } |
2668 | void CalendarView::todoAdded(Todo * t) | 2684 | void CalendarView::todoAdded(Todo * t) |
2669 | { | 2685 | { |
2670 | 2686 | ||
2671 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); | 2687 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); |
2672 | updateTodoViews(); | 2688 | updateTodoViews(); |
2673 | } | 2689 | } |
2674 | void CalendarView::todoChanged(Todo * t) | 2690 | void CalendarView::todoChanged(Todo * t) |
2675 | { | 2691 | { |
2676 | emit todoModified( t, 4 ); | 2692 | emit todoModified( t, 4 ); |
2677 | // updateTodoViews(); | 2693 | // updateTodoViews(); |
2678 | } | 2694 | } |
2679 | void CalendarView::todoToBeDeleted(Todo *) | 2695 | void CalendarView::todoToBeDeleted(Todo *) |
2680 | { | 2696 | { |
2681 | //qDebug("todoToBeDeleted(Todo *) "); | 2697 | //qDebug("todoToBeDeleted(Todo *) "); |
2682 | updateTodoViews(); | 2698 | updateTodoViews(); |
2683 | } | 2699 | } |
2684 | void CalendarView::todoDeleted() | 2700 | void CalendarView::todoDeleted() |
2685 | { | 2701 | { |
2686 | //qDebug(" todoDeleted()"); | 2702 | //qDebug(" todoDeleted()"); |
2687 | updateTodoViews(); | 2703 | updateTodoViews(); |
2688 | } | 2704 | } |
2689 | 2705 | ||
2690 | 2706 | ||
2691 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) | 2707 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) |
2692 | { | 2708 | { |
2693 | showTodoEditor(); | 2709 | showTodoEditor(); |
2694 | mTodoEditor->newTodo(dt,0,allday); | 2710 | mTodoEditor->newTodo(dt,0,allday); |
2695 | if ( mFilterView->filtersEnabled() ) { | 2711 | if ( mFilterView->filtersEnabled() ) { |
2696 | CalFilter *filter = mFilterView->selectedFilter(); | 2712 | CalFilter *filter = mFilterView->selectedFilter(); |
2697 | if (filter && filter->showCategories()) { | 2713 | if (filter && filter->showCategories()) { |
2698 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 2714 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
2699 | } | 2715 | } |
2700 | if ( filter ) | 2716 | if ( filter ) |
2701 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 2717 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
2702 | } | 2718 | } |
2703 | } | 2719 | } |
2704 | 2720 | ||
2705 | void CalendarView::newTodo() | 2721 | void CalendarView::newTodo() |
2706 | { | 2722 | { |
2707 | newTodoDateTime( QDateTime(),true ); | 2723 | newTodoDateTime( QDateTime(),true ); |
2708 | } | 2724 | } |
2709 | 2725 | ||
2710 | void CalendarView::newSubTodo() | 2726 | void CalendarView::newSubTodo() |
2711 | { | 2727 | { |
2712 | Todo *todo = selectedTodo(); | 2728 | Todo *todo = selectedTodo(); |
2713 | if ( todo ) newSubTodo( todo ); | 2729 | if ( todo ) newSubTodo( todo ); |
2714 | } | 2730 | } |
2715 | 2731 | ||
2716 | void CalendarView::newSubTodo(Todo *parentEvent) | 2732 | void CalendarView::newSubTodo(Todo *parentEvent) |
2717 | { | 2733 | { |
2718 | 2734 | ||
2719 | showTodoEditor(); | 2735 | showTodoEditor(); |
2720 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); | 2736 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); |
2721 | } | 2737 | } |
2722 | 2738 | ||
2723 | void CalendarView::newFloatingEvent() | 2739 | void CalendarView::newFloatingEvent() |
2724 | { | 2740 | { |
2725 | DateList tmpList = mNavigator->selectedDates(); | 2741 | DateList tmpList = mNavigator->selectedDates(); |
2726 | QDate date = tmpList.first(); | 2742 | QDate date = tmpList.first(); |
2727 | 2743 | ||
2728 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), | 2744 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), |
2729 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); | 2745 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); |
2730 | } | 2746 | } |
2731 | 2747 | ||
2732 | 2748 | ||
2733 | void CalendarView::editEvent( Event *event ) | 2749 | void CalendarView::editEvent( Event *event ) |
2734 | { | 2750 | { |
2735 | 2751 | ||
2736 | if ( !event ) return; | 2752 | if ( !event ) return; |
2737 | if ( event->isReadOnly() ) { | 2753 | if ( event->isReadOnly() ) { |
2738 | showEvent( event ); | 2754 | showEvent( event ); |
2739 | return; | 2755 | return; |
2740 | } | 2756 | } |
2741 | showEventEditor(); | 2757 | showEventEditor(); |
2742 | mEventEditor->editEvent( event , mFlagEditDescription); | 2758 | mEventEditor->editEvent( event , mFlagEditDescription); |
2743 | } | 2759 | } |
2744 | void CalendarView::editJournal( Journal *jour ) | 2760 | void CalendarView::editJournal( Journal *jour ) |
2745 | { | 2761 | { |
2746 | if ( !jour ) return; | 2762 | if ( !jour ) return; |
2747 | mDialogManager->hideSearchDialog(); | 2763 | mDialogManager->hideSearchDialog(); |
2748 | mViewManager->showJournalView(); | 2764 | mViewManager->showJournalView(); |
2749 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 2765 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
2750 | } | 2766 | } |
2751 | void CalendarView::editTodo( Todo *todo ) | 2767 | void CalendarView::editTodo( Todo *todo ) |
2752 | { | 2768 | { |
2753 | if ( !todo ) return; | 2769 | if ( !todo ) return; |
2754 | 2770 | ||
2755 | if ( todo->isReadOnly() ) { | 2771 | if ( todo->isReadOnly() ) { |
2756 | showTodo( todo ); | 2772 | showTodo( todo ); |
2757 | return; | 2773 | return; |
2758 | } | 2774 | } |
2759 | showTodoEditor(); | 2775 | showTodoEditor(); |
2760 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2776 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2761 | 2777 | ||
2762 | } | 2778 | } |
2763 | 2779 | ||
2764 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2780 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2765 | { | 2781 | { |
2766 | if ( !mEventViewerDialog ) { | 2782 | if ( !mEventViewerDialog ) { |
2767 | mEventViewerDialog = new KOEventViewerDialog(this); | 2783 | mEventViewerDialog = new KOEventViewerDialog(this); |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 6ea8287..8d7ff36 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -1,613 +1,615 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000, 2001 | 3 | Copyright (c) 2000, 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef CALENDARVIEW_H | 24 | #ifndef CALENDARVIEW_H |
25 | #define CALENDARVIEW_H | 25 | #define CALENDARVIEW_H |
26 | 26 | ||
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #include <qptrlist.h> | 30 | #include <qptrlist.h> |
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #ifndef DESKTOP_VERSION | 33 | #ifndef DESKTOP_VERSION |
34 | #include <qtopia/ir.h> | 34 | #include <qtopia/ir.h> |
35 | #else | 35 | #else |
36 | #define Ir char | 36 | #define Ir char |
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendar.h> | 38 | #include <libkcal/calendar.h> |
39 | #include <libkcal/scheduler.h> | 39 | #include <libkcal/scheduler.h> |
40 | #include <libkcal/calendarresources.h> | 40 | #include <libkcal/calendarresources.h> |
41 | #include <libkcal/resourcecalendar.h> | 41 | #include <libkcal/resourcecalendar.h> |
42 | 42 | ||
43 | #include <korganizer/calendarviewbase.h> | 43 | #include <korganizer/calendarviewbase.h> |
44 | 44 | ||
45 | #include <ksyncmanager.h> | 45 | #include <ksyncmanager.h> |
46 | 46 | ||
47 | class QWidgetStack; | 47 | class QWidgetStack; |
48 | class QSplitter; | 48 | class QSplitter; |
49 | 49 | ||
50 | class CalPrinter; | 50 | class CalPrinter; |
51 | class KOFilterView; | 51 | class KOFilterView; |
52 | class KOViewManager; | 52 | class KOViewManager; |
53 | class KODialogManager; | 53 | class KODialogManager; |
54 | class KOTodoView; | 54 | class KOTodoView; |
55 | class KDateNavigator; | 55 | class KDateNavigator; |
56 | class DateNavigator; | 56 | class DateNavigator; |
57 | class KOIncidenceEditor; | 57 | class KOIncidenceEditor; |
58 | class KDatePicker; | 58 | class KDatePicker; |
59 | class ResourceView; | 59 | class ResourceView; |
60 | class NavigatorBar; | 60 | class NavigatorBar; |
61 | class KOEventEditor; | 61 | class KOEventEditor; |
62 | class KOTodoEditor ; | 62 | class KOTodoEditor ; |
63 | class KOEventViewerDialog; | 63 | class KOEventViewerDialog; |
64 | class KOBeamPrefs; | 64 | class KOBeamPrefs; |
65 | class KSyncProfile; | 65 | class KSyncProfile; |
66 | class AlarmDialog; | 66 | class AlarmDialog; |
67 | class KCal::Attendee; | 67 | class KCal::Attendee; |
68 | 68 | ||
69 | namespace KCal { class FileStorage; } | 69 | namespace KCal { class FileStorage; } |
70 | 70 | ||
71 | using namespace KCal; | 71 | using namespace KCal; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | This is the main calendar widget. It provides the different vies on t he | 74 | This is the main calendar widget. It provides the different vies on t he |
75 | calendar data as well as the date navigator. It also handles synchronisation | 75 | calendar data as well as the date navigator. It also handles synchronisation |
76 | of the different views and controls the different dialogs like preferences, | 76 | of the different views and controls the different dialogs like preferences, |
77 | event editor, search dialog etc. | 77 | event editor, search dialog etc. |
78 | 78 | ||
79 | @short main calendar view widget | 79 | @short main calendar view widget |
80 | @author Cornelius Schumacher | 80 | @author Cornelius Schumacher |
81 | */ | 81 | */ |
82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
83 | { | 83 | { |
84 | Q_OBJECT | 84 | Q_OBJECT |
85 | public: | 85 | public: |
86 | /** | 86 | /** |
87 | Constructs a new calendar view widget. | 87 | Constructs a new calendar view widget. |
88 | 88 | ||
89 | @param calendar calendar document | 89 | @param calendar calendar document |
90 | @param parent parent window | 90 | @param parent parent window |
91 | @param name Qt internal widget object name | 91 | @param name Qt internal widget object name |
92 | */ | 92 | */ |
93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
94 | const char *name = 0 ); | 94 | const char *name = 0 ); |
95 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 95 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
96 | const char *name = 0 ); | 96 | const char *name = 0 ); |
97 | virtual ~CalendarView(); | 97 | virtual ~CalendarView(); |
98 | 98 | ||
99 | Calendar *calendar() { return mCalendar; } | 99 | Calendar *calendar() { return mCalendar; } |
100 | 100 | ||
101 | KOViewManager *viewManager(); | 101 | KOViewManager *viewManager(); |
102 | KODialogManager *dialogManager(); | 102 | KODialogManager *dialogManager(); |
103 | 103 | ||
104 | QDate startDate(); | 104 | QDate startDate(); |
105 | QDate endDate(); | 105 | QDate endDate(); |
106 | 106 | ||
107 | QWidgetStack *viewStack(); | 107 | QWidgetStack *viewStack(); |
108 | QWidget *leftFrame(); | 108 | QWidget *leftFrame(); |
109 | NavigatorBar *navigatorBar(); | 109 | NavigatorBar *navigatorBar(); |
110 | 110 | ||
111 | DateNavigator *dateNavigator(); | 111 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 112 | KDateNavigator *dateNavigatorWidget(); |
113 | 113 | ||
114 | void addView(KOrg::BaseView *); | 114 | void addView(KOrg::BaseView *); |
115 | void showView(KOrg::BaseView *); | 115 | void showView(KOrg::BaseView *); |
116 | KOEventViewerDialog* getEventViewerDialog(); | 116 | KOEventViewerDialog* getEventViewerDialog(); |
117 | Incidence *currentSelection(); | 117 | Incidence *currentSelection(); |
118 | 118 | ||
119 | signals: | 119 | signals: |
120 | void save (); | ||
121 | void saveStopTimer (); | ||
120 | void tempDisableBR(bool); | 122 | void tempDisableBR(bool); |
121 | /** This todo has been modified */ | 123 | /** This todo has been modified */ |
122 | void todoModified(Todo *, int); | 124 | void todoModified(Todo *, int); |
123 | 125 | ||
124 | /** when change is made to options dialog, the topwidget will catch this | 126 | /** when change is made to options dialog, the topwidget will catch this |
125 | * and emit this signal which notifies all widgets which have registered | 127 | * and emit this signal which notifies all widgets which have registered |
126 | * for notification to update their settings. */ | 128 | * for notification to update their settings. */ |
127 | void configChanged(); | 129 | void configChanged(); |
128 | /** emitted when the topwidget is closing down, so that any attached | 130 | /** emitted when the topwidget is closing down, so that any attached |
129 | child windows can also close. */ | 131 | child windows can also close. */ |
130 | void closingDown(); | 132 | void closingDown(); |
131 | /** emitted right before we die */ | 133 | /** emitted right before we die */ |
132 | void closed(QWidget *); | 134 | void closed(QWidget *); |
133 | 135 | ||
134 | /** Emitted when state of modified flag changes */ | 136 | /** Emitted when state of modified flag changes */ |
135 | void modifiedChanged(bool); | 137 | void modifiedChanged(bool); |
136 | void signalmodified(); | 138 | void signalmodified(); |
137 | 139 | ||
138 | /** Emitted when state of read-only flag changes */ | 140 | /** Emitted when state of read-only flag changes */ |
139 | void readOnlyChanged(bool); | 141 | void readOnlyChanged(bool); |
140 | 142 | ||
141 | /** Emitted when the unit of navigation changes */ | 143 | /** Emitted when the unit of navigation changes */ |
142 | void changeNavStringPrev(const QString &); | 144 | void changeNavStringPrev(const QString &); |
143 | void changeNavStringNext(const QString &); | 145 | void changeNavStringNext(const QString &); |
144 | 146 | ||
145 | /** Emitted when state of events selection has changed and user is organizer*/ | 147 | /** Emitted when state of events selection has changed and user is organizer*/ |
146 | void organizerEventsSelected(bool); | 148 | void organizerEventsSelected(bool); |
147 | /** Emitted when state of events selection has changed and user is attendee*/ | 149 | /** Emitted when state of events selection has changed and user is attendee*/ |
148 | void groupEventsSelected(bool); | 150 | void groupEventsSelected(bool); |
149 | /** | 151 | /** |
150 | Emitted when an incidence gets selected. If the selection is cleared the | 152 | Emitted when an incidence gets selected. If the selection is cleared the |
151 | signal is emitted with 0 as argument. | 153 | signal is emitted with 0 as argument. |
152 | */ | 154 | */ |
153 | void incidenceSelected( Incidence * ); | 155 | void incidenceSelected( Incidence * ); |
154 | /** Emitted, when a todoitem is selected or deselected. */ | 156 | /** Emitted, when a todoitem is selected or deselected. */ |
155 | void todoSelected( bool ); | 157 | void todoSelected( bool ); |
156 | 158 | ||
157 | /** | 159 | /** |
158 | Emitted, when clipboard content changes. Parameter indicates if paste | 160 | Emitted, when clipboard content changes. Parameter indicates if paste |
159 | is possible or not. | 161 | is possible or not. |
160 | */ | 162 | */ |
161 | void pasteEnabled(bool); | 163 | void pasteEnabled(bool); |
162 | 164 | ||
163 | /** Emitted, when the number of incoming messages has changed. */ | 165 | /** Emitted, when the number of incoming messages has changed. */ |
164 | void numIncomingChanged(int); | 166 | void numIncomingChanged(int); |
165 | 167 | ||
166 | /** Emitted, when the number of outgoing messages has changed. */ | 168 | /** Emitted, when the number of outgoing messages has changed. */ |
167 | void numOutgoingChanged(int); | 169 | void numOutgoingChanged(int); |
168 | 170 | ||
169 | /** Send status message, which can e.g. be displayed in the status bar. */ | 171 | /** Send status message, which can e.g. be displayed in the status bar. */ |
170 | void statusMessage(const QString &); | 172 | void statusMessage(const QString &); |
171 | 173 | ||
172 | void calendarViewExpanded( bool ); | 174 | void calendarViewExpanded( bool ); |
173 | void updateSearchDialog(); | 175 | void updateSearchDialog(); |
174 | 176 | ||
175 | 177 | ||
176 | public slots: | 178 | public slots: |
177 | void showNavigatorBar(bool); | 179 | void showNavigatorBar(bool); |
178 | void showOpenError(); | 180 | void showOpenError(); |
179 | void watchSavedFile(); | 181 | void watchSavedFile(); |
180 | void recheckTimerAlarm(); | 182 | void recheckTimerAlarm(); |
181 | void checkNextTimerAlarm(); | 183 | void checkNextTimerAlarm(); |
182 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 184 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
183 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 185 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
184 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 186 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
185 | 187 | ||
186 | /** options dialog made a changed to the configuration. we catch this | 188 | /** options dialog made a changed to the configuration. we catch this |
187 | * and notify all widgets which need to update their configuration. */ | 189 | * and notify all widgets which need to update their configuration. */ |
188 | void updateConfig(); | 190 | void updateConfig(); |
189 | 191 | ||
190 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 192 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
191 | const QStringList& anniversaryList, const QStringList& realNameList, | 193 | const QStringList& anniversaryList, const QStringList& realNameList, |
192 | const QStringList& emailList, const QStringList& assembledNameList, | 194 | const QStringList& emailList, const QStringList& assembledNameList, |
193 | const QStringList& uidList); | 195 | const QStringList& uidList); |
194 | 196 | ||
195 | /** | 197 | /** |
196 | Load calendar from file \a filename. If \a merge is true, load | 198 | Load calendar from file \a filename. If \a merge is true, load |
197 | calendar into existing one, if it is false, clear calendar, before | 199 | calendar into existing one, if it is false, clear calendar, before |
198 | loading. Return true, if calendar could be successfully loaded. | 200 | loading. Return true, if calendar could be successfully loaded. |
199 | */ | 201 | */ |
200 | bool openCalendar(QString filename, bool merge=false); | 202 | bool openCalendar(QString filename, bool merge=false); |
201 | bool syncCalendar(QString filename,int mode = 0 ); | 203 | bool syncCalendar(QString filename,int mode = 0 ); |
202 | 204 | ||
203 | /** | 205 | /** |
204 | Save calendar data to file. Return true if calendar could be | 206 | Save calendar data to file. Return true if calendar could be |
205 | successfully saved. | 207 | successfully saved. |
206 | */ | 208 | */ |
207 | bool saveCalendar(QString filename); | 209 | bool saveCalendar(QString filename); |
208 | 210 | ||
209 | /** | 211 | /** |
210 | Close calendar. Clear calendar data and reset views to display an empty | 212 | Close calendar. Clear calendar data and reset views to display an empty |
211 | calendar. | 213 | calendar. |
212 | */ | 214 | */ |
213 | void closeCalendar(); | 215 | void closeCalendar(); |
214 | 216 | ||
215 | /** Archive old events of calendar */ | 217 | /** Archive old events of calendar */ |
216 | void archiveCalendar(); | 218 | void archiveCalendar(); |
217 | 219 | ||
218 | void showIncidence(); | 220 | void showIncidence(); |
219 | void editIncidence(); | 221 | void editIncidence(); |
220 | void editIncidenceDescription(); | 222 | void editIncidenceDescription(); |
221 | void deleteIncidence(); | 223 | void deleteIncidence(); |
222 | void cloneIncidence(); | 224 | void cloneIncidence(); |
223 | void moveIncidence(); | 225 | void moveIncidence(); |
224 | void beamIncidence(); | 226 | void beamIncidence(); |
225 | void toggleCancelIncidence(); | 227 | void toggleCancelIncidence(); |
226 | 228 | ||
227 | /** create an editeventwin with supplied date/time, and if bool is true, | 229 | /** create an editeventwin with supplied date/time, and if bool is true, |
228 | * make the event take all day. */ | 230 | * make the event take all day. */ |
229 | void newEvent(QDateTime, QDateTime, bool allDay ); | 231 | void newEvent(QDateTime, QDateTime, bool allDay ); |
230 | void newEvent(QDateTime, QDateTime); | 232 | void newEvent(QDateTime, QDateTime); |
231 | void newEvent(QDateTime fh); | 233 | void newEvent(QDateTime fh); |
232 | void newEvent(QDate dt); | 234 | void newEvent(QDate dt); |
233 | /** create new event without having a date hint. Takes current date as | 235 | /** create new event without having a date hint. Takes current date as |
234 | default hint. */ | 236 | default hint. */ |
235 | void newEvent(); | 237 | void newEvent(); |
236 | void newFloatingEvent(); | 238 | void newFloatingEvent(); |
237 | 239 | ||
238 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 240 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
239 | void showIncidence(Incidence *); | 241 | void showIncidence(Incidence *); |
240 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 242 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
241 | void editIncidence(Incidence *); | 243 | void editIncidence(Incidence *); |
242 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 244 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
243 | void deleteIncidence(Incidence *); | 245 | void deleteIncidence(Incidence *); |
244 | void cloneIncidence(Incidence *); | 246 | void cloneIncidence(Incidence *); |
245 | void cancelIncidence(Incidence *); | 247 | void cancelIncidence(Incidence *); |
246 | /** Create an editor for the supplied event. */ | 248 | /** Create an editor for the supplied event. */ |
247 | void editEvent(Event *); | 249 | void editEvent(Event *); |
248 | /** Delete the supplied event. */ | 250 | /** Delete the supplied event. */ |
249 | void deleteEvent(Event *); | 251 | void deleteEvent(Event *); |
250 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 252 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
251 | found. */ | 253 | found. */ |
252 | bool deleteEvent(const QString &uid); | 254 | bool deleteEvent(const QString &uid); |
253 | /** Create a read-only viewer dialog for the supplied event. */ | 255 | /** Create a read-only viewer dialog for the supplied event. */ |
254 | void showEvent(Event *); | 256 | void showEvent(Event *); |
255 | 257 | ||
256 | void editJournal(Journal *); | 258 | void editJournal(Journal *); |
257 | void showJournal(Journal *); | 259 | void showJournal(Journal *); |
258 | void deleteJournal(Journal *); | 260 | void deleteJournal(Journal *); |
259 | /** Create an editor dialog for a todo */ | 261 | /** Create an editor dialog for a todo */ |
260 | void editTodo(Todo *); | 262 | void editTodo(Todo *); |
261 | /** Create a read-only viewer dialog for the supplied todo */ | 263 | /** Create a read-only viewer dialog for the supplied todo */ |
262 | void showTodo(Todo *); | 264 | void showTodo(Todo *); |
263 | /** create new todo */ | 265 | /** create new todo */ |
264 | void newTodo(); | 266 | void newTodo(); |
265 | void newTodoDateTime(QDateTime, bool allday); | 267 | void newTodoDateTime(QDateTime, bool allday); |
266 | /** create new todo with a parent todo */ | 268 | /** create new todo with a parent todo */ |
267 | void newSubTodo(); | 269 | void newSubTodo(); |
268 | /** create new todo with a parent todo */ | 270 | /** create new todo with a parent todo */ |
269 | void newSubTodo(Todo *); | 271 | void newSubTodo(Todo *); |
270 | /** Delete todo */ | 272 | /** Delete todo */ |
271 | void deleteTodo(Todo *); | 273 | void deleteTodo(Todo *); |
272 | 274 | ||
273 | 275 | ||
274 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is | 276 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is |
275 | * emitted as result. */ | 277 | * emitted as result. */ |
276 | void checkClipboard(); | 278 | void checkClipboard(); |
277 | 279 | ||
278 | /** using the KConfig associated with the kapp variable, read in the | 280 | /** using the KConfig associated with the kapp variable, read in the |
279 | * settings from the config file. | 281 | * settings from the config file. |
280 | */ | 282 | */ |
281 | void readSettings(); | 283 | void readSettings(); |
282 | 284 | ||
283 | /** write current state to config file. */ | 285 | /** write current state to config file. */ |
284 | void writeSettings(); | 286 | void writeSettings(); |
285 | 287 | ||
286 | /** read settings for calendar filters */ | 288 | /** read settings for calendar filters */ |
287 | void readFilterSettings(KConfig *config); | 289 | void readFilterSettings(KConfig *config); |
288 | 290 | ||
289 | /** write settings for calendar filters */ | 291 | /** write settings for calendar filters */ |
290 | void writeFilterSettings(KConfig *config); | 292 | void writeFilterSettings(KConfig *config); |
291 | 293 | ||
292 | /** passes on the message that an event has changed to the currently | 294 | /** passes on the message that an event has changed to the currently |
293 | * activated view so that it can make appropriate display changes. */ | 295 | * activated view so that it can make appropriate display changes. */ |
294 | void changeEventDisplay(Event *, int); | 296 | void changeEventDisplay(Event *, int); |
295 | void changeIncidenceDisplay(Incidence *, int); | 297 | void changeIncidenceDisplay(Incidence *, int); |
296 | void changeTodoDisplay(Todo *, int); | 298 | void changeTodoDisplay(Todo *, int); |
297 | 299 | ||
298 | void eventAdded(Event *); | 300 | void eventAdded(Event *); |
299 | void eventChanged(Event *); | 301 | void eventChanged(Event *); |
300 | void eventToBeDeleted(Event *); | 302 | void eventToBeDeleted(Event *); |
301 | void eventDeleted(); | 303 | void eventDeleted(); |
302 | 304 | ||
303 | void todoAdded(Todo *); | 305 | void todoAdded(Todo *); |
304 | void todoChanged(Todo *); | 306 | void todoChanged(Todo *); |
305 | void todoToBeDeleted(Todo *); | 307 | void todoToBeDeleted(Todo *); |
306 | void todoDeleted(); | 308 | void todoDeleted(); |
307 | 309 | ||
308 | void updateView(const QDate &start, const QDate &end); | 310 | void updateView(const QDate &start, const QDate &end); |
309 | void updateView(); | 311 | void updateView(); |
310 | 312 | ||
311 | /** Full update of visible todo views */ | 313 | /** Full update of visible todo views */ |
312 | void updateTodoViews(); | 314 | void updateTodoViews(); |
313 | 315 | ||
314 | void updateUnmanagedViews(); | 316 | void updateUnmanagedViews(); |
315 | 317 | ||
316 | /** cut the current appointment to the clipboard */ | 318 | /** cut the current appointment to the clipboard */ |
317 | void edit_cut(); | 319 | void edit_cut(); |
318 | 320 | ||
319 | /** copy the current appointment(s) to the clipboard */ | 321 | /** copy the current appointment(s) to the clipboard */ |
320 | void edit_copy(); | 322 | void edit_copy(); |
321 | 323 | ||
322 | /** paste the current vobject(s) in the clipboard buffer into calendar */ | 324 | /** paste the current vobject(s) in the clipboard buffer into calendar */ |
323 | void edit_paste(); | 325 | void edit_paste(); |
324 | 326 | ||
325 | /** edit viewing and configuration options. */ | 327 | /** edit viewing and configuration options. */ |
326 | void edit_options(); | 328 | void edit_options(); |
327 | /** | 329 | /** |
328 | Functions for printing, previewing a print, and setting up printing | 330 | Functions for printing, previewing a print, and setting up printing |
329 | parameters. | 331 | parameters. |
330 | */ | 332 | */ |
331 | void print(); | 333 | void print(); |
332 | void printSetup(); | 334 | void printSetup(); |
333 | void printPreview(); | 335 | void printPreview(); |
334 | 336 | ||
335 | /** Export as iCalendar file */ | 337 | /** Export as iCalendar file */ |
336 | void exportICalendar(); | 338 | void exportICalendar(); |
337 | 339 | ||
338 | /** Export as vCalendar file */ | 340 | /** Export as vCalendar file */ |
339 | bool exportVCalendar( QString fn); | 341 | bool exportVCalendar( QString fn); |
340 | 342 | ||
341 | /** pop up a dialog to show an existing appointment. */ | 343 | /** pop up a dialog to show an existing appointment. */ |
342 | void appointment_show(); | 344 | void appointment_show(); |
343 | /** | 345 | /** |
344 | * pop up an Appointment Dialog to edit an existing appointment.Get | 346 | * pop up an Appointment Dialog to edit an existing appointment.Get |
345 | * information on the appointment from the list of unique IDs that is | 347 | * information on the appointment from the list of unique IDs that is |
346 | * currently in the View, called currIds. | 348 | * currently in the View, called currIds. |
347 | */ | 349 | */ |
348 | void appointment_edit(); | 350 | void appointment_edit(); |
349 | /** | 351 | /** |
350 | * pop up dialog confirming deletion of currently selected event in the | 352 | * pop up dialog confirming deletion of currently selected event in the |
351 | * View. | 353 | * View. |
352 | */ | 354 | */ |
353 | void appointment_delete(); | 355 | void appointment_delete(); |
354 | 356 | ||
355 | /** mails the currently selected event to a particular user as a vCalendar | 357 | /** mails the currently selected event to a particular user as a vCalendar |
356 | attachment. */ | 358 | attachment. */ |
357 | void action_mail(); | 359 | void action_mail(); |
358 | 360 | ||
359 | /* frees a subtodo from it's relation */ | 361 | /* frees a subtodo from it's relation */ |
360 | void todo_unsub( Todo * ); | 362 | void todo_unsub( Todo * ); |
361 | void todo_resub( Todo * parent, Todo * sub ); | 363 | void todo_resub( Todo * parent, Todo * sub ); |
362 | 364 | ||
363 | /** Take ownership of selected event. */ | 365 | /** Take ownership of selected event. */ |
364 | void takeOverEvent(); | 366 | void takeOverEvent(); |
365 | 367 | ||
366 | /** Take ownership of all events in calendar. */ | 368 | /** Take ownership of all events in calendar. */ |
367 | void takeOverCalendar(); | 369 | void takeOverCalendar(); |
368 | 370 | ||
369 | /** query whether or not the calendar is "dirty". */ | 371 | /** query whether or not the calendar is "dirty". */ |
370 | bool isModified(); | 372 | bool isModified(); |
371 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ | 373 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ |
372 | void setModified(bool modified=true); | 374 | void setModified(bool modified=true); |
373 | 375 | ||
374 | /** query if the calendar is read-only. */ | 376 | /** query if the calendar is read-only. */ |
375 | bool isReadOnly(); | 377 | bool isReadOnly(); |
376 | /** set state of calendar to read-only */ | 378 | /** set state of calendar to read-only */ |
377 | void setReadOnly(bool readOnly=true); | 379 | void setReadOnly(bool readOnly=true); |
378 | 380 | ||
379 | void eventUpdated(Incidence *); | 381 | void eventUpdated(Incidence *); |
380 | 382 | ||
381 | /* iTIP scheduling actions */ | 383 | /* iTIP scheduling actions */ |
382 | void schedule_publish(Incidence *incidence = 0); | 384 | void schedule_publish(Incidence *incidence = 0); |
383 | void schedule_request(Incidence *incidence = 0); | 385 | void schedule_request(Incidence *incidence = 0); |
384 | void schedule_refresh(Incidence *incidence = 0); | 386 | void schedule_refresh(Incidence *incidence = 0); |
385 | void schedule_cancel(Incidence *incidence = 0); | 387 | void schedule_cancel(Incidence *incidence = 0); |
386 | void schedule_add(Incidence *incidence = 0); | 388 | void schedule_add(Incidence *incidence = 0); |
387 | void schedule_reply(Incidence *incidence = 0); | 389 | void schedule_reply(Incidence *incidence = 0); |
388 | void schedule_counter(Incidence *incidence = 0); | 390 | void schedule_counter(Incidence *incidence = 0); |
389 | void schedule_declinecounter(Incidence *incidence = 0); | 391 | void schedule_declinecounter(Incidence *incidence = 0); |
390 | void schedule_publish_freebusy(int daysToPublish = 30); | 392 | void schedule_publish_freebusy(int daysToPublish = 30); |
391 | 393 | ||
392 | void openAddressbook(); | 394 | void openAddressbook(); |
393 | 395 | ||
394 | void editFilters(); | 396 | void editFilters(); |
395 | void toggleFilerEnabled(); | 397 | void toggleFilerEnabled(); |
396 | QPtrList<CalFilter> filters(); | 398 | QPtrList<CalFilter> filters(); |
397 | void toggleFilter(); | 399 | void toggleFilter(); |
398 | void showFilter(bool visible); | 400 | void showFilter(bool visible); |
399 | void updateFilter(); | 401 | void updateFilter(); |
400 | void filterEdited(); | 402 | void filterEdited(); |
401 | void selectFilter( int ); | 403 | void selectFilter( int ); |
402 | KOFilterView *filterView(); | 404 | KOFilterView *filterView(); |
403 | 405 | ||
404 | void showIntro(); | 406 | void showIntro(); |
405 | 407 | ||
406 | /** Move the curdatepient view date to today */ | 408 | /** Move the curdatepient view date to today */ |
407 | void goToday(); | 409 | void goToday(); |
408 | 410 | ||
409 | /** Move to the next date(s) in the current view */ | 411 | /** Move to the next date(s) in the current view */ |
410 | void goNext(); | 412 | void goNext(); |
411 | 413 | ||
412 | /** Move to the previous date(s) in the current view */ | 414 | /** Move to the previous date(s) in the current view */ |
413 | void goPrevious(); | 415 | void goPrevious(); |
414 | /** Move to the next date(s) in the current view */ | 416 | /** Move to the next date(s) in the current view */ |
415 | void goNextMonth(); | 417 | void goNextMonth(); |
416 | 418 | ||
417 | /** Move to the previous date(s) in the current view */ | 419 | /** Move to the previous date(s) in the current view */ |
418 | void goPreviousMonth(); | 420 | void goPreviousMonth(); |
419 | 421 | ||
420 | void toggleExpand(); | 422 | void toggleExpand(); |
421 | void toggleDateNavigatorWidget(); | 423 | void toggleDateNavigatorWidget(); |
422 | void toggleAllDaySize(); | 424 | void toggleAllDaySize(); |
423 | void dialogClosing(Incidence *); | 425 | void dialogClosing(Incidence *); |
424 | 426 | ||
425 | /** Look for new messages in the inbox */ | 427 | /** Look for new messages in the inbox */ |
426 | void lookForIncomingMessages(); | 428 | void lookForIncomingMessages(); |
427 | /** Look for new messages in the outbox */ | 429 | /** Look for new messages in the outbox */ |
428 | void lookForOutgoingMessages(); | 430 | void lookForOutgoingMessages(); |
429 | 431 | ||
430 | void processMainViewSelection( Incidence * ); | 432 | void processMainViewSelection( Incidence * ); |
431 | void processTodoListSelection( Incidence * ); | 433 | void processTodoListSelection( Incidence * ); |
432 | 434 | ||
433 | void processIncidenceSelection( Incidence * ); | 435 | void processIncidenceSelection( Incidence * ); |
434 | 436 | ||
435 | void purgeCompleted(); | 437 | void purgeCompleted(); |
436 | bool removeCompletedSubTodos( Todo* ); | 438 | bool removeCompletedSubTodos( Todo* ); |
437 | void slotCalendarChanged(); | 439 | void slotCalendarChanged(); |
438 | bool importBday(); | 440 | bool importBday(); |
439 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); | 441 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); |
440 | bool importQtopia( const QString &categoriesFile, | 442 | bool importQtopia( const QString &categoriesFile, |
441 | const QString &datebookFile, | 443 | const QString &datebookFile, |
442 | const QString &tasklistFile ); | 444 | const QString &tasklistFile ); |
443 | void syncExternal( int mode ); | 445 | void syncExternal( int mode ); |
444 | void slotSelectPickerDate( QDate ) ; | 446 | void slotSelectPickerDate( QDate ) ; |
445 | void showDatePicker( ) ; | 447 | void showDatePicker( ) ; |
446 | void moveIncidence(Incidence *) ; | 448 | void moveIncidence(Incidence *) ; |
447 | void beamIncidence(Incidence *) ; | 449 | void beamIncidence(Incidence *) ; |
448 | void beamCalendar() ; | 450 | void beamCalendar() ; |
449 | void beamFilteredCalendar() ; | 451 | void beamFilteredCalendar() ; |
450 | void beamIncidenceList(QPtrList<Incidence>) ; | 452 | void beamIncidenceList(QPtrList<Incidence>) ; |
451 | void manageCategories(); | 453 | void manageCategories(); |
452 | int addCategories(); | 454 | int addCategories(); |
453 | void removeCategories(); | 455 | void removeCategories(); |
454 | void setSyncDevice( QString ); | 456 | void setSyncDevice( QString ); |
455 | void setSyncName( QString ); | 457 | void setSyncName( QString ); |
456 | void showDay( QDate ); | 458 | void showDay( QDate ); |
457 | void undo_delete(); | 459 | void undo_delete(); |
458 | protected slots: | 460 | protected slots: |
459 | void timerAlarm(); | 461 | void timerAlarm(); |
460 | void suspendAlarm(); | 462 | void suspendAlarm(); |
461 | void beamDone( Ir *ir ); | 463 | void beamDone( Ir *ir ); |
462 | /** Select a view or adapt the current view to display the specified dates. */ | 464 | /** Select a view or adapt the current view to display the specified dates. */ |
463 | void showDates( const KCal::DateList & ); | 465 | void showDates( const KCal::DateList & ); |
464 | void selectWeekNum ( int ); | 466 | void selectWeekNum ( int ); |
465 | 467 | ||
466 | public: | 468 | public: |
467 | // show a standard warning | 469 | // show a standard warning |
468 | // returns KMsgBox::yesNoCancel() | 470 | // returns KMsgBox::yesNoCancel() |
469 | int msgCalModified(); | 471 | int msgCalModified(); |
470 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 472 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
471 | 473 | ||
472 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 474 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
473 | virtual void removeSyncInfo( QString syncProfile); | 475 | virtual void removeSyncInfo( QString syncProfile); |
474 | void setSyncManager(KSyncManager* manager); | 476 | void setSyncManager(KSyncManager* manager); |
475 | void setLoadedFileVersion(QDateTime); | 477 | void setLoadedFileVersion(QDateTime); |
476 | bool checkFileVersion(QString fn); | 478 | bool checkFileVersion(QString fn); |
477 | bool checkFileChanged(QString fn); | 479 | bool checkFileChanged(QString fn); |
478 | Event* getLastSyncEvent(); | 480 | Event* getLastSyncEvent(); |
479 | /** Adapt navigation units correpsonding to step size of navigation of the | 481 | /** Adapt navigation units correpsonding to step size of navigation of the |
480 | * current view. | 482 | * current view. |
481 | */ | 483 | */ |
482 | void adaptNavigationUnits(); | 484 | void adaptNavigationUnits(); |
483 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 485 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
484 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 486 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
485 | //Attendee* getYourAttendee(Event *event); | 487 | //Attendee* getYourAttendee(Event *event); |
486 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} | 488 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} |
487 | protected: | 489 | protected: |
488 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 490 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
489 | 491 | ||
490 | // returns KMsgBox::OKCandel() | 492 | // returns KMsgBox::OKCandel() |
491 | int msgItemDelete(const QString name); | 493 | int msgItemDelete(const QString name); |
492 | void showEventEditor(); | 494 | void showEventEditor(); |
493 | void showTodoEditor(); | 495 | void showTodoEditor(); |
494 | void writeLocale(); | 496 | void writeLocale(); |
495 | Todo *selectedTodo(); | 497 | Todo *selectedTodo(); |
496 | 498 | ||
497 | private: | 499 | private: |
498 | bool mBlockShowDates; | 500 | bool mBlockShowDates; |
499 | KSyncManager* mSyncManager; | 501 | KSyncManager* mSyncManager; |
500 | AlarmDialog * mAlarmDialog; | 502 | AlarmDialog * mAlarmDialog; |
501 | QString mAlarmNotification; | 503 | QString mAlarmNotification; |
502 | QString mSuspendAlarmNotification; | 504 | QString mSuspendAlarmNotification; |
503 | QTimer* mSuspendTimer; | 505 | QTimer* mSuspendTimer; |
504 | QTimer* mAlarmTimer; | 506 | QTimer* mAlarmTimer; |
505 | QTimer* mRecheckAlarmTimer; | 507 | QTimer* mRecheckAlarmTimer; |
506 | void computeAlarm( QString ); | 508 | void computeAlarm( QString ); |
507 | void startAlarm( QString, QString ); | 509 | void startAlarm( QString, QString ); |
508 | void setSyncEventsReadOnly(); | 510 | void setSyncEventsReadOnly(); |
509 | 511 | ||
510 | QDateTime loadedFileVersion; | 512 | QDateTime loadedFileVersion; |
511 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 513 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); |
512 | void checkExternalId( Incidence * inc ); | 514 | void checkExternalId( Incidence * inc ); |
513 | int mGlobalSyncMode; | 515 | int mGlobalSyncMode; |
514 | QString mCurrentSyncDevice; | 516 | QString mCurrentSyncDevice; |
515 | QString mCurrentSyncName; | 517 | QString mCurrentSyncName; |
516 | KOBeamPrefs* beamDialog; | 518 | KOBeamPrefs* beamDialog; |
517 | void init(); | 519 | void init(); |
518 | int mDatePickerMode; | 520 | int mDatePickerMode; |
519 | bool mFlagEditDescription; | 521 | bool mFlagEditDescription; |
520 | QDateTime mLastCalendarSync; | 522 | QDateTime mLastCalendarSync; |
521 | void createPrinter(); | 523 | void createPrinter(); |
522 | 524 | ||
523 | void calendarModified( bool, Calendar * ); | 525 | void calendarModified( bool, Calendar * ); |
524 | 526 | ||
525 | CalPrinter *mCalPrinter; | 527 | CalPrinter *mCalPrinter; |
526 | 528 | ||
527 | QSplitter *mPanner; | 529 | QSplitter *mPanner; |
528 | QSplitter *mLeftSplitter; | 530 | QSplitter *mLeftSplitter; |
529 | QWidget *mLeftFrame; | 531 | QWidget *mLeftFrame; |
530 | QWidgetStack *mRightFrame; | 532 | QWidgetStack *mRightFrame; |
531 | 533 | ||
532 | KDatePicker* mDatePicker; | 534 | KDatePicker* mDatePicker; |
533 | QVBox* mDateFrame; | 535 | QVBox* mDateFrame; |
534 | NavigatorBar *mNavigatorBar; | 536 | NavigatorBar *mNavigatorBar; |
535 | 537 | ||
536 | KDateNavigator *mDateNavigator; // widget showing small month view. | 538 | KDateNavigator *mDateNavigator; // widget showing small month view. |
537 | 539 | ||
538 | KOFilterView *mFilterView; | 540 | KOFilterView *mFilterView; |
539 | 541 | ||
540 | ResourceView *mResourceView; | 542 | ResourceView *mResourceView; |
541 | 543 | ||
542 | // calendar object for this viewing instance | 544 | // calendar object for this viewing instance |
543 | Calendar *mCalendar; | 545 | Calendar *mCalendar; |
544 | 546 | ||
545 | CalendarResourceManager *mResourceManager; | 547 | CalendarResourceManager *mResourceManager; |
546 | 548 | ||
547 | FileStorage *mStorage; | 549 | FileStorage *mStorage; |
548 | 550 | ||
549 | DateNavigator *mNavigator; | 551 | DateNavigator *mNavigator; |
550 | 552 | ||
551 | KOViewManager *mViewManager; | 553 | KOViewManager *mViewManager; |
552 | KODialogManager *mDialogManager; | 554 | KODialogManager *mDialogManager; |
553 | 555 | ||
554 | // Calendar filters | 556 | // Calendar filters |
555 | QPtrList<CalFilter> mFilters; | 557 | QPtrList<CalFilter> mFilters; |
556 | 558 | ||
557 | // various housekeeping variables. | 559 | // various housekeeping variables. |
558 | bool mModified; // flag indicating if calendar is modified | 560 | bool mModified; // flag indicating if calendar is modified |
559 | bool mReadOnly; // flag indicating if calendar is read-only | 561 | bool mReadOnly; // flag indicating if calendar is read-only |
560 | QDate mSaveSingleDate; | 562 | QDate mSaveSingleDate; |
561 | 563 | ||
562 | Incidence *mSelectedIncidence; | 564 | Incidence *mSelectedIncidence; |
563 | Incidence *mMoveIncidence; | 565 | Incidence *mMoveIncidence; |
564 | QDate mMoveIncidenceOldDate; | 566 | QDate mMoveIncidenceOldDate; |
565 | KOTodoView *mTodoList; | 567 | KOTodoView *mTodoList; |
566 | KOEventEditor * mEventEditor; | 568 | KOEventEditor * mEventEditor; |
567 | KOTodoEditor * mTodoEditor; | 569 | KOTodoEditor * mTodoEditor; |
568 | KOEventViewerDialog * mEventViewerDialog; | 570 | KOEventViewerDialog * mEventViewerDialog; |
569 | void keyPressEvent ( QKeyEvent *e) ; | 571 | void keyPressEvent ( QKeyEvent *e) ; |
570 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 572 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
571 | }; | 573 | }; |
572 | 574 | ||
573 | 575 | ||
574 | class CalendarViewVisitor : public Incidence::Visitor | 576 | class CalendarViewVisitor : public Incidence::Visitor |
575 | { | 577 | { |
576 | public: | 578 | public: |
577 | CalendarViewVisitor() : mView( 0 ) {} | 579 | CalendarViewVisitor() : mView( 0 ) {} |
578 | 580 | ||
579 | bool act( Incidence *incidence, CalendarView *view ) | 581 | bool act( Incidence *incidence, CalendarView *view ) |
580 | { | 582 | { |
581 | mView = view; | 583 | mView = view; |
582 | return incidence->accept( *this ); | 584 | return incidence->accept( *this ); |
583 | } | 585 | } |
584 | 586 | ||
585 | protected: | 587 | protected: |
586 | CalendarView *mView; | 588 | CalendarView *mView; |
587 | }; | 589 | }; |
588 | 590 | ||
589 | class ShowIncidenceVisitor : public CalendarViewVisitor | 591 | class ShowIncidenceVisitor : public CalendarViewVisitor |
590 | { | 592 | { |
591 | protected: | 593 | protected: |
592 | bool visit( Event *event ) { mView->showEvent( event ); return true; } | 594 | bool visit( Event *event ) { mView->showEvent( event ); return true; } |
593 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } | 595 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } |
594 | bool visit( Journal * j ) { mView->showJournal( j );return true; } | 596 | bool visit( Journal * j ) { mView->showJournal( j );return true; } |
595 | }; | 597 | }; |
596 | 598 | ||
597 | class EditIncidenceVisitor : public CalendarViewVisitor | 599 | class EditIncidenceVisitor : public CalendarViewVisitor |
598 | { | 600 | { |
599 | protected: | 601 | protected: |
600 | bool visit( Event *event ) { mView->editEvent( event ); return true; } | 602 | bool visit( Event *event ) { mView->editEvent( event ); return true; } |
601 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } | 603 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } |
602 | bool visit( Journal *j ) { mView->editJournal( j); return true; } | 604 | bool visit( Journal *j ) { mView->editJournal( j); return true; } |
603 | }; | 605 | }; |
604 | 606 | ||
605 | class DeleteIncidenceVisitor : public CalendarViewVisitor | 607 | class DeleteIncidenceVisitor : public CalendarViewVisitor |
606 | { | 608 | { |
607 | protected: | 609 | protected: |
608 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } | 610 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } |
609 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } | 611 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } |
610 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } | 612 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } |
611 | }; | 613 | }; |
612 | 614 | ||
613 | #endif | 615 | #endif |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 3feb4ab..a2c20a8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,773 +1,775 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "klocale.h" | 60 | #include "klocale.h" |
61 | #include "kconfig.h" | 61 | #include "kconfig.h" |
62 | #include "simplealarmclient.h" | 62 | #include "simplealarmclient.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | 64 | ||
65 | using namespace KCal; | 65 | using namespace KCal; |
66 | #ifndef _WIN32_ | 66 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #else | 68 | #else |
69 | #ifdef _OL_IMPORT_ | 69 | #ifdef _OL_IMPORT_ |
70 | #include "koimportoldialog.h" | 70 | #include "koimportoldialog.h" |
71 | #endif | 71 | #endif |
72 | #endif | 72 | #endif |
73 | #include "mainwindow.h" | 73 | #include "mainwindow.h" |
74 | 74 | ||
75 | class KOex2phonePrefs : public QDialog | 75 | class KOex2phonePrefs : public QDialog |
76 | { | 76 | { |
77 | public: | 77 | public: |
78 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 78 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
79 | QDialog( parent, name, true ) | 79 | QDialog( parent, name, true ) |
80 | { | 80 | { |
81 | setCaption( i18n("Export to phone options") ); | 81 | setCaption( i18n("Export to phone options") ); |
82 | QVBoxLayout* lay = new QVBoxLayout( this ); | 82 | QVBoxLayout* lay = new QVBoxLayout( this ); |
83 | lay->setSpacing( 3 ); | 83 | lay->setSpacing( 3 ); |
84 | lay->setMargin( 3 ); | 84 | lay->setMargin( 3 ); |
85 | QLabel *lab; | 85 | QLabel *lab; |
86 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 86 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
87 | lab->setAlignment (AlignHCenter ); | 87 | lab->setAlignment (AlignHCenter ); |
88 | QHBox* temphb; | 88 | QHBox* temphb; |
89 | temphb = new QHBox( this ); | 89 | temphb = new QHBox( this ); |
90 | new QLabel( i18n("I/O device: "), temphb ); | 90 | new QLabel( i18n("I/O device: "), temphb ); |
91 | mPhoneDevice = new QLineEdit( temphb); | 91 | mPhoneDevice = new QLineEdit( temphb); |
92 | lay->addWidget( temphb ); | 92 | lay->addWidget( temphb ); |
93 | temphb = new QHBox( this ); | 93 | temphb = new QHBox( this ); |
94 | new QLabel( i18n("Connection: "), temphb ); | 94 | new QLabel( i18n("Connection: "), temphb ); |
95 | mPhoneConnection = new QLineEdit( temphb); | 95 | mPhoneConnection = new QLineEdit( temphb); |
96 | lay->addWidget( temphb ); | 96 | lay->addWidget( temphb ); |
97 | temphb = new QHBox( this ); | 97 | temphb = new QHBox( this ); |
98 | new QLabel( i18n("Model(opt.): "), temphb ); | 98 | new QLabel( i18n("Model(opt.): "), temphb ); |
99 | mPhoneModel = new QLineEdit( temphb); | 99 | mPhoneModel = new QLineEdit( temphb); |
100 | lay->addWidget( temphb ); | 100 | lay->addWidget( temphb ); |
101 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 101 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
102 | mWriteBackFuture->setChecked( true ); | 102 | mWriteBackFuture->setChecked( true ); |
103 | lay->addWidget( mWriteBackFuture ); | 103 | lay->addWidget( mWriteBackFuture ); |
104 | temphb = new QHBox( this ); | 104 | temphb = new QHBox( this ); |
105 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 105 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
106 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 106 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
107 | mWriteBackFutureWeeks->setValue( 8 ); | 107 | mWriteBackFutureWeeks->setValue( 8 ); |
108 | lay->addWidget( temphb ); | 108 | lay->addWidget( temphb ); |
109 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 109 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
110 | lab->setAlignment (AlignHCenter ); | 110 | lab->setAlignment (AlignHCenter ); |
111 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 111 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
112 | lay->addWidget( ok ); | 112 | lay->addWidget( ok ); |
113 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 113 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
114 | lay->addWidget( cancel ); | 114 | lay->addWidget( cancel ); |
115 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 115 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
116 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 116 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
117 | resize( 220, 240 ); | 117 | resize( 220, 240 ); |
118 | qApp->processEvents(); | 118 | qApp->processEvents(); |
119 | int dw = QApplication::desktop()->width(); | 119 | int dw = QApplication::desktop()->width(); |
120 | int dh = QApplication::desktop()->height(); | 120 | int dh = QApplication::desktop()->height(); |
121 | move( (dw-width())/2, (dh - height() )/2 ); | 121 | move( (dw-width())/2, (dh - height() )/2 ); |
122 | } | 122 | } |
123 | 123 | ||
124 | public: | 124 | public: |
125 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 125 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
126 | QCheckBox* mWriteBackFuture; | 126 | QCheckBox* mWriteBackFuture; |
127 | QSpinBox* mWriteBackFutureWeeks; | 127 | QSpinBox* mWriteBackFutureWeeks; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | int globalFlagBlockStartup; | 130 | int globalFlagBlockStartup; |
131 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 131 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
132 | QMainWindow( parent, name ) | 132 | QMainWindow( parent, name ) |
133 | { | 133 | { |
134 | 134 | ||
135 | #ifdef DESKTOP_VERSION | 135 | #ifdef DESKTOP_VERSION |
136 | setFont( QFont("Arial"), 14 ); | 136 | setFont( QFont("Arial"), 14 ); |
137 | #endif | 137 | #endif |
138 | mClosed = false; | 138 | mClosed = false; |
139 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 139 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
140 | QString confFile = locateLocal("config","korganizerrc"); | 140 | QString confFile = locateLocal("config","korganizerrc"); |
141 | QFileInfo finf ( confFile ); | 141 | QFileInfo finf ( confFile ); |
142 | bool showWarning = !finf.exists(); | 142 | bool showWarning = !finf.exists(); |
143 | setIcon(SmallIcon( "ko24" ) ); | 143 | setIcon(SmallIcon( "ko24" ) ); |
144 | mBlockAtStartup = true; | 144 | mBlockAtStartup = true; |
145 | mFlagKeyPressed = false; | 145 | mFlagKeyPressed = false; |
146 | setCaption("KOrganizer/Pi"); | 146 | setCaption("KOrganizer/Pi"); |
147 | KOPrefs *p = KOPrefs::instance(); | 147 | KOPrefs *p = KOPrefs::instance(); |
148 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 148 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
149 | if ( p->mHourSize > 18 ) | 149 | if ( p->mHourSize > 18 ) |
150 | p->mHourSize = 18; | 150 | p->mHourSize = 18; |
151 | QMainWindow::ToolBarDock tbd; | 151 | QMainWindow::ToolBarDock tbd; |
152 | if ( p->mToolBarHor ) { | 152 | if ( p->mToolBarHor ) { |
153 | if ( p->mToolBarUp ) | 153 | if ( p->mToolBarUp ) |
154 | tbd = Bottom; | 154 | tbd = Bottom; |
155 | else | 155 | else |
156 | tbd = Top; | 156 | tbd = Top; |
157 | } | 157 | } |
158 | else { | 158 | else { |
159 | if ( p->mToolBarUp ) | 159 | if ( p->mToolBarUp ) |
160 | tbd = Right; | 160 | tbd = Right; |
161 | else | 161 | else |
162 | tbd = Left; | 162 | tbd = Left; |
163 | } | 163 | } |
164 | if ( KOPrefs::instance()->mUseAppColors ) | 164 | if ( KOPrefs::instance()->mUseAppColors ) |
165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
166 | globalFlagBlockStartup = 1; | 166 | globalFlagBlockStartup = 1; |
167 | iconToolBar = new QPEToolBar( this ); | 167 | iconToolBar = new QPEToolBar( this ); |
168 | addToolBar (iconToolBar , tbd ); | 168 | addToolBar (iconToolBar , tbd ); |
169 | mCalendarModifiedFlag = false; | 169 | mCalendarModifiedFlag = false; |
170 | 170 | ||
171 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 171 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
172 | splash->setAlignment ( AlignCenter ); | 172 | splash->setAlignment ( AlignCenter ); |
173 | setCentralWidget( splash ); | 173 | setCentralWidget( splash ); |
174 | #ifndef DESKTOP_VERSION | 174 | #ifndef DESKTOP_VERSION |
175 | showMaximized(); | 175 | showMaximized(); |
176 | #endif | 176 | #endif |
177 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 177 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
178 | setDefaultPreferences(); | 178 | setDefaultPreferences(); |
179 | mCalendar = new CalendarLocal(); | 179 | mCalendar = new CalendarLocal(); |
180 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 180 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
181 | mView->hide(); | 181 | mView->hide(); |
182 | //mView->resize(splash->size() ); | 182 | //mView->resize(splash->size() ); |
183 | initActions(); | 183 | initActions(); |
184 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 184 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
185 | mSyncManager->setBlockSave(false); | 185 | mSyncManager->setBlockSave(false); |
186 | mView->setSyncManager(mSyncManager); | 186 | mView->setSyncManager(mSyncManager); |
187 | #ifndef DESKTOP_VERSION | 187 | #ifndef DESKTOP_VERSION |
188 | iconToolBar->show(); | 188 | iconToolBar->show(); |
189 | qApp->processEvents(); | 189 | qApp->processEvents(); |
190 | #endif | 190 | #endif |
191 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 191 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
192 | int vh = height() ; | 192 | int vh = height() ; |
193 | int vw = width(); | 193 | int vw = width(); |
194 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 194 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
195 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 195 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
196 | vh -= iconToolBar->height(); | 196 | vh -= iconToolBar->height(); |
197 | } else { | 197 | } else { |
198 | vw -= iconToolBar->height(); | 198 | vw -= iconToolBar->height(); |
199 | } | 199 | } |
200 | //mView->setMaximumSize( splash->size() ); | 200 | //mView->setMaximumSize( splash->size() ); |
201 | //mView->resize( splash->size() ); | 201 | //mView->resize( splash->size() ); |
202 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 202 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
203 | mView->readSettings(); | 203 | mView->readSettings(); |
204 | bool newFile = false; | 204 | bool newFile = false; |
205 | if( !QFile::exists( defaultFileName() ) ) { | 205 | if( !QFile::exists( defaultFileName() ) ) { |
206 | QFileInfo finfo ( defaultFileName() ); | 206 | QFileInfo finfo ( defaultFileName() ); |
207 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 207 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
208 | qDebug("oldfile %s ", oldFile.latin1()); | 208 | qDebug("oldfile %s ", oldFile.latin1()); |
209 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 209 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
210 | finfo.setFile( oldFile ); | 210 | finfo.setFile( oldFile ); |
211 | if (finfo.exists() ) { | 211 | if (finfo.exists() ) { |
212 | KMessageBox::information( this, message); | 212 | KMessageBox::information( this, message); |
213 | mView->openCalendar( oldFile ); | 213 | mView->openCalendar( oldFile ); |
214 | qApp->processEvents(); | 214 | qApp->processEvents(); |
215 | } else { | 215 | } else { |
216 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 216 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
217 | finfo.setFile( oldFile ); | 217 | finfo.setFile( oldFile ); |
218 | if (finfo.exists() ) { | 218 | if (finfo.exists() ) { |
219 | KMessageBox::information( this, message); | 219 | KMessageBox::information( this, message); |
220 | mView->openCalendar( oldFile ); | 220 | mView->openCalendar( oldFile ); |
221 | qApp->processEvents(); | 221 | qApp->processEvents(); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | mView->saveCalendar( defaultFileName() ); | 224 | mView->saveCalendar( defaultFileName() ); |
225 | newFile = true; | 225 | newFile = true; |
226 | } | 226 | } |
227 | 227 | ||
228 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 228 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
229 | mView->openCalendar( defaultFileName() ); | 229 | mView->openCalendar( defaultFileName() ); |
230 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 230 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
231 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 231 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
232 | 232 | ||
233 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 233 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
234 | KOPrefs::instance()->setCategoryDefaults(); | 234 | KOPrefs::instance()->setCategoryDefaults(); |
235 | int count = mView->addCategories(); | 235 | int count = mView->addCategories(); |
236 | } | 236 | } |
237 | processIncidenceSelection( 0 ); | 237 | processIncidenceSelection( 0 ); |
238 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 238 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
239 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 239 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
240 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 240 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
241 | SLOT( slotModifiedChanged( bool ) ) ); | 241 | SLOT( slotModifiedChanged( bool ) ) ); |
242 | 242 | ||
243 | 243 | ||
244 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 244 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
245 | SLOT( disableBR(bool) ) ); | 245 | SLOT( disableBR(bool) ) ); |
246 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 246 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | mBlockAtStartup = false; | 248 | mBlockAtStartup = false; |
249 | mView->setModified( false ); | 249 | mView->setModified( false ); |
250 | setCentralWidget( mView ); | 250 | setCentralWidget( mView ); |
251 | globalFlagBlockStartup = 0; | 251 | globalFlagBlockStartup = 0; |
252 | mView->show(); | 252 | mView->show(); |
253 | delete splash; | 253 | delete splash; |
254 | if ( newFile ) | 254 | if ( newFile ) |
255 | mView->updateConfig(); | 255 | mView->updateConfig(); |
256 | // qApp->processEvents(); | 256 | // qApp->processEvents(); |
257 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 257 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
258 | //fillSyncMenu(); | 258 | //fillSyncMenu(); |
259 | 259 | ||
260 | 260 | ||
261 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 261 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
262 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | ||
263 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | ||
262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 264 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 265 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
264 | mSyncManager->setDefaultFileName( defaultFileName()); | 266 | mSyncManager->setDefaultFileName( defaultFileName()); |
265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 267 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
266 | mSyncManager->fillSyncMenu(); | 268 | mSyncManager->fillSyncMenu(); |
267 | 269 | ||
268 | 270 | ||
269 | 271 | ||
270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 272 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
271 | if ( showWarning ) { | 273 | if ( showWarning ) { |
272 | KMessageBox::information( this, | 274 | KMessageBox::information( this, |
273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 275 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
274 | qApp->processEvents(); | 276 | qApp->processEvents(); |
275 | mView->dialogManager()->showSyncOptions(); | 277 | mView->dialogManager()->showSyncOptions(); |
276 | } | 278 | } |
277 | 279 | ||
278 | //US listen for result adressed from Ka/Pi | 280 | //US listen for result adressed from Ka/Pi |
279 | #ifndef DESKTOP_VERSION | 281 | #ifndef DESKTOP_VERSION |
280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 282 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
281 | #endif | 283 | #endif |
282 | #ifndef DESKTOP_VERSION | 284 | #ifndef DESKTOP_VERSION |
283 | infrared = 0; | 285 | infrared = 0; |
284 | #endif | 286 | #endif |
285 | 287 | ||
286 | mBRdisabled = false; | 288 | mBRdisabled = false; |
287 | //toggleBeamReceive(); | 289 | //toggleBeamReceive(); |
288 | } | 290 | } |
289 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
290 | { | 292 | { |
291 | //qDebug("MainWindow::~MainWindow() "); | 293 | //qDebug("MainWindow::~MainWindow() "); |
292 | //save toolbar location | 294 | //save toolbar location |
293 | delete mCalendar; | 295 | delete mCalendar; |
294 | delete mSyncManager; | 296 | delete mSyncManager; |
295 | #ifndef DESKTOP_VERSION | 297 | #ifndef DESKTOP_VERSION |
296 | if ( infrared ) | 298 | if ( infrared ) |
297 | delete infrared; | 299 | delete infrared; |
298 | #endif | 300 | #endif |
299 | 301 | ||
300 | 302 | ||
301 | } | 303 | } |
302 | 304 | ||
303 | void MainWindow::disableBR(bool b) | 305 | void MainWindow::disableBR(bool b) |
304 | { | 306 | { |
305 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
306 | if ( b ) { | 308 | if ( b ) { |
307 | if ( infrared ) { | 309 | if ( infrared ) { |
308 | toggleBeamReceive(); | 310 | toggleBeamReceive(); |
309 | mBRdisabled = true; | 311 | mBRdisabled = true; |
310 | } | 312 | } |
311 | mBRdisabled = true; | 313 | mBRdisabled = true; |
312 | } else { | 314 | } else { |
313 | if ( mBRdisabled ) { | 315 | if ( mBRdisabled ) { |
314 | mBRdisabled = false; | 316 | mBRdisabled = false; |
315 | //makes no sense,because other cal ap is probably running | 317 | //makes no sense,because other cal ap is probably running |
316 | // toggleBeamReceive(); | 318 | // toggleBeamReceive(); |
317 | } | 319 | } |
318 | } | 320 | } |
319 | #endif | 321 | #endif |
320 | 322 | ||
321 | } | 323 | } |
322 | bool MainWindow::beamReceiveEnabled() | 324 | bool MainWindow::beamReceiveEnabled() |
323 | { | 325 | { |
324 | #ifndef DESKTOP_VERSION | 326 | #ifndef DESKTOP_VERSION |
325 | return ( infrared != 0 ); | 327 | return ( infrared != 0 ); |
326 | #endif | 328 | #endif |
327 | return false; | 329 | return false; |
328 | } | 330 | } |
329 | 331 | ||
330 | void MainWindow::toggleBeamReceive() | 332 | void MainWindow::toggleBeamReceive() |
331 | { | 333 | { |
332 | if ( mBRdisabled ) | 334 | if ( mBRdisabled ) |
333 | return; | 335 | return; |
334 | #ifndef DESKTOP_VERSION | 336 | #ifndef DESKTOP_VERSION |
335 | if ( infrared ) { | 337 | if ( infrared ) { |
336 | qDebug("disable BeamReceive "); | 338 | qDebug("disable BeamReceive "); |
337 | delete infrared; | 339 | delete infrared; |
338 | infrared = 0; | 340 | infrared = 0; |
339 | brAction->setOn(false); | 341 | brAction->setOn(false); |
340 | return; | 342 | return; |
341 | } | 343 | } |
342 | qDebug("enable BeamReceive "); | 344 | qDebug("enable BeamReceive "); |
343 | brAction->setOn(true); | 345 | brAction->setOn(true); |
344 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
345 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
346 | #endif | 348 | #endif |
347 | } | 349 | } |
348 | void MainWindow::showMaximized () | 350 | void MainWindow::showMaximized () |
349 | { | 351 | { |
350 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
351 | if ( ! globalFlagBlockStartup ) | 353 | if ( ! globalFlagBlockStartup ) |
352 | if ( mClosed ) | 354 | if ( mClosed ) |
353 | mView->goToday(); | 355 | mView->goToday(); |
354 | #endif | 356 | #endif |
355 | QWidget::showMaximized () ; | 357 | QWidget::showMaximized () ; |
356 | mClosed = false; | 358 | mClosed = false; |
357 | } | 359 | } |
358 | void MainWindow::closeEvent( QCloseEvent* ce ) | 360 | void MainWindow::closeEvent( QCloseEvent* ce ) |
359 | { | 361 | { |
360 | 362 | ||
361 | 363 | ||
362 | 364 | ||
363 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 365 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
364 | saveOnClose(); | 366 | saveOnClose(); |
365 | mClosed = true; | 367 | mClosed = true; |
366 | ce->accept(); | 368 | ce->accept(); |
367 | return; | 369 | return; |
368 | 370 | ||
369 | } | 371 | } |
370 | 372 | ||
371 | switch( QMessageBox::information( this, "KO/Pi", | 373 | switch( QMessageBox::information( this, "KO/Pi", |
372 | i18n("Do you really want\nto close KO/Pi?"), | 374 | i18n("Do you really want\nto close KO/Pi?"), |
373 | i18n("Close"), i18n("No"), | 375 | i18n("Close"), i18n("No"), |
374 | 0, 0 ) ) { | 376 | 0, 0 ) ) { |
375 | case 0: | 377 | case 0: |
376 | saveOnClose(); | 378 | saveOnClose(); |
377 | mClosed = true; | 379 | mClosed = true; |
378 | ce->accept(); | 380 | ce->accept(); |
379 | break; | 381 | break; |
380 | case 1: | 382 | case 1: |
381 | ce->ignore(); | 383 | ce->ignore(); |
382 | break; | 384 | break; |
383 | case 2: | 385 | case 2: |
384 | 386 | ||
385 | default: | 387 | default: |
386 | break; | 388 | break; |
387 | } | 389 | } |
388 | 390 | ||
389 | 391 | ||
390 | } | 392 | } |
391 | 393 | ||
392 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
393 | { | 395 | { |
394 | QDataStream stream( data, IO_ReadOnly ); | 396 | QDataStream stream( data, IO_ReadOnly ); |
395 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
396 | //QString datamess; | 398 | //QString datamess; |
397 | //qDebug("message "); | 399 | //qDebug("message "); |
398 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
399 | 401 | ||
400 | if ( cmsg == "setDocument(QString)" ) { | 402 | if ( cmsg == "setDocument(QString)" ) { |
401 | QDataStream stream( data, IO_ReadOnly ); | 403 | QDataStream stream( data, IO_ReadOnly ); |
402 | QString fileName; | 404 | QString fileName; |
403 | stream >> fileName; | 405 | stream >> fileName; |
404 | //qDebug("filename %s ", fileName.latin1()); | 406 | //qDebug("filename %s ", fileName.latin1()); |
405 | showMaximized(); | 407 | showMaximized(); |
406 | raise(); | 408 | raise(); |
407 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
408 | mSyncManager->slotSyncMenu( 1002 ); | 410 | mSyncManager->slotSyncMenu( 1002 ); |
409 | return; | 411 | return; |
410 | } | 412 | } |
411 | 413 | ||
412 | if ( cmsg == "-writeFile" ) { | 414 | if ( cmsg == "-writeFile" ) { |
413 | // I made from the "-writeFile" an "-writeAlarm" | 415 | // I made from the "-writeFile" an "-writeAlarm" |
414 | mView->viewManager()->showWhatsNextView(); | 416 | mView->viewManager()->showWhatsNextView(); |
415 | mCalendar->checkAlarmForIncidence( 0, true); | 417 | mCalendar->checkAlarmForIncidence( 0, true); |
416 | showMaximized(); | 418 | showMaximized(); |
417 | raise(); | 419 | raise(); |
418 | return; | 420 | return; |
419 | 421 | ||
420 | } | 422 | } |
421 | if ( cmsg == "-writeFileSilent" ) { | 423 | if ( cmsg == "-writeFileSilent" ) { |
422 | // I made from the "-writeFile" an "-writeAlarm" | 424 | // I made from the "-writeFile" an "-writeAlarm" |
423 | // mView->viewManager()->showWhatsNextView(); | 425 | // mView->viewManager()->showWhatsNextView(); |
424 | mCalendar->checkAlarmForIncidence( 0, true); | 426 | mCalendar->checkAlarmForIncidence( 0, true); |
425 | //showMaximized(); | 427 | //showMaximized(); |
426 | //raise(); | 428 | //raise(); |
427 | hide(); | 429 | hide(); |
428 | return; | 430 | return; |
429 | } | 431 | } |
430 | if ( cmsg == "-newCountdown" ) { | 432 | if ( cmsg == "-newCountdown" ) { |
431 | qDebug("newCountdown "); | 433 | qDebug("newCountdown "); |
432 | 434 | ||
433 | } | 435 | } |
434 | QString msg ; | 436 | QString msg ; |
435 | QString allmsg = cmsg; | 437 | QString allmsg = cmsg; |
436 | while ( allmsg.length() > 0 ) { | 438 | while ( allmsg.length() > 0 ) { |
437 | int nextC = allmsg.find( "-", 1 ); | 439 | int nextC = allmsg.find( "-", 1 ); |
438 | if ( nextC == -1 ) { | 440 | if ( nextC == -1 ) { |
439 | msg = allmsg; | 441 | msg = allmsg; |
440 | allmsg = ""; | 442 | allmsg = ""; |
441 | } else{ | 443 | } else{ |
442 | msg = allmsg.left( nextC ); | 444 | msg = allmsg.left( nextC ); |
443 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
444 | } | 446 | } |
445 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
446 | if ( msg == "-newEvent" ) { | 448 | if ( msg == "-newEvent" ) { |
447 | mView->newEvent(); | 449 | mView->newEvent(); |
448 | } | 450 | } |
449 | if ( msg == "-newTodo" ) { | 451 | if ( msg == "-newTodo" ) { |
450 | mView->newTodo(); | 452 | mView->newTodo(); |
451 | 453 | ||
452 | } | 454 | } |
453 | if ( msg == "-showWN" ) { | 455 | if ( msg == "-showWN" ) { |
454 | mView->viewManager()->showWhatsNextView(); | 456 | mView->viewManager()->showWhatsNextView(); |
455 | } | 457 | } |
456 | if ( msg == "-showTodo" ) { | 458 | if ( msg == "-showTodo" ) { |
457 | mView->viewManager()->showTodoView(); | 459 | mView->viewManager()->showTodoView(); |
458 | } | 460 | } |
459 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
460 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
461 | } | 463 | } |
462 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
463 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
464 | } | 466 | } |
465 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
466 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
467 | } | 469 | } |
468 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
469 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
470 | } | 472 | } |
471 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
472 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
473 | } | 475 | } |
474 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
475 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
476 | } | 478 | } |
477 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
478 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
479 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
480 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
481 | } | 483 | } |
482 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
483 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
484 | } | 486 | } |
485 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
486 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
487 | } | 489 | } |
488 | else if ( msg == "-showNextXView" ) { | 490 | else if ( msg == "-showNextXView" ) { |
489 | mView->viewManager()->showNextXView(); | 491 | mView->viewManager()->showNextXView(); |
490 | } | 492 | } |
491 | 493 | ||
492 | 494 | ||
493 | } | 495 | } |
494 | 496 | ||
495 | showMaximized(); | 497 | showMaximized(); |
496 | raise(); | 498 | raise(); |
497 | } | 499 | } |
498 | 500 | ||
499 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
500 | { | 502 | { |
501 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
502 | 504 | ||
503 | } | 505 | } |
504 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
505 | { | 507 | { |
506 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
507 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
508 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
509 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
510 | 512 | ||
511 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
512 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
513 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
514 | selectFilterMenu = new QPopupMenu( this ); | 516 | selectFilterMenu = new QPopupMenu( this ); |
515 | selectFilterMenu->setCheckable( true ); | 517 | selectFilterMenu->setCheckable( true ); |
516 | syncMenu = new QPopupMenu( this ); | 518 | syncMenu = new QPopupMenu( this ); |
517 | configureAgendaMenu = new QPopupMenu( this ); | 519 | configureAgendaMenu = new QPopupMenu( this ); |
518 | configureToolBarMenu = new QPopupMenu( this ); | 520 | configureToolBarMenu = new QPopupMenu( this ); |
519 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 521 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
520 | if ( KOPrefs::instance()->mShowFullMenu ) { | 522 | if ( KOPrefs::instance()->mShowFullMenu ) { |
521 | QMenuBar *menuBar1; | 523 | QMenuBar *menuBar1; |
522 | menuBar1 = menuBar(); | 524 | menuBar1 = menuBar(); |
523 | menuBar1->insertItem( i18n("File"), importMenu ); | 525 | menuBar1->insertItem( i18n("File"), importMenu ); |
524 | menuBar1->insertItem( i18n("View"), viewMenu ); | 526 | menuBar1->insertItem( i18n("View"), viewMenu ); |
525 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 527 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
526 | #ifdef DESKTOP_VERSION | 528 | #ifdef DESKTOP_VERSION |
527 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 529 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
528 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 530 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
529 | #else | 531 | #else |
530 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 532 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
531 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 533 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
532 | #endif | 534 | #endif |
533 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 535 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
534 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 536 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
535 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 537 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
536 | } else { | 538 | } else { |
537 | QPEMenuBar *menuBar1; | 539 | QPEMenuBar *menuBar1; |
538 | menuBar1 = new QPEMenuBar( iconToolBar ); | 540 | menuBar1 = new QPEMenuBar( iconToolBar ); |
539 | QPopupMenu *menuBar = new QPopupMenu( this ); | 541 | QPopupMenu *menuBar = new QPopupMenu( this ); |
540 | menuBar1->insertItem( i18n("ME"), menuBar); | 542 | menuBar1->insertItem( i18n("ME"), menuBar); |
541 | menuBar->insertItem( i18n("File"), importMenu ); | 543 | menuBar->insertItem( i18n("File"), importMenu ); |
542 | menuBar->insertItem( i18n("View"), viewMenu ); | 544 | menuBar->insertItem( i18n("View"), viewMenu ); |
543 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 545 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
544 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 546 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
545 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 547 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
546 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 548 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
547 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 549 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
548 | menuBar->insertItem( i18n("Help"), helpMenu ); | 550 | menuBar->insertItem( i18n("Help"), helpMenu ); |
549 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 551 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
550 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 552 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
551 | } | 553 | } |
552 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 554 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
553 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 555 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
554 | 556 | ||
555 | // ****************** | 557 | // ****************** |
556 | QAction *action; | 558 | QAction *action; |
557 | QIconSet icon; | 559 | QIconSet icon; |
558 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 560 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
559 | configureToolBarMenu->setCheckable( true ); | 561 | configureToolBarMenu->setCheckable( true ); |
560 | 562 | ||
561 | QString pathString = ""; | 563 | QString pathString = ""; |
562 | if ( !p->mToolBarMiniIcons ) { | 564 | if ( !p->mToolBarMiniIcons ) { |
563 | if ( QApplication::desktop()->width() < 480 ) | 565 | if ( QApplication::desktop()->width() < 480 ) |
564 | pathString += "icons16/"; | 566 | pathString += "icons16/"; |
565 | } else | 567 | } else |
566 | pathString += "iconsmini/"; | 568 | pathString += "iconsmini/"; |
567 | configureAgendaMenu->setCheckable( true ); | 569 | configureAgendaMenu->setCheckable( true ); |
568 | int iii ; | 570 | int iii ; |
569 | for ( iii = 1;iii<= 10 ;++iii ){ | 571 | for ( iii = 1;iii<= 10 ;++iii ){ |
570 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 572 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
571 | } | 573 | } |
572 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 574 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
573 | 575 | ||
574 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 576 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
575 | this, SLOT( showConfigureAgenda( ) ) ); | 577 | this, SLOT( showConfigureAgenda( ) ) ); |
576 | 578 | ||
577 | icon = loadPixmap( pathString + "configure" ); | 579 | icon = loadPixmap( pathString + "configure" ); |
578 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 580 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
579 | action->addTo( actionMenu ); | 581 | action->addTo( actionMenu ); |
580 | connect( action, SIGNAL( activated() ), | 582 | connect( action, SIGNAL( activated() ), |
581 | mView, SLOT( edit_options() ) ); | 583 | mView, SLOT( edit_options() ) ); |
582 | actionMenu->insertSeparator(); | 584 | actionMenu->insertSeparator(); |
583 | 585 | ||
584 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 586 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
585 | action->addTo( actionMenu ); | 587 | action->addTo( actionMenu ); |
586 | connect( action, SIGNAL( activated() ), | 588 | connect( action, SIGNAL( activated() ), |
587 | mView, SLOT( undo_delete() ) ); | 589 | mView, SLOT( undo_delete() ) ); |
588 | actionMenu->insertSeparator(); | 590 | actionMenu->insertSeparator(); |
589 | 591 | ||
590 | icon = loadPixmap( pathString + "newevent" ); | 592 | icon = loadPixmap( pathString + "newevent" ); |
591 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 593 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
592 | configureToolBarMenu->insertSeparator(); | 594 | configureToolBarMenu->insertSeparator(); |
593 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 595 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
594 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 596 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
595 | ne_action->addTo( actionMenu ); | 597 | ne_action->addTo( actionMenu ); |
596 | connect( ne_action, SIGNAL( activated() ), | 598 | connect( ne_action, SIGNAL( activated() ), |
597 | mView, SLOT( newEvent() ) ); | 599 | mView, SLOT( newEvent() ) ); |
598 | icon = loadPixmap( pathString + "newtodo" ); | 600 | icon = loadPixmap( pathString + "newtodo" ); |
599 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 601 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
600 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 602 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
601 | nt_action->addTo( actionMenu ); | 603 | nt_action->addTo( actionMenu ); |
602 | connect( nt_action, SIGNAL( activated() ), | 604 | connect( nt_action, SIGNAL( activated() ), |
603 | mView, SLOT( newTodo() ) ); | 605 | mView, SLOT( newTodo() ) ); |
604 | 606 | ||
605 | icon = loadPixmap( pathString + "today" ); | 607 | icon = loadPixmap( pathString + "today" ); |
606 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 608 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
607 | today_action->addTo( viewMenu ); | 609 | today_action->addTo( viewMenu ); |
608 | connect( today_action, SIGNAL( activated() ), | 610 | connect( today_action, SIGNAL( activated() ), |
609 | mView, SLOT( goToday() ) ); | 611 | mView, SLOT( goToday() ) ); |
610 | viewMenu->insertSeparator(); | 612 | viewMenu->insertSeparator(); |
611 | 613 | ||
612 | icon = loadPixmap( pathString + "navi" ); | 614 | icon = loadPixmap( pathString + "navi" ); |
613 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 615 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
614 | action->addTo( viewMenu ); | 616 | action->addTo( viewMenu ); |
615 | connect( action, SIGNAL( activated() ), | 617 | connect( action, SIGNAL( activated() ), |
616 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 618 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
617 | mToggleNav = action ; | 619 | mToggleNav = action ; |
618 | icon = loadPixmap( pathString + "filter" ); | 620 | icon = loadPixmap( pathString + "filter" ); |
619 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 621 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
620 | action->addTo( viewMenu ); | 622 | action->addTo( viewMenu ); |
621 | connect( action, SIGNAL( activated() ), | 623 | connect( action, SIGNAL( activated() ), |
622 | mView, SLOT( toggleFilter() ) ); | 624 | mView, SLOT( toggleFilter() ) ); |
623 | mToggleFilter = action; | 625 | mToggleFilter = action; |
624 | icon = loadPixmap( pathString + "allday" ); | 626 | icon = loadPixmap( pathString + "allday" ); |
625 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 627 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
626 | action->addTo( viewMenu ); | 628 | action->addTo( viewMenu ); |
627 | connect( action, SIGNAL( activated() ), | 629 | connect( action, SIGNAL( activated() ), |
628 | mView, SLOT( toggleAllDaySize() ) ); | 630 | mView, SLOT( toggleAllDaySize() ) ); |
629 | mToggleAllday = action; | 631 | mToggleAllday = action; |
630 | 632 | ||
631 | 633 | ||
632 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 634 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
633 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 635 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
634 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 636 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
635 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 637 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
636 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 638 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
637 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 639 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
638 | 640 | ||
639 | viewMenu->insertSeparator(); | 641 | viewMenu->insertSeparator(); |
640 | icon = loadPixmap( pathString + "picker" ); | 642 | icon = loadPixmap( pathString + "picker" ); |
641 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 643 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
642 | action->addTo( viewMenu ); | 644 | action->addTo( viewMenu ); |
643 | connect( action, SIGNAL( activated() ), | 645 | connect( action, SIGNAL( activated() ), |
644 | mView, SLOT( showDatePicker() ) ); | 646 | mView, SLOT( showDatePicker() ) ); |
645 | action->addTo( iconToolBar ); | 647 | action->addTo( iconToolBar ); |
646 | viewMenu->insertSeparator(); | 648 | viewMenu->insertSeparator(); |
647 | icon = loadPixmap( pathString + "list" ); | 649 | icon = loadPixmap( pathString + "list" ); |
648 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 650 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
649 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 651 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
650 | showlist_action->addTo( viewMenu ); | 652 | showlist_action->addTo( viewMenu ); |
651 | connect( showlist_action, SIGNAL( activated() ), | 653 | connect( showlist_action, SIGNAL( activated() ), |
652 | mView->viewManager(), SLOT( showListView() ) ); | 654 | mView->viewManager(), SLOT( showListView() ) ); |
653 | 655 | ||
654 | 656 | ||
655 | icon = loadPixmap( pathString + "day" ); | 657 | icon = loadPixmap( pathString + "day" ); |
656 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 658 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
657 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 659 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
658 | day1_action->addTo( viewMenu ); | 660 | day1_action->addTo( viewMenu ); |
659 | // action->addTo( toolBar ); | 661 | // action->addTo( toolBar ); |
660 | connect( day1_action, SIGNAL( activated() ), | 662 | connect( day1_action, SIGNAL( activated() ), |
661 | mView->viewManager(), SLOT( showDayView() ) ); | 663 | mView->viewManager(), SLOT( showDayView() ) ); |
662 | 664 | ||
663 | icon = loadPixmap( pathString + "workweek" ); | 665 | icon = loadPixmap( pathString + "workweek" ); |
664 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 666 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
665 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 667 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
666 | day5_action->addTo( viewMenu ); | 668 | day5_action->addTo( viewMenu ); |
667 | connect( day5_action, SIGNAL( activated() ), | 669 | connect( day5_action, SIGNAL( activated() ), |
668 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 670 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
669 | 671 | ||
670 | icon = loadPixmap( pathString + "week" ); | 672 | icon = loadPixmap( pathString + "week" ); |
671 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 673 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
672 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 674 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
673 | day7_action->addTo( viewMenu ); | 675 | day7_action->addTo( viewMenu ); |
674 | connect( day7_action, SIGNAL( activated() ), | 676 | connect( day7_action, SIGNAL( activated() ), |
675 | mView->viewManager(), SLOT( showWeekView() ) ); | 677 | mView->viewManager(), SLOT( showWeekView() ) ); |
676 | 678 | ||
677 | icon = loadPixmap( pathString + "month" ); | 679 | icon = loadPixmap( pathString + "month" ); |
678 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 680 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
679 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 681 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
680 | month_action->addTo( viewMenu ); | 682 | month_action->addTo( viewMenu ); |
681 | connect( month_action, SIGNAL( activated() ), | 683 | connect( month_action, SIGNAL( activated() ), |
682 | mView->viewManager(), SLOT( showMonthView() ) ); | 684 | mView->viewManager(), SLOT( showMonthView() ) ); |
683 | 685 | ||
684 | icon = loadPixmap( pathString + "todo" ); | 686 | icon = loadPixmap( pathString + "todo" ); |
685 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 687 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
686 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 688 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
687 | todoview_action->addTo( viewMenu ); | 689 | todoview_action->addTo( viewMenu ); |
688 | connect( todoview_action, SIGNAL( activated() ), | 690 | connect( todoview_action, SIGNAL( activated() ), |
689 | mView->viewManager(), SLOT( showTodoView() ) ); | 691 | mView->viewManager(), SLOT( showTodoView() ) ); |
690 | 692 | ||
691 | icon = loadPixmap( pathString + "journal" ); | 693 | icon = loadPixmap( pathString + "journal" ); |
692 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 694 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
693 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 695 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
694 | viewjournal_action->addTo( viewMenu ); | 696 | viewjournal_action->addTo( viewMenu ); |
695 | connect( viewjournal_action, SIGNAL( activated() ), | 697 | connect( viewjournal_action, SIGNAL( activated() ), |
696 | mView->viewManager(), SLOT( showJournalView() ) ); | 698 | mView->viewManager(), SLOT( showJournalView() ) ); |
697 | 699 | ||
698 | icon = loadPixmap( pathString + "xdays" ); | 700 | icon = loadPixmap( pathString + "xdays" ); |
699 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 701 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
700 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 702 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
701 | xdays_action->addTo( viewMenu ); | 703 | xdays_action->addTo( viewMenu ); |
702 | connect( xdays_action, SIGNAL( activated() ), | 704 | connect( xdays_action, SIGNAL( activated() ), |
703 | mView->viewManager(), SLOT( showNextXView() ) ); | 705 | mView->viewManager(), SLOT( showNextXView() ) ); |
704 | 706 | ||
705 | icon = loadPixmap( pathString + "whatsnext" ); | 707 | icon = loadPixmap( pathString + "whatsnext" ); |
706 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 708 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
707 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 709 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
708 | whatsnext_action->addTo( viewMenu ); | 710 | whatsnext_action->addTo( viewMenu ); |
709 | connect( whatsnext_action, SIGNAL( activated() ), | 711 | connect( whatsnext_action, SIGNAL( activated() ), |
710 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 712 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
711 | 713 | ||
712 | #if 0 | 714 | #if 0 |
713 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 715 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
714 | action->addTo( viewMenu ); | 716 | action->addTo( viewMenu ); |
715 | connect( action, SIGNAL( activated() ), | 717 | connect( action, SIGNAL( activated() ), |
716 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 718 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
717 | #endif | 719 | #endif |
718 | 720 | ||
719 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 721 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
720 | this ); | 722 | this ); |
721 | mNewSubTodoAction->addTo( actionMenu ); | 723 | mNewSubTodoAction->addTo( actionMenu ); |
722 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 724 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
723 | mView, SLOT( newSubTodo() ) ); | 725 | mView, SLOT( newSubTodo() ) ); |
724 | 726 | ||
725 | actionMenu->insertSeparator(); | 727 | actionMenu->insertSeparator(); |
726 | 728 | ||
727 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 729 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
728 | mShowAction->addTo( actionMenu ); | 730 | mShowAction->addTo( actionMenu ); |
729 | connect( mShowAction, SIGNAL( activated() ), | 731 | connect( mShowAction, SIGNAL( activated() ), |
730 | mView, SLOT( showIncidence() ) ); | 732 | mView, SLOT( showIncidence() ) ); |
731 | 733 | ||
732 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 734 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
733 | mEditAction->addTo( actionMenu ); | 735 | mEditAction->addTo( actionMenu ); |
734 | connect( mEditAction, SIGNAL( activated() ), | 736 | connect( mEditAction, SIGNAL( activated() ), |
735 | mView, SLOT( editIncidence() ) ); | 737 | mView, SLOT( editIncidence() ) ); |
736 | 738 | ||
737 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 739 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
738 | mDeleteAction->addTo( actionMenu ); | 740 | mDeleteAction->addTo( actionMenu ); |
739 | connect( mDeleteAction, SIGNAL( activated() ), | 741 | connect( mDeleteAction, SIGNAL( activated() ), |
740 | mView, SLOT( deleteIncidence() ) ); | 742 | mView, SLOT( deleteIncidence() ) ); |
741 | 743 | ||
742 | 744 | ||
743 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 745 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
744 | mCloneAction->addTo( actionMenu ); | 746 | mCloneAction->addTo( actionMenu ); |
745 | connect( mCloneAction, SIGNAL( activated() ), | 747 | connect( mCloneAction, SIGNAL( activated() ), |
746 | mView, SLOT( cloneIncidence() ) ); | 748 | mView, SLOT( cloneIncidence() ) ); |
747 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 749 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
748 | mMoveAction->addTo( actionMenu ); | 750 | mMoveAction->addTo( actionMenu ); |
749 | connect( mMoveAction, SIGNAL( activated() ), | 751 | connect( mMoveAction, SIGNAL( activated() ), |
750 | mView, SLOT( moveIncidence() ) ); | 752 | mView, SLOT( moveIncidence() ) ); |
751 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 753 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
752 | mBeamAction->addTo( actionMenu ); | 754 | mBeamAction->addTo( actionMenu ); |
753 | connect( mBeamAction, SIGNAL( activated() ), | 755 | connect( mBeamAction, SIGNAL( activated() ), |
754 | mView, SLOT( beamIncidence() ) ); | 756 | mView, SLOT( beamIncidence() ) ); |
755 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 757 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
756 | mCancelAction->addTo( actionMenu ); | 758 | mCancelAction->addTo( actionMenu ); |
757 | connect( mCancelAction, SIGNAL( activated() ), | 759 | connect( mCancelAction, SIGNAL( activated() ), |
758 | mView, SLOT( toggleCancelIncidence() ) ); | 760 | mView, SLOT( toggleCancelIncidence() ) ); |
759 | 761 | ||
760 | actionMenu->insertSeparator(); | 762 | actionMenu->insertSeparator(); |
761 | 763 | ||
762 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 764 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
763 | this ); | 765 | this ); |
764 | action->addTo( actionMenu ); | 766 | action->addTo( actionMenu ); |
765 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 767 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
766 | 768 | ||
767 | icon = loadPixmap( pathString + "search" ); | 769 | icon = loadPixmap( pathString + "search" ); |
768 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 770 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
769 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 771 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
770 | search_action->addTo( actionMenu ); | 772 | search_action->addTo( actionMenu ); |
771 | connect( search_action, SIGNAL( activated() ), | 773 | connect( search_action, SIGNAL( activated() ), |
772 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 774 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
773 | 775 | ||
@@ -938,992 +940,1003 @@ void MainWindow::initActions() | |||
938 | 940 | ||
939 | // ****************************************************** | 941 | // ****************************************************** |
940 | // menubar icons | 942 | // menubar icons |
941 | 943 | ||
942 | 944 | ||
943 | iconToolBar->setHorizontalStretchable (true ); | 945 | iconToolBar->setHorizontalStretchable (true ); |
944 | //menuBar->insertItem( iconToolBar ); | 946 | //menuBar->insertItem( iconToolBar ); |
945 | //xdays_action | 947 | //xdays_action |
946 | if (p-> mShowIconNewEvent) | 948 | if (p-> mShowIconNewEvent) |
947 | ne_action->addTo( iconToolBar ); | 949 | ne_action->addTo( iconToolBar ); |
948 | if (p->mShowIconNewTodo ) | 950 | if (p->mShowIconNewTodo ) |
949 | nt_action->addTo( iconToolBar ); | 951 | nt_action->addTo( iconToolBar ); |
950 | if (p-> mShowIconSearch) | 952 | if (p-> mShowIconSearch) |
951 | search_action->addTo( iconToolBar ); | 953 | search_action->addTo( iconToolBar ); |
952 | if (p-> mShowIconNext) | 954 | if (p-> mShowIconNext) |
953 | whatsnext_action->addTo( iconToolBar ); | 955 | whatsnext_action->addTo( iconToolBar ); |
954 | if (p-> mShowIconNextDays) | 956 | if (p-> mShowIconNextDays) |
955 | xdays_action->addTo( iconToolBar ); | 957 | xdays_action->addTo( iconToolBar ); |
956 | if (p-> mShowIconList) | 958 | if (p-> mShowIconList) |
957 | showlist_action->addTo( iconToolBar ); | 959 | showlist_action->addTo( iconToolBar ); |
958 | if (p-> mShowIconDay1) | 960 | if (p-> mShowIconDay1) |
959 | day1_action->addTo( iconToolBar ); | 961 | day1_action->addTo( iconToolBar ); |
960 | if (p-> mShowIconDay5) | 962 | if (p-> mShowIconDay5) |
961 | day5_action->addTo( iconToolBar ); | 963 | day5_action->addTo( iconToolBar ); |
962 | if (p-> mShowIconDay7) | 964 | if (p-> mShowIconDay7) |
963 | day7_action->addTo( iconToolBar ); | 965 | day7_action->addTo( iconToolBar ); |
964 | if (p-> mShowIconMonth) | 966 | if (p-> mShowIconMonth) |
965 | month_action->addTo( iconToolBar ); | 967 | month_action->addTo( iconToolBar ); |
966 | if (p-> mShowIconTodoview) | 968 | if (p-> mShowIconTodoview) |
967 | todoview_action->addTo( iconToolBar ); | 969 | todoview_action->addTo( iconToolBar ); |
968 | if (p-> mShowIconJournal) | 970 | if (p-> mShowIconJournal) |
969 | viewjournal_action->addTo( iconToolBar ); | 971 | viewjournal_action->addTo( iconToolBar ); |
970 | icon = loadPixmap( pathString + "2leftarrowB" ); | 972 | icon = loadPixmap( pathString + "2leftarrowB" ); |
971 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 973 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
972 | if (p-> mShowIconBackFast) { | 974 | if (p-> mShowIconBackFast) { |
973 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 975 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
974 | connect( action, SIGNAL( activated() ), | 976 | connect( action, SIGNAL( activated() ), |
975 | mView, SLOT( goPreviousMonth() ) ); | 977 | mView, SLOT( goPreviousMonth() ) ); |
976 | action->addTo( iconToolBar ); | 978 | action->addTo( iconToolBar ); |
977 | } | 979 | } |
978 | icon = loadPixmap( pathString + "1leftarrowB" ); | 980 | icon = loadPixmap( pathString + "1leftarrowB" ); |
979 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 981 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
980 | if (p-> mShowIconBack) { | 982 | if (p-> mShowIconBack) { |
981 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 983 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
982 | connect( action, SIGNAL( activated() ), | 984 | connect( action, SIGNAL( activated() ), |
983 | mView, SLOT( goPrevious() ) ); | 985 | mView, SLOT( goPrevious() ) ); |
984 | action->addTo( iconToolBar ); | 986 | action->addTo( iconToolBar ); |
985 | } | 987 | } |
986 | icon = loadPixmap( pathString + "today" ); | 988 | icon = loadPixmap( pathString + "today" ); |
987 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 989 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
988 | if (p-> mShowIconToday) | 990 | if (p-> mShowIconToday) |
989 | today_action->addTo( iconToolBar ); | 991 | today_action->addTo( iconToolBar ); |
990 | icon = loadPixmap( pathString + "1rightarrowB" ); | 992 | icon = loadPixmap( pathString + "1rightarrowB" ); |
991 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 993 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
992 | if (p-> mShowIconForward) { | 994 | if (p-> mShowIconForward) { |
993 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 995 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
994 | connect( action, SIGNAL( activated() ), | 996 | connect( action, SIGNAL( activated() ), |
995 | mView, SLOT( goNext() ) ); | 997 | mView, SLOT( goNext() ) ); |
996 | action->addTo( iconToolBar ); | 998 | action->addTo( iconToolBar ); |
997 | } | 999 | } |
998 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1000 | icon = loadPixmap( pathString + "2rightarrowB" ); |
999 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1001 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1000 | if (p-> mShowIconForwardFast) { | 1002 | if (p-> mShowIconForwardFast) { |
1001 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1003 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1002 | connect( action, SIGNAL( activated() ), | 1004 | connect( action, SIGNAL( activated() ), |
1003 | mView, SLOT( goNextMonth() ) ); | 1005 | mView, SLOT( goNextMonth() ) ); |
1004 | action->addTo( iconToolBar ); | 1006 | action->addTo( iconToolBar ); |
1005 | } | 1007 | } |
1006 | 1008 | ||
1007 | 1009 | ||
1008 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 1010 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
1009 | 1011 | ||
1010 | if (p-> mShowIconNewEvent) | 1012 | if (p-> mShowIconNewEvent) |
1011 | configureToolBarMenu->setItemChecked( 10, true ); | 1013 | configureToolBarMenu->setItemChecked( 10, true ); |
1012 | if (p->mShowIconNewTodo ) | 1014 | if (p->mShowIconNewTodo ) |
1013 | configureToolBarMenu->setItemChecked( 20, true ); | 1015 | configureToolBarMenu->setItemChecked( 20, true ); |
1014 | if (p-> mShowIconSearch) | 1016 | if (p-> mShowIconSearch) |
1015 | configureToolBarMenu->setItemChecked( 120, true ); | 1017 | configureToolBarMenu->setItemChecked( 120, true ); |
1016 | if (p-> mShowIconList) | 1018 | if (p-> mShowIconList) |
1017 | configureToolBarMenu->setItemChecked( 30, true ); | 1019 | configureToolBarMenu->setItemChecked( 30, true ); |
1018 | if (p-> mShowIconDay1) | 1020 | if (p-> mShowIconDay1) |
1019 | configureToolBarMenu->setItemChecked( 40, true ); | 1021 | configureToolBarMenu->setItemChecked( 40, true ); |
1020 | if (p-> mShowIconDay5) | 1022 | if (p-> mShowIconDay5) |
1021 | configureToolBarMenu->setItemChecked( 50, true ); | 1023 | configureToolBarMenu->setItemChecked( 50, true ); |
1022 | if (p-> mShowIconDay7) | 1024 | if (p-> mShowIconDay7) |
1023 | configureToolBarMenu->setItemChecked( 60, true ); | 1025 | configureToolBarMenu->setItemChecked( 60, true ); |
1024 | if (p-> mShowIconMonth) | 1026 | if (p-> mShowIconMonth) |
1025 | configureToolBarMenu->setItemChecked( 70, true ); | 1027 | configureToolBarMenu->setItemChecked( 70, true ); |
1026 | if (p-> mShowIconTodoview) | 1028 | if (p-> mShowIconTodoview) |
1027 | configureToolBarMenu->setItemChecked( 80, true ); | 1029 | configureToolBarMenu->setItemChecked( 80, true ); |
1028 | if (p-> mShowIconBackFast) | 1030 | if (p-> mShowIconBackFast) |
1029 | configureToolBarMenu->setItemChecked( 200, true ); | 1031 | configureToolBarMenu->setItemChecked( 200, true ); |
1030 | if (p-> mShowIconBack) | 1032 | if (p-> mShowIconBack) |
1031 | configureToolBarMenu->setItemChecked( 210, true ); | 1033 | configureToolBarMenu->setItemChecked( 210, true ); |
1032 | if (p-> mShowIconToday) | 1034 | if (p-> mShowIconToday) |
1033 | configureToolBarMenu->setItemChecked( 130, true ); | 1035 | configureToolBarMenu->setItemChecked( 130, true ); |
1034 | if (p-> mShowIconForward) | 1036 | if (p-> mShowIconForward) |
1035 | configureToolBarMenu->setItemChecked( 220, true ); | 1037 | configureToolBarMenu->setItemChecked( 220, true ); |
1036 | if (p-> mShowIconForwardFast) | 1038 | if (p-> mShowIconForwardFast) |
1037 | configureToolBarMenu->setItemChecked( 230, true ); | 1039 | configureToolBarMenu->setItemChecked( 230, true ); |
1038 | if (p-> mShowIconNextDays) | 1040 | if (p-> mShowIconNextDays) |
1039 | configureToolBarMenu->setItemChecked( 100, true ); | 1041 | configureToolBarMenu->setItemChecked( 100, true ); |
1040 | if (p-> mShowIconNext) | 1042 | if (p-> mShowIconNext) |
1041 | configureToolBarMenu->setItemChecked( 110, true ); | 1043 | configureToolBarMenu->setItemChecked( 110, true ); |
1042 | if (p-> mShowIconJournal) | 1044 | if (p-> mShowIconJournal) |
1043 | configureToolBarMenu->setItemChecked( 90, true ); | 1045 | configureToolBarMenu->setItemChecked( 90, true ); |
1044 | if (p-> mShowIconWhatsThis) | 1046 | if (p-> mShowIconWhatsThis) |
1045 | configureToolBarMenu->setItemChecked( 300, true ); | 1047 | configureToolBarMenu->setItemChecked( 300, true ); |
1046 | 1048 | ||
1047 | QLabel* dummy = new QLabel( iconToolBar ); | 1049 | QLabel* dummy = new QLabel( iconToolBar ); |
1048 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1050 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1049 | if (!p-> mShowIconStretch) | 1051 | if (!p-> mShowIconStretch) |
1050 | iconToolBar->setStretchableWidget ( dummy ) ; | 1052 | iconToolBar->setStretchableWidget ( dummy ) ; |
1051 | else | 1053 | else |
1052 | configureToolBarMenu->setItemChecked( 5, true ); | 1054 | configureToolBarMenu->setItemChecked( 5, true ); |
1053 | if (p-> mShowIconWhatsThis) | 1055 | if (p-> mShowIconWhatsThis) |
1054 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1056 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1055 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1057 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1056 | configureAgenda( p->mHourSize ); | 1058 | configureAgenda( p->mHourSize ); |
1057 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1059 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1060 | void MainWindow::exportToPhone( int mode ) | 1062 | void MainWindow::exportToPhone( int mode ) |
1061 | { | 1063 | { |
1062 | 1064 | ||
1063 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1065 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1064 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1066 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1065 | KOex2phonePrefs ex2phone; | 1067 | KOex2phonePrefs ex2phone; |
1066 | 1068 | ||
1067 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1069 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1068 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1070 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1069 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1071 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1070 | if ( mode == 1 ) | 1072 | if ( mode == 1 ) |
1071 | ex2phone.setCaption(i18n("Export complete calendar")); | 1073 | ex2phone.setCaption(i18n("Export complete calendar")); |
1072 | if ( mode == 2 ) | 1074 | if ( mode == 2 ) |
1073 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1075 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1074 | 1076 | ||
1075 | if ( !ex2phone.exec() ) { | 1077 | if ( !ex2phone.exec() ) { |
1076 | return; | 1078 | return; |
1077 | } | 1079 | } |
1078 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1080 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1079 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1081 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1080 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1082 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1081 | 1083 | ||
1082 | int inFuture = 0; | 1084 | int inFuture = 0; |
1083 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1085 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1084 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1086 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1085 | QPtrList<Incidence> delSel; | 1087 | QPtrList<Incidence> delSel; |
1086 | if ( mode == 1 ) | 1088 | if ( mode == 1 ) |
1087 | delSel = mCalendar->rawIncidences(); | 1089 | delSel = mCalendar->rawIncidences(); |
1088 | if ( mode == 2 ) | 1090 | if ( mode == 2 ) |
1089 | delSel = mCalendar->incidences(); | 1091 | delSel = mCalendar->incidences(); |
1090 | CalendarLocal* cal = new CalendarLocal(); | 1092 | CalendarLocal* cal = new CalendarLocal(); |
1091 | cal->setLocalTime(); | 1093 | cal->setLocalTime(); |
1092 | Incidence *incidence = delSel.first(); | 1094 | Incidence *incidence = delSel.first(); |
1093 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1095 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1094 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1096 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1095 | while ( incidence ) { | 1097 | while ( incidence ) { |
1096 | if ( incidence->type() != "Journal" ) { | 1098 | if ( incidence->type() != "Journal" ) { |
1097 | bool add = true; | 1099 | bool add = true; |
1098 | if ( inFuture ) { | 1100 | if ( inFuture ) { |
1099 | QDateTime dt; | 1101 | QDateTime dt; |
1100 | if ( incidence->type() == "Todo" ) { | 1102 | if ( incidence->type() == "Todo" ) { |
1101 | Todo * t = (Todo*)incidence; | 1103 | Todo * t = (Todo*)incidence; |
1102 | if ( t->hasDueDate() ) | 1104 | if ( t->hasDueDate() ) |
1103 | dt = t->dtDue(); | 1105 | dt = t->dtDue(); |
1104 | else | 1106 | else |
1105 | dt = cur.addSecs( 62 ); | 1107 | dt = cur.addSecs( 62 ); |
1106 | } | 1108 | } |
1107 | else { | 1109 | else { |
1108 | bool ok; | 1110 | bool ok; |
1109 | dt = incidence->getNextOccurence( cur, &ok ); | 1111 | dt = incidence->getNextOccurence( cur, &ok ); |
1110 | if ( !ok ) | 1112 | if ( !ok ) |
1111 | dt = cur.addSecs( -62 ); | 1113 | dt = cur.addSecs( -62 ); |
1112 | } | 1114 | } |
1113 | if ( dt < cur || dt > end ) { | 1115 | if ( dt < cur || dt > end ) { |
1114 | add = false; | 1116 | add = false; |
1115 | } | 1117 | } |
1116 | } | 1118 | } |
1117 | if ( add ) { | 1119 | if ( add ) { |
1118 | Incidence *in = incidence->clone(); | 1120 | Incidence *in = incidence->clone(); |
1119 | cal->addIncidence( in ); | 1121 | cal->addIncidence( in ); |
1120 | } | 1122 | } |
1121 | } | 1123 | } |
1122 | incidence = delSel.next(); | 1124 | incidence = delSel.next(); |
1123 | } | 1125 | } |
1124 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1126 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1125 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1127 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1126 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1128 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1127 | 1129 | ||
1128 | setCaption( i18n("Writing to phone...")); | 1130 | setCaption( i18n("Writing to phone...")); |
1129 | if ( PhoneFormat::writeToPhone( cal ) ) | 1131 | if ( PhoneFormat::writeToPhone( cal ) ) |
1130 | setCaption( i18n("Export to phone successful!")); | 1132 | setCaption( i18n("Export to phone successful!")); |
1131 | else | 1133 | else |
1132 | setCaption( i18n("Error exporting to phone!")); | 1134 | setCaption( i18n("Error exporting to phone!")); |
1133 | delete cal; | 1135 | delete cal; |
1134 | } | 1136 | } |
1135 | 1137 | ||
1136 | 1138 | ||
1137 | void MainWindow::setDefaultPreferences() | 1139 | void MainWindow::setDefaultPreferences() |
1138 | { | 1140 | { |
1139 | KOPrefs *p = KOPrefs::instance(); | 1141 | KOPrefs *p = KOPrefs::instance(); |
1140 | 1142 | ||
1141 | p->mCompactDialogs = true; | 1143 | p->mCompactDialogs = true; |
1142 | p->mConfirm = true; | 1144 | p->mConfirm = true; |
1143 | // p->mEnableQuickTodo = false; | 1145 | // p->mEnableQuickTodo = false; |
1144 | 1146 | ||
1145 | } | 1147 | } |
1146 | 1148 | ||
1147 | QString MainWindow::resourcePath() | 1149 | QString MainWindow::resourcePath() |
1148 | { | 1150 | { |
1149 | return KGlobal::iconLoader()->iconPath(); | 1151 | return KGlobal::iconLoader()->iconPath(); |
1150 | } | 1152 | } |
1151 | 1153 | ||
1152 | void MainWindow::displayText( QString text ,QString cap ) | 1154 | void MainWindow::displayText( QString text ,QString cap ) |
1153 | { | 1155 | { |
1154 | QDialog dia( this, "name", true ); ; | 1156 | QDialog dia( this, "name", true ); ; |
1155 | dia.setCaption( cap ); | 1157 | dia.setCaption( cap ); |
1156 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1158 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1157 | lay->setSpacing( 3 ); | 1159 | lay->setSpacing( 3 ); |
1158 | lay->setMargin( 3 ); | 1160 | lay->setMargin( 3 ); |
1159 | QTextBrowser tb ( &dia ); | 1161 | QTextBrowser tb ( &dia ); |
1160 | lay->addWidget( &tb ); | 1162 | lay->addWidget( &tb ); |
1161 | tb.setText( text ); | 1163 | tb.setText( text ); |
1162 | #ifdef DESKTOP_VERSION | 1164 | #ifdef DESKTOP_VERSION |
1163 | dia.resize( 640, 480); | 1165 | dia.resize( 640, 480); |
1164 | #else | 1166 | #else |
1165 | dia.showMaximized(); | 1167 | dia.showMaximized(); |
1166 | #endif | 1168 | #endif |
1167 | dia.exec(); | 1169 | dia.exec(); |
1168 | } | 1170 | } |
1169 | 1171 | ||
1170 | void MainWindow::features() | 1172 | void MainWindow::features() |
1171 | { | 1173 | { |
1172 | 1174 | ||
1173 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1175 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1174 | } | 1176 | } |
1175 | 1177 | ||
1176 | void MainWindow::usertrans() | 1178 | void MainWindow::usertrans() |
1177 | { | 1179 | { |
1178 | 1180 | ||
1179 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1181 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1180 | } | 1182 | } |
1181 | 1183 | ||
1182 | void MainWindow::kdesynchowto() | 1184 | void MainWindow::kdesynchowto() |
1183 | { | 1185 | { |
1184 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1186 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1185 | } | 1187 | } |
1186 | void MainWindow::multisynchowto() | 1188 | void MainWindow::multisynchowto() |
1187 | { | 1189 | { |
1188 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1190 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1189 | } | 1191 | } |
1190 | void MainWindow::synchowto() | 1192 | void MainWindow::synchowto() |
1191 | { | 1193 | { |
1192 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1194 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1193 | } | 1195 | } |
1194 | void MainWindow::faq() | 1196 | void MainWindow::faq() |
1195 | { | 1197 | { |
1196 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1198 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1197 | 1199 | ||
1198 | } | 1200 | } |
1199 | void MainWindow::whatsNew() | 1201 | void MainWindow::whatsNew() |
1200 | { | 1202 | { |
1201 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1203 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1202 | 1204 | ||
1203 | } | 1205 | } |
1204 | void MainWindow::licence() | 1206 | void MainWindow::licence() |
1205 | { | 1207 | { |
1206 | KApplication::showLicence(); | 1208 | KApplication::showLicence(); |
1207 | 1209 | ||
1208 | } | 1210 | } |
1209 | void MainWindow::about() | 1211 | void MainWindow::about() |
1210 | { | 1212 | { |
1211 | QString version; | 1213 | QString version; |
1212 | #include <../version> | 1214 | #include <../version> |
1213 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1215 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1214 | i18n("KOrganizer/Platform-independent\n") + | 1216 | i18n("KOrganizer/Platform-independent\n") + |
1215 | "(KO/Pi) " + version + " - " + | 1217 | "(KO/Pi) " + version + " - " + |
1216 | 1218 | ||
1217 | #ifdef DESKTOP_VERSION | 1219 | #ifdef DESKTOP_VERSION |
1218 | i18n("Desktop Edition\n") + | 1220 | i18n("Desktop Edition\n") + |
1219 | #else | 1221 | #else |
1220 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1222 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1221 | #endif | 1223 | #endif |
1222 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1224 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1223 | } | 1225 | } |
1224 | void MainWindow::keyBindings() | 1226 | void MainWindow::keyBindings() |
1225 | { | 1227 | { |
1226 | QString cap = i18n("KO/Pi Keys + Colors"); | 1228 | QString cap = i18n("KO/Pi Keys + Colors"); |
1227 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1229 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1228 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1230 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1229 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1231 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1230 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1232 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1231 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1233 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1232 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1234 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1233 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1235 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1234 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1236 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1235 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1237 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1236 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1238 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1237 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1239 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1238 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1240 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1239 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1241 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1240 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1242 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1241 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1243 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1242 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1244 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1243 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1245 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1244 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1246 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1245 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1247 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1246 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1248 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1247 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1249 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1248 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1250 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1249 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1251 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1250 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1252 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1251 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1253 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1252 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1254 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1253 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1255 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1254 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1256 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1255 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1257 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1256 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1258 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1257 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1259 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1258 | i18n("<p><h3>In list view:</h3></p>\n") + | 1260 | i18n("<p><h3>In list view:</h3></p>\n") + |
1259 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1261 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1260 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1262 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1261 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1263 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1262 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1264 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1263 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1265 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1264 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1266 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1265 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1267 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1266 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1268 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1267 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1269 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1268 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1270 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1269 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1271 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1270 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1272 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1271 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1273 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1272 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1274 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1273 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1275 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1274 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1276 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1275 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1277 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1276 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1278 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1277 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1279 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1278 | displayText( text, cap); | 1280 | displayText( text, cap); |
1279 | } | 1281 | } |
1280 | void MainWindow::aboutAutoSaving() | 1282 | void MainWindow::aboutAutoSaving() |
1281 | { | 1283 | { |
1282 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1284 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1283 | 1285 | ||
1284 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1286 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1285 | 1287 | ||
1286 | } | 1288 | } |
1287 | void MainWindow::aboutKnownBugs() | 1289 | void MainWindow::aboutKnownBugs() |
1288 | { | 1290 | { |
1289 | QMessageBox* msg; | 1291 | QMessageBox* msg; |
1290 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1292 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1291 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1293 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1292 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1294 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1293 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + | 1295 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + |
1294 | i18n("\nor report them in the bugtracker on\n") + | 1296 | i18n("\nor report them in the bugtracker on\n") + |
1295 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1297 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1296 | QMessageBox::NoIcon, | 1298 | QMessageBox::NoIcon, |
1297 | QMessageBox::Ok, | 1299 | QMessageBox::Ok, |
1298 | QMessageBox::NoButton, | 1300 | QMessageBox::NoButton, |
1299 | QMessageBox::NoButton); | 1301 | QMessageBox::NoButton); |
1300 | msg->exec(); | 1302 | msg->exec(); |
1301 | delete msg; | 1303 | delete msg; |
1302 | 1304 | ||
1303 | } | 1305 | } |
1304 | 1306 | ||
1305 | QString MainWindow::defaultFileName() | 1307 | QString MainWindow::defaultFileName() |
1306 | { | 1308 | { |
1307 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1309 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1308 | } | 1310 | } |
1309 | QString MainWindow::syncFileName() | 1311 | QString MainWindow::syncFileName() |
1310 | { | 1312 | { |
1311 | #ifdef DESKTOP_VERSION | 1313 | #ifdef DESKTOP_VERSION |
1312 | return locateLocal( "tmp", "synccalendar.ics" ); | 1314 | return locateLocal( "tmp", "synccalendar.ics" ); |
1313 | #else | 1315 | #else |
1314 | return QString( "/tmp/synccalendar.ics" ); | 1316 | return QString( "/tmp/synccalendar.ics" ); |
1315 | #endif | 1317 | #endif |
1316 | } | 1318 | } |
1317 | 1319 | ||
1318 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1320 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1319 | { | 1321 | { |
1320 | if ( !incidence ) { | 1322 | if ( !incidence ) { |
1321 | enableIncidenceActions( false ); | 1323 | enableIncidenceActions( false ); |
1322 | 1324 | ||
1323 | mNewSubTodoAction->setEnabled( false ); | 1325 | mNewSubTodoAction->setEnabled( false ); |
1324 | setCaptionToDates(); | 1326 | setCaptionToDates(); |
1325 | return; | 1327 | return; |
1326 | 1328 | ||
1327 | } | 1329 | } |
1328 | 1330 | ||
1329 | //KGlobal::locale()->formatDateTime(nextA, true); | 1331 | //KGlobal::locale()->formatDateTime(nextA, true); |
1330 | QString startString = ""; | 1332 | QString startString = ""; |
1331 | if ( incidence->type() != "Todo" ) { | 1333 | if ( incidence->type() != "Todo" ) { |
1332 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1334 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1333 | if ( incidence->doesFloat() ) { | 1335 | if ( incidence->doesFloat() ) { |
1334 | startString += ": "+incidence->dtStartDateStr( true ); | 1336 | startString += ": "+incidence->dtStartDateStr( true ); |
1335 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1337 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1336 | 1338 | ||
1337 | } else { | 1339 | } else { |
1338 | startString = ": "+incidence->dtStartStr(true); | 1340 | startString = ": "+incidence->dtStartStr(true); |
1339 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1341 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1340 | 1342 | ||
1341 | } | 1343 | } |
1342 | 1344 | ||
1343 | } else { | 1345 | } else { |
1344 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1346 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1345 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1347 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1346 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1348 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1347 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1349 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1348 | } | 1350 | } |
1349 | 1351 | ||
1350 | } | 1352 | } |
1351 | else | 1353 | else |
1352 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1354 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1353 | if ( !incidence->location().isEmpty() ) | 1355 | if ( !incidence->location().isEmpty() ) |
1354 | startString += " (" +incidence->location()+")"; | 1356 | startString += " (" +incidence->location()+")"; |
1355 | setCaption( incidence->summary()+startString); | 1357 | setCaption( incidence->summary()+startString); |
1356 | 1358 | ||
1357 | enableIncidenceActions( true ); | 1359 | enableIncidenceActions( true ); |
1358 | 1360 | ||
1359 | if ( incidence->type() == "Event" ) { | 1361 | if ( incidence->type() == "Event" ) { |
1360 | mShowAction->setText( i18n("Show Event...") ); | 1362 | mShowAction->setText( i18n("Show Event...") ); |
1361 | mEditAction->setText( i18n("Edit Event...") ); | 1363 | mEditAction->setText( i18n("Edit Event...") ); |
1362 | mDeleteAction->setText( i18n("Delete Event...") ); | 1364 | mDeleteAction->setText( i18n("Delete Event...") ); |
1363 | 1365 | ||
1364 | mNewSubTodoAction->setEnabled( false ); | 1366 | mNewSubTodoAction->setEnabled( false ); |
1365 | } else if ( incidence->type() == "Todo" ) { | 1367 | } else if ( incidence->type() == "Todo" ) { |
1366 | mShowAction->setText( i18n("Show Todo...") ); | 1368 | mShowAction->setText( i18n("Show Todo...") ); |
1367 | mEditAction->setText( i18n("Edit Todo...") ); | 1369 | mEditAction->setText( i18n("Edit Todo...") ); |
1368 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1370 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1369 | 1371 | ||
1370 | mNewSubTodoAction->setEnabled( true ); | 1372 | mNewSubTodoAction->setEnabled( true ); |
1371 | } else { | 1373 | } else { |
1372 | mShowAction->setText( i18n("Show...") ); | 1374 | mShowAction->setText( i18n("Show...") ); |
1373 | mShowAction->setText( i18n("Edit...") ); | 1375 | mShowAction->setText( i18n("Edit...") ); |
1374 | mShowAction->setText( i18n("Delete...") ); | 1376 | mShowAction->setText( i18n("Delete...") ); |
1375 | 1377 | ||
1376 | mNewSubTodoAction->setEnabled( false ); | 1378 | mNewSubTodoAction->setEnabled( false ); |
1377 | } | 1379 | } |
1378 | } | 1380 | } |
1379 | 1381 | ||
1380 | void MainWindow::enableIncidenceActions( bool enabled ) | 1382 | void MainWindow::enableIncidenceActions( bool enabled ) |
1381 | { | 1383 | { |
1382 | mShowAction->setEnabled( enabled ); | 1384 | mShowAction->setEnabled( enabled ); |
1383 | mEditAction->setEnabled( enabled ); | 1385 | mEditAction->setEnabled( enabled ); |
1384 | mDeleteAction->setEnabled( enabled ); | 1386 | mDeleteAction->setEnabled( enabled ); |
1385 | 1387 | ||
1386 | mCloneAction->setEnabled( enabled ); | 1388 | mCloneAction->setEnabled( enabled ); |
1387 | mMoveAction->setEnabled( enabled ); | 1389 | mMoveAction->setEnabled( enabled ); |
1388 | mBeamAction->setEnabled( enabled ); | 1390 | mBeamAction->setEnabled( enabled ); |
1389 | mCancelAction->setEnabled( enabled ); | 1391 | mCancelAction->setEnabled( enabled ); |
1390 | } | 1392 | } |
1391 | 1393 | ||
1392 | void MainWindow::importOL() | 1394 | void MainWindow::importOL() |
1393 | { | 1395 | { |
1394 | #ifdef _OL_IMPORT_ | 1396 | #ifdef _OL_IMPORT_ |
1395 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1397 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1396 | id->exec(); | 1398 | id->exec(); |
1397 | delete id; | 1399 | delete id; |
1398 | mView->updateView(); | 1400 | mView->updateView(); |
1399 | #endif | 1401 | #endif |
1400 | } | 1402 | } |
1401 | void MainWindow::importBday() | 1403 | void MainWindow::importBday() |
1402 | { | 1404 | { |
1403 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1405 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1404 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1406 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1405 | i18n("Import!"), i18n("Cancel"), 0, | 1407 | i18n("Import!"), i18n("Cancel"), 0, |
1406 | 0, 1 ); | 1408 | 0, 1 ); |
1407 | if ( result == 0 ) { | 1409 | if ( result == 0 ) { |
1408 | mView->importBday(); | 1410 | mView->importBday(); |
1409 | 1411 | ||
1410 | } | 1412 | } |
1411 | 1413 | ||
1412 | 1414 | ||
1413 | } | 1415 | } |
1414 | void MainWindow::importQtopia() | 1416 | void MainWindow::importQtopia() |
1415 | { | 1417 | { |
1416 | #ifndef DESKTOP_VERSION | 1418 | #ifndef DESKTOP_VERSION |
1417 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1419 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1418 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), | 1420 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), |
1419 | i18n("Import!"), i18n("Cancel"), 0, | 1421 | i18n("Import!"), i18n("Cancel"), 0, |
1420 | 0, 1 ); | 1422 | 0, 1 ); |
1421 | if ( result == 0 ) { | 1423 | if ( result == 0 ) { |
1422 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1424 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1423 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1425 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1424 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1426 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1425 | mView->importQtopia( categories, datebook, todolist ); | 1427 | mView->importQtopia( categories, datebook, todolist ); |
1426 | } | 1428 | } |
1427 | #else | 1429 | #else |
1428 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1430 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1429 | i18n("Not supported \non desktop!\n"), | 1431 | i18n("Not supported \non desktop!\n"), |
1430 | i18n("Ok"), i18n("Cancel"), 0, | 1432 | i18n("Ok"), i18n("Cancel"), 0, |
1431 | 0, 1 ); | 1433 | 0, 1 ); |
1432 | 1434 | ||
1433 | #endif | 1435 | #endif |
1434 | } | 1436 | } |
1435 | 1437 | ||
1436 | void MainWindow::saveOnClose() | 1438 | void MainWindow::saveOnClose() |
1437 | { | 1439 | { |
1438 | KOPrefs *p = KOPrefs::instance(); | 1440 | KOPrefs *p = KOPrefs::instance(); |
1439 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1441 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1440 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1442 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1441 | iconToolBar->y() > height()/2; | 1443 | iconToolBar->y() > height()/2; |
1442 | mView->writeSettings(); | 1444 | mView->writeSettings(); |
1443 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1445 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1444 | save(); | 1446 | save(); |
1445 | } | 1447 | } |
1446 | void MainWindow::slotModifiedChanged( bool changed ) | 1448 | void MainWindow::slotModifiedChanged( bool changed ) |
1447 | { | 1449 | { |
1448 | if ( mBlockAtStartup ) | 1450 | if ( mBlockAtStartup ) |
1449 | return; | 1451 | return; |
1452 | |||
1450 | int msec; | 1453 | int msec; |
1451 | // we store the changes after 1 minute, | 1454 | // we store the changes after 1 minute, |
1452 | // and for safety reasons after 10 minutes again | 1455 | // and for safety reasons after 10 minutes again |
1453 | if ( !mSyncManager->blockSave() ) | 1456 | if ( !mSyncManager->blockSave() ) |
1454 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1457 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1455 | else | 1458 | else |
1456 | msec = 1000 * 600; | 1459 | msec = 1000 * 600; |
1457 | mSaveTimer.start( msec, true ); // 1 minute | 1460 | mSaveTimer.start( msec, true ); // 1 minute |
1458 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1461 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1459 | mCalendarModifiedFlag = true; | 1462 | mCalendarModifiedFlag = true; |
1460 | } | 1463 | } |
1464 | void MainWindow::saveStopTimer() | ||
1465 | { | ||
1466 | mSaveTimer.stop(); | ||
1467 | if (mSaveTimer.isActive() ) | ||
1468 | qDebug("ti active "); | ||
1469 | else | ||
1470 | qDebug("KO: Save timer stopped"); | ||
1471 | } | ||
1461 | void MainWindow::save() | 1472 | void MainWindow::save() |
1462 | { | 1473 | { |
1474 | if ( !mCalendarModifiedFlag ) { | ||
1475 | qDebug("KO: Calendar not modified. Nothing saved."); | ||
1476 | return; | ||
1477 | } | ||
1463 | if ( mSyncManager->blockSave() ) | 1478 | if ( mSyncManager->blockSave() ) |
1464 | return; | 1479 | return; |
1465 | mSyncManager->setBlockSave(true); | 1480 | mSyncManager->setBlockSave(true); |
1466 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1481 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1467 | |||
1468 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1482 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1469 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1483 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1470 | qDebug("KO: Start saving data to file!"); | 1484 | qDebug("KO: Start saving data to file!"); |
1471 | mView->saveCalendar( defaultFileName() ); | 1485 | mView->saveCalendar( defaultFileName() ); |
1472 | 1486 | mCalendarModifiedFlag = false; | |
1473 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1487 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1474 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1488 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1475 | QString savemes; | 1489 | QString savemes; |
1476 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1490 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1477 | setCaption(savemes); | 1491 | setCaption(savemes); |
1478 | } else | 1492 | } else |
1479 | setCaption(i18n("Saving cancelled!")); | 1493 | setCaption(i18n("Saving cancelled!")); |
1480 | mCalendarModifiedFlag = false; | ||
1481 | mSyncManager->setBlockSave( false ); | 1494 | mSyncManager->setBlockSave( false ); |
1482 | } | 1495 | } |
1483 | 1496 | ||
1484 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1497 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1485 | { | 1498 | { |
1486 | if ( !e->isAutoRepeat() ) { | 1499 | if ( !e->isAutoRepeat() ) { |
1487 | mFlagKeyPressed = false; | 1500 | mFlagKeyPressed = false; |
1488 | } | 1501 | } |
1489 | } | 1502 | } |
1490 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1503 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1491 | { | 1504 | { |
1492 | qApp->processEvents(); | 1505 | qApp->processEvents(); |
1493 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1506 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1494 | e->ignore(); | 1507 | e->ignore(); |
1495 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1508 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1496 | return; | 1509 | return; |
1497 | } | 1510 | } |
1498 | if (! e->isAutoRepeat() ) | 1511 | if (! e->isAutoRepeat() ) |
1499 | mFlagKeyPressed = true; | 1512 | mFlagKeyPressed = true; |
1500 | KOPrefs *p = KOPrefs::instance(); | 1513 | KOPrefs *p = KOPrefs::instance(); |
1501 | bool showSelectedDates = false; | 1514 | bool showSelectedDates = false; |
1502 | int size; | 1515 | int size; |
1503 | int pro = 0; | 1516 | int pro = 0; |
1504 | //qDebug("MainWindow::keyPressEvent "); | 1517 | //qDebug("MainWindow::keyPressEvent "); |
1505 | switch ( e->key() ) { | 1518 | switch ( e->key() ) { |
1506 | case Qt::Key_Right: | 1519 | case Qt::Key_Right: |
1507 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1520 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1508 | mView->goNextMonth(); | 1521 | mView->goNextMonth(); |
1509 | else | 1522 | else |
1510 | mView->goNext(); | 1523 | mView->goNext(); |
1511 | showSelectedDates = true; | 1524 | showSelectedDates = true; |
1512 | break; | 1525 | break; |
1513 | case Qt::Key_Left: | 1526 | case Qt::Key_Left: |
1514 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1527 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1515 | mView->goPreviousMonth(); | 1528 | mView->goPreviousMonth(); |
1516 | else | 1529 | else |
1517 | mView->goPrevious(); | 1530 | mView->goPrevious(); |
1518 | showSelectedDates = true; | 1531 | showSelectedDates = true; |
1519 | break; | 1532 | break; |
1520 | case Qt::Key_Down: | 1533 | case Qt::Key_Down: |
1521 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1534 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1522 | break; | 1535 | break; |
1523 | case Qt::Key_Up: | 1536 | case Qt::Key_Up: |
1524 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1537 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1525 | break; | 1538 | break; |
1526 | case Qt::Key_I: | 1539 | case Qt::Key_I: |
1527 | mView->showIncidence(); | 1540 | mView->showIncidence(); |
1528 | break; | 1541 | break; |
1529 | case Qt::Key_Delete: | 1542 | case Qt::Key_Delete: |
1530 | case Qt::Key_Backspace: | 1543 | case Qt::Key_Backspace: |
1531 | mView->deleteIncidence(); | 1544 | mView->deleteIncidence(); |
1532 | break; | 1545 | break; |
1533 | case Qt::Key_D: | 1546 | case Qt::Key_D: |
1534 | mView->viewManager()->showDayView(); | 1547 | mView->viewManager()->showDayView(); |
1535 | showSelectedDates = true; | 1548 | showSelectedDates = true; |
1536 | break; | 1549 | break; |
1537 | case Qt::Key_O: | 1550 | case Qt::Key_O: |
1538 | mView->toggleFilerEnabled( ); | 1551 | mView->toggleFilerEnabled( ); |
1539 | break; | 1552 | break; |
1540 | case Qt::Key_0: | 1553 | case Qt::Key_0: |
1541 | case Qt::Key_1: | 1554 | case Qt::Key_1: |
1542 | case Qt::Key_2: | 1555 | case Qt::Key_2: |
1543 | case Qt::Key_3: | 1556 | case Qt::Key_3: |
1544 | case Qt::Key_4: | 1557 | case Qt::Key_4: |
1545 | case Qt::Key_5: | 1558 | case Qt::Key_5: |
1546 | case Qt::Key_6: | 1559 | case Qt::Key_6: |
1547 | case Qt::Key_7: | 1560 | case Qt::Key_7: |
1548 | case Qt::Key_8: | 1561 | case Qt::Key_8: |
1549 | case Qt::Key_9: | 1562 | case Qt::Key_9: |
1550 | pro = e->key()-48; | 1563 | pro = e->key()-48; |
1551 | if ( pro == 0 ) | 1564 | if ( pro == 0 ) |
1552 | pro = 10; | 1565 | pro = 10; |
1553 | if ( e->state() == Qt::ControlButton) | 1566 | if ( e->state() == Qt::ControlButton) |
1554 | pro += 10; | 1567 | pro += 10; |
1555 | break; | 1568 | break; |
1556 | case Qt::Key_M: | 1569 | case Qt::Key_M: |
1557 | mView->viewManager()->showMonthView(); | 1570 | mView->viewManager()->showMonthView(); |
1558 | showSelectedDates = true; | 1571 | showSelectedDates = true; |
1559 | break; | 1572 | break; |
1560 | case Qt::Key_Insert: | 1573 | case Qt::Key_Insert: |
1561 | mView->newEvent(); | 1574 | mView->newEvent(); |
1562 | break; | 1575 | break; |
1563 | case Qt::Key_S : | 1576 | case Qt::Key_S : |
1564 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1577 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1565 | mView->newSubTodo(); | 1578 | mView->newSubTodo(); |
1566 | else | 1579 | else |
1567 | mView->dialogManager()->showSearchDialog(); | 1580 | mView->dialogManager()->showSearchDialog(); |
1568 | break; | 1581 | break; |
1569 | case Qt::Key_Y : | 1582 | case Qt::Key_Y : |
1570 | case Qt::Key_Z : | 1583 | case Qt::Key_Z : |
1571 | mView->viewManager()->showWorkWeekView(); | 1584 | mView->viewManager()->showWorkWeekView(); |
1572 | showSelectedDates = true; | 1585 | showSelectedDates = true; |
1573 | break; | 1586 | break; |
1574 | case Qt::Key_U : | 1587 | case Qt::Key_U : |
1575 | mView->viewManager()->showWeekView(); | 1588 | mView->viewManager()->showWeekView(); |
1576 | showSelectedDates = true; | 1589 | showSelectedDates = true; |
1577 | break; | 1590 | break; |
1578 | case Qt::Key_H : | 1591 | case Qt::Key_H : |
1579 | keyBindings(); | 1592 | keyBindings(); |
1580 | break; | 1593 | break; |
1581 | case Qt::Key_W: | 1594 | case Qt::Key_W: |
1582 | mView->viewManager()->showWhatsNextView(); | 1595 | mView->viewManager()->showWhatsNextView(); |
1583 | break; | 1596 | break; |
1584 | case Qt::Key_L: | 1597 | case Qt::Key_L: |
1585 | mView->viewManager()->showListView(); | 1598 | mView->viewManager()->showListView(); |
1586 | break; | 1599 | break; |
1587 | case Qt::Key_N: | 1600 | case Qt::Key_N: |
1588 | mView->viewManager()->showNextXView(); | 1601 | mView->viewManager()->showNextXView(); |
1589 | showSelectedDates = true; | 1602 | showSelectedDates = true; |
1590 | break; | 1603 | break; |
1591 | case Qt::Key_V: | 1604 | case Qt::Key_V: |
1592 | mView->viewManager()->showTodoView(); | 1605 | mView->viewManager()->showTodoView(); |
1593 | break; | 1606 | break; |
1594 | case Qt::Key_C: | 1607 | case Qt::Key_C: |
1595 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1608 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1596 | break; | 1609 | break; |
1597 | case Qt::Key_P: | 1610 | case Qt::Key_P: |
1598 | mView->showDatePicker( ); | 1611 | mView->showDatePicker( ); |
1599 | break; | 1612 | break; |
1600 | case Qt::Key_F: | 1613 | case Qt::Key_F: |
1601 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1614 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1602 | mView->editFilters(); | 1615 | mView->editFilters(); |
1603 | else | 1616 | else |
1604 | mView->toggleFilter(); | 1617 | mView->toggleFilter(); |
1605 | break; | 1618 | break; |
1606 | case Qt::Key_X: | 1619 | case Qt::Key_X: |
1607 | mView->toggleDateNavigatorWidget(); | 1620 | mView->toggleDateNavigatorWidget(); |
1608 | break; | 1621 | break; |
1609 | case Qt::Key_Space: | 1622 | case Qt::Key_Space: |
1610 | mView->toggleExpand(); | 1623 | mView->toggleExpand(); |
1611 | break; | 1624 | break; |
1612 | case Qt::Key_A: | 1625 | case Qt::Key_A: |
1613 | mView->toggleAllDaySize(); | 1626 | mView->toggleAllDaySize(); |
1614 | break; | 1627 | break; |
1615 | case Qt::Key_T: | 1628 | case Qt::Key_T: |
1616 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1629 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1617 | mView->newTodo(); | 1630 | mView->newTodo(); |
1618 | else { | 1631 | else { |
1619 | mView->goToday(); | 1632 | mView->goToday(); |
1620 | showSelectedDates = true; | 1633 | showSelectedDates = true; |
1621 | } | 1634 | } |
1622 | break; | 1635 | break; |
1623 | case Qt::Key_J: | 1636 | case Qt::Key_J: |
1624 | mView->viewManager()->showJournalView(); | 1637 | mView->viewManager()->showJournalView(); |
1625 | break; | 1638 | break; |
1626 | case Qt::Key_B: | 1639 | case Qt::Key_B: |
1627 | mView->editIncidenceDescription();; | 1640 | mView->editIncidenceDescription();; |
1628 | break; | 1641 | break; |
1629 | // case Qt::Key_Return: | 1642 | // case Qt::Key_Return: |
1630 | case Qt::Key_E: | 1643 | case Qt::Key_E: |
1631 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1644 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1632 | mView->newEvent(); | 1645 | mView->newEvent(); |
1633 | else | 1646 | else |
1634 | mView->editIncidence(); | 1647 | mView->editIncidence(); |
1635 | break; | 1648 | break; |
1636 | case Qt::Key_Plus: | 1649 | case Qt::Key_Plus: |
1637 | size = p->mHourSize +2; | 1650 | size = p->mHourSize +2; |
1638 | if ( size <= 18 ) | 1651 | if ( size <= 18 ) |
1639 | configureAgenda( size ); | 1652 | configureAgenda( size ); |
1640 | break; | 1653 | break; |
1641 | case Qt::Key_Minus: | 1654 | case Qt::Key_Minus: |
1642 | size = p->mHourSize - 2; | 1655 | size = p->mHourSize - 2; |
1643 | if ( size >= 4 ) | 1656 | if ( size >= 4 ) |
1644 | configureAgenda( size ); | 1657 | configureAgenda( size ); |
1645 | break; | 1658 | break; |
1646 | 1659 | ||
1647 | 1660 | ||
1648 | default: | 1661 | default: |
1649 | e->ignore(); | 1662 | e->ignore(); |
1650 | } | 1663 | } |
1651 | if ( pro > 0 ) { | 1664 | if ( pro > 0 ) { |
1652 | mView->selectFilter( pro-1 ); | 1665 | mView->selectFilter( pro-1 ); |
1653 | } | 1666 | } |
1654 | if ( showSelectedDates ) { | 1667 | if ( showSelectedDates ) { |
1655 | ;// setCaptionToDates(); | 1668 | ;// setCaptionToDates(); |
1656 | } | 1669 | } |
1657 | 1670 | ||
1658 | } | 1671 | } |
1659 | 1672 | ||
1660 | void MainWindow::fillFilterMenu() | 1673 | void MainWindow::fillFilterMenu() |
1661 | { | 1674 | { |
1662 | selectFilterMenu->clear(); | 1675 | selectFilterMenu->clear(); |
1663 | bool disable = false; | 1676 | bool disable = false; |
1664 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1677 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1665 | selectFilterMenu->insertSeparator(); | 1678 | selectFilterMenu->insertSeparator(); |
1666 | if ( mView->filterView()->filtersEnabled() ) { | 1679 | if ( mView->filterView()->filtersEnabled() ) { |
1667 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1680 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1668 | } | 1681 | } |
1669 | else { | 1682 | else { |
1670 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1683 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1671 | disable = true; | 1684 | disable = true; |
1672 | } | 1685 | } |
1673 | selectFilterMenu->insertSeparator(); | 1686 | selectFilterMenu->insertSeparator(); |
1674 | QPtrList<CalFilter> fili = mView->filters(); | 1687 | QPtrList<CalFilter> fili = mView->filters(); |
1675 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1688 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1676 | CalFilter *filter = fili.first(); | 1689 | CalFilter *filter = fili.first(); |
1677 | int iii = 2; | 1690 | int iii = 2; |
1678 | while(filter) { | 1691 | while(filter) { |
1679 | selectFilterMenu->insertItem( filter->name(), iii ); | 1692 | selectFilterMenu->insertItem( filter->name(), iii ); |
1680 | if ( filter == curfilter) | 1693 | if ( filter == curfilter) |
1681 | selectFilterMenu->setItemChecked( iii, true ); | 1694 | selectFilterMenu->setItemChecked( iii, true ); |
1682 | if ( disable ) | 1695 | if ( disable ) |
1683 | selectFilterMenu->setItemEnabled( iii, false ); | 1696 | selectFilterMenu->setItemEnabled( iii, false ); |
1684 | filter = fili.next(); | 1697 | filter = fili.next(); |
1685 | ++iii; | 1698 | ++iii; |
1686 | } | 1699 | } |
1687 | } | 1700 | } |
1688 | void MainWindow::selectFilter( int fil ) | 1701 | void MainWindow::selectFilter( int fil ) |
1689 | { | 1702 | { |
1690 | if ( fil == 0 ) { | 1703 | if ( fil == 0 ) { |
1691 | mView->editFilters( ); | 1704 | mView->editFilters( ); |
1692 | } else if ( fil == 1 ){ | 1705 | } else if ( fil == 1 ){ |
1693 | mView->toggleFilerEnabled( ); | 1706 | mView->toggleFilerEnabled( ); |
1694 | } else { | 1707 | } else { |
1695 | mView->selectFilter( fil-2 ); | 1708 | mView->selectFilter( fil-2 ); |
1696 | } | 1709 | } |
1697 | } | 1710 | } |
1698 | void MainWindow::configureToolBar( int item ) | 1711 | void MainWindow::configureToolBar( int item ) |
1699 | { | 1712 | { |
1700 | 1713 | ||
1701 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1714 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1702 | KOPrefs *p = KOPrefs::instance(); | 1715 | KOPrefs *p = KOPrefs::instance(); |
1703 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1716 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1704 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1717 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1705 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1718 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1706 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1719 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1707 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1720 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1708 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1721 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1709 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1722 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1710 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1723 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1711 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1724 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1712 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1725 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1713 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1726 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1714 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1727 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1715 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1728 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1716 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1729 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1717 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1730 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1718 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1731 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1719 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1732 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1720 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1733 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1721 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1734 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1722 | // initActions(); | 1735 | // initActions(); |
1723 | } | 1736 | } |
1724 | 1737 | ||
1725 | void MainWindow::setCaptionToDates() | 1738 | void MainWindow::setCaptionToDates() |
1726 | { | 1739 | { |
1727 | QString selDates; | 1740 | QString selDates; |
1728 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1741 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1729 | if (mView->startDate() < mView->endDate() ) | 1742 | if (mView->startDate() < mView->endDate() ) |
1730 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1743 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1731 | else { | 1744 | else { |
1732 | QString addString; | 1745 | QString addString; |
1733 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | 1746 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) |
1734 | addString = i18n("Today"); | 1747 | addString = i18n("Today"); |
1735 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | 1748 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) |
1736 | addString = i18n("Tomorrow"); | 1749 | addString = i18n("Tomorrow"); |
1737 | if ( !addString.isEmpty() ) | 1750 | if ( !addString.isEmpty() ) |
1738 | selDates = addString+", "+selDates ; | 1751 | selDates = addString+", "+selDates ; |
1739 | } | 1752 | } |
1740 | setCaption( i18n("Dates: ") + selDates ); | 1753 | setCaption( i18n("Dates: ") + selDates ); |
1741 | 1754 | ||
1742 | } | 1755 | } |
1743 | void MainWindow::showConfigureAgenda( ) | 1756 | void MainWindow::showConfigureAgenda( ) |
1744 | { | 1757 | { |
1745 | int iii; | 1758 | int iii; |
1746 | for ( iii = 1;iii<= 10 ;++iii ){ | 1759 | for ( iii = 1;iii<= 10 ;++iii ){ |
1747 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1760 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
1748 | } | 1761 | } |
1749 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 1762 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
1750 | } | 1763 | } |
1751 | void MainWindow::configureAgenda( int item ) | 1764 | void MainWindow::configureAgenda( int item ) |
1752 | { | 1765 | { |
1753 | if ( KOPrefs::instance()->mHourSize == item ) | 1766 | if ( KOPrefs::instance()->mHourSize == item ) |
1754 | return; | 1767 | return; |
1755 | KOPrefs::instance()->mHourSize=item; | 1768 | KOPrefs::instance()->mHourSize=item; |
1756 | mView->viewManager()->agendaView()->updateConfig(); | 1769 | mView->viewManager()->agendaView()->updateConfig(); |
1757 | } | 1770 | } |
1758 | 1771 | ||
1759 | void MainWindow::saveCalendar() | 1772 | void MainWindow::saveCalendar() |
1760 | { | 1773 | { |
1761 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1774 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1762 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1775 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1763 | 1776 | ||
1764 | if ( fn == "" ) | 1777 | if ( fn == "" ) |
1765 | return; | 1778 | return; |
1766 | QFileInfo info; | 1779 | QFileInfo info; |
1767 | info.setFile( fn ); | 1780 | info.setFile( fn ); |
1768 | QString mes; | 1781 | QString mes; |
1769 | bool createbup = true; | 1782 | bool createbup = true; |
1770 | if ( info. exists() ) { | 1783 | if ( info. exists() ) { |
1771 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1784 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1772 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1785 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1773 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1786 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1774 | 0, 1 ); | 1787 | 0, 1 ); |
1775 | if ( result != 0 ) { | 1788 | if ( result != 0 ) { |
1776 | createbup = false; | 1789 | createbup = false; |
1777 | } | 1790 | } |
1778 | } | 1791 | } |
1779 | if ( createbup ) { | 1792 | if ( createbup ) { |
1780 | mView->saveCalendar( fn ); | 1793 | mView->saveCalendar( fn ); |
1781 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1794 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1782 | KOPrefs::instance()->mLastSaveFile = fn; | 1795 | KOPrefs::instance()->mLastSaveFile = fn; |
1783 | setCaption(mes); | 1796 | setCaption(mes); |
1784 | } | 1797 | } |
1785 | } | 1798 | } |
1786 | void MainWindow::loadCalendar() | 1799 | void MainWindow::loadCalendar() |
1787 | { | 1800 | { |
1788 | 1801 | ||
1789 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1802 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1790 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1803 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1791 | 1804 | ||
1792 | if ( fn == "" ) | 1805 | if ( fn == "" ) |
1793 | return; | 1806 | return; |
1794 | QFileInfo info; | 1807 | QFileInfo info; |
1795 | info.setFile( fn ); | 1808 | info.setFile( fn ); |
1796 | QString mess; | 1809 | QString mess; |
1797 | bool loadbup = true; | 1810 | bool loadbup = true; |
1798 | if ( info. exists() ) { | 1811 | if ( info. exists() ) { |
1799 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1812 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1800 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1813 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1801 | mess, | 1814 | mess, |
1802 | i18n("Load!"), i18n("Cancel"), 0, | 1815 | i18n("Load!"), i18n("Cancel"), 0, |
1803 | 0, 1 ); | 1816 | 0, 1 ); |
1804 | if ( result != 0 ) { | 1817 | if ( result != 0 ) { |
1805 | loadbup = false; | 1818 | loadbup = false; |
1806 | } | 1819 | } |
1807 | } else { | 1820 | } else { |
1808 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1821 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1809 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1822 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1810 | 0, 1 ); | 1823 | 0, 1 ); |
1811 | 1824 | ||
1812 | return; | 1825 | return; |
1813 | } | 1826 | } |
1814 | if ( loadbup ) { | 1827 | if ( loadbup ) { |
1815 | mView->openCalendar( fn ); | 1828 | mView->openCalendar( fn ); |
1816 | KOPrefs::instance()->mLastLoadFile = fn; | 1829 | KOPrefs::instance()->mLastLoadFile = fn; |
1817 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1830 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1818 | setCaption(mess); | 1831 | setCaption(mess); |
1819 | } | 1832 | } |
1820 | 1833 | ||
1821 | } | 1834 | } |
1822 | void MainWindow::quickImportIcal() | 1835 | void MainWindow::quickImportIcal() |
1823 | { | 1836 | { |
1824 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1837 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1825 | } | 1838 | } |
1826 | void MainWindow::importFile( QString fn, bool quick ) | 1839 | void MainWindow::importFile( QString fn, bool quick ) |
1827 | { | 1840 | { |
1828 | QFileInfo info; | 1841 | QFileInfo info; |
1829 | info.setFile( fn ); | 1842 | info.setFile( fn ); |
1830 | QString mess; | 1843 | QString mess; |
1831 | bool loadbup = true; | 1844 | bool loadbup = true; |
1832 | if ( !info. exists() ) { | 1845 | if ( !info. exists() ) { |
1833 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1846 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1834 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1847 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1835 | mess ); | 1848 | mess ); |
1836 | return; | 1849 | return; |
1837 | } | 1850 | } |
1838 | int result = 0; | 1851 | int result = 0; |
1839 | if ( !quick ) { | 1852 | if ( !quick ) { |
1840 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1853 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1841 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1854 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1842 | mess, | 1855 | mess, |
1843 | "Import", "Cancel", 0, | 1856 | "Import", "Cancel", 0, |
1844 | 0, 1 ); | 1857 | 0, 1 ); |
1845 | } | 1858 | } |
1846 | if ( result == 0 ) { | 1859 | if ( result == 0 ) { |
1847 | if ( mView->openCalendar( fn, true )) { | 1860 | if ( mView->openCalendar( fn, true )) { |
1848 | KOPrefs::instance()->mLastImportFile = fn; | 1861 | KOPrefs::instance()->mLastImportFile = fn; |
1849 | setCaption(i18n("Imported file successfully")); | 1862 | setCaption(i18n("Imported file successfully")); |
1850 | } else { | 1863 | } else { |
1851 | setCaption(i18n("Error importing file")); | 1864 | setCaption(i18n("Error importing file")); |
1852 | } | 1865 | } |
1853 | } | 1866 | } |
1854 | } | 1867 | } |
1855 | 1868 | ||
1856 | void MainWindow::importIcal() | 1869 | void MainWindow::importIcal() |
1857 | { | 1870 | { |
1858 | 1871 | ||
1859 | QString fn =KOPrefs::instance()->mLastImportFile; | 1872 | QString fn =KOPrefs::instance()->mLastImportFile; |
1860 | 1873 | ||
1861 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 1874 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
1862 | if ( fn == "" ) | 1875 | if ( fn == "" ) |
1863 | return; | 1876 | return; |
1864 | importFile( fn, true ); | 1877 | importFile( fn, true ); |
1865 | 1878 | ||
1866 | } | 1879 | } |
1867 | 1880 | ||
1868 | void MainWindow::exportVCalendar() | 1881 | void MainWindow::exportVCalendar() |
1869 | { | 1882 | { |
1870 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1883 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1871 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1884 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1872 | if ( fn == "" ) | 1885 | if ( fn == "" ) |
1873 | return; | 1886 | return; |
1874 | QFileInfo info; | 1887 | QFileInfo info; |
1875 | info.setFile( fn ); | 1888 | info.setFile( fn ); |
1876 | QString mes; | 1889 | QString mes; |
1877 | bool createbup = true; | 1890 | bool createbup = true; |
1878 | if ( info. exists() ) { | 1891 | if ( info. exists() ) { |
1879 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1892 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1880 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1893 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1881 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1894 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1882 | 0, 1 ); | 1895 | 0, 1 ); |
1883 | if ( result != 0 ) { | 1896 | if ( result != 0 ) { |
1884 | createbup = false; | 1897 | createbup = false; |
1885 | } | 1898 | } |
1886 | } | 1899 | } |
1887 | if ( createbup ) { | 1900 | if ( createbup ) { |
1888 | if ( mView->exportVCalendar( fn ) ) { | 1901 | if ( mView->exportVCalendar( fn ) ) { |
1889 | KOPrefs::instance()->mLastVcalFile = fn; | 1902 | KOPrefs::instance()->mLastVcalFile = fn; |
1890 | if ( fn.length() > 20 ) | 1903 | if ( fn.length() > 20 ) |
1891 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1904 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1892 | else | 1905 | else |
1893 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1906 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1894 | setCaption(mes); | 1907 | setCaption(mes); |
1895 | } | 1908 | } |
1896 | } | 1909 | } |
1897 | 1910 | ||
1898 | } | 1911 | } |
1899 | 1912 | ||
1900 | void MainWindow::syncFileRequest() | 1913 | void MainWindow::syncFileRequest() |
1901 | { | 1914 | { |
1902 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1915 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1903 | mSyncManager->slotSyncMenu( 999 ); | 1916 | mSyncManager->slotSyncMenu( 999 ); |
1904 | } | 1917 | } |
1905 | save(); | 1918 | save(); |
1906 | } | 1919 | } |
1907 | void MainWindow::getFile( bool success ) | 1920 | void MainWindow::getFile( bool success ) |
1908 | { | 1921 | { |
1909 | if ( ! success ) { | 1922 | if ( ! success ) { |
1910 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 1923 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
1911 | return; | 1924 | return; |
1912 | } | 1925 | } |
1913 | mView->openCalendar( defaultFileName() ); | 1926 | mView->openCalendar( defaultFileName() ); |
1914 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1927 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1915 | mSyncManager->slotSyncMenu( 999 ); | 1928 | mSyncManager->slotSyncMenu( 999 ); |
1916 | } | 1929 | } |
1917 | setCaption( i18n("Pi-Sync successful!") ); | 1930 | setCaption( i18n("Pi-Sync successful!") ); |
1918 | } | 1931 | } |
1919 | 1932 | ||
1920 | void MainWindow::printSel( ) | 1933 | void MainWindow::printSel( ) |
1921 | { | 1934 | { |
1922 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 1935 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
1923 | } | 1936 | } |
1924 | 1937 | ||
1925 | void MainWindow::printCal() | 1938 | void MainWindow::printCal() |
1926 | { | 1939 | { |
1927 | mView->print();//mCp->showDialog(); | 1940 | mView->print();//mCp->showDialog(); |
1928 | } | 1941 | } |
1929 | 1942 | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 6de0543..8dd55ac 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,141 +1,142 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <qdict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qtextstream.h> | 8 | #include <qtextstream.h> |
9 | #include <qregexp.h> | 9 | #include <qregexp.h> |
10 | 10 | ||
11 | #include <libkcal/incidence.h> | 11 | #include <libkcal/incidence.h> |
12 | #include "simplealarmclient.h" | 12 | #include "simplealarmclient.h" |
13 | #include <ksyncmanager.h> | 13 | #include <ksyncmanager.h> |
14 | #ifndef DESKTOP_VERSION | 14 | #ifndef DESKTOP_VERSION |
15 | #include <qcopchannel_qws.h> | 15 | #include <qcopchannel_qws.h> |
16 | #endif | 16 | #endif |
17 | class QAction; | 17 | class QAction; |
18 | class CalendarView; | 18 | class CalendarView; |
19 | class KSyncProfile; | 19 | class KSyncProfile; |
20 | #ifdef DESKTOP_VERSION | 20 | #ifdef DESKTOP_VERSION |
21 | 21 | ||
22 | #define QPEToolBar QToolBar | 22 | #define QPEToolBar QToolBar |
23 | #define QPEMenuBar QMenuBar | 23 | #define QPEMenuBar QMenuBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | 26 | ||
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | class CalendarLocal; | 29 | class CalendarLocal; |
30 | } | 30 | } |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | class MainWindow : public QMainWindow | 34 | class MainWindow : public QMainWindow |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
39 | ~MainWindow(); | 39 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 40 | bool beamReceiveEnabled(); |
41 | static QString defaultFileName(); | 41 | static QString defaultFileName(); |
42 | static QString syncFileName(); | 42 | static QString syncFileName(); |
43 | static QString resourcePath(); | 43 | static QString resourcePath(); |
44 | public slots: | 44 | public slots: |
45 | virtual void showMaximized (); | 45 | virtual void showMaximized (); |
46 | void configureAgenda( int ); | 46 | void configureAgenda( int ); |
47 | void recieve( const QCString& msg, const QByteArray& data ); | 47 | void recieve( const QCString& msg, const QByteArray& data ); |
48 | protected slots: | 48 | protected slots: |
49 | void setCaptionToDates(); | 49 | void setCaptionToDates(); |
50 | void about(); | 50 | void about(); |
51 | void licence(); | 51 | void licence(); |
52 | void faq(); | 52 | void faq(); |
53 | void usertrans(); | 53 | void usertrans(); |
54 | void features(); | 54 | void features(); |
55 | void synchowto(); | 55 | void synchowto(); |
56 | void kdesynchowto(); | 56 | void kdesynchowto(); |
57 | void multisynchowto(); | 57 | void multisynchowto(); |
58 | void whatsNew(); | 58 | void whatsNew(); |
59 | void keyBindings(); | 59 | void keyBindings(); |
60 | void aboutAutoSaving();; | 60 | void aboutAutoSaving();; |
61 | void aboutKnownBugs(); | 61 | void aboutKnownBugs(); |
62 | 62 | ||
63 | void processIncidenceSelection( Incidence * ); | 63 | void processIncidenceSelection( Incidence * ); |
64 | 64 | ||
65 | void importQtopia(); | 65 | void importQtopia(); |
66 | void importBday(); | 66 | void importBday(); |
67 | void importOL(); | 67 | void importOL(); |
68 | void importIcal(); | 68 | void importIcal(); |
69 | void importFile( QString, bool ); | 69 | void importFile( QString, bool ); |
70 | void quickImportIcal(); | 70 | void quickImportIcal(); |
71 | 71 | ||
72 | void slotModifiedChanged( bool ); | 72 | void slotModifiedChanged( bool ); |
73 | 73 | ||
74 | void save(); | 74 | void save(); |
75 | void saveStopTimer(); | ||
75 | void configureToolBar( int ); | 76 | void configureToolBar( int ); |
76 | void printSel(); | 77 | void printSel(); |
77 | void printCal(); | 78 | void printCal(); |
78 | void saveCalendar(); | 79 | void saveCalendar(); |
79 | void loadCalendar(); | 80 | void loadCalendar(); |
80 | void exportVCalendar(); | 81 | void exportVCalendar(); |
81 | void fillFilterMenu(); | 82 | void fillFilterMenu(); |
82 | void selectFilter( int ); | 83 | void selectFilter( int ); |
83 | void exportToPhone( int ); | 84 | void exportToPhone( int ); |
84 | void toggleBeamReceive(); | 85 | void toggleBeamReceive(); |
85 | void disableBR(bool); | 86 | void disableBR(bool); |
86 | 87 | ||
87 | private slots: | 88 | private slots: |
88 | void showConfigureAgenda(); | 89 | void showConfigureAgenda(); |
89 | void getFile( bool ); | 90 | void getFile( bool ); |
90 | void syncFileRequest(); | 91 | void syncFileRequest(); |
91 | 92 | ||
92 | protected: | 93 | protected: |
93 | void displayText( QString, QString); | 94 | void displayText( QString, QString); |
94 | void enableIncidenceActions( bool ); | 95 | void enableIncidenceActions( bool ); |
95 | 96 | ||
96 | private: | 97 | private: |
97 | bool mBRdisabled; | 98 | bool mBRdisabled; |
98 | #ifndef DESKTOP_VERSION | 99 | #ifndef DESKTOP_VERSION |
99 | QCopChannel* infrared; | 100 | QCopChannel* infrared; |
100 | #endif | 101 | #endif |
101 | QAction* brAction; | 102 | QAction* brAction; |
102 | KSyncManager* mSyncManager; | 103 | KSyncManager* mSyncManager; |
103 | bool mClosed; | 104 | bool mClosed; |
104 | void saveOnClose(); | 105 | void saveOnClose(); |
105 | bool mFlagKeyPressed; | 106 | bool mFlagKeyPressed; |
106 | bool mBlockAtStartup; | 107 | bool mBlockAtStartup; |
107 | QPEToolBar *iconToolBar; | 108 | QPEToolBar *iconToolBar; |
108 | void initActions(); | 109 | void initActions(); |
109 | void setDefaultPreferences(); | 110 | void setDefaultPreferences(); |
110 | void keyPressEvent ( QKeyEvent * ) ; | 111 | void keyPressEvent ( QKeyEvent * ) ; |
111 | void keyReleaseEvent ( QKeyEvent * ) ; | 112 | void keyReleaseEvent ( QKeyEvent * ) ; |
112 | QPopupMenu *configureToolBarMenu; | 113 | QPopupMenu *configureToolBarMenu; |
113 | QPopupMenu *selectFilterMenu; | 114 | QPopupMenu *selectFilterMenu; |
114 | QPopupMenu *configureAgendaMenu, *syncMenu; | 115 | QPopupMenu *configureAgendaMenu, *syncMenu; |
115 | CalendarLocal *mCalendar; | 116 | CalendarLocal *mCalendar; |
116 | CalendarView *mView; | 117 | CalendarView *mView; |
117 | QAction *mNewSubTodoAction; | 118 | QAction *mNewSubTodoAction; |
118 | 119 | ||
119 | QAction *mShowAction; | 120 | QAction *mShowAction; |
120 | QAction *mEditAction; | 121 | QAction *mEditAction; |
121 | QAction *mDeleteAction; | 122 | QAction *mDeleteAction; |
122 | QAction *mCloneAction; | 123 | QAction *mCloneAction; |
123 | QAction *mMoveAction; | 124 | QAction *mMoveAction; |
124 | QAction *mBeamAction; | 125 | QAction *mBeamAction; |
125 | QAction *mCancelAction; | 126 | QAction *mCancelAction; |
126 | 127 | ||
127 | QAction *mToggleNav; | 128 | QAction *mToggleNav; |
128 | QAction *mToggleFilter; | 129 | QAction *mToggleFilter; |
129 | QAction *mToggleAllday; | 130 | QAction *mToggleAllday; |
130 | 131 | ||
131 | 132 | ||
132 | void closeEvent( QCloseEvent* ce ); | 133 | void closeEvent( QCloseEvent* ce ); |
133 | SimpleAlarmClient mAlarmClient; | 134 | SimpleAlarmClient mAlarmClient; |
134 | QTimer mSaveTimer; | 135 | QTimer mSaveTimer; |
135 | //bool mBlockSaveFlag; | 136 | //bool mBlockSaveFlag; |
136 | bool mCalendarModifiedFlag; | 137 | bool mCalendarModifiedFlag; |
137 | QPixmap loadPixmap( QString ); | 138 | QPixmap loadPixmap( QString ); |
138 | }; | 139 | }; |
139 | 140 | ||
140 | 141 | ||
141 | #endif | 142 | #endif |