author | zautrix <zautrix> | 2005-02-16 22:08:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-16 22:08:18 (UTC) |
commit | 451b4de59893b5c0801a7bbb2f8cbe8e0266b324 (patch) (unidiff) | |
tree | ce3f535541583d37cfe951ddd8d7474770d9c374 | |
parent | b2cf8e9a08082539e0a5578a98766e5990783f9a (diff) | |
download | kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.zip kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.gz kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.bz2 |
month view fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/datenavigator.cpp | 15 | ||||
-rw-r--r-- | korganizer/datenavigator.h | 3 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 8 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 62 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 12 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 26 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 4 |
13 files changed, 124 insertions, 19 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index a3ea5ee..3d8edfc 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,262 +1,264 @@ | |||
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.8 ************ | 3 | ********** VERSION 2.0.8 ************ |
4 | 4 | ||
5 | Fixed a problem in dependency info in the ipk files for the Zaurus. | 5 | Fixed a problem in dependency info in the ipk files for the Zaurus. |
6 | 6 | ||
7 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. | ||
8 | |||
7 | 9 | ||
8 | ********** VERSION 2.0.7 ************ | 10 | ********** VERSION 2.0.7 ************ |
9 | 11 | ||
10 | Added global application font settings | 12 | Added global application font settings |
11 | (for all KDE-Pim/Pi apps) to the general settings. | 13 | (for all KDE-Pim/Pi apps) to the general settings. |
12 | 14 | ||
13 | Fixed a problem in OM/Pi when trying to login to some IMAP servers | 15 | Fixed a problem in OM/Pi when trying to login to some IMAP servers |
14 | (like the IMAP server of Apple: mail.mac.com ) | 16 | (like the IMAP server of Apple: mail.mac.com ) |
15 | 17 | ||
16 | Added recurring todos to KO/Pi. | 18 | Added recurring todos to KO/Pi. |
17 | 19 | ||
18 | 20 | ||
19 | ********** VERSION 2.0.6 ************ | 21 | ********** VERSION 2.0.6 ************ |
20 | 22 | ||
21 | Some bugfixes in the pi-sync mode. | 23 | Some bugfixes in the pi-sync mode. |
22 | Added German translation for pi-sync mode. | 24 | Added German translation for pi-sync mode. |
23 | 25 | ||
24 | KO/Pi: | 26 | KO/Pi: |
25 | Made the todolist using alternate background. | 27 | Made the todolist using alternate background. |
26 | 28 | ||
27 | Other minor fixes in KO/Pi. | 29 | Other minor fixes in KO/Pi. |
28 | 30 | ||
29 | 31 | ||
30 | ********** VERSION 2.0.5 ************ | 32 | ********** VERSION 2.0.5 ************ |
31 | 33 | ||
32 | Bugfixes in KO/Pi. | 34 | Bugfixes in KO/Pi. |
33 | 35 | ||
34 | ********** VERSION 2.0.4 ************ | 36 | ********** VERSION 2.0.4 ************ |
35 | 37 | ||
36 | KO/Pi: | 38 | KO/Pi: |
37 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. | 39 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. |
38 | 40 | ||
39 | Added a general "select week number" to the toolbar. | 41 | Added a general "select week number" to the toolbar. |
40 | 42 | ||
41 | Fixed some small problem of the new features introduced in version 2.0.3. | 43 | Fixed some small problem of the new features introduced in version 2.0.3. |
42 | 44 | ||
43 | Made it possible to specify one specific category as category color, | 45 | Made it possible to specify one specific category as category color, |
44 | if more than one categories are selected. | 46 | if more than one categories are selected. |
45 | 47 | ||
46 | Fixed a bug in saving colors for categories with non-ascii characters. | 48 | Fixed a bug in saving colors for categories with non-ascii characters. |
47 | (Like, e.g. German Umlauts). | 49 | (Like, e.g. German Umlauts). |
48 | Propably you have to set your colors again for those categories. | 50 | Propably you have to set your colors again for those categories. |
49 | 51 | ||
50 | 52 | ||
51 | ********** VERSION 2.0.3 ************ | 53 | ********** VERSION 2.0.3 ************ |
52 | 54 | ||
53 | KO/Pi: | 55 | KO/Pi: |
54 | Added feature for changing alarm settings for many items at once: | 56 | Added feature for changing alarm settings for many items at once: |
55 | Open list view (or search dialog), select the desired items and choose in | 57 | Open list view (or search dialog), select the desired items and choose in |
56 | the popup menu: Set alarm for selected... | 58 | the popup menu: Set alarm for selected... |
57 | 59 | ||
58 | Added to the event/todo viewer the option to send an email to | 60 | Added to the event/todo viewer the option to send an email to |
59 | all attendees or all selected (with RSVP) attendees. | 61 | all attendees or all selected (with RSVP) attendees. |
60 | 62 | ||
61 | Made the week-month mode changing in month view faster. | 63 | Made the week-month mode changing in month view faster. |
62 | 64 | ||
63 | Made month view better useable with keyboard. | 65 | Made month view better useable with keyboard. |
64 | Now TAB key jumps to next cell with an event/todo. | 66 | Now TAB key jumps to next cell with an event/todo. |
65 | Scroll in cell with coursor keys, scroll in time (next week) with | 67 | Scroll in cell with coursor keys, scroll in time (next week) with |
66 | Shift/Control + coursorkeys. | 68 | Shift/Control + coursorkeys. |
67 | 69 | ||
68 | Fixed bug that the todo view flat mode was reset after first view update. | 70 | Fixed bug that the todo view flat mode was reset after first view update. |
69 | 71 | ||
70 | If a todo is displayed closed in the todo view, | 72 | If a todo is displayed closed in the todo view, |
71 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. | 73 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. |
72 | 74 | ||
73 | Added info about the numbers of years to the caption (title) information about a birthday event. | 75 | Added info about the numbers of years to the caption (title) information about a birthday event. |
74 | 76 | ||
75 | Made completion date in todo editor editable. | 77 | Made completion date in todo editor editable. |
76 | 78 | ||
77 | Added possibility to save/load templates for journals. | 79 | Added possibility to save/load templates for journals. |
78 | (Which is just a simple "save text to file" or "insert text from file". | 80 | (Which is just a simple "save text to file" or "insert text from file". |
79 | 81 | ||
80 | ********** VERSION 2.0.2 ************ | 82 | ********** VERSION 2.0.2 ************ |
81 | 83 | ||
82 | KO/Pi: | 84 | KO/Pi: |
83 | Fixed the layout problem of the day label buttons | 85 | Fixed the layout problem of the day label buttons |
84 | of the agenda view introduced in version 2.0.1. | 86 | of the agenda view introduced in version 2.0.1. |
85 | 87 | ||
86 | Added WhatsThis support for the todo view and the list view. | 88 | Added WhatsThis support for the todo view and the list view. |
87 | 89 | ||
88 | Added a quite useful feature to the montview. | 90 | Added a quite useful feature to the montview. |
89 | Just click on the week numbers on the left. | 91 | Just click on the week numbers on the left. |
90 | And in the top right corner of month view/agenda view | 92 | And in the top right corner of month view/agenda view |
91 | there is now a "week number quick selector". | 93 | there is now a "week number quick selector". |
92 | (Click on the black triangle). | 94 | (Click on the black triangle). |
93 | 95 | ||
94 | Made the quite difficult timezone change in KO/Pi easy. | 96 | Made the quite difficult timezone change in KO/Pi easy. |
95 | 97 | ||
96 | OM/Pi: | 98 | OM/Pi: |
97 | Fixed too small icons on desktop. | 99 | Fixed too small icons on desktop. |
98 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 100 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
99 | Added signature file setting to smtp account config. | 101 | Added signature file setting to smtp account config. |
100 | And the signature can be edited and saved in the edit mail dialog. | 102 | And the signature can be edited and saved in the edit mail dialog. |
101 | That does mean: | 103 | That does mean: |
102 | Simply edit the signature for the selected smtp account in the | 104 | Simply edit the signature for the selected smtp account in the |
103 | edit new mail dialog and press the "save signature" button there. | 105 | edit new mail dialog and press the "save signature" button there. |
104 | Then the signature is saved to the file specified in the smtp account settings. | 106 | Then the signature is saved to the file specified in the smtp account settings. |
105 | If there is no file specified, it is saved automatically to the file | 107 | If there is no file specified, it is saved automatically to the file |
106 | kdepim/apps/kopiemail/<accountname>.sig. | 108 | kdepim/apps/kopiemail/<accountname>.sig. |
107 | 109 | ||
108 | 110 | ||
109 | 111 | ||
110 | ********** VERSION 2.0.1 ************ | 112 | ********** VERSION 2.0.1 ************ |
111 | 113 | ||
112 | Oooops ... I forgot to test on the Zaurus 5500 ... | 114 | Oooops ... I forgot to test on the Zaurus 5500 ... |
113 | 115 | ||
114 | Fixed many problems of new (english) strings (and german translations) | 116 | Fixed many problems of new (english) strings (and german translations) |
115 | introduced in the latest versions, where the text was not fitting on the | 117 | introduced in the latest versions, where the text was not fitting on the |
116 | 240x320 display of the Zaurus 5500. | 118 | 240x320 display of the Zaurus 5500. |
117 | 119 | ||
118 | KO/Pi: | 120 | KO/Pi: |
119 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 121 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
120 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 122 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
121 | 123 | ||
122 | Added items to the todolist popup menu for: | 124 | Added items to the todolist popup menu for: |
123 | Display all opened, all closed or all todos flat. | 125 | Display all opened, all closed or all todos flat. |
124 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 126 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
125 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 127 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
126 | Fixed several bugs in setting the completed datetime for todos. | 128 | Fixed several bugs in setting the completed datetime for todos. |
127 | Added info about completed datetime of todos to the todo viewer. | 129 | Added info about completed datetime of todos to the todo viewer. |
128 | Now displaying a completed todo (with completed datetime set) in the agenda view | 130 | Now displaying a completed todo (with completed datetime set) in the agenda view |
129 | at the time of the completion. Such that now it is possible to see in the agenda view | 131 | at the time of the completion. Such that now it is possible to see in the agenda view |
130 | when what todo was completed. | 132 | when what todo was completed. |
131 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 133 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
132 | Now the behaviour is: | 134 | Now the behaviour is: |
133 | Setting a parent to complete sets all (sub)childs to complete. | 135 | Setting a parent to complete sets all (sub)childs to complete. |
134 | Setting a parent to uncomplete does not change the childs. | 136 | Setting a parent to uncomplete does not change the childs. |
135 | Setting a child to uncomplete sets all parent to uncomplete. | 137 | Setting a child to uncomplete sets all parent to uncomplete. |
136 | Setting a child to complete does not change the parents. | 138 | Setting a child to complete does not change the parents. |
137 | 139 | ||
138 | Smart updating and double buffering of the daymatrix. | 140 | Smart updating and double buffering of the daymatrix. |
139 | Showing holidays in the day matrix. | 141 | Showing holidays in the day matrix. |
140 | Many other small performance updates. | 142 | Many other small performance updates. |
141 | 143 | ||
142 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 144 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
143 | 145 | ||
144 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 146 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
145 | 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. | 147 | 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. |
146 | 148 | ||
147 | 149 | ||
148 | ********** VERSION 2.0.0 ************ | 150 | ********** VERSION 2.0.0 ************ |
149 | 151 | ||
150 | Stable release 2.0.0! | 152 | Stable release 2.0.0! |
151 | 153 | ||
152 | KO/Pi: | 154 | KO/Pi: |
153 | Fixed problem in edit dialog recreation at startup. | 155 | Fixed problem in edit dialog recreation at startup. |
154 | Made "toggle view*" menu items enabled context sensitive. | 156 | Made "toggle view*" menu items enabled context sensitive. |
155 | Changed agenda size menu to items 1-10. | 157 | Changed agenda size menu to items 1-10. |
156 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 158 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
157 | Usebility enhancements in the KO/Pi menus. | 159 | Usebility enhancements in the KO/Pi menus. |
158 | Birthday import now adds year to summary. | 160 | Birthday import now adds year to summary. |
159 | What's Next view shows age in years for birthday. | 161 | What's Next view shows age in years for birthday. |
160 | 162 | ||
161 | OM/Pi: | 163 | OM/Pi: |
162 | Added three info lines to display subject, from and to of selected mails. | 164 | Added three info lines to display subject, from and to of selected mails. |
163 | 165 | ||
164 | KA/Pi: | 166 | KA/Pi: |
165 | Fixed jump bar behaviour on Zaurus. | 167 | Fixed jump bar behaviour on Zaurus. |
166 | Now KA/Pi search field supports searching for a range of starting characters. | 168 | Now KA/Pi search field supports searching for a range of starting characters. |
167 | E.g. to search for all contact beginning with b to n, type | 169 | E.g. to search for all contact beginning with b to n, type |
168 | b-n | 170 | b-n |
169 | in the search field. | 171 | in the search field. |
170 | 172 | ||
171 | ********** VERSION 1.9.20 ************ | 173 | ********** VERSION 1.9.20 ************ |
172 | 174 | ||
173 | KO/Pi: | 175 | KO/Pi: |
174 | Added for the "dislplay one day" agenda mode | 176 | Added for the "dislplay one day" agenda mode |
175 | info in the caption and in the day lables: | 177 | info in the caption and in the day lables: |
176 | Now it is displayed, if the selected day is from "day before yesterday" | 178 | Now it is displayed, if the selected day is from "day before yesterday" |
177 | to "day after tomorrow". | 179 | to "day after tomorrow". |
178 | Made it possible to delete a Todo, which has sub-todos. | 180 | Made it possible to delete a Todo, which has sub-todos. |
179 | Fixed two small problems in the todo view. | 181 | Fixed two small problems in the todo view. |
180 | Added missing German translation for filter edit and print dialog. | 182 | Added missing German translation for filter edit and print dialog. |
181 | Made search dialog closeable by cancel key. | 183 | Made search dialog closeable by cancel key. |
182 | 184 | ||
183 | Made it possible to select in the date picker the (ligt grey ) | 185 | Made it possible to select in the date picker the (ligt grey ) |
184 | dates of the prev./next month with the mouse. | 186 | dates of the prev./next month with the mouse. |
185 | 187 | ||
186 | OM/Pi: | 188 | OM/Pi: |
187 | "Delete mail" icon in main window now deletes all selected mails. | 189 | "Delete mail" icon in main window now deletes all selected mails. |
188 | Fixed the problem, that the state flag of imap mails was ignored. | 190 | Fixed the problem, that the state flag of imap mails was ignored. |
189 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view | 191 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view |
190 | to indecate that they are already seen. | 192 | to indecate that they are already seen. |
191 | Fixed the problem that the body of some mails was not displayed in the | 193 | Fixed the problem that the body of some mails was not displayed in the |
192 | mail viewer when fetching them from the imap server directly to read them. | 194 | mail viewer when fetching them from the imap server directly to read them. |
193 | Made it (configurable) possible to show the "To:" field in the list view. | 195 | Made it (configurable) possible to show the "To:" field in the list view. |
194 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | 196 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. |
195 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the | 197 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the |
196 | local storage folder (specified in account settings) of the account of the mail. | 198 | local storage folder (specified in account settings) of the account of the mail. |
197 | Removed some memory leaks in OM/Pi. | 199 | Removed some memory leaks in OM/Pi. |
198 | 200 | ||
199 | 201 | ||
200 | ********** VERSION 1.9.19 ************ | 202 | ********** VERSION 1.9.19 ************ |
201 | 203 | ||
202 | Added a lot of missing translations to KA/Pi, | 204 | Added a lot of missing translations to KA/Pi, |
203 | Added some missing translations to KO/Pi and OM/Pi. | 205 | Added some missing translations to KO/Pi and OM/Pi. |
204 | 206 | ||
205 | Fixed some minor problems in KA/Pi + KO/Pi. | 207 | Fixed some minor problems in KA/Pi + KO/Pi. |
206 | 208 | ||
207 | Fixed a crash when closing PwM/Pi. | 209 | Fixed a crash when closing PwM/Pi. |
208 | Added German translation for PwM/Pi. | 210 | Added German translation for PwM/Pi. |
209 | 211 | ||
210 | Made view change and Month View update faster in KO/Pi. | 212 | Made view change and Month View update faster in KO/Pi. |
211 | 213 | ||
212 | 214 | ||
213 | ********** VERSION 1.9.18 ************ | 215 | ********** VERSION 1.9.18 ************ |
214 | 216 | ||
215 | FYI: The VERSION 1.9.17 was a testing release only. | 217 | FYI: The VERSION 1.9.17 was a testing release only. |
216 | Please read the changelog of VERSION 1.9.17 as well. | 218 | Please read the changelog of VERSION 1.9.17 as well. |
217 | 219 | ||
218 | Cleaned up the syncing config dialog. | 220 | Cleaned up the syncing config dialog. |
219 | Added sync config options for date range for events. | 221 | Added sync config options for date range for events. |
220 | Added sync config options for filters on incoming data. | 222 | Added sync config options for filters on incoming data. |
221 | Added sync config options for filters on outgoing data. | 223 | Added sync config options for filters on outgoing data. |
222 | Please read the updated SyncHowTo about the new filter settings. | 224 | Please read the updated SyncHowTo about the new filter settings. |
223 | These filter settings make it now possible to sync with shared | 225 | These filter settings make it now possible to sync with shared |
224 | calendars without writing back private or confidential data | 226 | calendars without writing back private or confidential data |
225 | (via the outgoing filters). | 227 | (via the outgoing filters). |
226 | To sync only with particular parts of a shared calendar, | 228 | To sync only with particular parts of a shared calendar, |
227 | the incoming filter settings can be used. | 229 | the incoming filter settings can be used. |
228 | An example can be found in the SyncHowTo. | 230 | An example can be found in the SyncHowTo. |
229 | Same for shared addressbooks. | 231 | Same for shared addressbooks. |
230 | 232 | ||
231 | Added a setting for the global kdepim data storage. | 233 | Added a setting for the global kdepim data storage. |
232 | Usually the data is stored in (yourhomedir/kdepim). | 234 | Usually the data is stored in (yourhomedir/kdepim). |
233 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" | 235 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" |
234 | a directory where all the kdepim data is stored. | 236 | a directory where all the kdepim data is stored. |
235 | That makes it easy to save all kdepim data on a SD card on the Z, for example. | 237 | That makes it easy to save all kdepim data on a SD card on the Z, for example. |
236 | 238 | ||
237 | KO/Pi: | 239 | KO/Pi: |
238 | The timeedit input has a pulldown list for times. | 240 | The timeedit input has a pulldown list for times. |
239 | If opened, this pulldown list should now has the right time highlighted. | 241 | If opened, this pulldown list should now has the right time highlighted. |
240 | Added the possibility to exclude events/todos/journals in a filter. | 242 | Added the possibility to exclude events/todos/journals in a filter. |
241 | You should exclude journals, if you do not want them to sync with a public calendar. | 243 | You should exclude journals, if you do not want them to sync with a public calendar. |
242 | 244 | ||
243 | KA/Pi: | 245 | KA/Pi: |
244 | Added the possibility to in/exclude public/private/confidential contacts to a filter. | 246 | Added the possibility to in/exclude public/private/confidential contacts to a filter. |
245 | 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 ... | 247 | 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 ... |
246 | Added printing of card view and details view on desktop. | 248 | Added printing of card view and details view on desktop. |
247 | Printing of list view is not working... | 249 | Printing of list view is not working... |
248 | Added button for removing pictures in contact editor. | 250 | Added button for removing pictures in contact editor. |
249 | Parsing data fix of KA/Pi version 1.9.17. | 251 | Parsing data fix of KA/Pi version 1.9.17. |
250 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. | 252 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. |
251 | Fixed some syncing merging problems. | 253 | Fixed some syncing merging problems. |
252 | 254 | ||
253 | 255 | ||
254 | ********** VERSION 1.9.17 ************ | 256 | ********** VERSION 1.9.17 ************ |
255 | 257 | ||
256 | KO/Pi: | 258 | KO/Pi: |
257 | Fixed that tooltips were not updated after moving an item in agenda view. | 259 | Fixed that tooltips were not updated after moving an item in agenda view. |
258 | Fixed a bug in sorting start date for recurring events in list view. | 260 | Fixed a bug in sorting start date for recurring events in list view. |
259 | Changed the left button in todo viewer from "Agenda" to "Set completed". | 261 | Changed the left button in todo viewer from "Agenda" to "Set completed". |
260 | 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. | 262 | 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. |
261 | Added more info in the todo viewer: Startdate, parent/sub todos. | 263 | Added more info in the todo viewer: Startdate, parent/sub todos. |
262 | 264 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2d4cb74..5f1bee4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1018,267 +1018,267 @@ | |||
1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, | 1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, |
1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, | 1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, |
1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, | 1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, |
1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, | 1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, |
1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, | 1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, |
1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, | 1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, |
1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datenavigator</p>\n" }, | 1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datenavigator</p>\n" }, |
1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, | 1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, |
1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, | 1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, |
1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monats Ansicht</p>\n" }, | 1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monats Ansicht</p>\n" }, |
1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" }, | 1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" }, |
1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, | 1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, |
1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht days view| <b>W</b>: What's next Ansicht\n " }, | 1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht days view| <b>W</b>: What's next Ansicht\n " }, |
1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, | 1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, |
1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, | 1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, |
1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, | 1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, |
1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, | 1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, |
1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, | 1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, |
1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, | 1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, |
1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, | 1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, |
1038 | { "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","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, | 1038 | { "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","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, |
1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, | 1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, |
1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, | 1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, |
1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, | 1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, |
1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" }, | 1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" }, |
1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, | 1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, |
1044 | { "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","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, | 1044 | { "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","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, |
1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, | 1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, |
1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, | 1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, |
1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, | 1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, |
1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, | 1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, |
1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, | 1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, |
1050 | { "From: ","Von: " }, | 1050 | { "From: ","Von: " }, |
1051 | { "Remove sync info","Entferne Sync Info" }, | 1051 | { "Remove sync info","Entferne Sync Info" }, |
1052 | { "For all profiles","Für alle Profile" }, | 1052 | { "For all profiles","Für alle Profile" }, |
1053 | { "Hide not Running","Verstecke nicht Laufende" }, | 1053 | { "Hide not Running","Verstecke nicht Laufende" }, |
1054 | { "ME","ME" }, | 1054 | { "ME","ME" }, |
1055 | { "Toolbar","Toolbar" }, | 1055 | { "Toolbar","Toolbar" }, |
1056 | { "Undo Delete...","Löschen rückgängig machen..." }, | 1056 | { "Undo Delete...","Löschen rückgängig machen..." }, |
1057 | { "Undo Delete","Löschen rückgängig machen" }, | 1057 | { "Undo Delete","Löschen rückgängig machen" }, |
1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, | 1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, |
1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, | 1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, |
1060 | { "Januar","Januar" }, | 1060 | { "Januar","Januar" }, |
1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, | 1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, |
1062 | { "No Filter","Kein Filter" }, | 1062 | { "No Filter","Kein Filter" }, |
1063 | { "Multiple Sync options","Multi Sync Optionen" }, | 1063 | { "Multiple Sync options","Multi Sync Optionen" }, |
1064 | { "Sync algo options","Sync Ablauf Optionen" }, | 1064 | { "Sync algo options","Sync Ablauf Optionen" }, |
1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
1068 | { "Write back options","Optionen zum Zurückschreiben" }, | 1068 | { "Write back options","Optionen zum Zurückschreiben" }, |
1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
1074 | { "Time period","Zeitspanne" }, | 1074 | { "Time period","Zeitspanne" }, |
1075 | { "From ","Von " }, | 1075 | { "From ","Von " }, |
1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
1077 | { " weeks in the future "," Wochen in der Zukunft " }, | 1077 | { " weeks in the future "," Wochen in der Zukunft " }, |
1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
1079 | { "Local temp file:","Lokale temp Datei:" }, | 1079 | { "Local temp file:","Lokale temp Datei:" }, |
1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
1082 | { "Language","Sprache" }, | 1082 | { "Language","Sprache" }, |
1083 | { "Time Format","Zeit Format" }, | 1083 | { "Time Format","Zeit Format" }, |
1084 | { "Time Zone","Zeit Zone" }, | 1084 | { "Time Zone","Zeit Zone" }, |
1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, | 1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, |
1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
1089 | { "Save settings","Speichere Einstellungen" }, | 1089 | { "Save settings","Speichere Einstellungen" }, |
1090 | { "Save standard","Speichere Standard" }, | 1090 | { "Save standard","Speichere Standard" }, |
1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
1093 | { "Data storage path","Daten Speicherpfad" }, | 1093 | { "Data storage path","Daten Speicherpfad" }, |
1094 | { "Language","Sprache" }, | 1094 | { "Language","Sprache" }, |
1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, | 1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, |
1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, | 1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, |
1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, | 1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, |
1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, | 1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, |
1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
1100 | { "KO/Pi","KO/Pi" }, | 1100 | { "KO/Pi","KO/Pi" }, |
1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, | 1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, |
1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, | 1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, |
1103 | { "Sound.Al.: ","Sound.Al.: " }, | 1103 | { "Sound.Al.: ","Sound.Al.: " }, |
1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, | 1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, |
1105 | { "Restore","Wiederherstellen" }, | 1105 | { "Restore","Wiederherstellen" }, |
1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, | 1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, |
1107 | { "% completed","% komplett" }, | 1107 | { "% completed","% komplett" }, |
1108 | { "%d item(s) found.","%d Item(s) gefunden." }, | 1108 | { "%d item(s) found.","%d Item(s) gefunden." }, |
1109 | { "Set complete","Setze auf erledigt" }, | 1109 | { "Set complete","Setze auf erledigt" }, |
1110 | { "(cancelled)","(gecancelt)" }, | 1110 | { "(cancelled)","(gecancelt)" }, |
1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, | 1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, |
1112 | { " Local time "," Locale Zeit " }, | 1112 | { " Local time "," Locale Zeit " }, |
1113 | { "Form2","Form2" }, | 1113 | { "Form2","Form2" }, |
1114 | { "Filter enabled","Filter angeschaltet" }, | 1114 | { "Filter enabled","Filter angeschaltet" }, |
1115 | { "Edit Filters","Ändere Filter" }, | 1115 | { "Edit Filters","Ändere Filter" }, |
1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1117 | { "Agenda","Agenda" }, | 1117 | { "Agenda","Agenda" }, |
1118 | { " ("," (" }, | 1118 | { " ("," (" }, |
1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1120 | { "Print","Print" }, | 1120 | { "Print","Print" }, |
1121 | { "&Setup Printer...","Drucker &Setup..." }, | 1121 | { "&Setup Printer...","Drucker &Setup..." }, |
1122 | { "View Type","Zeige Typ" }, | 1122 | { "View Type","Zeige Typ" }, |
1123 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1123 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1126 | { "Portrait","Portrait" }, | 1126 | { "Portrait","Portrait" }, |
1127 | { "Landscape","Landschaft" }, | 1127 | { "Landscape","Landschaft" }, |
1128 | { "Print day","Drucke Tag" }, | 1128 | { "Print day","Drucke Tag" }, |
1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1130 | { "Date && Time Range","Datum && Zeitspanne" }, | 1130 | { "Date && Time Range","Datum && Zeitspanne" }, |
1131 | { "&End date:","&Enddatum:" }, | 1131 | { "&End date:","&Enddatum:" }, |
1132 | { "&Start date:","&Startdatum:" }, | 1132 | { "&Start date:","&Startdatum:" }, |
1133 | { "Start &time:","Startzeit:" }, | 1133 | { "Start &time:","Startzeit:" }, |
1134 | { "End ti&me:","Endzeit:" }, | 1134 | { "End ti&me:","Endzeit:" }, |
1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
1204 | { "Display all flat","Zeige alle flach" }, | 1204 | { "Display all flat","Zeige alle flach" }, |
1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1208 | { "Select Week","Wähle Woche" }, | 1208 | { "Select Week","Wähle Woche" }, |
1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1210 | { "Set Alarm!","Setze Alarm!" }, | 1210 | { "Set Alarm!","Setze Alarm!" }, |
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "","" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "","" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "","" }, | 1276 | { "","" }, |
1277 | { "","" }, | 1277 | { "","" }, |
1278 | { "","" }, | 1278 | { "","" }, |
1279 | { "","" }, | 1279 | { "","" }, |
1280 | { "","" }, | 1280 | { "","" }, |
1281 | { "","" }, | 1281 | { "","" }, |
1282 | { "","" }, | 1282 | { "","" }, |
1283 | { "","" }, | 1283 | { "","" }, |
1284 | { "","" }, \ No newline at end of file | 1284 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp index 8b7c993..b0eac51 100644 --- a/korganizer/datenavigator.cpp +++ b/korganizer/datenavigator.cpp | |||
@@ -1,300 +1,315 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "datenavigator.h" | 24 | #include "datenavigator.h" |
25 | 25 | ||
26 | #include "koglobals.h" | 26 | #include "koglobals.h" |
27 | 27 | ||
28 | #include <kcalendarsystem.h> | 28 | #include <kcalendarsystem.h> |
29 | 29 | ||
30 | #include <kdebug.h> | 30 | #include <kdebug.h> |
31 | #include <kglobal.h> | 31 | #include <kglobal.h> |
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | 33 | ||
34 | using namespace KCal; | 34 | using namespace KCal; |
35 | 35 | ||
36 | DateNavigator::DateNavigator( QObject *parent, const char *name , KOViewManager * v) | 36 | DateNavigator::DateNavigator( QObject *parent, const char *name , KOViewManager * v) |
37 | : QObject( parent, name ) | 37 | : QObject( parent, name ) |
38 | { | 38 | { |
39 | mViewManager = v; | 39 | mViewManager = v; |
40 | mSelectedDates.append( QDate::currentDate() ); | 40 | mSelectedDates.append( QDate::currentDate() ); |
41 | } | 41 | } |
42 | 42 | ||
43 | DateNavigator::~DateNavigator() | 43 | DateNavigator::~DateNavigator() |
44 | { | 44 | { |
45 | } | 45 | } |
46 | 46 | ||
47 | void DateNavigator::slotMonthSelect( int m ) | 47 | void DateNavigator::slotMonthSelect( int m ) |
48 | { | 48 | { |
49 | QDate firstSelected = mSelectedDates.first(); | 49 | QDate firstSelected = mSelectedDates.first(); |
50 | int weekDay = firstSelected.dayOfWeek(); | 50 | int weekDay = firstSelected.dayOfWeek(); |
51 | int diff = m - firstSelected.month() ; | 51 | int diff = m - firstSelected.month() ; |
52 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, diff ); | 52 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, diff ); |
53 | 53 | ||
54 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 54 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
55 | selectMonthByDate( firstSelected ); | 55 | selectMonthByDate( firstSelected ); |
56 | else | 56 | else |
57 | selectWeekByDay( weekDay, firstSelected ); | 57 | selectWeekByDay( weekDay, firstSelected ); |
58 | 58 | ||
59 | } | 59 | } |
60 | 60 | ||
61 | void DateNavigator::slotDaySelect( QDate d ) | 61 | void DateNavigator::slotDaySelect( QDate d ) |
62 | { | 62 | { |
63 | QDate firstSelected = mSelectedDates.first(); | 63 | QDate firstSelected = mSelectedDates.first(); |
64 | int weekDay = firstSelected.dayOfWeek(); | 64 | int weekDay = firstSelected.dayOfWeek(); |
65 | //int diff = firstSelected.daysTo( d ) ; | 65 | //int diff = firstSelected.daysTo( d ) ; |
66 | firstSelected = firstSelected.addDays( firstSelected .daysTo( d ) ); | 66 | firstSelected = firstSelected.addDays( firstSelected .daysTo( d ) ); |
67 | 67 | ||
68 | selectWeekByDay( weekDay, firstSelected ); | 68 | selectWeekByDay( weekDay, firstSelected ); |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | void DateNavigator::selectMonthByDate( const QDate & firstSelected ) | 72 | void DateNavigator::selectMonthByDate( const QDate & firstSelected ) |
73 | { | 73 | { |
74 | 74 | ||
75 | int monthDay = firstSelected.day(); | 75 | int monthDay = firstSelected.day(); |
76 | QDate date = firstSelected.addDays( 1-monthDay ); | 76 | QDate date = firstSelected.addDays( 1-monthDay ); |
77 | selectDates( date , date.daysInMonth ()); | 77 | selectDates( date , date.daysInMonth ()); |
78 | 78 | ||
79 | } | 79 | } |
80 | void DateNavigator::selectMonth() | 80 | void DateNavigator::selectMonth() |
81 | { | 81 | { |
82 | 82 | ||
83 | QDate date =mSelectedDates.first(); | 83 | QDate date =mSelectedDates.first(); |
84 | selectMonthByDate( date ); | 84 | selectMonthByDate( date ); |
85 | } | 85 | } |
86 | void DateNavigator::selectMonthFromMonthview() | ||
87 | { | ||
88 | |||
89 | QDate date =mSelectedDates.first().addDays( 7 ); | ||
90 | selectMonthByDate( date ); | ||
91 | } | ||
86 | 92 | ||
87 | DateList DateNavigator::selectedDates() | 93 | DateList DateNavigator::selectedDates() |
88 | { | 94 | { |
89 | return mSelectedDates; | 95 | return mSelectedDates; |
90 | } | 96 | } |
91 | 97 | ||
92 | int DateNavigator::datesCount() const | 98 | int DateNavigator::datesCount() const |
93 | { | 99 | { |
94 | return mSelectedDates.count(); | 100 | return mSelectedDates.count(); |
95 | } | 101 | } |
96 | 102 | ||
97 | void DateNavigator::selectDates( const DateList& dateList ) | 103 | void DateNavigator::selectDates( const DateList& dateList ) |
98 | { | 104 | { |
99 | if (dateList.count() > 0) { | 105 | if (dateList.count() > 0) { |
100 | mSelectedDates = dateList; | 106 | mSelectedDates = dateList; |
101 | emitSelected(); | 107 | emitSelected(); |
102 | } | 108 | } |
103 | } | 109 | } |
104 | 110 | ||
105 | void DateNavigator::selectDate( const QDate &date ) | 111 | void DateNavigator::selectDate( const QDate &date ) |
106 | { | 112 | { |
107 | QDate d = date; | 113 | QDate d = date; |
108 | 114 | ||
109 | if ( !d.isValid() ) { | 115 | if ( !d.isValid() ) { |
110 | d = QDate::currentDate(); | 116 | d = QDate::currentDate(); |
111 | } | 117 | } |
112 | 118 | ||
113 | mSelectedDates.clear(); | 119 | mSelectedDates.clear(); |
114 | mSelectedDates.append( d ); | 120 | mSelectedDates.append( d ); |
115 | 121 | ||
116 | emitSelected(); | 122 | emitSelected(); |
117 | } | 123 | } |
118 | 124 | ||
119 | void DateNavigator::selectDates( int count ) | 125 | void DateNavigator::selectDates( int count ) |
120 | { | 126 | { |
121 | 127 | ||
122 | QDate d = mSelectedDates.first(); | 128 | QDate d = mSelectedDates.first(); |
123 | selectDates( d, count ); | 129 | selectDates( d, count ); |
124 | } | 130 | } |
125 | 131 | ||
126 | void DateNavigator::selectDates( const QDate &d, int count ) | 132 | void DateNavigator::selectDates( const QDate &d, int count ) |
127 | { | 133 | { |
128 | DateList dates; | 134 | DateList dates; |
129 | 135 | ||
130 | int i; | 136 | int i; |
131 | for( i = 0; i < count; ++i ) { | 137 | for( i = 0; i < count; ++i ) { |
132 | dates.append( d.addDays( i ) ); | 138 | dates.append( d.addDays( i ) ); |
133 | } | 139 | } |
134 | 140 | ||
135 | mSelectedDates = dates; | 141 | mSelectedDates = dates; |
136 | 142 | ||
137 | emitSelected(); | 143 | emitSelected(); |
138 | } | 144 | } |
139 | 145 | ||
140 | void DateNavigator::selectWeekByDay( int weekDay, const QDate &d ) | 146 | void DateNavigator::selectWeekByDay( int weekDay, const QDate &d ) |
141 | { | 147 | { |
142 | // qDebug("selectWeekByDay( %d %s ", weekDay, d.toString().latin1()); | 148 | // qDebug("selectWeekByDay( %d %s ", weekDay, d.toString().latin1()); |
143 | int dateCount = mSelectedDates.count(); | 149 | int dateCount = mSelectedDates.count(); |
144 | bool weekStart = ( weekDay == KGlobal::locale()->weekStartDay() ); | 150 | bool weekStart = ( weekDay == KGlobal::locale()->weekStartDay() ); |
145 | if ( weekDay == 1 && dateCount == 5 ) selectWorkWeek( d ); | 151 | if ( weekDay == 1 && dateCount == 5 ) selectWorkWeek( d ); |
146 | else if ( weekStart && dateCount == 7 ) selectWeek( d ); | 152 | else if ( weekStart && dateCount == 7 ) selectWeek( d ); |
147 | else selectDates( d, dateCount ); | 153 | else selectDates( d, dateCount ); |
148 | } | 154 | } |
149 | 155 | ||
150 | void DateNavigator::selectWeek() | 156 | void DateNavigator::selectWeek() |
151 | { | 157 | { |
152 | QDate d = mSelectedDates.first(); | 158 | QDate d = mSelectedDates.first(); |
153 | selectWeek( d ); | 159 | selectWeek( d ); |
154 | } | 160 | } |
155 | void DateNavigator::selectWeek( int num ) | 161 | void DateNavigator::selectWeek( int num ) |
156 | { | 162 | { |
157 | int year = mSelectedDates.first().year(); | 163 | int year = mSelectedDates.first().year(); |
158 | QDate d = QDate ( year, 1,1); | 164 | QDate d = QDate ( year, 1,1); |
159 | while ( d.dayOfWeek() != 4 ) | 165 | while ( d.dayOfWeek() != 4 ) |
160 | d = d.addDays( 1 ); | 166 | d = d.addDays( 1 ); |
161 | selectWeek( d.addDays ( (num-1) *7 ) ); | 167 | selectWeek( d.addDays ( (num-1) *7 ) ); |
162 | } | 168 | } |
163 | void DateNavigator::selectWeekFromMonthView( int num ) | 169 | void DateNavigator::selectWeekFromMonthView( int num ) |
164 | { | 170 | { |
165 | int year = mSelectedDates.first().year(); | 171 | int year = mSelectedDates.first().year(); |
166 | if ( mSelectedDates.first().dayOfYear() > 300 && num < 10 ) | 172 | if ( mSelectedDates.first().dayOfYear() > 300 && num < 10 ) |
167 | ++year; | 173 | ++year; |
168 | if ( mSelectedDates.first().dayOfYear() < 70 && num > 40 ) | 174 | if ( mSelectedDates.first().dayOfYear() < 70 && num > 40 ) |
169 | --year; | 175 | --year; |
170 | QDate d = QDate ( year, 1,1); | 176 | QDate d = QDate ( year, 1,1); |
171 | while ( d.dayOfWeek() != 4 ) | 177 | while ( d.dayOfWeek() != 4 ) |
172 | d = d.addDays( 1 ); | 178 | d = d.addDays( 1 ); |
173 | selectWeek( d.addDays ( (num-1) *7 ) ); | 179 | selectWeek( d.addDays ( (num-1) *7 ) ); |
174 | } | 180 | } |
175 | void DateNavigator::selectWeek( const QDate &d ) | 181 | void DateNavigator::selectWeek( const QDate &d ) |
176 | { | 182 | { |
177 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); | 183 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); |
178 | 184 | ||
179 | int weekStart = KGlobal::locale()->weekStartDay(); | 185 | int weekStart = KGlobal::locale()->weekStartDay(); |
180 | QDate firstDate = d.addDays( weekStart - dayOfWeek ); | 186 | QDate firstDate = d.addDays( weekStart - dayOfWeek ); |
181 | 187 | ||
182 | if ( weekStart != 1 && dayOfWeek < weekStart ) { | 188 | if ( weekStart != 1 && dayOfWeek < weekStart ) { |
183 | firstDate = firstDate.addDays(-7 ); | 189 | firstDate = firstDate.addDays(-7 ); |
184 | } | 190 | } |
185 | 191 | ||
186 | 192 | ||
187 | selectDates( firstDate, 7 ); | 193 | selectDates( firstDate, 7 ); |
188 | } | 194 | } |
189 | 195 | ||
190 | void DateNavigator::selectWorkWeek() | 196 | void DateNavigator::selectWorkWeek() |
191 | { | 197 | { |
192 | QDate d = mSelectedDates.first(); | 198 | QDate d = mSelectedDates.first(); |
193 | selectWorkWeek( d ); | 199 | selectWorkWeek( d ); |
194 | } | 200 | } |
195 | 201 | ||
196 | void DateNavigator::selectWorkWeek( const QDate &d ) | 202 | void DateNavigator::selectWorkWeek( const QDate &d ) |
197 | { | 203 | { |
198 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); | 204 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); |
199 | 205 | ||
200 | QDate firstDate = d.addDays( 1 - dayOfWeek ); | 206 | QDate firstDate = d.addDays( 1 - dayOfWeek ); |
201 | 207 | ||
202 | int weekStart = KGlobal::locale()->weekStartDay(); | 208 | int weekStart = KGlobal::locale()->weekStartDay(); |
203 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { | 209 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { |
204 | firstDate = firstDate.addDays( 7 ); | 210 | firstDate = firstDate.addDays( 7 ); |
205 | } | 211 | } |
206 | 212 | ||
207 | selectDates( firstDate, 5 ); | 213 | selectDates( firstDate, 5 ); |
208 | } | 214 | } |
209 | 215 | ||
210 | void DateNavigator::selectTodayMonth() | 216 | void DateNavigator::selectTodayMonth() |
211 | { | 217 | { |
212 | QDate date = QDate::currentDate().addDays( 1-QDate::currentDate().day() ); | 218 | QDate date = QDate::currentDate().addDays( 1-QDate::currentDate().day() ); |
213 | selectDates( date , date.daysInMonth ()); | 219 | selectDates( date , date.daysInMonth ()); |
214 | 220 | ||
215 | } | 221 | } |
216 | void DateNavigator::selectToday() | 222 | void DateNavigator::selectToday() |
217 | { | 223 | { |
218 | QDate d = QDate::currentDate(); | 224 | QDate d = QDate::currentDate(); |
219 | 225 | ||
220 | int dateCount = mSelectedDates.count(); | 226 | int dateCount = mSelectedDates.count(); |
221 | if ( dateCount == 5 && d.dayOfWeek() < 6 ) selectWorkWeek( d ); | 227 | if ( dateCount == 5 && d.dayOfWeek() < 6 ) selectWorkWeek( d ); |
222 | else if ( dateCount == 7 ) selectWeek( d ); | 228 | else if ( dateCount == 7 ) selectWeek( d ); |
223 | else selectDates( d, dateCount ); | 229 | else selectDates( d, dateCount ); |
224 | } | 230 | } |
225 | 231 | ||
226 | void DateNavigator::selectPreviousYear() | 232 | void DateNavigator::selectPreviousYear() |
227 | { | 233 | { |
228 | QDate firstSelected = mSelectedDates.first(); | 234 | QDate firstSelected = mSelectedDates.first(); |
229 | int weekDay = firstSelected.dayOfWeek(); | 235 | int weekDay = firstSelected.dayOfWeek(); |
230 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); | 236 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); |
231 | 237 | ||
232 | selectWeekByDay( weekDay, firstSelected ); | 238 | selectWeekByDay( weekDay, firstSelected ); |
233 | } | 239 | } |
234 | 240 | ||
235 | void DateNavigator::selectPreviousMonth() | 241 | void DateNavigator::selectPreviousMonth() |
236 | { | 242 | { |
237 | QDate firstSelected = mSelectedDates.first(); | 243 | QDate firstSelected = mSelectedDates.first(); |
238 | int weekDay = firstSelected.dayOfWeek(); | 244 | int weekDay = firstSelected.dayOfWeek(); |
239 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); | 245 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); |
240 | 246 | ||
241 | 247 | ||
242 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 248 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
243 | selectMonthByDate( firstSelected ); | 249 | selectMonthByDate( firstSelected ); |
244 | else | 250 | else |
245 | selectWeekByDay( weekDay, firstSelected ); | 251 | selectWeekByDay( weekDay, firstSelected ); |
246 | } | 252 | } |
247 | 253 | ||
248 | void DateNavigator::selectNextMonth() | 254 | void DateNavigator::selectNextMonth() |
249 | { | 255 | { |
250 | QDate firstSelected = mSelectedDates.first(); | 256 | QDate firstSelected = mSelectedDates.first(); |
251 | int weekDay = firstSelected.dayOfWeek(); | 257 | int weekDay = firstSelected.dayOfWeek(); |
252 | 258 | ||
253 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); | 259 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); |
254 | 260 | ||
255 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 261 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
256 | selectMonthByDate( firstSelected ); | 262 | selectMonthByDate( firstSelected ); |
257 | else | 263 | else |
258 | selectWeekByDay( weekDay, firstSelected ); | 264 | selectWeekByDay( weekDay, firstSelected ); |
259 | 265 | ||
260 | } | 266 | } |
267 | void DateNavigator::selectPreviousWeek() | ||
268 | { | ||
269 | selectDates( mSelectedDates.first().addDays( -7 ), datesCount() ); | ||
270 | } | ||
271 | |||
272 | void DateNavigator::selectNextWeek() | ||
273 | { | ||
274 | selectDates( mSelectedDates.first().addDays( 7 ), datesCount() ); | ||
275 | } | ||
261 | 276 | ||
262 | void DateNavigator::selectNextYear() | 277 | void DateNavigator::selectNextYear() |
263 | { | 278 | { |
264 | QDate firstSelected = mSelectedDates.first(); | 279 | QDate firstSelected = mSelectedDates.first(); |
265 | int weekDay = firstSelected.dayOfWeek(); | 280 | int weekDay = firstSelected.dayOfWeek(); |
266 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); | 281 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); |
267 | 282 | ||
268 | selectWeekByDay( weekDay, firstSelected ); | 283 | selectWeekByDay( weekDay, firstSelected ); |
269 | } | 284 | } |
270 | 285 | ||
271 | void DateNavigator::selectPrevious() | 286 | void DateNavigator::selectPrevious() |
272 | { | 287 | { |
273 | int offset = -7; | 288 | int offset = -7; |
274 | if ( datesCount() == 1 ) { | 289 | if ( datesCount() == 1 ) { |
275 | offset = -1; | 290 | offset = -1; |
276 | } | 291 | } |
277 | if ( mViewManager ) | 292 | if ( mViewManager ) |
278 | if ( mViewManager->showsNextDays() ) | 293 | if ( mViewManager->showsNextDays() ) |
279 | offset = -datesCount(); | 294 | offset = -datesCount(); |
280 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 295 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
281 | } | 296 | } |
282 | 297 | ||
283 | void DateNavigator::selectNext() | 298 | void DateNavigator::selectNext() |
284 | { | 299 | { |
285 | int offset = 7; | 300 | int offset = 7; |
286 | if ( datesCount() == 1 ) { | 301 | if ( datesCount() == 1 ) { |
287 | offset = 1; | 302 | offset = 1; |
288 | } | 303 | } |
289 | if ( mViewManager ) | 304 | if ( mViewManager ) |
290 | if ( mViewManager->showsNextDays() ) | 305 | if ( mViewManager->showsNextDays() ) |
291 | offset = datesCount(); | 306 | offset = datesCount(); |
292 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 307 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
293 | } | 308 | } |
294 | 309 | ||
295 | void DateNavigator::emitSelected() | 310 | void DateNavigator::emitSelected() |
296 | { | 311 | { |
297 | emit datesSelected( mSelectedDates ); | 312 | emit datesSelected( mSelectedDates ); |
298 | } | 313 | } |
299 | 314 | ||
300 | //#include "datenavigator.moc" | 315 | //#include "datenavigator.moc" |
diff --git a/korganizer/datenavigator.h b/korganizer/datenavigator.h index 4265e84..9742d41 100644 --- a/korganizer/datenavigator.h +++ b/korganizer/datenavigator.h | |||
@@ -1,91 +1,94 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef DATENAVIGATOR_H | 23 | #ifndef DATENAVIGATOR_H |
24 | #define DATENAVIGATOR_H | 24 | #define DATENAVIGATOR_H |
25 | 25 | ||
26 | #include <libkcal/incidencebase.h> | 26 | #include <libkcal/incidencebase.h> |
27 | 27 | ||
28 | #include <qobject.h> | 28 | #include <qobject.h> |
29 | #include "koviewmanager.h" | 29 | #include "koviewmanager.h" |
30 | 30 | ||
31 | /** | 31 | /** |
32 | This class controls date navigation. All requests to move the views to another | 32 | This class controls date navigation. All requests to move the views to another |
33 | date are sent to the DateNavigator. The DateNavigator processes the new | 33 | date are sent to the DateNavigator. The DateNavigator processes the new |
34 | selection of dates and emits the required signals for the views. | 34 | selection of dates and emits the required signals for the views. |
35 | */ | 35 | */ |
36 | class DateNavigator : public QObject | 36 | class DateNavigator : public QObject |
37 | { | 37 | { |
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | public: | 39 | public: |
40 | DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0); | 40 | DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0); |
41 | ~DateNavigator(); | 41 | ~DateNavigator(); |
42 | 42 | ||
43 | KCal::DateList selectedDates(); | 43 | KCal::DateList selectedDates(); |
44 | 44 | ||
45 | int datesCount() const; | 45 | int datesCount() const; |
46 | 46 | ||
47 | public slots: | 47 | public slots: |
48 | void selectDates( const KCal::DateList & ); | 48 | void selectDates( const KCal::DateList & ); |
49 | void selectDate( const QDate & ); | 49 | void selectDate( const QDate & ); |
50 | 50 | ||
51 | void selectDates( int count ); | 51 | void selectDates( int count ); |
52 | void selectDates( const QDate &, int count ); | 52 | void selectDates( const QDate &, int count ); |
53 | 53 | ||
54 | void selectWeek(); | 54 | void selectWeek(); |
55 | void selectWeek( int weeknum ); | 55 | void selectWeek( int weeknum ); |
56 | void selectWeekFromMonthView( int weeknum ); | 56 | void selectWeekFromMonthView( int weeknum ); |
57 | void selectWeek( const QDate & ); | 57 | void selectWeek( const QDate & ); |
58 | 58 | ||
59 | void selectWorkWeek(); | 59 | void selectWorkWeek(); |
60 | void selectWorkWeek( const QDate & ); | 60 | void selectWorkWeek( const QDate & ); |
61 | 61 | ||
62 | void selectWeekByDay( int weekDay, const QDate & ); | 62 | void selectWeekByDay( int weekDay, const QDate & ); |
63 | 63 | ||
64 | void selectToday(); | 64 | void selectToday(); |
65 | void selectTodayMonth(); | 65 | void selectTodayMonth(); |
66 | 66 | ||
67 | void selectPreviousYear(); | 67 | void selectPreviousYear(); |
68 | void selectPreviousMonth(); | 68 | void selectPreviousMonth(); |
69 | void selectNextMonth(); | 69 | void selectNextMonth(); |
70 | void selectPreviousWeek(); | ||
71 | void selectNextWeek(); | ||
70 | void selectNextYear(); | 72 | void selectNextYear(); |
71 | 73 | ||
72 | void selectMonth(); | 74 | void selectMonth(); |
75 | void selectMonthFromMonthview(); | ||
73 | void selectMonthByDate( const QDate & ); | 76 | void selectMonthByDate( const QDate & ); |
74 | 77 | ||
75 | void selectPrevious(); | 78 | void selectPrevious(); |
76 | void selectNext(); | 79 | void selectNext(); |
77 | void slotMonthSelect( int ); | 80 | void slotMonthSelect( int ); |
78 | void slotDaySelect( QDate d ); | 81 | void slotDaySelect( QDate d ); |
79 | 82 | ||
80 | signals: | 83 | signals: |
81 | void datesSelected( const KCal::DateList & ); | 84 | void datesSelected( const KCal::DateList & ); |
82 | 85 | ||
83 | protected: | 86 | protected: |
84 | void emitSelected(); | 87 | void emitSelected(); |
85 | 88 | ||
86 | private: | 89 | private: |
87 | KOViewManager * mViewManager; | 90 | KOViewManager * mViewManager; |
88 | KCal::DateList mSelectedDates; | 91 | KCal::DateList mSelectedDates; |
89 | }; | 92 | }; |
90 | 93 | ||
91 | #endif | 94 | #endif |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index d0380e3..f9bc1ca 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -696,525 +696,527 @@ QDate MonthViewCell::selectedIncidenceDate() | |||
696 | int index = mItemList->currentItem(); | 696 | int index = mItemList->currentItem(); |
697 | if ( index < 0 ) return qd; | 697 | if ( index < 0 ) return qd; |
698 | 698 | ||
699 | MonthViewItem *item = | 699 | MonthViewItem *item = |
700 | static_cast<MonthViewItem *>( mItemList->item( index ) ); | 700 | static_cast<MonthViewItem *>( mItemList->item( index ) ); |
701 | 701 | ||
702 | if ( !item ) return qd; | 702 | if ( !item ) return qd; |
703 | 703 | ||
704 | return item->incidenceDate(); | 704 | return item->incidenceDate(); |
705 | } | 705 | } |
706 | 706 | ||
707 | void MonthViewCell::deselect() | 707 | void MonthViewCell::deselect() |
708 | { | 708 | { |
709 | mItemList->clearSelection(); | 709 | mItemList->clearSelection(); |
710 | enableScrollBars( false ); | 710 | enableScrollBars( false ); |
711 | // updateCell(); | 711 | // updateCell(); |
712 | } | 712 | } |
713 | void MonthViewCell::select() | 713 | void MonthViewCell::select() |
714 | { | 714 | { |
715 | ;// updateCell(); | 715 | ;// updateCell(); |
716 | } | 716 | } |
717 | 717 | ||
718 | void MonthViewCell::resizeEvent ( QResizeEvent * ) | 718 | void MonthViewCell::resizeEvent ( QResizeEvent * ) |
719 | { | 719 | { |
720 | if ( !mMonthView->isUpdatePossible() ) | 720 | if ( !mMonthView->isUpdatePossible() ) |
721 | return; | 721 | return; |
722 | 722 | ||
723 | int size = height() - mLabel->height() - 2; | 723 | int size = height() - mLabel->height() - 2; |
724 | if ( size > 0 ) | 724 | if ( size > 0 ) |
725 | mItemList->verticalScrollBar()->setMaximumHeight( size ); | 725 | mItemList->verticalScrollBar()->setMaximumHeight( size ); |
726 | size = width() - mLabel->width() -2; | 726 | size = width() - mLabel->width() -2; |
727 | if ( size > 0 ) | 727 | if ( size > 0 ) |
728 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); | 728 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); |
729 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); | 729 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); |
730 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 730 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
731 | } | 731 | } |
732 | 732 | ||
733 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 733 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
734 | { | 734 | { |
735 | if ( !item ) return; | 735 | if ( !item ) return; |
736 | 736 | ||
737 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 737 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
738 | Incidence *incidence = eventItem->incidence(); | 738 | Incidence *incidence = eventItem->incidence(); |
739 | if ( incidence ) mMonthView->defaultAction( incidence ); | 739 | if ( incidence ) mMonthView->defaultAction( incidence ); |
740 | } | 740 | } |
741 | void MonthViewCell::showDay() | 741 | void MonthViewCell::showDay() |
742 | { | 742 | { |
743 | emit showDaySignal( date() ); | 743 | emit showDaySignal( date() ); |
744 | } | 744 | } |
745 | void MonthViewCell::newEvent() | 745 | void MonthViewCell::newEvent() |
746 | { | 746 | { |
747 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 747 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
748 | emit newEventSignal( dt ); | 748 | emit newEventSignal( dt ); |
749 | } | 749 | } |
750 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 750 | void MonthViewCell::cellClicked( QListBoxItem *item ) |
751 | { | 751 | { |
752 | static QListBoxItem * lastClicked = 0; | 752 | static QListBoxItem * lastClicked = 0; |
753 | if ( item == 0 ) { | 753 | if ( item == 0 ) { |
754 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 754 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
755 | emit newEventSignal( dt ); | 755 | emit newEventSignal( dt ); |
756 | return; | 756 | return; |
757 | } | 757 | } |
758 | /* | 758 | /* |
759 | if ( lastClicked ) | 759 | if ( lastClicked ) |
760 | if ( ! item ) { | 760 | if ( ! item ) { |
761 | if ( lastClicked->listBox() != item->listBox() ) | 761 | if ( lastClicked->listBox() != item->listBox() ) |
762 | lastClicked->listBox()->clearSelection(); | 762 | lastClicked->listBox()->clearSelection(); |
763 | } | 763 | } |
764 | */ | 764 | */ |
765 | 765 | ||
766 | mMonthView->setSelectedCell( this ); | 766 | mMonthView->setSelectedCell( this ); |
767 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); | 767 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); |
768 | select(); | 768 | select(); |
769 | } | 769 | } |
770 | 770 | ||
771 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 771 | void MonthViewCell::contextMenu( QListBoxItem *item ) |
772 | { | 772 | { |
773 | if ( !item ) return; | 773 | if ( !item ) return; |
774 | 774 | ||
775 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 775 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
776 | Incidence *incidence = eventItem->incidence(); | 776 | Incidence *incidence = eventItem->incidence(); |
777 | if ( incidence ) mMonthView->showContextMenu( incidence ); | 777 | if ( incidence ) mMonthView->showContextMenu( incidence ); |
778 | } | 778 | } |
779 | 779 | ||
780 | void MonthViewCell::selection( QListBoxItem *item ) | 780 | void MonthViewCell::selection( QListBoxItem *item ) |
781 | { | 781 | { |
782 | if ( !item ) return; | 782 | if ( !item ) return; |
783 | 783 | ||
784 | mMonthView->setSelectedCell( this ); | 784 | mMonthView->setSelectedCell( this ); |
785 | } | 785 | } |
786 | 786 | ||
787 | 787 | ||
788 | // ******************************************************************************* | 788 | // ******************************************************************************* |
789 | // ******************************************************************************* | 789 | // ******************************************************************************* |
790 | // ******************************************************************************* | 790 | // ******************************************************************************* |
791 | 791 | ||
792 | 792 | ||
793 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 793 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
794 | : KOEventView( calendar, parent, name ), | 794 | : KOEventView( calendar, parent, name ), |
795 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 795 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
796 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 796 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
797 | { | 797 | { |
798 | mShortDayLabelsM = false; | 798 | mShortDayLabelsM = false; |
799 | mShortDayLabelsW = false; | 799 | mShortDayLabelsW = false; |
800 | skipResize = false; | 800 | skipResize = false; |
801 | clPending = true; | 801 | clPending = true; |
802 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); | 802 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); |
803 | mWidStack = new QWidgetStack( this ); | 803 | mWidStack = new QWidgetStack( this ); |
804 | QVBoxLayout* hb = new QVBoxLayout( this ); | 804 | QVBoxLayout* hb = new QVBoxLayout( this ); |
805 | mMonthView = new QWidget( mWidStack ); | 805 | mMonthView = new QWidget( mWidStack ); |
806 | mWeekView = new QWidget( mWidStack ); | 806 | mWeekView = new QWidget( mWidStack ); |
807 | #if QT_VERSION >= 0x030000 | 807 | #if QT_VERSION >= 0x030000 |
808 | mWidStack->addWidget(mMonthView ); | 808 | mWidStack->addWidget(mMonthView ); |
809 | mWidStack->addWidget(mWeekView ); | 809 | mWidStack->addWidget(mWeekView ); |
810 | #else | 810 | #else |
811 | mWidStack->addWidget( mMonthView, 1 ); | 811 | mWidStack->addWidget( mMonthView, 1 ); |
812 | mWidStack->addWidget( mWeekView , 1 ); | 812 | mWidStack->addWidget( mWeekView , 1 ); |
813 | #endif | 813 | #endif |
814 | hb->addWidget( mNavigatorBar ); | 814 | hb->addWidget( mNavigatorBar ); |
815 | hb->addWidget( mWidStack ); | 815 | hb->addWidget( mWidStack ); |
816 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 816 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
817 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; | 817 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; |
818 | if ( mShowWeekView ) | 818 | if ( mShowWeekView ) |
819 | mWeekStartsMonday = true; | 819 | mWeekStartsMonday = true; |
820 | updatePossible = false; | 820 | updatePossible = false; |
821 | //updatePossible = true; | 821 | //updatePossible = true; |
822 | mCells.setAutoDelete( true ); | 822 | mCells.setAutoDelete( true ); |
823 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 823 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
824 | mDayLabels.resize( mDaysPerWeek ); | 824 | mDayLabels.resize( mDaysPerWeek ); |
825 | mDayLabelsW.resize( mDaysPerWeek ); | 825 | mDayLabelsW.resize( mDaysPerWeek ); |
826 | QFont bfont = font(); | 826 | QFont bfont = font(); |
827 | if ( QApplication::desktop()->width() < 650 ) { | 827 | if ( QApplication::desktop()->width() < 650 ) { |
828 | bfont.setPointSize( bfont.pointSize() - 2 ); | 828 | bfont.setPointSize( bfont.pointSize() - 2 ); |
829 | } | 829 | } |
830 | bfont.setBold( true ); | 830 | bfont.setBold( true ); |
831 | int i; | 831 | int i; |
832 | 832 | ||
833 | for( i = 0; i < mDaysPerWeek; i++ ) { | 833 | for( i = 0; i < mDaysPerWeek; i++ ) { |
834 | QLabel *label = new QLabel( mMonthView ); | 834 | QLabel *label = new QLabel( mMonthView ); |
835 | label->setFont(bfont); | 835 | label->setFont(bfont); |
836 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 836 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
837 | label->setLineWidth(1); | 837 | label->setLineWidth(1); |
838 | label->setAlignment(AlignCenter); | 838 | label->setAlignment(AlignCenter); |
839 | mDayLabels.insert( i, label ); | 839 | mDayLabels.insert( i, label ); |
840 | label = new QLabel( mWeekView ); | 840 | label = new QLabel( mWeekView ); |
841 | label->setFont(bfont); | 841 | label->setFont(bfont); |
842 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 842 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
843 | label->setLineWidth(1); | 843 | label->setLineWidth(1); |
844 | label->setAlignment(AlignCenter); | 844 | label->setAlignment(AlignCenter); |
845 | mDayLabelsW.insert( i, label ); | 845 | mDayLabelsW.insert( i, label ); |
846 | } | 846 | } |
847 | 847 | ||
848 | bfont.setBold( false ); | 848 | bfont.setBold( false ); |
849 | mWeekLabels.resize( mNumWeeks+1 ); | 849 | mWeekLabels.resize( mNumWeeks+1 ); |
850 | mWeekLabelsW.resize( 2 ); | 850 | mWeekLabelsW.resize( 2 ); |
851 | for( i = 0; i < mNumWeeks+1; i++ ) { | 851 | for( i = 0; i < mNumWeeks+1; i++ ) { |
852 | KOWeekButton *label = new KOWeekButton( mMonthView ); | 852 | KOWeekButton *label = new KOWeekButton( mMonthView ); |
853 | label->setFocusPolicy(NoFocus); | 853 | label->setFocusPolicy(NoFocus); |
854 | label->setFont(bfont); | 854 | label->setFont(bfont); |
855 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 855 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
856 | label->setFlat(true); | 856 | label->setFlat(true); |
857 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 857 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
858 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 858 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
859 | //label->setLineWidth(1); | 859 | //label->setLineWidth(1); |
860 | //label->setAlignment(AlignCenter); | 860 | //label->setAlignment(AlignCenter); |
861 | mWeekLabels.insert( i, label ); | 861 | mWeekLabels.insert( i, label ); |
862 | } | 862 | } |
863 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 863 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
864 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); | 864 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); |
865 | 865 | ||
866 | for( i = 0; i < 1+1; i++ ) { | 866 | for( i = 0; i < 1+1; i++ ) { |
867 | KOWeekButton *label = new KOWeekButton( mWeekView ); | 867 | KOWeekButton *label = new KOWeekButton( mWeekView ); |
868 | label->setFocusPolicy(NoFocus); | 868 | label->setFocusPolicy(NoFocus); |
869 | label->setFont(bfont); | 869 | label->setFont(bfont); |
870 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 870 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
871 | label->setFlat(true); | 871 | label->setFlat(true); |
872 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 872 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
873 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 873 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
874 | //label->setLineWidth(1); | 874 | //label->setLineWidth(1); |
875 | //label->setAlignment(AlignCenter); | 875 | //label->setAlignment(AlignCenter); |
876 | mWeekLabelsW.insert( i, label ); | 876 | mWeekLabelsW.insert( i, label ); |
877 | } | 877 | } |
878 | mWeekLabelsW[1]->setText( i18n("W")); | 878 | mWeekLabelsW[1]->setText( i18n("W")); |
879 | 879 | ||
880 | 880 | ||
881 | int row, col; | 881 | int row, col; |
882 | mCells.resize( mNumCells ); | 882 | mCells.resize( mNumCells ); |
883 | for( row = 0; row < mNumWeeks; ++row ) { | 883 | for( row = 0; row < mNumWeeks; ++row ) { |
884 | for( col = 0; col < mDaysPerWeek; ++col ) { | 884 | for( col = 0; col < mDaysPerWeek; ++col ) { |
885 | MonthViewCell *cell = new MonthViewCell( this, mMonthView ); | 885 | MonthViewCell *cell = new MonthViewCell( this, mMonthView ); |
886 | mCells.insert( row * mDaysPerWeek + col, cell ); | 886 | mCells.insert( row * mDaysPerWeek + col, cell ); |
887 | 887 | ||
888 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 888 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
889 | SLOT( defaultAction( Incidence * ) ) ); | 889 | SLOT( defaultAction( Incidence * ) ) ); |
890 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 890 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
891 | SIGNAL( newEventSignal( QDateTime ) ) ); | 891 | SIGNAL( newEventSignal( QDateTime ) ) ); |
892 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 892 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
893 | SIGNAL( showDaySignal( QDate ) ) ); | 893 | SIGNAL( showDaySignal( QDate ) ) ); |
894 | } | 894 | } |
895 | } | 895 | } |
896 | mCellsW.resize( mDaysPerWeek ); | 896 | mCellsW.resize( mDaysPerWeek ); |
897 | for( col = 0; col < mDaysPerWeek; ++col ) { | 897 | for( col = 0; col < mDaysPerWeek; ++col ) { |
898 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); | 898 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); |
899 | mCellsW.insert( col, cell ); | 899 | mCellsW.insert( col, cell ); |
900 | 900 | ||
901 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 901 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
902 | SLOT( defaultAction( Incidence * ) ) ); | 902 | SLOT( defaultAction( Incidence * ) ) ); |
903 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 903 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
904 | SIGNAL( newEventSignal( QDateTime ) ) ); | 904 | SIGNAL( newEventSignal( QDateTime ) ) ); |
905 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 905 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
906 | SIGNAL( showDaySignal( QDate ) ) ); | 906 | SIGNAL( showDaySignal( QDate ) ) ); |
907 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); | 907 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); |
908 | } | 908 | } |
909 | 909 | ||
910 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); | 910 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); |
911 | mContextMenu = eventPopup(); | 911 | mContextMenu = eventPopup(); |
912 | // updateConfig(); //useless here... | 912 | // updateConfig(); //useless here... |
913 | // ... but we need mWidthLongDayLabel computed | 913 | // ... but we need mWidthLongDayLabel computed |
914 | QFontMetrics fontmetric(mDayLabels[0]->font()); | 914 | QFontMetrics fontmetric(mDayLabels[0]->font()); |
915 | mWidthLongDayLabel = 0; | 915 | mWidthLongDayLabel = 0; |
916 | for (int i = 0; i < 7; i++) { | 916 | for (int i = 0; i < 7; i++) { |
917 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 917 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
918 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 918 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
919 | } | 919 | } |
920 | 920 | ||
921 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 921 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
922 | 922 | ||
923 | #if 0 | 923 | #if 0 |
924 | if ( mShowWeekView ) | 924 | if ( mShowWeekView ) |
925 | mWidStack->raiseWidget( mWeekView ); | 925 | mWidStack->raiseWidget( mWeekView ); |
926 | else | 926 | else |
927 | mWidStack->raiseWidget( mMonthView ); | 927 | mWidStack->raiseWidget( mMonthView ); |
928 | #endif | 928 | #endif |
929 | 929 | ||
930 | emit incidenceSelected( 0 ); | 930 | emit incidenceSelected( 0 ); |
931 | #ifndef DESKTOP_VERSION | 931 | #ifndef DESKTOP_VERSION |
932 | resize( QApplication::desktop()->size() ); | 932 | resize( QApplication::desktop()->size() ); |
933 | #else | 933 | #else |
934 | resize(640, 480 ); | 934 | resize(640, 480 ); |
935 | updatePossible = true; | 935 | updatePossible = true; |
936 | #endif | 936 | #endif |
937 | computeLayout(); | 937 | computeLayout(); |
938 | 938 | ||
939 | if ( mShowWeekView ) | 939 | if ( mShowWeekView ) |
940 | mWidStack->raiseWidget( mWeekView ); | 940 | mWidStack->raiseWidget( mWeekView ); |
941 | else | 941 | else |
942 | mWidStack->raiseWidget( mMonthView ); | 942 | mWidStack->raiseWidget( mMonthView ); |
943 | } | 943 | } |
944 | 944 | ||
945 | KOMonthView::~KOMonthView() | 945 | KOMonthView::~KOMonthView() |
946 | { | 946 | { |
947 | delete mContextMenu; | 947 | delete mContextMenu; |
948 | } | 948 | } |
949 | 949 | ||
950 | void KOMonthView::selectInternalWeekNum ( int n ) | 950 | void KOMonthView::selectInternalWeekNum ( int n ) |
951 | { | 951 | { |
952 | switchView(); | 952 | switchView(); |
953 | emit selectWeekNum ( n ); | 953 | if ( !KOPrefs::instance()->mMonthViewWeek ) |
954 | emit selectMonth (); | ||
955 | else | ||
956 | emit selectWeekNum ( n ); | ||
954 | } | 957 | } |
955 | 958 | ||
956 | int KOMonthView::currentWeek() | 959 | int KOMonthView::currentWeek() |
957 | { | 960 | { |
958 | if ( mShowWeekView ) | 961 | if ( mShowWeekView ) |
959 | return mWeekLabelsW[0]->getWeekNum(); | 962 | return mWeekLabelsW[0]->getWeekNum(); |
960 | return mWeekLabels[0]->getWeekNum(); | 963 | return mWeekLabels[0]->getWeekNum(); |
961 | } | 964 | } |
962 | void KOMonthView::switchView() | 965 | void KOMonthView::switchView() |
963 | { | 966 | { |
964 | |||
965 | if ( selectedCell( ) ) | 967 | if ( selectedCell( ) ) |
966 | selectedCell()->deselect(); | 968 | selectedCell()->deselect(); |
967 | mShowWeekView = !mShowWeekView; | 969 | mShowWeekView = !mShowWeekView; |
968 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; | 970 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; |
969 | if ( clPending ) { | 971 | if ( clPending ) { |
970 | computeLayout(); | 972 | computeLayout(); |
971 | updateConfig(); | 973 | updateConfig(); |
972 | } | 974 | } |
973 | if ( mShowWeekView ) | 975 | if ( mShowWeekView ) |
974 | mWidStack->raiseWidget( mWeekView ); | 976 | mWidStack->raiseWidget( mWeekView ); |
975 | else | 977 | else |
976 | mWidStack->raiseWidget( mMonthView ); | 978 | mWidStack->raiseWidget( mMonthView ); |
977 | clPending = false; | 979 | clPending = false; |
978 | } | 980 | } |
979 | 981 | ||
980 | int KOMonthView::maxDatesHint() | 982 | int KOMonthView::maxDatesHint() |
981 | { | 983 | { |
982 | return mNumCells; | 984 | return mNumCells; |
983 | } | 985 | } |
984 | 986 | ||
985 | int KOMonthView::currentDateCount() | 987 | int KOMonthView::currentDateCount() |
986 | { | 988 | { |
987 | return mNumCells; | 989 | return mNumCells; |
988 | } | 990 | } |
989 | 991 | ||
990 | QPtrList<Incidence> KOMonthView::selectedIncidences() | 992 | QPtrList<Incidence> KOMonthView::selectedIncidences() |
991 | { | 993 | { |
992 | QPtrList<Incidence> selected; | 994 | QPtrList<Incidence> selected; |
993 | 995 | ||
994 | if ( mSelectedCell ) { | 996 | if ( mSelectedCell ) { |
995 | Incidence *incidence = mSelectedCell->selectedIncidence(); | 997 | Incidence *incidence = mSelectedCell->selectedIncidence(); |
996 | if ( incidence ) selected.append( incidence ); | 998 | if ( incidence ) selected.append( incidence ); |
997 | } | 999 | } |
998 | 1000 | ||
999 | return selected; | 1001 | return selected; |
1000 | } | 1002 | } |
1001 | 1003 | ||
1002 | DateList KOMonthView::selectedDates() | 1004 | DateList KOMonthView::selectedDates() |
1003 | { | 1005 | { |
1004 | DateList selected; | 1006 | DateList selected; |
1005 | 1007 | ||
1006 | if ( mSelectedCell ) { | 1008 | if ( mSelectedCell ) { |
1007 | QDate qd = mSelectedCell->selectedIncidenceDate(); | 1009 | QDate qd = mSelectedCell->selectedIncidenceDate(); |
1008 | if ( qd.isValid() ) selected.append( qd ); | 1010 | if ( qd.isValid() ) selected.append( qd ); |
1009 | } | 1011 | } |
1010 | 1012 | ||
1011 | return selected; | 1013 | return selected; |
1012 | } | 1014 | } |
1013 | 1015 | ||
1014 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1016 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1015 | const QDate &td) | 1017 | const QDate &td) |
1016 | { | 1018 | { |
1017 | #ifndef KORG_NOPRINTER | 1019 | #ifndef KORG_NOPRINTER |
1018 | calPrinter->preview(CalPrinter::Month, fd, td); | 1020 | calPrinter->preview(CalPrinter::Month, fd, td); |
1019 | #endif | 1021 | #endif |
1020 | } | 1022 | } |
1021 | 1023 | ||
1022 | void KOMonthView::updateConfig() | 1024 | void KOMonthView::updateConfig() |
1023 | { | 1025 | { |
1024 | 1026 | ||
1025 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 1027 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
1026 | 1028 | ||
1027 | if ( mShowWeekView ) { | 1029 | if ( mShowWeekView ) { |
1028 | mWeekStartsMonday = true; | 1030 | mWeekStartsMonday = true; |
1029 | } | 1031 | } |
1030 | QFontMetrics fontmetric(mDayLabels[0]->font()); | 1032 | QFontMetrics fontmetric(mDayLabels[0]->font()); |
1031 | mWidthLongDayLabel = 0; | 1033 | mWidthLongDayLabel = 0; |
1032 | 1034 | ||
1033 | for (int i = 0; i < 7; i++) { | 1035 | for (int i = 0; i < 7; i++) { |
1034 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 1036 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
1035 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 1037 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
1036 | } | 1038 | } |
1037 | bool temp = mShowSatSunComp ; | 1039 | bool temp = mShowSatSunComp ; |
1038 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 1040 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
1039 | if ( ! mShowWeekView ) { | 1041 | if ( ! mShowWeekView ) { |
1040 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) | 1042 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) |
1041 | computeLayout(); | 1043 | computeLayout(); |
1042 | } | 1044 | } |
1043 | updateDayLabels(); | 1045 | updateDayLabels(); |
1044 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); | 1046 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); |
1045 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; | 1047 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; |
1046 | //resizeEvent( 0 ); | 1048 | //resizeEvent( 0 ); |
1047 | for (uint i = 0; i < mCells.count(); ++i) { | 1049 | for (uint i = 0; i < mCells.count(); ++i) { |
1048 | mCells[i]->updateConfig(); | 1050 | mCells[i]->updateConfig(); |
1049 | } | 1051 | } |
1050 | 1052 | ||
1051 | for (uint i = 0; i < mCellsW.count(); ++i) { | 1053 | for (uint i = 0; i < mCellsW.count(); ++i) { |
1052 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); | 1054 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); |
1053 | } | 1055 | } |
1054 | #ifdef DESKTOP_VERSION | 1056 | #ifdef DESKTOP_VERSION |
1055 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 1057 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); |
1056 | #endif | 1058 | #endif |
1057 | updateView(); | 1059 | updateView(); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1060 | void KOMonthView::updateDayLabels() | 1062 | void KOMonthView::updateDayLabels() |
1061 | { | 1063 | { |
1062 | 1064 | ||
1063 | QPtrVector<QLabel> *mDayLabelsT; | 1065 | QPtrVector<QLabel> *mDayLabelsT; |
1064 | 1066 | ||
1065 | mDayLabelsT = &mDayLabelsW; | 1067 | mDayLabelsT = &mDayLabelsW; |
1066 | for (int i = 0; i < 7; i++) { | 1068 | for (int i = 0; i < 7; i++) { |
1067 | if (mWeekStartsMonday) { | 1069 | if (mWeekStartsMonday) { |
1068 | bool show = mShortDayLabelsW; | 1070 | bool show = mShortDayLabelsW; |
1069 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) | 1071 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) |
1070 | show = true; | 1072 | show = true; |
1071 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 1073 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
1072 | } else { | 1074 | } else { |
1073 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW)); | 1075 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW)); |
1074 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW)); | 1076 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW)); |
1075 | 1077 | ||
1076 | } | 1078 | } |
1077 | } | 1079 | } |
1078 | mDayLabelsT = &mDayLabels; | 1080 | mDayLabelsT = &mDayLabels; |
1079 | for (int i = 0; i < 7; i++) { | 1081 | for (int i = 0; i < 7; i++) { |
1080 | if (mWeekStartsMonday) { | 1082 | if (mWeekStartsMonday) { |
1081 | bool show = mShortDayLabelsM; | 1083 | bool show = mShortDayLabelsM; |
1082 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) | 1084 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) |
1083 | show = true; | 1085 | show = true; |
1084 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 1086 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
1085 | } else { | 1087 | } else { |
1086 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM)); | 1088 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM)); |
1087 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM)); | 1089 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM)); |
1088 | 1090 | ||
1089 | } | 1091 | } |
1090 | } | 1092 | } |
1091 | 1093 | ||
1092 | } | 1094 | } |
1093 | 1095 | ||
1094 | void KOMonthView::showDates(const QDate &start, const QDate &) | 1096 | void KOMonthView::showDates(const QDate &start, const QDate &) |
1095 | { | 1097 | { |
1096 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 1098 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
1097 | 1099 | ||
1098 | QPtrVector<MonthViewCell> *cells; | 1100 | QPtrVector<MonthViewCell> *cells; |
1099 | QPtrVector<QLabel> *dayLabels; | 1101 | QPtrVector<QLabel> *dayLabels; |
1100 | QPtrVector<KOWeekButton> *weekLabels; | 1102 | QPtrVector<KOWeekButton> *weekLabels; |
1101 | int weekNum = 6; | 1103 | int weekNum = 6; |
1102 | if ( mShowWeekView ) { | 1104 | if ( mShowWeekView ) { |
1103 | weekNum = 1; | 1105 | weekNum = 1; |
1104 | cells = &mCellsW; | 1106 | cells = &mCellsW; |
1105 | dayLabels = &mDayLabelsW; | 1107 | dayLabels = &mDayLabelsW; |
1106 | weekLabels = &mWeekLabelsW; | 1108 | weekLabels = &mWeekLabelsW; |
1107 | } else { | 1109 | } else { |
1108 | cells = &mCells; | 1110 | cells = &mCells; |
1109 | dayLabels = &mDayLabels; | 1111 | dayLabels = &mDayLabels; |
1110 | weekLabels = &mWeekLabels; | 1112 | weekLabels = &mWeekLabels; |
1111 | } | 1113 | } |
1112 | 1114 | ||
1113 | mStartDate = start; | 1115 | mStartDate = start; |
1114 | 1116 | ||
1115 | int startWeekDay = mWeekStartsMonday ? 1 : 7; | 1117 | int startWeekDay = mWeekStartsMonday ? 1 : 7; |
1116 | 1118 | ||
1117 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { | 1119 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { |
1118 | mStartDate = mStartDate.addDays( -1 ); | 1120 | mStartDate = mStartDate.addDays( -1 ); |
1119 | } | 1121 | } |
1120 | 1122 | ||
1121 | bool primary = false; | 1123 | bool primary = false; |
1122 | uint i; | 1124 | uint i; |
1123 | for( i = 0; i < (*cells).size(); ++i ) { | 1125 | for( i = 0; i < (*cells).size(); ++i ) { |
1124 | QDate date = mStartDate.addDays( i ); | 1126 | QDate date = mStartDate.addDays( i ); |
1125 | (*cells)[i]->setDate( date ); | 1127 | (*cells)[i]->setDate( date ); |
1126 | 1128 | ||
1127 | #ifndef KORG_NOPLUGINS | 1129 | #ifndef KORG_NOPLUGINS |
1128 | // add holiday, if present | 1130 | // add holiday, if present |
1129 | QString hstring(KOCore::self()->holiday(date)); | 1131 | QString hstring(KOCore::self()->holiday(date)); |
1130 | (*cells)[i]->setHoliday( hstring ); | 1132 | (*cells)[i]->setHoliday( hstring ); |
1131 | #endif | 1133 | #endif |
1132 | 1134 | ||
1133 | } | 1135 | } |
1134 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); | 1136 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); |
1135 | for( i = 0; i < weekNum; ++i ) { | 1137 | for( i = 0; i < weekNum; ++i ) { |
1136 | int wno; | 1138 | int wno; |
1137 | // remember, according to ISO 8601, the first week of the year is the | 1139 | // remember, according to ISO 8601, the first week of the year is the |
1138 | // first week that contains a thursday. Thus we must subtract off 4, | 1140 | // first week that contains a thursday. Thus we must subtract off 4, |
1139 | // not just 1. | 1141 | // not just 1. |
1140 | int dayOfYear = date.dayOfYear(); | 1142 | int dayOfYear = date.dayOfYear(); |
1141 | if (dayOfYear % 7 != 0) | 1143 | if (dayOfYear % 7 != 0) |
1142 | wno = dayOfYear / 7 + 1; | 1144 | wno = dayOfYear / 7 + 1; |
1143 | else | 1145 | else |
1144 | wno =dayOfYear / 7; | 1146 | wno =dayOfYear / 7; |
1145 | (*weekLabels)[i]->setWeekNum( wno ); | 1147 | (*weekLabels)[i]->setWeekNum( wno ); |
1146 | date = date.addDays( 7 ); | 1148 | date = date.addDays( 7 ); |
1147 | } | 1149 | } |
1148 | updateView(); | 1150 | updateView(); |
1149 | } | 1151 | } |
1150 | 1152 | ||
1151 | void KOMonthView::showEvents(QPtrList<Event>) | 1153 | void KOMonthView::showEvents(QPtrList<Event>) |
1152 | { | 1154 | { |
1153 | qDebug("KOMonthView::selectEvents is not implemented yet. "); | 1155 | qDebug("KOMonthView::selectEvents is not implemented yet. "); |
1154 | } | 1156 | } |
1155 | 1157 | ||
1156 | void KOMonthView::changeEventDisplay(Event *, int) | 1158 | void KOMonthView::changeEventDisplay(Event *, int) |
1157 | { | 1159 | { |
1158 | // this should be re-written to be much more efficient, but this | 1160 | // this should be re-written to be much more efficient, but this |
1159 | // quick-and-dirty-hack gets the job done for right now. | 1161 | // quick-and-dirty-hack gets the job done for right now. |
1160 | updateView(); | 1162 | updateView(); |
1161 | } | 1163 | } |
1162 | 1164 | ||
1163 | void KOMonthView::updateView() | 1165 | void KOMonthView::updateView() |
1164 | { | 1166 | { |
1165 | 1167 | ||
1166 | if ( !updatePossible ) | 1168 | if ( !updatePossible ) |
1167 | return; | 1169 | return; |
1168 | //QTime ti; | 1170 | //QTime ti; |
1169 | //ti.start(); | 1171 | //ti.start(); |
1170 | QPtrVector<MonthViewCell> *cells; | 1172 | QPtrVector<MonthViewCell> *cells; |
1171 | if ( mShowWeekView ) { | 1173 | if ( mShowWeekView ) { |
1172 | cells = &mCellsW; | 1174 | cells = &mCellsW; |
1173 | } else { | 1175 | } else { |
1174 | cells = &mCells; | 1176 | cells = &mCells; |
1175 | } | 1177 | } |
1176 | #if 1 | 1178 | #if 1 |
1177 | int i; | 1179 | int i; |
1178 | int timeSpan = (*cells).size()-1; | 1180 | int timeSpan = (*cells).size()-1; |
1179 | if ( KOPrefs::instance()->mMonthViewWeek ) | 1181 | if ( KOPrefs::instance()->mMonthViewWeek ) |
1180 | timeSpan = 6; | 1182 | timeSpan = 6; |
1181 | for( i = 0; i < timeSpan + 1; ++i ) { | 1183 | for( i = 0; i < timeSpan + 1; ++i ) { |
1182 | (*cells)[i]->startUpdateCell(); | 1184 | (*cells)[i]->startUpdateCell(); |
1183 | } | 1185 | } |
1184 | 1186 | ||
1185 | QPtrList<Event> events = calendar()->events(); | 1187 | QPtrList<Event> events = calendar()->events(); |
1186 | Event *event; | 1188 | Event *event; |
1187 | QDateTime dt; | 1189 | QDateTime dt; |
1188 | bool ok; | 1190 | bool ok; |
1189 | QDate endDate = mStartDate.addDays( timeSpan ); | 1191 | QDate endDate = mStartDate.addDays( timeSpan ); |
1190 | for( event = events.first(); event; event = events.next() ) { // for event | 1192 | for( event = events.first(); event; event = events.next() ) { // for event |
1191 | if ( event->doesRecur() ) { | 1193 | if ( event->doesRecur() ) { |
1192 | bool last; | 1194 | bool last; |
1193 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); | 1195 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); |
1194 | QDateTime incidenceEnd; | 1196 | QDateTime incidenceEnd; |
1195 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 1197 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
1196 | bool invalid = false; | 1198 | bool invalid = false; |
1197 | while( true ) { | 1199 | while( true ) { |
1198 | if ( incidenceStart.isValid() ) { | 1200 | if ( incidenceStart.isValid() ) { |
1199 | incidenceEnd = incidenceStart.addDays( eventlen ); | 1201 | incidenceEnd = incidenceStart.addDays( eventlen ); |
1200 | int st = incidenceStart.date().daysTo( endDate ); | 1202 | int st = incidenceStart.date().daysTo( endDate ); |
1201 | if ( st >= 0 ) { // start before timeend | 1203 | if ( st >= 0 ) { // start before timeend |
1202 | int end = mStartDate.daysTo( incidenceEnd.date() ); | 1204 | int end = mStartDate.daysTo( incidenceEnd.date() ); |
1203 | if ( end >= 0 ) { // end after timestart --- got one! | 1205 | if ( end >= 0 ) { // end after timestart --- got one! |
1204 | //normalize | 1206 | //normalize |
1205 | st = timeSpan - st; | 1207 | st = timeSpan - st; |
1206 | if ( st < 0 ) st = 0; | 1208 | if ( st < 0 ) st = 0; |
1207 | if ( end > timeSpan ) end = timeSpan; | 1209 | if ( end > timeSpan ) end = timeSpan; |
1208 | int iii; | 1210 | int iii; |
1209 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); | 1211 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); |
1210 | for ( iii = st;iii<= end;++iii) | 1212 | for ( iii = st;iii<= end;++iii) |
1211 | (*cells)[iii]->insertEvent( event ); | 1213 | (*cells)[iii]->insertEvent( event ); |
1212 | } | 1214 | } |
1213 | } | 1215 | } |
1214 | } else { | 1216 | } else { |
1215 | if ( invalid ) | 1217 | if ( invalid ) |
1216 | break; | 1218 | break; |
1217 | invalid = true; | 1219 | invalid = true; |
1218 | //qDebug("invalid %s", event->summary().latin1()); | 1220 | //qDebug("invalid %s", event->summary().latin1()); |
1219 | incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; | 1221 | incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; |
1220 | } | 1222 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 03f9dc6..2f6f5dc 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -1,298 +1,299 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _KOMONTHVIEW_H | 20 | #ifndef _KOMONTHVIEW_H |
21 | #define _KOMONTHVIEW_H | 21 | #define _KOMONTHVIEW_H |
22 | 22 | ||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qframe.h> | 24 | #include <qframe.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qlistbox.h> | 26 | #include <qlistbox.h> |
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qwidgetstack.h> | 28 | #include <qwidgetstack.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qintdict.h> | 30 | #include <qintdict.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qvaluelist.h> | 32 | #include <qvaluelist.h> |
33 | #include <qptrvector.h> | 33 | #include <qptrvector.h> |
34 | 34 | ||
35 | #include <libkcal/calendar.h> | 35 | #include <libkcal/calendar.h> |
36 | #include <libkcal/event.h> | 36 | #include <libkcal/event.h> |
37 | 37 | ||
38 | #include "koeventview.h" | 38 | #include "koeventview.h" |
39 | #include "navigatorbar.h" | 39 | #include "navigatorbar.h" |
40 | 40 | ||
41 | #ifdef DESKTOP_VERSION | 41 | #ifdef DESKTOP_VERSION |
42 | class QToolTipGroup; | 42 | class QToolTipGroup; |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | class KNOWhatsThis; | 45 | class KNOWhatsThis; |
46 | class KOWeekButton : public QPushButton | 46 | class KOWeekButton : public QPushButton |
47 | { | 47 | { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | public: | 49 | public: |
50 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : | 50 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : |
51 | QPushButton( parent, name) | 51 | QPushButton( parent, name) |
52 | { | 52 | { |
53 | connect( this, SIGNAL( clicked() ), | 53 | connect( this, SIGNAL( clicked() ), |
54 | SLOT( bottonClicked() )); | 54 | SLOT( bottonClicked() )); |
55 | mNumber = -1; | 55 | mNumber = -1; |
56 | } | 56 | } |
57 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} | 57 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} |
58 | int getWeekNum() { return mNumber;} | 58 | int getWeekNum() { return mNumber;} |
59 | signals: | 59 | signals: |
60 | void selectWeekNum ( int ); | 60 | void selectWeekNum ( int ); |
61 | private: | 61 | private: |
62 | int mNumber; | 62 | int mNumber; |
63 | private slots : | 63 | private slots : |
64 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } | 64 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } |
65 | }; | 65 | }; |
66 | 66 | ||
67 | class KNoScrollListBox: public QListBox | 67 | class KNoScrollListBox: public QListBox |
68 | { | 68 | { |
69 | Q_OBJECT | 69 | Q_OBJECT |
70 | public: | 70 | public: |
71 | KNoScrollListBox(QWidget *parent=0, const char *name=0); | 71 | KNoScrollListBox(QWidget *parent=0, const char *name=0); |
72 | ~KNoScrollListBox(); | 72 | ~KNoScrollListBox(); |
73 | QString getWhatsThisText(QPoint p) ; | 73 | QString getWhatsThisText(QPoint p) ; |
74 | 74 | ||
75 | signals: | 75 | signals: |
76 | void shiftDown(); | 76 | void shiftDown(); |
77 | void shiftUp(); | 77 | void shiftUp(); |
78 | void rightClick(); | 78 | void rightClick(); |
79 | 79 | ||
80 | protected slots: | 80 | protected slots: |
81 | void oneDown(); | 81 | void oneDown(); |
82 | void keyPressEvent(QKeyEvent *); | 82 | void keyPressEvent(QKeyEvent *); |
83 | void keyReleaseEvent(QKeyEvent *); | 83 | void keyReleaseEvent(QKeyEvent *); |
84 | void mousePressEvent(QMouseEvent *); | 84 | void mousePressEvent(QMouseEvent *); |
85 | 85 | ||
86 | private: | 86 | private: |
87 | KNOWhatsThis * mWT; | 87 | KNOWhatsThis * mWT; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | 90 | ||
91 | class MonthViewItem: public QListBoxItem | 91 | class MonthViewItem: public QListBoxItem |
92 | { | 92 | { |
93 | public: | 93 | public: |
94 | MonthViewItem( Incidence *, QDate qd, const QString & title ); | 94 | MonthViewItem( Incidence *, QDate qd, const QString & title ); |
95 | 95 | ||
96 | void setRecur(bool on) { mRecur = on; } | 96 | void setRecur(bool on) { mRecur = on; } |
97 | void setAlarm(bool on) { mAlarm = on; } | 97 | void setAlarm(bool on) { mAlarm = on; } |
98 | void setReply(bool on) { mReply = on; } | 98 | void setReply(bool on) { mReply = on; } |
99 | void setMoreInfo(bool on) { mInfo = on; } | 99 | void setMoreInfo(bool on) { mInfo = on; } |
100 | 100 | ||
101 | 101 | ||
102 | void setPalette(const QPalette &p) { mPalette = p; } | 102 | void setPalette(const QPalette &p) { mPalette = p; } |
103 | QPalette palette() const { return mPalette; } | 103 | QPalette palette() const { return mPalette; } |
104 | 104 | ||
105 | Incidence *incidence() const { return mIncidence; } | 105 | Incidence *incidence() const { return mIncidence; } |
106 | QDate incidenceDate() { return mDate; } | 106 | QDate incidenceDate() { return mDate; } |
107 | 107 | ||
108 | protected: | 108 | protected: |
109 | virtual void paint(QPainter *); | 109 | virtual void paint(QPainter *); |
110 | virtual int height(const QListBox *) const; | 110 | virtual int height(const QListBox *) const; |
111 | virtual int width(const QListBox *) const; | 111 | virtual int width(const QListBox *) const; |
112 | 112 | ||
113 | private: | 113 | private: |
114 | bool mRecur; | 114 | bool mRecur; |
115 | bool mAlarm; | 115 | bool mAlarm; |
116 | bool mReply; | 116 | bool mReply; |
117 | bool mInfo; | 117 | bool mInfo; |
118 | 118 | ||
119 | QPalette mPalette; | 119 | QPalette mPalette; |
120 | QDate mDate; | 120 | QDate mDate; |
121 | 121 | ||
122 | Incidence *mIncidence; | 122 | Incidence *mIncidence; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | 125 | ||
126 | class KOMonthView; | 126 | class KOMonthView; |
127 | 127 | ||
128 | class MonthViewCell : public QWidget | 128 | class MonthViewCell : public QWidget |
129 | { | 129 | { |
130 | Q_OBJECT | 130 | Q_OBJECT |
131 | public: | 131 | public: |
132 | MonthViewCell(KOMonthView *,QWidget* ); | 132 | MonthViewCell(KOMonthView *,QWidget* ); |
133 | 133 | ||
134 | void setDate( const QDate & ); | 134 | void setDate( const QDate & ); |
135 | QDate date() const; | 135 | QDate date() const; |
136 | 136 | ||
137 | void setPrimary( bool ); | 137 | void setPrimary( bool ); |
138 | bool isPrimary() const; | 138 | bool isPrimary() const; |
139 | 139 | ||
140 | void setHoliday( bool ); | 140 | void setHoliday( bool ); |
141 | void setHoliday( const QString & ); | 141 | void setHoliday( const QString & ); |
142 | 142 | ||
143 | void updateCell(); | 143 | void updateCell(); |
144 | void startUpdateCell(); | 144 | void startUpdateCell(); |
145 | void finishUpdateCell(); | 145 | void finishUpdateCell(); |
146 | void insertEvent(Event *); | 146 | void insertEvent(Event *); |
147 | void insertTodo(Todo *); | 147 | void insertTodo(Todo *); |
148 | 148 | ||
149 | void updateConfig( bool bigFont = false ); | 149 | void updateConfig( bool bigFont = false ); |
150 | 150 | ||
151 | void enableScrollBars( bool ); | 151 | void enableScrollBars( bool ); |
152 | 152 | ||
153 | Incidence *selectedIncidence(); | 153 | Incidence *selectedIncidence(); |
154 | QDate selectedIncidenceDate(); | 154 | QDate selectedIncidenceDate(); |
155 | 155 | ||
156 | void deselect(); | 156 | void deselect(); |
157 | void select(); | 157 | void select(); |
158 | 158 | ||
159 | #ifdef DESKTOP_VERSION | 159 | #ifdef DESKTOP_VERSION |
160 | static QToolTipGroup *toolTipGroup(); | 160 | static QToolTipGroup *toolTipGroup(); |
161 | #endif | 161 | #endif |
162 | signals: | 162 | signals: |
163 | void defaultAction( Incidence * ); | 163 | void defaultAction( Incidence * ); |
164 | void newEventSignal( QDateTime ); | 164 | void newEventSignal( QDateTime ); |
165 | void showDaySignal( QDate ); | 165 | void showDaySignal( QDate ); |
166 | 166 | ||
167 | protected: | 167 | protected: |
168 | QString mToolTip; | 168 | QString mToolTip; |
169 | void resizeEvent( QResizeEvent * ); | 169 | void resizeEvent( QResizeEvent * ); |
170 | 170 | ||
171 | protected slots: | 171 | protected slots: |
172 | void defaultAction( QListBoxItem * ); | 172 | void defaultAction( QListBoxItem * ); |
173 | void contextMenu( QListBoxItem * ); | 173 | void contextMenu( QListBoxItem * ); |
174 | void selection( QListBoxItem * ); | 174 | void selection( QListBoxItem * ); |
175 | void cellClicked( QListBoxItem * ); | 175 | void cellClicked( QListBoxItem * ); |
176 | void newEvent(); | 176 | void newEvent(); |
177 | void showDay(); | 177 | void showDay(); |
178 | 178 | ||
179 | private: | 179 | private: |
180 | KOMonthView *mMonthView; | 180 | KOMonthView *mMonthView; |
181 | 181 | ||
182 | QDate mDate; | 182 | QDate mDate; |
183 | bool mPrimary; | 183 | bool mPrimary; |
184 | bool mHoliday; | 184 | bool mHoliday; |
185 | QString mHolidayString; | 185 | QString mHolidayString; |
186 | 186 | ||
187 | //QLabel *mLabel; | 187 | //QLabel *mLabel; |
188 | QPushButton *mLabel; | 188 | QPushButton *mLabel; |
189 | QListBox *mItemList; | 189 | QListBox *mItemList; |
190 | #ifdef DESKTOP_VERSION | 190 | #ifdef DESKTOP_VERSION |
191 | static QToolTipGroup *mToolTipGroup; | 191 | static QToolTipGroup *mToolTipGroup; |
192 | #endif | 192 | #endif |
193 | QSize mLabelSize; | 193 | QSize mLabelSize; |
194 | QSize mLabelBigSize; | 194 | QSize mLabelBigSize; |
195 | QPalette mHolidayPalette; | 195 | QPalette mHolidayPalette; |
196 | QPalette mStandardPalette; | 196 | QPalette mStandardPalette; |
197 | QPalette mPrimaryPalette; | 197 | QPalette mPrimaryPalette; |
198 | QPalette mNonPrimaryPalette; | 198 | QPalette mNonPrimaryPalette; |
199 | void setMyPalette(); | 199 | void setMyPalette(); |
200 | QPalette getPalette (); | 200 | QPalette getPalette (); |
201 | void keyPressEvent ( QKeyEvent * ) ; | 201 | void keyPressEvent ( QKeyEvent * ) ; |
202 | 202 | ||
203 | }; | 203 | }; |
204 | 204 | ||
205 | 205 | ||
206 | class KOMonthView: public KOEventView | 206 | class KOMonthView: public KOEventView |
207 | { | 207 | { |
208 | Q_OBJECT | 208 | Q_OBJECT |
209 | public: | 209 | public: |
210 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); | 210 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); |
211 | ~KOMonthView(); | 211 | ~KOMonthView(); |
212 | 212 | ||
213 | /** Returns maximum number of days supported by the komonthview */ | 213 | /** Returns maximum number of days supported by the komonthview */ |
214 | virtual int maxDatesHint(); | 214 | virtual int maxDatesHint(); |
215 | 215 | ||
216 | /** Returns number of currently shown dates. */ | 216 | /** Returns number of currently shown dates. */ |
217 | virtual int currentDateCount(); | 217 | virtual int currentDateCount(); |
218 | 218 | ||
219 | /** returns the currently selected events */ | 219 | /** returns the currently selected events */ |
220 | virtual QPtrList<Incidence> selectedIncidences(); | 220 | virtual QPtrList<Incidence> selectedIncidences(); |
221 | 221 | ||
222 | /** returns dates of the currently selected events */ | 222 | /** returns dates of the currently selected events */ |
223 | virtual DateList selectedDates(); | 223 | virtual DateList selectedDates(); |
224 | 224 | ||
225 | virtual void printPreview(CalPrinter *calPrinter, | 225 | virtual void printPreview(CalPrinter *calPrinter, |
226 | const QDate &, const QDate &); | 226 | const QDate &, const QDate &); |
227 | bool isMonthView() { return true; } | 227 | bool isMonthView() { return true; } |
228 | bool isUpdatePossible() { return updatePossible; } | 228 | bool isUpdatePossible() { return updatePossible; } |
229 | 229 | ||
230 | MonthViewCell * selectedCell(); | 230 | MonthViewCell * selectedCell(); |
231 | bool skipResize; | 231 | bool skipResize; |
232 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} | 232 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} |
233 | public slots: | 233 | public slots: |
234 | virtual void updateView(); | 234 | virtual void updateView(); |
235 | virtual void updateConfig(); | 235 | virtual void updateConfig(); |
236 | virtual void showDates(const QDate &start, const QDate &end); | 236 | virtual void showDates(const QDate &start, const QDate &end); |
237 | virtual void showEvents(QPtrList<Event> eventList); | 237 | virtual void showEvents(QPtrList<Event> eventList); |
238 | 238 | ||
239 | void changeEventDisplay(Event *, int); | 239 | void changeEventDisplay(Event *, int); |
240 | 240 | ||
241 | void clearSelection(); | 241 | void clearSelection(); |
242 | 242 | ||
243 | void showContextMenu( Incidence * ); | 243 | void showContextMenu( Incidence * ); |
244 | 244 | ||
245 | void setSelectedCell( MonthViewCell * ); | 245 | void setSelectedCell( MonthViewCell * ); |
246 | void switchView(); | ||
246 | 247 | ||
247 | protected slots: | 248 | protected slots: |
248 | void selectInternalWeekNum ( int ); | 249 | void selectInternalWeekNum ( int ); |
249 | void switchView(); | ||
250 | void processSelectionChange(); | 250 | void processSelectionChange(); |
251 | signals: | 251 | signals: |
252 | void nextMonth(); | 252 | void nextMonth(); |
253 | void prevMonth(); | 253 | void prevMonth(); |
254 | void selectWeekNum ( int ); | 254 | void selectWeekNum ( int ); |
255 | void selectMonth (); | ||
255 | void showDaySignal( QDate ); | 256 | void showDaySignal( QDate ); |
256 | protected: | 257 | protected: |
257 | void resizeEvent(QResizeEvent *); | 258 | void resizeEvent(QResizeEvent *); |
258 | void viewChanged(); | 259 | void viewChanged(); |
259 | void updateDayLabels(); | 260 | void updateDayLabels(); |
260 | 261 | ||
261 | private: | 262 | private: |
262 | NavigatorBar* mNavigatorBar; | 263 | NavigatorBar* mNavigatorBar; |
263 | int currentWeek(); | 264 | int currentWeek(); |
264 | bool clPending; | 265 | bool clPending; |
265 | QWidgetStack * mWidStack; | 266 | QWidgetStack * mWidStack; |
266 | QWidget* mMonthView; | 267 | QWidget* mMonthView; |
267 | QWidget* mWeekView; | 268 | QWidget* mWeekView; |
268 | bool mShowWeekView; | 269 | bool mShowWeekView; |
269 | bool updatePossible; | 270 | bool updatePossible; |
270 | int mDaysPerWeek; | 271 | int mDaysPerWeek; |
271 | int mNumWeeks; | 272 | int mNumWeeks; |
272 | int mNumCells; | 273 | int mNumCells; |
273 | bool mWeekStartsMonday; | 274 | bool mWeekStartsMonday; |
274 | bool mShowSatSunComp; | 275 | bool mShowSatSunComp; |
275 | void computeLayout(); | 276 | void computeLayout(); |
276 | void computeLayoutWeek(); | 277 | void computeLayoutWeek(); |
277 | 278 | ||
278 | QPtrVector<MonthViewCell> mCells; | 279 | QPtrVector<MonthViewCell> mCells; |
279 | QPtrVector<QLabel> mDayLabels; | 280 | QPtrVector<QLabel> mDayLabels; |
280 | QPtrVector<KOWeekButton> mWeekLabels; | 281 | QPtrVector<KOWeekButton> mWeekLabels; |
281 | QPtrVector<MonthViewCell> mCellsW; | 282 | QPtrVector<MonthViewCell> mCellsW; |
282 | QPtrVector<QLabel> mDayLabelsW; | 283 | QPtrVector<QLabel> mDayLabelsW; |
283 | QPtrVector<KOWeekButton> mWeekLabelsW; | 284 | QPtrVector<KOWeekButton> mWeekLabelsW; |
284 | 285 | ||
285 | bool mShortDayLabelsM; | 286 | bool mShortDayLabelsM; |
286 | bool mShortDayLabelsW; | 287 | bool mShortDayLabelsW; |
287 | int mWidthLongDayLabel; | 288 | int mWidthLongDayLabel; |
288 | 289 | ||
289 | QDate mStartDate; | 290 | QDate mStartDate; |
290 | 291 | ||
291 | MonthViewCell *mSelectedCell; | 292 | MonthViewCell *mSelectedCell; |
292 | 293 | ||
293 | KOEventPopupMenu *mContextMenu; | 294 | KOEventPopupMenu *mContextMenu; |
294 | void keyPressEvent ( QKeyEvent * ) ; | 295 | void keyPressEvent ( QKeyEvent * ) ; |
295 | 296 | ||
296 | }; | 297 | }; |
297 | 298 | ||
298 | #endif | 299 | #endif |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 7efb6a6..5efc247 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -1,333 +1,334 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <time.h> | 24 | #include <time.h> |
25 | #ifndef _WIN32_ | 25 | #ifndef _WIN32_ |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #endif | 27 | #endif |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qtextcodec.h> | 30 | #include <qtextcodec.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | #include <qfont.h> | 33 | #include <qfont.h> |
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <stdlib.h> | 36 | #include <stdlib.h> |
37 | 37 | ||
38 | #include <kglobal.h> | 38 | #include <kglobal.h> |
39 | #include <kglobalsettings.h> | 39 | #include <kglobalsettings.h> |
40 | #include <kconfig.h> | 40 | #include <kconfig.h> |
41 | #include <klocale.h> | 41 | #include <klocale.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kemailsettings.h> | 43 | #include <kemailsettings.h> |
44 | #include <kstaticdeleter.h> | 44 | #include <kstaticdeleter.h> |
45 | #include <libkdepim/kpimglobalprefs.h> | 45 | #include <libkdepim/kpimglobalprefs.h> |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "mainwindow.h" | 48 | #include "mainwindow.h" |
49 | 49 | ||
50 | KOPrefs *KOPrefs::mInstance = 0; | 50 | KOPrefs *KOPrefs::mInstance = 0; |
51 | static KStaticDeleter<KOPrefs> insd; | 51 | static KStaticDeleter<KOPrefs> insd; |
52 | 52 | ||
53 | KOPrefs::KOPrefs() : | 53 | KOPrefs::KOPrefs() : |
54 | KPimPrefs("korganizerrc") | 54 | KPimPrefs("korganizerrc") |
55 | { | 55 | { |
56 | mCategoryColors.setAutoDelete(true); | 56 | mCategoryColors.setAutoDelete(true); |
57 | fillMailDefaults(); | 57 | fillMailDefaults(); |
58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
59 | QColor defaultHolidayColor = QColor(255,0,0); | 59 | QColor defaultHolidayColor = QColor(255,0,0); |
60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
64 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 64 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
65 | 65 | ||
66 | 66 | ||
67 | KPrefs::setCurrentGroup("General"); | 67 | KPrefs::setCurrentGroup("General"); |
68 | 68 | ||
69 | 69 | ||
70 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 70 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
71 | 71 | ||
72 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 72 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
73 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 73 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
74 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 74 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
75 | addItemBool("ShowIconList",&mShowIconList,true); | 75 | addItemBool("ShowIconList",&mShowIconList,true); |
76 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 76 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
77 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 77 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
78 | addItemBool("ShowIconDay6",&mShowIconDay6,true); | ||
78 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 79 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
79 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 80 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
80 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 81 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
81 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 82 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
82 | addItemBool("ShowIconBack",&mShowIconBack,true); | 83 | addItemBool("ShowIconBack",&mShowIconBack,true); |
83 | addItemBool("ShowIconToday",&mShowIconToday,true); | 84 | addItemBool("ShowIconToday",&mShowIconToday,true); |
84 | addItemBool("ShowIconForward",&mShowIconForward,true); | 85 | addItemBool("ShowIconForward",&mShowIconForward,true); |
85 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 86 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
86 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); | 87 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); |
87 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 88 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
88 | addItemBool("ShowIconNext",&mShowIconNext,true); | 89 | addItemBool("ShowIconNext",&mShowIconNext,true); |
89 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 90 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
90 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 91 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
91 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 92 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
92 | 93 | ||
93 | addItemBool("AskForQuit",&mAskForQuit,false); | 94 | addItemBool("AskForQuit",&mAskForQuit,false); |
94 | 95 | ||
95 | #ifndef DESKTOP_VERSION | 96 | #ifndef DESKTOP_VERSION |
96 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 97 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
97 | #else | 98 | #else |
98 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 99 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
99 | #endif | 100 | #endif |
100 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 101 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
101 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 102 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
102 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 103 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
103 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 104 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
104 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 105 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
105 | 106 | ||
106 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 107 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
107 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | 108 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); |
108 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | 109 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); |
109 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 110 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
110 | addItemInt("AllDay Size",&mAllDaySize,28); | 111 | addItemInt("AllDay Size",&mAllDaySize,28); |
111 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 112 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
112 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 113 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
113 | 114 | ||
114 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 115 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
115 | addItemStringList("EventSummary User",&mEventSummaryUser); | 116 | addItemStringList("EventSummary User",&mEventSummaryUser); |
116 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 117 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
117 | 118 | ||
118 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 119 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
119 | addItemBool("Enable Project View",&mEnableProjectView,false); | 120 | addItemBool("Enable Project View",&mEnableProjectView,false); |
120 | addItemBool("Auto Save",&mAutoSave,false); | 121 | addItemBool("Auto Save",&mAutoSave,false); |
121 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 122 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
122 | addItemBool("Confirm Deletes",&mConfirm,true); | 123 | addItemBool("Confirm Deletes",&mConfirm,true); |
123 | addItemString("Archive File",&mArchiveFile); | 124 | addItemString("Archive File",&mArchiveFile); |
124 | addItemString("Html Export File",&mHtmlExportFile, | 125 | addItemString("Html Export File",&mHtmlExportFile, |
125 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 126 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
126 | addItemBool("Html With Save",&mHtmlWithSave,false); | 127 | addItemBool("Html With Save",&mHtmlWithSave,false); |
127 | 128 | ||
128 | KPrefs::setCurrentGroup("Personal Settings"); | 129 | KPrefs::setCurrentGroup("Personal Settings"); |
129 | 130 | ||
130 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 131 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
131 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 132 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
132 | addItemBool("Bcc",&mBcc,false); | 133 | addItemBool("Bcc",&mBcc,false); |
133 | 134 | ||
134 | KPrefs::setCurrentGroup("Time & Date"); | 135 | KPrefs::setCurrentGroup("Time & Date"); |
135 | 136 | ||
136 | 137 | ||
137 | addItemInt("Default Start Time",&mStartTime,10); | 138 | addItemInt("Default Start Time",&mStartTime,10); |
138 | addItemInt("Default Duration",&mDefaultDuration,2); | 139 | addItemInt("Default Duration",&mDefaultDuration,2); |
139 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 140 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
140 | KPrefs::setCurrentGroup("AlarmSettings"); | 141 | KPrefs::setCurrentGroup("AlarmSettings"); |
141 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 142 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
142 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 143 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
143 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 144 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
144 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 145 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
145 | 146 | ||
146 | 147 | ||
147 | KPrefs::setCurrentGroup("Calendar"); | 148 | KPrefs::setCurrentGroup("Calendar"); |
148 | 149 | ||
149 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 150 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
150 | 151 | ||
151 | KPrefs::setCurrentGroup("Fonts"); | 152 | KPrefs::setCurrentGroup("Fonts"); |
152 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 153 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
153 | addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); | 154 | addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); |
154 | addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); | 155 | addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); |
155 | addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); | 156 | addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); |
156 | addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); | 157 | addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); |
157 | addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); | 158 | addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); |
158 | addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); | 159 | addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); |
159 | addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); | 160 | addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); |
160 | addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); | 161 | addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); |
161 | addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); | 162 | addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); |
162 | addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); | 163 | addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); |
163 | addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont()); | 164 | addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont()); |
164 | addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont()); | 165 | addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont()); |
165 | 166 | ||
166 | KPrefs::setCurrentGroup("RemoteSyncing"); | 167 | KPrefs::setCurrentGroup("RemoteSyncing"); |
167 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 168 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
168 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 169 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
169 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 170 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
170 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 171 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
171 | 172 | ||
172 | #ifdef _WIN32_ | 173 | #ifdef _WIN32_ |
173 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 174 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
174 | #else | 175 | #else |
175 | QString hdp= locateLocal("data","korganizer")+"/"; | 176 | QString hdp= locateLocal("data","korganizer")+"/"; |
176 | #endif | 177 | #endif |
177 | 178 | ||
178 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 179 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
179 | 180 | ||
180 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 181 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
181 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 182 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
182 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 183 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
183 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 184 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
184 | 185 | ||
185 | 186 | ||
186 | KPrefs::setCurrentGroup("Locale"); | 187 | KPrefs::setCurrentGroup("Locale"); |
187 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 188 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
188 | 189 | ||
189 | 190 | ||
190 | KPrefs::setCurrentGroup("Colors"); | 191 | KPrefs::setCurrentGroup("Colors"); |
191 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 192 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
192 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 193 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
193 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 194 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
194 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); | 195 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); |
195 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 196 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
196 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 197 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
197 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 198 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
198 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 199 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
199 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 200 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
200 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 201 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
201 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 202 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
202 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 203 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
203 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 204 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
204 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 205 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
205 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 206 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
206 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 207 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
207 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 208 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
208 | addItemBool("UseAppColors",&mUseAppColors,false); | 209 | addItemBool("UseAppColors",&mUseAppColors,false); |
209 | 210 | ||
210 | 211 | ||
211 | 212 | ||
212 | KPrefs::setCurrentGroup("Views"); | 213 | KPrefs::setCurrentGroup("Views"); |
213 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 214 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
214 | addItemInt("Hour Size",&mHourSize,8); | 215 | addItemInt("Hour Size",&mHourSize,8); |
215 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
216 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
217 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
218 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
219 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
220 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
221 | #ifdef DESKTOP_VERION | 222 | #ifdef DESKTOP_VERION |
222 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 223 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
223 | #else | 224 | #else |
224 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 225 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
225 | #endif | 226 | #endif |
226 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 227 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
227 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 228 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
228 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 229 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
229 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 230 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
230 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 231 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
231 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 232 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
232 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 233 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
233 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 234 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
234 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 235 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
235 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 236 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
236 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 237 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
237 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 238 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
238 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 239 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
239 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 240 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
240 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 241 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
241 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 242 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
242 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 243 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
243 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 244 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
244 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 245 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
245 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 246 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
246 | #ifdef DESKTOP_VERSION | 247 | #ifdef DESKTOP_VERSION |
247 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 248 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
248 | #else | 249 | #else |
249 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 250 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
250 | #endif | 251 | #endif |
251 | addItemInt("Day Begins",&mDayBegins,7); | 252 | addItemInt("Day Begins",&mDayBegins,7); |
252 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 253 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
253 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 254 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
254 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 255 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
255 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 256 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
256 | 257 | ||
257 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 258 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
258 | addItemBool("Full View Month",&mFullViewMonth,true); | 259 | addItemBool("Full View Month",&mFullViewMonth,true); |
259 | addItemBool("Full View Todo",&mFullViewTodo,true); | 260 | addItemBool("Full View Todo",&mFullViewTodo,true); |
260 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 261 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
261 | 262 | ||
262 | addItemInt("Next X Days",&mNextXDays,3); | 263 | addItemInt("Next X Days",&mNextXDays,3); |
263 | 264 | ||
264 | KPrefs::setCurrentGroup("Printer"); | 265 | KPrefs::setCurrentGroup("Printer"); |
265 | 266 | ||
266 | KPrefs::setCurrentGroup("Layout"); | 267 | KPrefs::setCurrentGroup("Layout"); |
267 | 268 | ||
268 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 269 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
269 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 270 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
270 | 271 | ||
271 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 272 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
272 | 273 | ||
273 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 274 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
274 | 275 | ||
275 | KPrefs::setCurrentGroup("Group Scheduling"); | 276 | KPrefs::setCurrentGroup("Group Scheduling"); |
276 | 277 | ||
277 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 278 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
278 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 279 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
279 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 280 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
280 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 281 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
281 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 282 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
282 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 283 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
283 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 284 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
284 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 285 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
285 | 286 | ||
286 | KPrefs::setCurrentGroup( "Editors" ); | 287 | KPrefs::setCurrentGroup( "Editors" ); |
287 | 288 | ||
288 | addItemStringList( "EventTemplates", &mEventTemplates ); | 289 | addItemStringList( "EventTemplates", &mEventTemplates ); |
289 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 290 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
290 | 291 | ||
291 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 292 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
292 | 293 | ||
293 | 294 | ||
294 | 295 | ||
295 | } | 296 | } |
296 | 297 | ||
297 | 298 | ||
298 | KOPrefs::~KOPrefs() | 299 | KOPrefs::~KOPrefs() |
299 | { | 300 | { |
300 | if (mInstance == this) | 301 | if (mInstance == this) |
301 | mInstance = insd.setObject(0); | 302 | mInstance = insd.setObject(0); |
302 | 303 | ||
303 | //qDebug("KOPrefs::~KOPrefs() "); | 304 | //qDebug("KOPrefs::~KOPrefs() "); |
304 | } | 305 | } |
305 | 306 | ||
306 | 307 | ||
307 | KOPrefs *KOPrefs::instance() | 308 | KOPrefs *KOPrefs::instance() |
308 | { | 309 | { |
309 | if (!mInstance) { | 310 | if (!mInstance) { |
310 | mInstance = insd.setObject(new KOPrefs()); | 311 | mInstance = insd.setObject(new KOPrefs()); |
311 | mInstance->readConfig(); | 312 | mInstance->readConfig(); |
312 | } | 313 | } |
313 | 314 | ||
314 | return mInstance; | 315 | return mInstance; |
315 | } | 316 | } |
316 | 317 | ||
317 | void KOPrefs::usrSetDefaults() | 318 | void KOPrefs::usrSetDefaults() |
318 | { | 319 | { |
319 | 320 | ||
320 | } | 321 | } |
321 | 322 | ||
322 | void KOPrefs::fillMailDefaults() | 323 | void KOPrefs::fillMailDefaults() |
323 | { | 324 | { |
324 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 325 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
325 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 326 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
326 | } | 327 | } |
327 | 328 | ||
328 | void KOPrefs::setTimeZoneIdDefault() | 329 | void KOPrefs::setTimeZoneIdDefault() |
329 | { | 330 | { |
330 | ; | 331 | ; |
331 | } | 332 | } |
332 | 333 | ||
333 | void KOPrefs::setAllDefaults() | 334 | void KOPrefs::setAllDefaults() |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index fa69d52..e300067 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -1,283 +1,284 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOPREFS_H | 23 | #ifndef KOPREFS_H |
24 | #define KOPREFS_H | 24 | #define KOPREFS_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <libkdepim/kpimprefs.h> | 27 | #include <libkdepim/kpimprefs.h> |
28 | #include <qdict.h> | 28 | #include <qdict.h> |
29 | 29 | ||
30 | class KConfig; | 30 | class KConfig; |
31 | class QFont; | 31 | class QFont; |
32 | class QColor; | 32 | class QColor; |
33 | class QStringList; | 33 | class QStringList; |
34 | 34 | ||
35 | class KOPrefs : public KPimPrefs | 35 | class KOPrefs : public KPimPrefs |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | enum { FormatVCalendar, FormatICalendar }; | 38 | enum { FormatVCalendar, FormatICalendar }; |
39 | enum { MailClientKMail, MailClientSendmail }; | 39 | enum { MailClientKMail, MailClientSendmail }; |
40 | enum { IMIPDummy, IMIPKMail }; | 40 | enum { IMIPDummy, IMIPKMail }; |
41 | enum { IMIPOutbox, IMIPdirectsend }; | 41 | enum { IMIPOutbox, IMIPdirectsend }; |
42 | enum { neverAuto, addressbookAuto, selectedAuto }; | 42 | enum { neverAuto, addressbookAuto, selectedAuto }; |
43 | enum { standardDestination, askDestination }; | 43 | enum { standardDestination, askDestination }; |
44 | 44 | ||
45 | virtual ~KOPrefs(); | 45 | virtual ~KOPrefs(); |
46 | 46 | ||
47 | /** Get instance of KOPrefs. It is made sure that there is only one | 47 | /** Get instance of KOPrefs. It is made sure that there is only one |
48 | instance. */ | 48 | instance. */ |
49 | static KOPrefs *instance(); | 49 | static KOPrefs *instance(); |
50 | 50 | ||
51 | /** Set preferences to default values */ | 51 | /** Set preferences to default values */ |
52 | void usrSetDefaults(); | 52 | void usrSetDefaults(); |
53 | 53 | ||
54 | /** Read preferences from config file */ | 54 | /** Read preferences from config file */ |
55 | void usrReadConfig(); | 55 | void usrReadConfig(); |
56 | 56 | ||
57 | /** Write preferences to config file */ | 57 | /** Write preferences to config file */ |
58 | void usrWriteConfig(); | 58 | void usrWriteConfig(); |
59 | void setCategoryDefaults(); | 59 | void setCategoryDefaults(); |
60 | void setAllDefaults(); | 60 | void setAllDefaults(); |
61 | 61 | ||
62 | protected: | 62 | protected: |
63 | void setTimeZoneIdDefault(); | 63 | void setTimeZoneIdDefault(); |
64 | 64 | ||
65 | /** Fill empty mail fields with default values. */ | 65 | /** Fill empty mail fields with default values. */ |
66 | void fillMailDefaults(); | 66 | void fillMailDefaults(); |
67 | 67 | ||
68 | private: | 68 | private: |
69 | /** Constructor disabled for public. Use instance() to create a KOPrefs | 69 | /** Constructor disabled for public. Use instance() to create a KOPrefs |
70 | object. */ | 70 | object. */ |
71 | KOPrefs(); | 71 | KOPrefs(); |
72 | 72 | ||
73 | static KOPrefs *mInstance; | 73 | static KOPrefs *mInstance; |
74 | QStringList getDefaultList(); | 74 | QStringList getDefaultList(); |
75 | QStringList getLocationDefaultList(); | 75 | QStringList getLocationDefaultList(); |
76 | public: | 76 | public: |
77 | // preferences data | 77 | // preferences data |
78 | KConfig* getConfig(); | 78 | KConfig* getConfig(); |
79 | void setFullName(const QString &); | 79 | void setFullName(const QString &); |
80 | QString fullName(); | 80 | QString fullName(); |
81 | void setEmail(const QString &); | 81 | void setEmail(const QString &); |
82 | QString email(); | 82 | QString email(); |
83 | 83 | ||
84 | QString mAdditional; | 84 | QString mAdditional; |
85 | 85 | ||
86 | bool mEmailControlCenter; | 86 | bool mEmailControlCenter; |
87 | 87 | ||
88 | bool mBcc; | 88 | bool mBcc; |
89 | bool mAutoSave; | 89 | bool mAutoSave; |
90 | int mAutoSaveInterval; | 90 | int mAutoSaveInterval; |
91 | bool mConfirm; | 91 | bool mConfirm; |
92 | 92 | ||
93 | bool mEnableGroupScheduling; | 93 | bool mEnableGroupScheduling; |
94 | bool mEnableProjectView; | 94 | bool mEnableProjectView; |
95 | 95 | ||
96 | int mDefaultFormat; | 96 | int mDefaultFormat; |
97 | int mMailClient; | 97 | int mMailClient; |
98 | 98 | ||
99 | int mStartTime; | 99 | int mStartTime; |
100 | int mDefaultDuration; | 100 | int mDefaultDuration; |
101 | int mAlarmTime; | 101 | int mAlarmTime; |
102 | 102 | ||
103 | int mWorkingHoursStart; | 103 | int mWorkingHoursStart; |
104 | int mWorkingHoursEnd; | 104 | int mWorkingHoursEnd; |
105 | bool mExcludeHolidays; | 105 | bool mExcludeHolidays; |
106 | bool mExcludeSaturdays; | 106 | bool mExcludeSaturdays; |
107 | bool mMarcusBainsShowSeconds; | 107 | bool mMarcusBainsShowSeconds; |
108 | 108 | ||
109 | QFont mTimeBarFont; | 109 | QFont mTimeBarFont; |
110 | QFont mMonthViewFont; | 110 | QFont mMonthViewFont; |
111 | QFont mAgendaViewFont; | 111 | QFont mAgendaViewFont; |
112 | QFont mMarcusBainsFont; | 112 | QFont mMarcusBainsFont; |
113 | QFont mTimeLabelsFont; | 113 | QFont mTimeLabelsFont; |
114 | QFont mTodoViewFont; | 114 | QFont mTodoViewFont; |
115 | QFont mListViewFont; | 115 | QFont mListViewFont; |
116 | QFont mDateNavigatorFont; | 116 | QFont mDateNavigatorFont; |
117 | QFont mEditBoxFont; | 117 | QFont mEditBoxFont; |
118 | QFont mJornalViewFont; | 118 | QFont mJornalViewFont; |
119 | QFont mWhatsNextFont; | 119 | QFont mWhatsNextFont; |
120 | QFont mEventViewFont; | 120 | QFont mEventViewFont; |
121 | 121 | ||
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | QColor mHolidayColor; | 125 | QColor mHolidayColor; |
126 | QColor mHighlightColor; | 126 | QColor mHighlightColor; |
127 | QColor mEventColor; | 127 | QColor mEventColor; |
128 | QColor mTodoDoneColor; | 128 | QColor mTodoDoneColor; |
129 | QColor mAgendaBgColor; | 129 | QColor mAgendaBgColor; |
130 | QColor mWorkingHoursColor; | 130 | QColor mWorkingHoursColor; |
131 | QColor mTodoDueTodayColor; | 131 | QColor mTodoDueTodayColor; |
132 | QColor mTodoOverdueColor; | 132 | QColor mTodoOverdueColor; |
133 | QColor mMonthViewEvenColor; | 133 | QColor mMonthViewEvenColor; |
134 | QColor mMonthViewOddColor; | 134 | QColor mMonthViewOddColor; |
135 | QColor mMonthViewHolidayColor; | 135 | QColor mMonthViewHolidayColor; |
136 | bool mMonthViewUsesDayColors; | 136 | bool mMonthViewUsesDayColors; |
137 | bool mMonthViewSatSunTog; | 137 | bool mMonthViewSatSunTog; |
138 | bool mMonthViewWeek; | 138 | bool mMonthViewWeek; |
139 | QColor mAppColor1; | 139 | QColor mAppColor1; |
140 | QColor mAppColor2; | 140 | QColor mAppColor2; |
141 | bool mUseAppColors; | 141 | bool mUseAppColors; |
142 | 142 | ||
143 | int mDayBegins; | 143 | int mDayBegins; |
144 | int mHourSize; | 144 | int mHourSize; |
145 | int mAllDaySize; | 145 | int mAllDaySize; |
146 | bool mShowFullMenu; | 146 | bool mShowFullMenu; |
147 | bool mDailyRecur; | 147 | bool mDailyRecur; |
148 | bool mWeeklyRecur; | 148 | bool mWeeklyRecur; |
149 | bool mMonthDailyRecur; | 149 | bool mMonthDailyRecur; |
150 | bool mMonthWeeklyRecur; | 150 | bool mMonthWeeklyRecur; |
151 | bool mMonthShowIcons; | 151 | bool mMonthShowIcons; |
152 | bool mMonthShowShort; | 152 | bool mMonthShowShort; |
153 | bool mEnableToolTips; | 153 | bool mEnableToolTips; |
154 | bool mEnableMonthScroll; | 154 | bool mEnableMonthScroll; |
155 | bool mFullViewMonth; | 155 | bool mFullViewMonth; |
156 | bool mMonthViewUsesCategoryColor; | 156 | bool mMonthViewUsesCategoryColor; |
157 | bool mFullViewTodo; | 157 | bool mFullViewTodo; |
158 | bool mShowCompletedTodo; | 158 | bool mShowCompletedTodo; |
159 | bool mMarcusBainsEnabled; | 159 | bool mMarcusBainsEnabled; |
160 | int mNextXDays; | 160 | int mNextXDays; |
161 | int mWhatsNextDays; | 161 | int mWhatsNextDays; |
162 | int mWhatsNextPrios; | 162 | int mWhatsNextPrios; |
163 | bool mEnableQuickTodo; | 163 | bool mEnableQuickTodo; |
164 | 164 | ||
165 | bool mCompactDialogs; | 165 | bool mCompactDialogs; |
166 | bool mVerticalScreen; | 166 | bool mVerticalScreen; |
167 | 167 | ||
168 | bool mShowIconNewTodo; | 168 | bool mShowIconNewTodo; |
169 | bool mShowIconNewEvent; | 169 | bool mShowIconNewEvent; |
170 | bool mShowIconSearch; | 170 | bool mShowIconSearch; |
171 | bool mShowIconList; | 171 | bool mShowIconList; |
172 | bool mShowIconDay1; | 172 | bool mShowIconDay1; |
173 | bool mShowIconDay5; | 173 | bool mShowIconDay5; |
174 | bool mShowIconDay6; | ||
174 | bool mShowIconDay7; | 175 | bool mShowIconDay7; |
175 | bool mShowIconMonth; | 176 | bool mShowIconMonth; |
176 | bool mShowIconTodoview; | 177 | bool mShowIconTodoview; |
177 | bool mShowIconBackFast; | 178 | bool mShowIconBackFast; |
178 | bool mShowIconBack; | 179 | bool mShowIconBack; |
179 | bool mShowIconToday; | 180 | bool mShowIconToday; |
180 | bool mShowIconForward; | 181 | bool mShowIconForward; |
181 | bool mShowIconForwardFast; | 182 | bool mShowIconForwardFast; |
182 | bool mShowIconWhatsThis; | 183 | bool mShowIconWhatsThis; |
183 | bool mShowIconNextDays; | 184 | bool mShowIconNextDays; |
184 | bool mShowIconNext; | 185 | bool mShowIconNext; |
185 | bool mShowIconJournal; | 186 | bool mShowIconJournal; |
186 | 187 | ||
187 | bool mShowIconStretch; | 188 | bool mShowIconStretch; |
188 | 189 | ||
189 | bool mToolBarHor; | 190 | bool mToolBarHor; |
190 | bool mToolBarUp; | 191 | bool mToolBarUp; |
191 | bool mToolBarMiniIcons; | 192 | bool mToolBarMiniIcons; |
192 | 193 | ||
193 | bool mAskForQuit; | 194 | bool mAskForQuit; |
194 | bool mUsePassWd; | 195 | bool mUsePassWd; |
195 | bool mShowSyncEvents; | 196 | bool mShowSyncEvents; |
196 | bool mShowTodoInAgenda; | 197 | bool mShowTodoInAgenda; |
197 | bool mShowTimeInAgenda; | 198 | bool mShowTimeInAgenda; |
198 | bool mHideNonStartedTodos; | 199 | bool mHideNonStartedTodos; |
199 | 200 | ||
200 | int mLastSyncTime; | 201 | int mLastSyncTime; |
201 | void setCategoryColor(QString cat,const QColor & color); | 202 | void setCategoryColor(QString cat,const QColor & color); |
202 | QColor *categoryColor(QString cat); | 203 | QColor *categoryColor(QString cat); |
203 | 204 | ||
204 | QString mArchiveFile; | 205 | QString mArchiveFile; |
205 | QString mHtmlExportFile; | 206 | QString mHtmlExportFile; |
206 | bool mHtmlWithSave; | 207 | bool mHtmlWithSave; |
207 | 208 | ||
208 | QStringList mSelectedPlugins; | 209 | QStringList mSelectedPlugins; |
209 | 210 | ||
210 | QString mLastImportFile; | 211 | QString mLastImportFile; |
211 | QString mLastVcalFile; | 212 | QString mLastVcalFile; |
212 | QString mLastSaveFile; | 213 | QString mLastSaveFile; |
213 | QString mLastLoadFile; | 214 | QString mLastLoadFile; |
214 | 215 | ||
215 | 216 | ||
216 | QString mDefaultAlarmFile; | 217 | QString mDefaultAlarmFile; |
217 | int mIMIPScheduler; | 218 | int mIMIPScheduler; |
218 | int mIMIPSend; | 219 | int mIMIPSend; |
219 | QStringList mAdditionalMails; | 220 | QStringList mAdditionalMails; |
220 | int mIMIPAutoRefresh; | 221 | int mIMIPAutoRefresh; |
221 | int mIMIPAutoInsertReply; | 222 | int mIMIPAutoInsertReply; |
222 | int mIMIPAutoInsertRequest; | 223 | int mIMIPAutoInsertRequest; |
223 | int mIMIPAutoFreeBusy; | 224 | int mIMIPAutoFreeBusy; |
224 | int mIMIPAutoFreeBusyReply; | 225 | int mIMIPAutoFreeBusyReply; |
225 | 226 | ||
226 | QStringList mTodoTemplates; | 227 | QStringList mTodoTemplates; |
227 | QStringList mEventTemplates; | 228 | QStringList mEventTemplates; |
228 | 229 | ||
229 | int mDestination; | 230 | int mDestination; |
230 | 231 | ||
231 | 232 | ||
232 | bool mEditOnDoubleClick; | 233 | bool mEditOnDoubleClick; |
233 | bool mViewChangeHoldFullscreen; | 234 | bool mViewChangeHoldFullscreen; |
234 | bool mViewChangeHoldNonFullscreen; | 235 | bool mViewChangeHoldNonFullscreen; |
235 | bool mCenterOnCurrentTime; | 236 | bool mCenterOnCurrentTime; |
236 | bool mSetTimeToDayStartAt; | 237 | bool mSetTimeToDayStartAt; |
237 | bool mHighlightCurrentDay; | 238 | bool mHighlightCurrentDay; |
238 | bool mUseHighlightLightColor; | 239 | bool mUseHighlightLightColor; |
239 | bool mListViewMonthTimespan; | 240 | bool mListViewMonthTimespan; |
240 | bool mWNViewShowsParents; | 241 | bool mWNViewShowsParents; |
241 | bool mWNViewShowsPast; | 242 | bool mWNViewShowsPast; |
242 | bool mWNViewShowLocation; | 243 | bool mWNViewShowLocation; |
243 | bool mTodoViewShowsPercentage; | 244 | bool mTodoViewShowsPercentage; |
244 | bool mTodoViewUsesCatColors; | 245 | bool mTodoViewUsesCatColors; |
245 | bool mMonthViewUsesBigFont; | 246 | bool mMonthViewUsesBigFont; |
246 | bool mTodoViewUsesSmallFont; | 247 | bool mTodoViewUsesSmallFont; |
247 | bool mTodoViewUsesForegroundColor; | 248 | bool mTodoViewUsesForegroundColor; |
248 | bool mMonthViewUsesForegroundColor; | 249 | bool mMonthViewUsesForegroundColor; |
249 | 250 | ||
250 | bool mHightlightDateTimeEdit; | 251 | bool mHightlightDateTimeEdit; |
251 | bool mShortDateInViewer; | 252 | bool mShortDateInViewer; |
252 | 253 | ||
253 | bool mShowDateNavigator; | 254 | bool mShowDateNavigator; |
254 | 255 | ||
255 | QStringList mLocationDefaults; | 256 | QStringList mLocationDefaults; |
256 | QStringList mEventSummaryUser; | 257 | QStringList mEventSummaryUser; |
257 | QStringList mTodoSummaryUser; | 258 | QStringList mTodoSummaryUser; |
258 | 259 | ||
259 | bool mUseInternalAlarmNotification; | 260 | bool mUseInternalAlarmNotification; |
260 | int mAlarmPlayBeeps; | 261 | int mAlarmPlayBeeps; |
261 | int mAlarmSuspendTime; | 262 | int mAlarmSuspendTime; |
262 | int mAlarmSuspendCount; | 263 | int mAlarmSuspendCount; |
263 | int mAlarmBeepInterval; | 264 | int mAlarmBeepInterval; |
264 | int mOldLanguage; | 265 | int mOldLanguage; |
265 | int mOldLoadedLanguage; | 266 | int mOldLoadedLanguage; |
266 | 267 | ||
267 | 268 | ||
268 | QString mActiveSyncPort; | 269 | QString mActiveSyncPort; |
269 | QString mActiveSyncIP; | 270 | QString mActiveSyncIP; |
270 | 271 | ||
271 | private: | 272 | private: |
272 | QDict<QColor> mCategoryColors; | 273 | QDict<QColor> mCategoryColors; |
273 | QColor mDefaultCategoryColor; | 274 | QColor mDefaultCategoryColor; |
274 | 275 | ||
275 | QFont mDefaultTimeBarFont; | 276 | QFont mDefaultTimeBarFont; |
276 | QFont mDefaultViewFont; | 277 | QFont mDefaultViewFont; |
277 | QFont mDefaultMonthViewFont; | 278 | QFont mDefaultMonthViewFont; |
278 | 279 | ||
279 | QString mName; | 280 | QString mName; |
280 | QString mEmail; | 281 | QString mEmail; |
281 | }; | 282 | }; |
282 | 283 | ||
283 | #endif | 284 | #endif |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index f8f6c1d..e22f096 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -1,674 +1,714 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001 | 4 | Copyright (c) 2001 |
5 | Cornelius Schumacher <schumacher@kde.org> | 5 | Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qwidgetstack.h> | 26 | #include <qwidgetstack.h> |
27 | 27 | ||
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #else | 32 | #else |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #endif | 34 | #endif |
35 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
36 | #include "calendarview.h" | 36 | #include "calendarview.h" |
37 | #include "datenavigator.h" | 37 | #include "datenavigator.h" |
38 | #include "kotodoview.h" | 38 | #include "kotodoview.h" |
39 | #include "koagendaview.h" | 39 | #include "koagendaview.h" |
40 | #include "kodialogmanager.h" | 40 | #include "kodialogmanager.h" |
41 | #include "komonthview.h" | 41 | #include "komonthview.h" |
42 | #include "kolistview.h" | 42 | #include "kolistview.h" |
43 | #include "kowhatsnextview.h" | 43 | #include "kowhatsnextview.h" |
44 | #include "kojournalview.h" | 44 | #include "kojournalview.h" |
45 | #include "kotimespanview.h" | 45 | #include "kotimespanview.h" |
46 | #include "koprefs.h" | 46 | #include "koprefs.h" |
47 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
48 | #include "kdatenavigator.h" | 48 | #include "kdatenavigator.h" |
49 | 49 | ||
50 | #include "koviewmanager.h" | 50 | #include "koviewmanager.h" |
51 | //extern bool externFlagMonthviewBlockPainting; | 51 | //extern bool externFlagMonthviewBlockPainting; |
52 | 52 | ||
53 | //bool globalFlagBlockPainting = false; | 53 | //bool globalFlagBlockPainting = false; |
54 | int globalFlagBlockAgenda = 0; | 54 | int globalFlagBlockAgenda = 0; |
55 | int globalFlagBlockLabel = 0; | 55 | int globalFlagBlockLabel = 0; |
56 | int globalFlagBlockAgendaItemPaint = 1; | 56 | int globalFlagBlockAgendaItemPaint = 1; |
57 | int globalFlagBlockAgendaItemUpdate = 1; | 57 | int globalFlagBlockAgendaItemUpdate = 1; |
58 | 58 | ||
59 | 59 | ||
60 | KOViewManager::KOViewManager( CalendarView *mainView ) : | 60 | KOViewManager::KOViewManager( CalendarView *mainView ) : |
61 | QObject(), mMainView( mainView ) | 61 | QObject(), mMainView( mainView ) |
62 | { | 62 | { |
63 | mCurrentView = 0; | 63 | mCurrentView = 0; |
64 | 64 | ||
65 | mWhatsNextView = 0; | 65 | mWhatsNextView = 0; |
66 | mTodoView = 0; | 66 | mTodoView = 0; |
67 | mAgendaView = 0; | 67 | mAgendaView = 0; |
68 | mMonthView = 0; | 68 | mMonthView = 0; |
69 | mListView = 0; | 69 | mListView = 0; |
70 | mJournalView = 0; | 70 | mJournalView = 0; |
71 | mTimeSpanView = 0; | 71 | mTimeSpanView = 0; |
72 | mCurrentAgendaView = 0 ; | 72 | mCurrentAgendaView = 0 ; |
73 | mFlagShowNextxDays = false; | 73 | mFlagShowNextxDays = false; |
74 | } | 74 | } |
75 | 75 | ||
76 | KOViewManager::~KOViewManager() | 76 | KOViewManager::~KOViewManager() |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | KOrg::BaseView *KOViewManager::currentView() | 81 | KOrg::BaseView *KOViewManager::currentView() |
82 | { | 82 | { |
83 | return mCurrentView; | 83 | return mCurrentView; |
84 | } | 84 | } |
85 | 85 | ||
86 | void KOViewManager::readSettings(KConfig *config) | 86 | void KOViewManager::readSettings(KConfig *config) |
87 | { | 87 | { |
88 | config->setGroup("General"); | 88 | config->setGroup("General"); |
89 | QString view = config->readEntry("Current View"); | 89 | QString view = config->readEntry("Current View"); |
90 | if (view == "WhatsNext") showWhatsNextView(); | 90 | if (view == "WhatsNext") showWhatsNextView(); |
91 | else if (view == "Month") showMonthView(); | 91 | else if (view == "Month") { |
92 | if ( KOPrefs::instance()->mMonthViewWeek ) | ||
93 | showMonthView(); | ||
94 | else | ||
95 | showMonthViewWeek(); | ||
96 | } | ||
92 | else if (view == "List") showListView(); | 97 | else if (view == "List") showListView(); |
93 | else if (view == "Journal") showJournalView(); | 98 | else if (view == "Journal") showJournalView(); |
94 | else if (view == "TimeSpan") showTimeSpanView(); | 99 | else if (view == "TimeSpan") showTimeSpanView(); |
95 | else if (view == "Todo") showTodoView(); | 100 | else if (view == "Todo") showTodoView(); |
96 | else { | 101 | else { |
97 | config->setGroup( "Views" ); | 102 | config->setGroup( "Views" ); |
98 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 103 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
99 | mCurrentAgendaView = dateCount; | 104 | mCurrentAgendaView = dateCount; |
100 | showAgendaView(); | 105 | showAgendaView(); |
101 | mCurrentAgendaView = dateCount; | 106 | mCurrentAgendaView = dateCount; |
102 | #ifdef DESKTOP_VERSION | 107 | #ifdef DESKTOP_VERSION |
103 | QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); | 108 | QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); |
104 | #endif | 109 | #endif |
105 | } | 110 | } |
106 | } | 111 | } |
107 | 112 | ||
108 | void KOViewManager::showDateView( int view, QDate date) | 113 | void KOViewManager::showDateView( int view, QDate date) |
109 | { | 114 | { |
110 | static int lastMode = 0; | 115 | static int lastMode = 0; |
111 | static int lastCount = 0; | 116 | static int lastCount = 0; |
112 | static bool lastNDMode = false; | 117 | static bool lastNDMode = false; |
113 | static QDate lastDate; | 118 | static QDate lastDate; |
114 | //qDebug("date %d %s", view, date.toString().latin1()); | 119 | //qDebug("date %d %s", view, date.toString().latin1()); |
115 | 120 | ||
116 | if (view != 9) | 121 | if (view != 9) |
117 | lastMode = 0; | 122 | lastMode = 0; |
118 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); | 123 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); |
119 | bool savemFlagShowNextxDays = mFlagShowNextxDays; | 124 | bool savemFlagShowNextxDays = mFlagShowNextxDays; |
120 | mFlagShowNextxDays = false; | 125 | mFlagShowNextxDays = false; |
121 | if ( view == 3 ) { | 126 | if ( view == 3 ) { |
122 | //mCurrentAgendaView = 1 ; | 127 | //mCurrentAgendaView = 1 ; |
123 | lastDate = mMainView->dateNavigator()->selectedDates().first(); | 128 | lastDate = mMainView->dateNavigator()->selectedDates().first(); |
124 | lastCount = mMainView->dateNavigator()->selectedDates().count(); | 129 | lastCount = mMainView->dateNavigator()->selectedDates().count(); |
125 | lastNDMode = savemFlagShowNextxDays; | 130 | lastNDMode = savemFlagShowNextxDays; |
126 | mMainView->showDay( date ); | 131 | mMainView->showDay( date ); |
127 | lastMode = 1; | 132 | lastMode = 1; |
128 | } else if (view == 4 ) { | 133 | } else if (view == 4 ) { |
129 | mCurrentAgendaView = 7 ; | 134 | mCurrentAgendaView = 7 ; |
130 | mMainView->dateNavigator()->selectDates( date, 7 ); | 135 | mMainView->dateNavigator()->selectDates( date, 7 ); |
131 | } else if (view == 5 ) { | 136 | } else if (view == 5 ) { |
132 | mCurrentAgendaView = 14 ; | 137 | mCurrentAgendaView = 14 ; |
133 | mMainView->dateNavigator()->selectDates( date, 14); | 138 | mMainView->dateNavigator()->selectDates( date, 14); |
134 | } else if (view == 6 ) { | 139 | } else if (view == 6 ) { |
135 | //mMainView->dateNavigator()->selectDates( date, 7 ); | 140 | //mMainView->dateNavigator()->selectDates( date, 7 ); |
136 | showMonthView(); | 141 | showMonthView(); |
137 | } else if (view == 7 ) { | 142 | } else if (view == 7 ) { |
138 | mMainView->dateNavigator()->selectDate( date ); | 143 | mMainView->dateNavigator()->selectDate( date ); |
139 | showJournalView(); | 144 | showJournalView(); |
140 | } else if (view == 8 ) { | 145 | } else if (view == 8 ) { |
141 | globalFlagBlockAgenda = 1; | 146 | globalFlagBlockAgenda = 1; |
142 | if ( mCurrentAgendaView != 3 ) | 147 | if ( mCurrentAgendaView != 3 ) |
143 | mCurrentAgendaView = -1; | 148 | mCurrentAgendaView = -1; |
144 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 149 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
145 | globalFlagBlockAgenda = 2; | 150 | globalFlagBlockAgenda = 2; |
146 | mMainView->dateNavigator()->selectDates( date , | 151 | mMainView->dateNavigator()->selectDates( date , |
147 | KOPrefs::instance()->mNextXDays ); | 152 | KOPrefs::instance()->mNextXDays ); |
148 | mFlagShowNextxDays = true; | 153 | mFlagShowNextxDays = true; |
149 | mCurrentAgendaView = 3 ; | 154 | mCurrentAgendaView = 3 ; |
150 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) | 155 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) |
151 | if ( lastMode ) { | 156 | if ( lastMode ) { |
152 | mCurrentAgendaView = lastCount ; | 157 | mCurrentAgendaView = lastCount ; |
153 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); | 158 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); |
154 | mFlagShowNextxDays = lastNDMode; | 159 | mFlagShowNextxDays = lastNDMode; |
155 | if ( mFlagShowNextxDays ) { | 160 | if ( mFlagShowNextxDays ) { |
156 | mCurrentAgendaView = 3 ; | 161 | mCurrentAgendaView = 3 ; |
157 | } | 162 | } |
158 | } else | 163 | } else |
159 | showWeekView(); | 164 | showWeekView(); |
160 | } else if (view == 10) { | 165 | } else if (view == 10) { |
161 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | 166 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); |
162 | } | 167 | } |
163 | } | 168 | } |
164 | 169 | ||
165 | 170 | ||
166 | 171 | ||
167 | void KOViewManager::writeSettings(KConfig *config) | 172 | void KOViewManager::writeSettings(KConfig *config) |
168 | { | 173 | { |
169 | config->setGroup("General"); | 174 | config->setGroup("General"); |
170 | 175 | ||
171 | QString view; | 176 | QString view; |
172 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 177 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
173 | else if (mCurrentView == mMonthView) view = "Month"; | 178 | else if (mCurrentView == mMonthView) view = "Month"; |
174 | else if (mCurrentView == mListView) view = "List"; | 179 | else if (mCurrentView == mListView) view = "List"; |
175 | else if (mCurrentView == mJournalView) view = "Journal"; | 180 | else if (mCurrentView == mJournalView) view = "Journal"; |
176 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 181 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
177 | else if (mCurrentView == mTodoView) view = "Todo"; | 182 | else if (mCurrentView == mTodoView) view = "Todo"; |
178 | else view = "Agenda"; | 183 | else view = "Agenda"; |
179 | 184 | ||
180 | config->writeEntry("Current View",view); | 185 | config->writeEntry("Current View",view); |
181 | 186 | ||
182 | if (mAgendaView) { | 187 | if (mAgendaView) { |
183 | mAgendaView->writeSettings(config); | 188 | mAgendaView->writeSettings(config); |
184 | } | 189 | } |
185 | if (mTimeSpanView) { | 190 | if (mTimeSpanView) { |
186 | mTimeSpanView->writeSettings(config); | 191 | mTimeSpanView->writeSettings(config); |
187 | } | 192 | } |
188 | if (mListView) { | 193 | if (mListView) { |
189 | mListView->writeSettings(config); | 194 | mListView->writeSettings(config); |
190 | } | 195 | } |
191 | if (mTodoView) { | 196 | if (mTodoView) { |
192 | mTodoView->saveLayout(config,"Todo View"); | 197 | mTodoView->saveLayout(config,"Todo View"); |
193 | } | 198 | } |
194 | } | 199 | } |
195 | 200 | ||
196 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 201 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
197 | { | 202 | { |
198 | 203 | ||
199 | //mFlagShowNextxDays = false; | 204 | //mFlagShowNextxDays = false; |
200 | //if(view == mCurrentView) return; | 205 | //if(view == mCurrentView) return; |
201 | if ( view == 0 ) { | 206 | if ( view == 0 ) { |
202 | view = mCurrentView; | 207 | view = mCurrentView; |
203 | if ( view == 0 ) | 208 | if ( view == 0 ) |
204 | return; | 209 | return; |
205 | } | 210 | } |
206 | bool full = fullScreen; | 211 | bool full = fullScreen; |
207 | if(view == mCurrentView && view != mWhatsNextView ) { | 212 | if(view == mCurrentView && view != mWhatsNextView ) { |
208 | if ( mCurrentAgendaView < 0 ) | 213 | if ( mCurrentAgendaView < 0 ) |
209 | return; | 214 | return; |
210 | full = mMainView->leftFrame()->isVisible(); | 215 | if ( view != mMonthView ) |
216 | full = mMainView->leftFrame()->isVisible(); | ||
211 | } else { | 217 | } else { |
212 | if ( view == mMonthView && mMonthView) | 218 | if ( view == mMonthView && mMonthView) |
213 | ;//mMonthView->skipResize = true ; | 219 | ;//mMonthView->skipResize = true ; |
214 | mCurrentView = view; | 220 | mCurrentView = view; |
215 | // bool full = fullScreen; | 221 | // bool full = fullScreen; |
216 | bool isFull = !mMainView->leftFrame()->isVisible(); | 222 | bool isFull = !mMainView->leftFrame()->isVisible(); |
217 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 223 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
218 | full = true; | 224 | full = true; |
219 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 225 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
220 | full = false; | 226 | full = false; |
221 | } | 227 | } |
222 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 228 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
223 | //raiseCurrentView( full ); | 229 | //raiseCurrentView( full ); |
224 | mMainView->processIncidenceSelection( 0 ); | 230 | mMainView->processIncidenceSelection( 0 ); |
225 | //mMainView->updateView(); | 231 | //mMainView->updateView(); |
226 | raiseCurrentView( full, true ); | 232 | raiseCurrentView( full, true ); |
227 | mMainView->adaptNavigationUnits(); | 233 | mMainView->adaptNavigationUnits(); |
228 | } | 234 | } |
229 | 235 | ||
230 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 236 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
231 | { | 237 | { |
232 | mCurrentAgendaView = 0; | 238 | mCurrentAgendaView = 0; |
233 | if ( fullScreen ) { | 239 | if ( fullScreen ) { |
234 | mMainView->leftFrame()->hide(); | 240 | mMainView->leftFrame()->hide(); |
235 | } else { | 241 | } else { |
236 | mMainView->leftFrame()->show(); | 242 | mMainView->leftFrame()->show(); |
237 | } | 243 | } |
238 | emit signalFullScreen( !fullScreen ); | 244 | emit signalFullScreen( !fullScreen ); |
239 | if ( callUpdateView ) | 245 | if ( callUpdateView ) |
240 | mMainView->updateView(); | 246 | mMainView->updateView(); |
241 | 247 | ||
242 | if ( globalFlagBlockAgenda == 5 ) { | 248 | if ( globalFlagBlockAgenda == 5 ) { |
243 | globalFlagBlockAgenda = 4; | 249 | globalFlagBlockAgenda = 4; |
244 | globalFlagBlockAgendaItemPaint = 1; | 250 | globalFlagBlockAgendaItemPaint = 1; |
245 | } | 251 | } |
246 | mMainView->viewStack()->raiseWidget(mCurrentView); | 252 | mMainView->viewStack()->raiseWidget(mCurrentView); |
247 | if ( globalFlagBlockAgenda == 4 ) { | 253 | if ( globalFlagBlockAgenda == 4 ) { |
248 | if ( mCurrentView == mAgendaView ) { | 254 | if ( mCurrentView == mAgendaView ) { |
249 | //globalFlagBlockAgenda =1 ; | 255 | //globalFlagBlockAgenda =1 ; |
250 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 256 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
251 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 257 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
252 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 258 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
253 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 259 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
254 | qApp->processEvents(); | 260 | qApp->processEvents(); |
255 | //qDebug("qApp->processEvents() "); | 261 | //qDebug("qApp->processEvents() "); |
256 | globalFlagBlockAgenda = 0; | 262 | globalFlagBlockAgenda = 0; |
257 | mAgendaView->repaintAgenda(); | 263 | mAgendaView->repaintAgenda(); |
258 | 264 | ||
259 | } | 265 | } |
260 | globalFlagBlockAgenda = 0; | 266 | globalFlagBlockAgenda = 0; |
261 | } | 267 | } |
262 | emit signalAgendaView( mCurrentView == mAgendaView ); | 268 | emit signalAgendaView( mCurrentView == mAgendaView ); |
263 | //qDebug("raiseCurrentView ende "); | 269 | //qDebug("raiseCurrentView ende "); |
264 | 270 | ||
265 | } | 271 | } |
266 | 272 | ||
267 | void KOViewManager::updateView() | 273 | void KOViewManager::updateView() |
268 | { | 274 | { |
269 | // qDebug("KOViewManager::updateView() "); | 275 | // qDebug("KOViewManager::updateView() "); |
270 | // if we are updating mTodoView, we get endless recursion | 276 | // if we are updating mTodoView, we get endless recursion |
271 | if ( mTodoView == mCurrentView ) | 277 | if ( mTodoView == mCurrentView ) |
272 | return; | 278 | return; |
273 | if ( mCurrentView ) mCurrentView->updateView(); | 279 | if ( mCurrentView ) mCurrentView->updateView(); |
274 | 280 | ||
275 | } | 281 | } |
276 | 282 | ||
277 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 283 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
278 | { | 284 | { |
279 | // kdDebug() << "KOViewManager::updateView()" << endl; | 285 | // kdDebug() << "KOViewManager::updateView()" << endl; |
280 | 286 | ||
281 | if (mCurrentView) mCurrentView->showDates(start, end); | 287 | if (mCurrentView) mCurrentView->showDates(start, end); |
282 | 288 | ||
283 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); | 289 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); |
284 | } | 290 | } |
285 | 291 | ||
286 | 292 | ||
287 | void KOViewManager::updateWNview() | 293 | void KOViewManager::updateWNview() |
288 | { | 294 | { |
289 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 295 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
290 | mWhatsNextView->updateView(); | 296 | mWhatsNextView->updateView(); |
291 | 297 | ||
292 | } | 298 | } |
293 | void KOViewManager::showWhatsNextView() | 299 | void KOViewManager::showWhatsNextView() |
294 | { | 300 | { |
295 | if (!mWhatsNextView) { | 301 | if (!mWhatsNextView) { |
296 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 302 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
297 | "KOViewManager::WhatsNextView"); | 303 | "KOViewManager::WhatsNextView"); |
298 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 304 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
299 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 305 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
300 | addView(mWhatsNextView); | 306 | addView(mWhatsNextView); |
301 | connect(this, SIGNAL( printWNV() ), | 307 | connect(this, SIGNAL( printWNV() ), |
302 | mWhatsNextView, SLOT( printMe() ) ); | 308 | mWhatsNextView, SLOT( printMe() ) ); |
303 | } | 309 | } |
304 | globalFlagBlockAgenda = 1; | 310 | globalFlagBlockAgenda = 1; |
305 | showView(mWhatsNextView, true ); | 311 | showView(mWhatsNextView, true ); |
306 | //mWhatsNextView->updateView(); | 312 | //mWhatsNextView->updateView(); |
307 | 313 | ||
308 | } | 314 | } |
309 | 315 | ||
310 | void KOViewManager::showListView() | 316 | void KOViewManager::showListView() |
311 | { | 317 | { |
312 | if (!mListView) { | 318 | if (!mListView) { |
313 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 319 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
314 | addView(mListView); | 320 | addView(mListView); |
315 | 321 | ||
316 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 322 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
317 | mMainView, SLOT(showIncidence(Incidence *))); | 323 | mMainView, SLOT(showIncidence(Incidence *))); |
318 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 324 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
319 | mMainView, SLOT(editIncidence(Incidence *))); | 325 | mMainView, SLOT(editIncidence(Incidence *))); |
320 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 326 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
321 | mMainView, SLOT(deleteIncidence(Incidence *))); | 327 | mMainView, SLOT(deleteIncidence(Incidence *))); |
322 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 328 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
323 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 329 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
324 | connect( mListView, SIGNAL( signalNewEvent() ), | 330 | connect( mListView, SIGNAL( signalNewEvent() ), |
325 | mMainView, SLOT( newEvent() ) ); | 331 | mMainView, SLOT( newEvent() ) ); |
326 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 332 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
327 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 333 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
328 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 334 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
329 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 335 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
330 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 336 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
331 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 337 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
332 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 338 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
333 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 339 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
334 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 340 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
335 | } | 341 | } |
336 | // bool temp = mFlagShowNextxDays; | 342 | // bool temp = mFlagShowNextxDays; |
337 | //globalFlagBlockPainting = true; | 343 | //globalFlagBlockPainting = true; |
338 | globalFlagBlockAgenda = 1; | 344 | globalFlagBlockAgenda = 1; |
339 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 345 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
340 | mMainView->setBlockShowDates( true ); | 346 | mMainView->setBlockShowDates( true ); |
341 | mMainView->dateNavigator()->selectMonth(); | 347 | mMainView->dateNavigator()->selectMonth(); |
342 | mMainView->setBlockShowDates( false ); | 348 | mMainView->setBlockShowDates( false ); |
343 | } | 349 | } |
344 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 350 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
345 | //mFlagShowNextxDays = temp; | 351 | //mFlagShowNextxDays = temp; |
346 | } | 352 | } |
347 | 353 | ||
348 | void KOViewManager::showAgendaView( bool fullScreen ) | 354 | void KOViewManager::showAgendaView( bool fullScreen ) |
349 | { | 355 | { |
350 | 356 | ||
351 | mMainView->dialogManager()->hideSearchDialog(); | 357 | mMainView->dialogManager()->hideSearchDialog(); |
352 | // qDebug("KOViewManager::showAgendaView "); | 358 | // qDebug("KOViewManager::showAgendaView "); |
353 | bool full; | 359 | bool full; |
354 | full = fullScreen; | 360 | full = fullScreen; |
355 | if (!mAgendaView) { | 361 | if (!mAgendaView) { |
356 | full = false; | 362 | full = false; |
357 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 363 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
358 | addView(mAgendaView); | 364 | addView(mAgendaView); |
359 | #ifndef DESKTOP_VERSION | 365 | #ifndef DESKTOP_VERSION |
360 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 366 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
361 | #endif | 367 | #endif |
362 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 368 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
363 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 369 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
364 | 370 | ||
365 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 371 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
366 | 372 | ||
367 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); | 373 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); |
368 | 374 | ||
369 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), | 375 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), |
370 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); | 376 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); |
371 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 377 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
372 | mMainView, SLOT(newEvent(QDateTime))); | 378 | mMainView, SLOT(newEvent(QDateTime))); |
373 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 379 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
374 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 380 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
375 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 381 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
376 | mMainView, SLOT(newEvent(QDate))); | 382 | mMainView, SLOT(newEvent(QDate))); |
377 | 383 | ||
378 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 384 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
379 | mMainView, SLOT(editIncidence(Incidence *))); | 385 | mMainView, SLOT(editIncidence(Incidence *))); |
380 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 386 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
381 | mMainView, SLOT(showIncidence(Incidence *))); | 387 | mMainView, SLOT(showIncidence(Incidence *))); |
382 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 388 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
383 | mMainView, SLOT(deleteIncidence(Incidence *))); | 389 | mMainView, SLOT(deleteIncidence(Incidence *))); |
384 | 390 | ||
385 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 391 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
386 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 392 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
387 | 393 | ||
388 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 394 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
389 | mMainView, SLOT( toggleExpand() ) ); | 395 | mMainView, SLOT( toggleExpand() ) ); |
390 | 396 | ||
391 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 397 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
392 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 398 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
393 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 399 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
394 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 400 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
395 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 401 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
396 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 402 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
397 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 403 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
398 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 404 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
399 | SLOT( updateTodo( Todo *, int ) ) ); | 405 | SLOT( updateTodo( Todo *, int ) ) ); |
400 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 406 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
401 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 407 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
402 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 408 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
403 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 409 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
404 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 410 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
405 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 411 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
406 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), | 412 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), |
407 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 413 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
408 | mAgendaView->readSettings(); | 414 | mAgendaView->readSettings(); |
409 | mAgendaView->updateConfig(); | 415 | mAgendaView->updateConfig(); |
410 | } | 416 | } |
411 | 417 | ||
412 | showView( mAgendaView, full); | 418 | showView( mAgendaView, full); |
413 | 419 | ||
414 | } | 420 | } |
415 | 421 | ||
416 | void KOViewManager::showDayView() | 422 | void KOViewManager::showDayView() |
417 | { | 423 | { |
418 | mFlagShowNextxDays = false; | 424 | mFlagShowNextxDays = false; |
419 | globalFlagBlockLabel = 1; | 425 | globalFlagBlockLabel = 1; |
420 | globalFlagBlockAgenda = 1; | 426 | globalFlagBlockAgenda = 1; |
421 | if ( mCurrentAgendaView != 1 ) | 427 | if ( mCurrentAgendaView != 1 ) |
422 | mCurrentAgendaView = -1; | 428 | mCurrentAgendaView = -1; |
423 | showAgendaView(); | 429 | showAgendaView(); |
424 | qApp->processEvents(); | 430 | qApp->processEvents(); |
425 | globalFlagBlockAgenda = 2; | 431 | globalFlagBlockAgenda = 2; |
426 | globalFlagBlockLabel = 0; | 432 | globalFlagBlockLabel = 0; |
427 | mMainView->dateNavigator()->selectDates( 1 ); | 433 | mMainView->dateNavigator()->selectDates( 1 ); |
428 | mCurrentAgendaView = 1 ; | 434 | mCurrentAgendaView = 1 ; |
429 | 435 | ||
430 | } | 436 | } |
431 | 437 | ||
432 | void KOViewManager::showWorkWeekView() | 438 | void KOViewManager::showWorkWeekView() |
433 | { | 439 | { |
434 | mFlagShowNextxDays = false; | 440 | mFlagShowNextxDays = false; |
435 | globalFlagBlockAgenda = 1; | 441 | globalFlagBlockAgenda = 1; |
436 | globalFlagBlockLabel = 1; | 442 | globalFlagBlockLabel = 1; |
437 | if ( mCurrentAgendaView != 5 ) | 443 | if ( mCurrentAgendaView != 5 ) |
438 | mCurrentAgendaView = -1; | 444 | mCurrentAgendaView = -1; |
439 | showAgendaView(); | 445 | showAgendaView(); |
440 | qApp->processEvents(); | 446 | qApp->processEvents(); |
441 | globalFlagBlockAgenda = 2; | 447 | globalFlagBlockAgenda = 2; |
442 | globalFlagBlockLabel = 0; | 448 | globalFlagBlockLabel = 0; |
443 | mMainView->dateNavigator()->selectWorkWeek(); | 449 | mMainView->dateNavigator()->selectWorkWeek(); |
444 | mCurrentAgendaView = 5 ; | 450 | mCurrentAgendaView = 5 ; |
445 | 451 | ||
446 | } | 452 | } |
447 | 453 | ||
448 | void KOViewManager::showWeekView() | 454 | void KOViewManager::showWeekView() |
449 | { | 455 | { |
450 | /* | 456 | /* |
451 | globalFlagBlockAgenda = 2; | 457 | globalFlagBlockAgenda = 2; |
452 | qDebug("4globalFlagBlockAgenda = 2; "); | 458 | qDebug("4globalFlagBlockAgenda = 2; "); |
453 | //globalFlagBlockPainting = true; | 459 | //globalFlagBlockPainting = true; |
454 | mMainView->dateNavigator()->selectWeek(); | 460 | mMainView->dateNavigator()->selectWeek(); |
455 | showAgendaView(); | 461 | showAgendaView(); |
456 | */ | 462 | */ |
457 | 463 | ||
458 | 464 | ||
459 | mFlagShowNextxDays = false; | 465 | mFlagShowNextxDays = false; |
460 | globalFlagBlockAgenda = 1; | 466 | globalFlagBlockAgenda = 1; |
461 | globalFlagBlockLabel = 1; | 467 | globalFlagBlockLabel = 1; |
462 | if ( mCurrentAgendaView != 7 ) | 468 | if ( mCurrentAgendaView != 7 ) |
463 | mCurrentAgendaView = -1; | 469 | mCurrentAgendaView = -1; |
464 | showAgendaView(); | 470 | showAgendaView(); |
465 | qApp->processEvents(); | 471 | qApp->processEvents(); |
466 | globalFlagBlockAgenda = 2; | 472 | globalFlagBlockAgenda = 2; |
467 | globalFlagBlockLabel = 0; | 473 | globalFlagBlockLabel = 0; |
468 | mMainView->dateNavigator()->selectWeek(); | 474 | mMainView->dateNavigator()->selectWeek(); |
469 | mCurrentAgendaView = 7 ; | 475 | mCurrentAgendaView = 7 ; |
470 | } | 476 | } |
471 | 477 | ||
472 | void KOViewManager::showNextXView() | 478 | void KOViewManager::showNextXView() |
473 | { | 479 | { |
474 | 480 | ||
475 | globalFlagBlockAgenda = 1; | 481 | globalFlagBlockAgenda = 1; |
476 | if ( mCurrentAgendaView != 3 ) | 482 | if ( mCurrentAgendaView != 3 ) |
477 | mCurrentAgendaView = -1; | 483 | mCurrentAgendaView = -1; |
478 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 484 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
479 | globalFlagBlockAgenda = 2; | 485 | globalFlagBlockAgenda = 2; |
480 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 486 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
481 | KOPrefs::instance()->mNextXDays ); | 487 | KOPrefs::instance()->mNextXDays ); |
482 | mFlagShowNextxDays = true; | 488 | mFlagShowNextxDays = true; |
483 | mCurrentAgendaView = 3 ; | 489 | mCurrentAgendaView = 3 ; |
484 | } | 490 | } |
485 | bool KOViewManager::showsNextDays() | 491 | bool KOViewManager::showsNextDays() |
486 | { | 492 | { |
487 | return mFlagShowNextxDays; | 493 | return mFlagShowNextxDays; |
488 | } | 494 | } |
489 | void KOViewManager::showMonthView() | 495 | void KOViewManager::createMonthView() |
490 | { | 496 | { |
491 | if (!mMonthView) { | 497 | if (!mMonthView) { |
492 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 498 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
493 | 499 | ||
494 | addView(mMonthView); | 500 | addView(mMonthView); |
495 | // mMonthView->show(); | 501 | // mMonthView->show(); |
496 | // SIGNALS/SLOTS FOR MONTH VIEW | 502 | // SIGNALS/SLOTS FOR MONTH VIEW |
497 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 503 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
498 | mMainView, SLOT(newEvent(QDateTime))); | 504 | mMainView, SLOT(newEvent(QDateTime))); |
499 | 505 | ||
500 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 506 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
501 | mMainView, SLOT(showIncidence(Incidence *))); | 507 | mMainView, SLOT(showIncidence(Incidence *))); |
502 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 508 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
503 | mMainView, SLOT(editIncidence(Incidence *))); | 509 | mMainView, SLOT(editIncidence(Incidence *))); |
504 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 510 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
505 | mMainView, SLOT(deleteIncidence(Incidence *))); | 511 | mMainView, SLOT(deleteIncidence(Incidence *))); |
506 | 512 | ||
507 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 513 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
508 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 514 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
509 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 515 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
510 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 516 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
511 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 517 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
512 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 518 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
513 | 519 | ||
514 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 520 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
515 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 521 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
516 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 522 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
517 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 523 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
518 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 524 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
519 | mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); | 525 | mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); |
526 | connect( mMonthView, SIGNAL( selectMonth() ), | ||
527 | mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); | ||
520 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 528 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
521 | mMainView, SLOT ( showDay( QDate ) ) ); | 529 | mMainView, SLOT ( showDay( QDate ) ) ); |
522 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 530 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
523 | connect( mMonthView, SIGNAL(nextMonth() ), | 531 | connect( mMonthView, SIGNAL(nextMonth() ), |
524 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 532 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
525 | connect( mMonthView, SIGNAL(prevMonth() ), | 533 | connect( mMonthView, SIGNAL(prevMonth() ), |
526 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 534 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
527 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), | 535 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), |
528 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); | 536 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); |
529 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), | 537 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), |
530 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); | 538 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); |
531 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), | 539 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), |
532 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); | 540 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); |
533 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), | 541 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), |
534 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); | 542 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); |
543 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), | ||
544 | mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); | ||
545 | connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), | ||
546 | mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); | ||
535 | 547 | ||
536 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 548 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
537 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); | 549 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); |
538 | 550 | ||
539 | 551 | ||
540 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), | 552 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), |
541 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); | 553 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); |
542 | 554 | ||
543 | } | 555 | } |
556 | } | ||
557 | void KOViewManager::showMonthViewWeek() | ||
558 | { | ||
559 | createMonthView(); | ||
560 | bool full = true; | ||
561 | if ( mCurrentView == mMonthView) | ||
562 | full = mMainView->leftFrame()->isVisible(); | ||
563 | if ( !KOPrefs::instance()->mMonthViewWeek ) { | ||
564 | mMonthView->switchView(); | ||
565 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | ||
566 | full = false; | ||
567 | else | ||
568 | full = true; | ||
569 | } | ||
570 | mMainView->dateNavigator()->selectWeek(); | ||
571 | showView(mMonthView, full ); | ||
572 | } | ||
544 | 573 | ||
574 | void KOViewManager::showMonthView() | ||
575 | { | ||
576 | |||
577 | createMonthView(); | ||
545 | globalFlagBlockAgenda = 1; | 578 | globalFlagBlockAgenda = 1; |
546 | //mFlagShowNextxDays = false; | 579 | //mFlagShowNextxDays = false; |
547 | // if(mMonthView == mCurrentView) return; | 580 | bool full = true; |
548 | if ( KOPrefs::instance()->mMonthViewWeek ) | 581 | if ( mCurrentView == mMonthView) |
549 | mMainView->dateNavigator()->selectWeek(); | 582 | full = mMainView->leftFrame()->isVisible(); |
550 | else | 583 | // if(mMonthView == mCurrentView) return; |
551 | mMainView->dateNavigator()->selectMonth(); | 584 | if ( KOPrefs::instance()->mMonthViewWeek ) { |
585 | mMonthView->switchView(); | ||
586 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | ||
587 | full = false; | ||
588 | else | ||
589 | full = true; | ||
590 | } | ||
591 | mMainView->dateNavigator()->selectMonth(); | ||
552 | 592 | ||
553 | showView(mMonthView, true ); | 593 | showView(mMonthView, full ); |
554 | 594 | ||
555 | } | 595 | } |
556 | 596 | ||
557 | void KOViewManager::showTodoView() | 597 | void KOViewManager::showTodoView() |
558 | { | 598 | { |
559 | //mFlagShowNextxDays = false; | 599 | //mFlagShowNextxDays = false; |
560 | if ( !mTodoView ) { | 600 | if ( !mTodoView ) { |
561 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 601 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
562 | "KOViewManager::TodoView" ); | 602 | "KOViewManager::TodoView" ); |
563 | 603 | ||
564 | addView( mTodoView ); | 604 | addView( mTodoView ); |
565 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 605 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
566 | 606 | ||
567 | // SIGNALS/SLOTS FOR TODO VIEW | 607 | // SIGNALS/SLOTS FOR TODO VIEW |
568 | connect( mTodoView, SIGNAL( newTodoSignal() ), | 608 | connect( mTodoView, SIGNAL( newTodoSignal() ), |
569 | mMainView, SLOT( newTodo() ) ); | 609 | mMainView, SLOT( newTodo() ) ); |
570 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), | 610 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), |
571 | mMainView, SLOT( newSubTodo( Todo *) ) ); | 611 | mMainView, SLOT( newSubTodo( Todo *) ) ); |
572 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), | 612 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), |
573 | mMainView, SLOT( showTodo( Todo * ) ) ); | 613 | mMainView, SLOT( showTodo( Todo * ) ) ); |
574 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), | 614 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |
575 | mMainView, SLOT( editTodo( Todo * ) ) ); | 615 | mMainView, SLOT( editTodo( Todo * ) ) ); |
576 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 616 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
577 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 617 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
578 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), | 618 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), |
579 | mMainView, SLOT( purgeCompleted() ) ); | 619 | mMainView, SLOT( purgeCompleted() ) ); |
580 | 620 | ||
581 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), | 621 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), |
582 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 622 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
583 | 623 | ||
584 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, | 624 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, |
585 | SLOT( updateConfig() ) ); | 625 | SLOT( updateConfig() ) ); |
586 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, | 626 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, |
587 | SLOT( updateTodo( Todo *, int ) ) ); | 627 | SLOT( updateTodo( Todo *, int ) ) ); |
588 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 628 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
589 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); | 629 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); |
590 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), | 630 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), |
591 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 631 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
592 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), | 632 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), |
593 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 633 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
594 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), | 634 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), |
595 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); | 635 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); |
596 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 636 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
597 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); | 637 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); |
598 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), | 638 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), |
599 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 639 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
600 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), | 640 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), |
601 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 641 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
602 | KConfig *config = KOGlobals::config(); | 642 | KConfig *config = KOGlobals::config(); |
603 | mTodoView->restoreLayout(config,"Todo View"); | 643 | mTodoView->restoreLayout(config,"Todo View"); |
604 | mTodoView->setNavigator( mMainView->dateNavigator() ); | 644 | mTodoView->setNavigator( mMainView->dateNavigator() ); |
605 | } | 645 | } |
606 | 646 | ||
607 | globalFlagBlockAgenda = 1; | 647 | globalFlagBlockAgenda = 1; |
608 | showView( mTodoView, true ); | 648 | showView( mTodoView, true ); |
609 | 649 | ||
610 | } | 650 | } |
611 | 651 | ||
612 | void KOViewManager::showJournalView() | 652 | void KOViewManager::showJournalView() |
613 | { | 653 | { |
614 | //mFlagShowNextxDays = false; | 654 | //mFlagShowNextxDays = false; |
615 | if (!mJournalView) { | 655 | if (!mJournalView) { |
616 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 656 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
617 | "KOViewManager::JournalView"); | 657 | "KOViewManager::JournalView"); |
618 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 658 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
619 | SLOT( updateConfig() ) ); | 659 | SLOT( updateConfig() ) ); |
620 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 660 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
621 | addView(mJournalView); | 661 | addView(mJournalView); |
622 | } | 662 | } |
623 | 663 | ||
624 | showView(mJournalView); | 664 | showView(mJournalView); |
625 | mMainView->dateNavigator()->selectDates( 1 ); | 665 | mMainView->dateNavigator()->selectDates( 1 ); |
626 | } | 666 | } |
627 | 667 | ||
628 | void KOViewManager::showTimeSpanView() | 668 | void KOViewManager::showTimeSpanView() |
629 | { | 669 | { |
630 | //mFlagShowNextxDays = false; | 670 | //mFlagShowNextxDays = false; |
631 | if (!mTimeSpanView) { | 671 | if (!mTimeSpanView) { |
632 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 672 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
633 | "KOViewManager::TimeSpanView"); | 673 | "KOViewManager::TimeSpanView"); |
634 | addView(mTimeSpanView); | 674 | addView(mTimeSpanView); |
635 | 675 | ||
636 | mTimeSpanView->readSettings(); | 676 | mTimeSpanView->readSettings(); |
637 | } | 677 | } |
638 | 678 | ||
639 | showView(mTimeSpanView); | 679 | showView(mTimeSpanView); |
640 | } | 680 | } |
641 | 681 | ||
642 | Incidence *KOViewManager::currentSelection() | 682 | Incidence *KOViewManager::currentSelection() |
643 | { | 683 | { |
644 | if (!mCurrentView) return 0; | 684 | if (!mCurrentView) return 0; |
645 | if ( mCurrentView == mListView ) { | 685 | if ( mCurrentView == mListView ) { |
646 | if ( mListView->currentItem() ) | 686 | if ( mListView->currentItem() ) |
647 | return mListView->currentItem(); | 687 | return mListView->currentItem(); |
648 | } | 688 | } |
649 | return mCurrentView->selectedIncidences().first(); | 689 | return mCurrentView->selectedIncidences().first(); |
650 | } | 690 | } |
651 | 691 | ||
652 | QDate KOViewManager::currentSelectionDate() | 692 | QDate KOViewManager::currentSelectionDate() |
653 | { | 693 | { |
654 | QDate qd; | 694 | QDate qd; |
655 | if (mCurrentView) { | 695 | if (mCurrentView) { |
656 | DateList qvl = mCurrentView->selectedDates(); | 696 | DateList qvl = mCurrentView->selectedDates(); |
657 | if (!qvl.isEmpty()) qd = qvl.first(); | 697 | if (!qvl.isEmpty()) qd = qvl.first(); |
658 | } | 698 | } |
659 | return qd; | 699 | return qd; |
660 | } | 700 | } |
661 | 701 | ||
662 | void KOViewManager::addView(KOrg::BaseView *view) | 702 | void KOViewManager::addView(KOrg::BaseView *view) |
663 | { | 703 | { |
664 | #if QT_VERSION >= 0x030000 | 704 | #if QT_VERSION >= 0x030000 |
665 | mMainView->viewStack()->addWidget( view ); | 705 | mMainView->viewStack()->addWidget( view ); |
666 | #else | 706 | #else |
667 | mMainView->viewStack()->addWidget( view, 1 ); | 707 | mMainView->viewStack()->addWidget( view, 1 ); |
668 | #endif | 708 | #endif |
669 | } | 709 | } |
670 | 710 | ||
671 | void KOViewManager::setDocumentId( const QString &id ) | 711 | void KOViewManager::setDocumentId( const QString &id ) |
672 | { | 712 | { |
673 | if (mTodoView) mTodoView->setDocumentId( id ); | 713 | if (mTodoView) mTodoView->setDocumentId( id ); |
674 | } | 714 | } |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 66ab138..8f0bf82 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -1,118 +1,120 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 | 3 | Copyright (c) 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef KOVIEWMANAGER_H | 24 | #ifndef KOVIEWMANAGER_H |
25 | #define KOVIEWMANAGER_H | 25 | #define KOVIEWMANAGER_H |
26 | 26 | ||
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | 28 | ||
29 | #include <korganizer/baseview.h> | 29 | #include <korganizer/baseview.h> |
30 | 30 | ||
31 | class CalendarView; | 31 | class CalendarView; |
32 | 32 | ||
33 | class KOListView; | 33 | class KOListView; |
34 | class KOAgendaView; | 34 | class KOAgendaView; |
35 | class KOMonthView; | 35 | class KOMonthView; |
36 | class KOTimeSpanView; | 36 | class KOTimeSpanView; |
37 | class KOTodoView; | 37 | class KOTodoView; |
38 | class KOWhatsNextView; | 38 | class KOWhatsNextView; |
39 | class KOJournalView; | 39 | class KOJournalView; |
40 | 40 | ||
41 | using namespace KCal; | 41 | using namespace KCal; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | This class manages the views of the calendar. It owns the objects and handles | 44 | This class manages the views of the calendar. It owns the objects and handles |
45 | creation and selection. | 45 | creation and selection. |
46 | */ | 46 | */ |
47 | class KOViewManager : public QObject | 47 | class KOViewManager : public QObject |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | KOViewManager( CalendarView * ); | 51 | KOViewManager( CalendarView * ); |
52 | virtual ~KOViewManager(); | 52 | virtual ~KOViewManager(); |
53 | 53 | ||
54 | /** changes the view to be the currently selected view */ | 54 | /** changes the view to be the currently selected view */ |
55 | void showView(KOrg::BaseView *, bool fullScreen = false ); | 55 | void showView(KOrg::BaseView *, bool fullScreen = false ); |
56 | void updateWNview(); | 56 | void updateWNview(); |
57 | void readSettings(KConfig *config); | 57 | void readSettings(KConfig *config); |
58 | void writeSettings(KConfig *config); | 58 | void writeSettings(KConfig *config); |
59 | bool showsNextDays(); | 59 | bool showsNextDays(); |
60 | /** Read which view was shown last from config file */ | 60 | /** Read which view was shown last from config file */ |
61 | void readCurrentView(KConfig *); | 61 | void readCurrentView(KConfig *); |
62 | /** Write which view is currently shown to config file */ | 62 | /** Write which view is currently shown to config file */ |
63 | void writeCurrentView(KConfig *); | 63 | void writeCurrentView(KConfig *); |
64 | 64 | ||
65 | KOrg::BaseView *currentView(); | 65 | KOrg::BaseView *currentView(); |
66 | 66 | ||
67 | void setDocumentId( const QString & ); | 67 | void setDocumentId( const QString & ); |
68 | 68 | ||
69 | void updateView( const QDate &start, const QDate &end ); | 69 | void updateView( const QDate &start, const QDate &end ); |
70 | 70 | ||
71 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); | 71 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); |
72 | 72 | ||
73 | void addView(KOrg::BaseView *); | 73 | void addView(KOrg::BaseView *); |
74 | 74 | ||
75 | Incidence *currentSelection(); | 75 | Incidence *currentSelection(); |
76 | QDate currentSelectionDate(); | 76 | QDate currentSelectionDate(); |
77 | 77 | ||
78 | KOAgendaView *agendaView() const { return mAgendaView; } | 78 | KOAgendaView *agendaView() const { return mAgendaView; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void printWNV(); | 81 | void printWNV(); |
82 | void signalFullScreen( bool ); | 82 | void signalFullScreen( bool ); |
83 | void signalAgendaView( bool ); | 83 | void signalAgendaView( bool ); |
84 | public slots: | 84 | public slots: |
85 | void showDateView( int, QDate ); | 85 | void showDateView( int, QDate ); |
86 | void updateView(); | 86 | void updateView(); |
87 | void showWhatsNextView(); | 87 | void showWhatsNextView(); |
88 | void showListView(); | 88 | void showListView(); |
89 | void showAgendaView( bool fullScreen = false ); | 89 | void showAgendaView( bool fullScreen = false ); |
90 | void showDayView(); | 90 | void showDayView(); |
91 | void showWorkWeekView(); | 91 | void showWorkWeekView(); |
92 | void showWeekView(); | 92 | void showWeekView(); |
93 | void showNextXView(); | 93 | void showNextXView(); |
94 | void showMonthView(); | 94 | void showMonthView(); |
95 | void showMonthViewWeek(); | ||
95 | void showTodoView(); | 96 | void showTodoView(); |
96 | void showJournalView(); | 97 | void showJournalView(); |
97 | void showTimeSpanView(); | 98 | void showTimeSpanView(); |
98 | 99 | ||
99 | private: | 100 | private: |
101 | void createMonthView(); | ||
100 | CalendarView *mMainView; | 102 | CalendarView *mMainView; |
101 | 103 | ||
102 | int mCurrentAgendaView; | 104 | int mCurrentAgendaView; |
103 | KOAgendaView *mAgendaView; | 105 | KOAgendaView *mAgendaView; |
104 | KOListView *mListView; | 106 | KOListView *mListView; |
105 | KOMonthView *mMonthView; | 107 | KOMonthView *mMonthView; |
106 | KOTodoView *mTodoView; | 108 | KOTodoView *mTodoView; |
107 | KOWhatsNextView *mWhatsNextView; | 109 | KOWhatsNextView *mWhatsNextView; |
108 | KOJournalView *mJournalView; | 110 | KOJournalView *mJournalView; |
109 | KOTimeSpanView *mTimeSpanView; | 111 | KOTimeSpanView *mTimeSpanView; |
110 | 112 | ||
111 | KOrg::BaseView *mCurrentView; // currently active event view | 113 | KOrg::BaseView *mCurrentView; // currently active event view |
112 | 114 | ||
113 | int mAgendaViewMode; | 115 | int mAgendaViewMode; |
114 | bool mFlagShowNextxDays; | 116 | bool mFlagShowNextxDays; |
115 | 117 | ||
116 | }; | 118 | }; |
117 | 119 | ||
118 | #endif | 120 | #endif |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ab0e4d6..16031b8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -460,850 +460,861 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
460 | } | 460 | } |
461 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
462 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
463 | } | 463 | } |
464 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
465 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
466 | } | 466 | } |
467 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
468 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
471 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
472 | } | 472 | } |
473 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
474 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "-showNextXView" ) { | 490 | else if ( msg == "-showNextXView" ) { |
491 | mView->viewManager()->showNextXView(); | 491 | mView->viewManager()->showNextXView(); |
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | showMaximized(); | 497 | showMaximized(); |
498 | raise(); | 498 | raise(); |
499 | } | 499 | } |
500 | 500 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
502 | { | 502 | { |
503 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
504 | 504 | ||
505 | } | 505 | } |
506 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
507 | { | 507 | { |
508 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
509 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
510 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
512 | 512 | ||
513 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
514 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
515 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
516 | selectFilterMenu = new QPopupMenu( this ); | 516 | selectFilterMenu = new QPopupMenu( this ); |
517 | selectFilterMenu->setCheckable( true ); | 517 | selectFilterMenu->setCheckable( true ); |
518 | syncMenu = new QPopupMenu( this ); | 518 | syncMenu = new QPopupMenu( this ); |
519 | configureAgendaMenu = new QPopupMenu( this ); | 519 | configureAgendaMenu = new QPopupMenu( this ); |
520 | configureToolBarMenu = new QPopupMenu( this ); | 520 | configureToolBarMenu = new QPopupMenu( this ); |
521 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 521 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
522 | if ( KOPrefs::instance()->mShowFullMenu ) { | 522 | if ( KOPrefs::instance()->mShowFullMenu ) { |
523 | QMenuBar *menuBar1; | 523 | QMenuBar *menuBar1; |
524 | menuBar1 = menuBar(); | 524 | menuBar1 = menuBar(); |
525 | menuBar1->insertItem( i18n("File"), importMenu ); | 525 | menuBar1->insertItem( i18n("File"), importMenu ); |
526 | menuBar1->insertItem( i18n("View"), viewMenu ); | 526 | menuBar1->insertItem( i18n("View"), viewMenu ); |
527 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 527 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
528 | #ifdef DESKTOP_VERSION | 528 | #ifdef DESKTOP_VERSION |
529 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 529 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
530 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 530 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
531 | #else | 531 | #else |
532 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 532 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
533 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 533 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
534 | #endif | 534 | #endif |
535 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 535 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
536 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 536 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
537 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 537 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
538 | } else { | 538 | } else { |
539 | QPEMenuBar *menuBar1; | 539 | QPEMenuBar *menuBar1; |
540 | menuBar1 = new QPEMenuBar( iconToolBar ); | 540 | menuBar1 = new QPEMenuBar( iconToolBar ); |
541 | QPopupMenu *menuBar = new QPopupMenu( this ); | 541 | QPopupMenu *menuBar = new QPopupMenu( this ); |
542 | menuBar1->insertItem( i18n("ME"), menuBar); | 542 | menuBar1->insertItem( i18n("ME"), menuBar); |
543 | menuBar->insertItem( i18n("File"), importMenu ); | 543 | menuBar->insertItem( i18n("File"), importMenu ); |
544 | menuBar->insertItem( i18n("View"), viewMenu ); | 544 | menuBar->insertItem( i18n("View"), viewMenu ); |
545 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 545 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
546 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 546 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
547 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 547 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
548 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 548 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
549 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 549 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
550 | menuBar->insertItem( i18n("Help"), helpMenu ); | 550 | menuBar->insertItem( i18n("Help"), helpMenu ); |
551 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 551 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
552 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 552 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
553 | } | 553 | } |
554 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 554 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
555 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 555 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
556 | QIconSet icon; | 556 | QIconSet icon; |
557 | int pixWid = 22, pixHei = 22; | 557 | int pixWid = 22, pixHei = 22; |
558 | QString pathString = ""; | 558 | QString pathString = ""; |
559 | if ( !p->mToolBarMiniIcons ) { | 559 | if ( !p->mToolBarMiniIcons ) { |
560 | if ( QApplication::desktop()->width() < 480 ) { | 560 | if ( QApplication::desktop()->width() < 480 ) { |
561 | pathString += "icons16/"; | 561 | pathString += "icons16/"; |
562 | pixWid = 18; pixHei = 16; | 562 | pixWid = 18; pixHei = 16; |
563 | } | 563 | } |
564 | } else { | 564 | } else { |
565 | pathString += "iconsmini/"; | 565 | pathString += "iconsmini/"; |
566 | pixWid = 18; pixHei = 16; | 566 | pixWid = 18; pixHei = 16; |
567 | } | 567 | } |
568 | mWeekBgColor = iconToolBar->backgroundColor(); | 568 | mWeekBgColor = iconToolBar->backgroundColor(); |
569 | mWeekPixmap.resize( pixWid , pixHei ); | 569 | mWeekPixmap.resize( pixWid , pixHei ); |
570 | mWeekPixmap.fill( mWeekBgColor ); | 570 | mWeekPixmap.fill( mWeekBgColor ); |
571 | icon = mWeekPixmap; | 571 | icon = mWeekPixmap; |
572 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 572 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
573 | mWeekAction->addTo( iconToolBar ); | 573 | mWeekAction->addTo( iconToolBar ); |
574 | mWeekFont = font(); | 574 | mWeekFont = font(); |
575 | 575 | ||
576 | int fontPoint = mWeekFont.pointSize(); | 576 | int fontPoint = mWeekFont.pointSize(); |
577 | QFontMetrics f( mWeekFont ); | 577 | QFontMetrics f( mWeekFont ); |
578 | int fontWid = f.width( "30" ); | 578 | int fontWid = f.width( "30" ); |
579 | while ( fontWid > pixWid ) { | 579 | while ( fontWid > pixWid ) { |
580 | --fontPoint; | 580 | --fontPoint; |
581 | mWeekFont.setPointSize( fontPoint ); | 581 | mWeekFont.setPointSize( fontPoint ); |
582 | QFontMetrics f( mWeekFont ); | 582 | QFontMetrics f( mWeekFont ); |
583 | fontWid = f.width( "30" ); | 583 | fontWid = f.width( "30" ); |
584 | qDebug("dec-- "); | 584 | qDebug("dec-- "); |
585 | } | 585 | } |
586 | 586 | ||
587 | connect( mWeekAction, SIGNAL( activated() ), | 587 | connect( mWeekAction, SIGNAL( activated() ), |
588 | this, SLOT( weekAction() ) ); | 588 | this, SLOT( weekAction() ) ); |
589 | 589 | ||
590 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 590 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
591 | 591 | ||
592 | //#endif | 592 | //#endif |
593 | // ****************** | 593 | // ****************** |
594 | QAction *action; | 594 | QAction *action; |
595 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 595 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
596 | configureToolBarMenu->setCheckable( true ); | 596 | configureToolBarMenu->setCheckable( true ); |
597 | 597 | ||
598 | 598 | ||
599 | configureAgendaMenu->setCheckable( true ); | 599 | configureAgendaMenu->setCheckable( true ); |
600 | int iii ; | 600 | int iii ; |
601 | for ( iii = 1;iii<= 10 ;++iii ){ | 601 | for ( iii = 1;iii<= 10 ;++iii ){ |
602 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 602 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
603 | } | 603 | } |
604 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 604 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
605 | 605 | ||
606 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 606 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
607 | this, SLOT( showConfigureAgenda( ) ) ); | 607 | this, SLOT( showConfigureAgenda( ) ) ); |
608 | 608 | ||
609 | icon = loadPixmap( pathString + "configure" ); | 609 | icon = loadPixmap( pathString + "configure" ); |
610 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 610 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
611 | action->addTo( actionMenu ); | 611 | action->addTo( actionMenu ); |
612 | connect( action, SIGNAL( activated() ), | 612 | connect( action, SIGNAL( activated() ), |
613 | mView, SLOT( edit_options() ) ); | 613 | mView, SLOT( edit_options() ) ); |
614 | actionMenu->insertSeparator(); | 614 | actionMenu->insertSeparator(); |
615 | 615 | ||
616 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 616 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
617 | action->addTo( actionMenu ); | 617 | action->addTo( actionMenu ); |
618 | connect( action, SIGNAL( activated() ), | 618 | connect( action, SIGNAL( activated() ), |
619 | mView, SLOT( undo_delete() ) ); | 619 | mView, SLOT( undo_delete() ) ); |
620 | actionMenu->insertSeparator(); | 620 | actionMenu->insertSeparator(); |
621 | 621 | ||
622 | icon = loadPixmap( pathString + "newevent" ); | 622 | icon = loadPixmap( pathString + "newevent" ); |
623 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 623 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
624 | configureToolBarMenu->insertSeparator(); | 624 | configureToolBarMenu->insertSeparator(); |
625 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 625 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
626 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 626 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
627 | ne_action->addTo( actionMenu ); | 627 | ne_action->addTo( actionMenu ); |
628 | connect( ne_action, SIGNAL( activated() ), | 628 | connect( ne_action, SIGNAL( activated() ), |
629 | mView, SLOT( newEvent() ) ); | 629 | mView, SLOT( newEvent() ) ); |
630 | icon = loadPixmap( pathString + "newtodo" ); | 630 | icon = loadPixmap( pathString + "newtodo" ); |
631 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 631 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
632 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 632 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
633 | nt_action->addTo( actionMenu ); | 633 | nt_action->addTo( actionMenu ); |
634 | connect( nt_action, SIGNAL( activated() ), | 634 | connect( nt_action, SIGNAL( activated() ), |
635 | mView, SLOT( newTodo() ) ); | 635 | mView, SLOT( newTodo() ) ); |
636 | 636 | ||
637 | icon = loadPixmap( pathString + "today" ); | 637 | icon = loadPixmap( pathString + "today" ); |
638 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 638 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
639 | today_action->addTo( viewMenu ); | 639 | today_action->addTo( viewMenu ); |
640 | connect( today_action, SIGNAL( activated() ), | 640 | connect( today_action, SIGNAL( activated() ), |
641 | mView, SLOT( goToday() ) ); | 641 | mView, SLOT( goToday() ) ); |
642 | viewMenu->insertSeparator(); | 642 | viewMenu->insertSeparator(); |
643 | 643 | ||
644 | icon = loadPixmap( pathString + "navi" ); | 644 | icon = loadPixmap( pathString + "navi" ); |
645 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 645 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
646 | action->addTo( viewMenu ); | 646 | action->addTo( viewMenu ); |
647 | connect( action, SIGNAL( activated() ), | 647 | connect( action, SIGNAL( activated() ), |
648 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 648 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
649 | mToggleNav = action ; | 649 | mToggleNav = action ; |
650 | icon = loadPixmap( pathString + "filter" ); | 650 | icon = loadPixmap( pathString + "filter" ); |
651 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 651 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
652 | action->addTo( viewMenu ); | 652 | action->addTo( viewMenu ); |
653 | connect( action, SIGNAL( activated() ), | 653 | connect( action, SIGNAL( activated() ), |
654 | mView, SLOT( toggleFilter() ) ); | 654 | mView, SLOT( toggleFilter() ) ); |
655 | mToggleFilter = action; | 655 | mToggleFilter = action; |
656 | icon = loadPixmap( pathString + "allday" ); | 656 | icon = loadPixmap( pathString + "allday" ); |
657 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 657 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
658 | action->addTo( viewMenu ); | 658 | action->addTo( viewMenu ); |
659 | connect( action, SIGNAL( activated() ), | 659 | connect( action, SIGNAL( activated() ), |
660 | mView, SLOT( toggleAllDaySize() ) ); | 660 | mView, SLOT( toggleAllDaySize() ) ); |
661 | mToggleAllday = action; | 661 | mToggleAllday = action; |
662 | 662 | ||
663 | 663 | ||
664 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 664 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
665 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 665 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
666 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 666 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
667 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 667 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
668 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 668 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
669 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 669 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
670 | 670 | ||
671 | viewMenu->insertSeparator(); | 671 | viewMenu->insertSeparator(); |
672 | icon = loadPixmap( pathString + "picker" ); | 672 | icon = loadPixmap( pathString + "picker" ); |
673 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 673 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
674 | action->addTo( viewMenu ); | 674 | action->addTo( viewMenu ); |
675 | connect( action, SIGNAL( activated() ), | 675 | connect( action, SIGNAL( activated() ), |
676 | mView, SLOT( showDatePicker() ) ); | 676 | mView, SLOT( showDatePicker() ) ); |
677 | action->addTo( iconToolBar ); | 677 | action->addTo( iconToolBar ); |
678 | viewMenu->insertSeparator(); | 678 | viewMenu->insertSeparator(); |
679 | icon = loadPixmap( pathString + "list" ); | 679 | icon = loadPixmap( pathString + "list" ); |
680 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 680 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
681 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 681 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
682 | showlist_action->addTo( viewMenu ); | 682 | showlist_action->addTo( viewMenu ); |
683 | connect( showlist_action, SIGNAL( activated() ), | 683 | connect( showlist_action, SIGNAL( activated() ), |
684 | mView->viewManager(), SLOT( showListView() ) ); | 684 | mView->viewManager(), SLOT( showListView() ) ); |
685 | 685 | ||
686 | 686 | ||
687 | icon = loadPixmap( pathString + "day" ); | 687 | icon = loadPixmap( pathString + "day" ); |
688 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 688 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
689 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 689 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
690 | day1_action->addTo( viewMenu ); | 690 | day1_action->addTo( viewMenu ); |
691 | // action->addTo( toolBar ); | 691 | // action->addTo( toolBar ); |
692 | connect( day1_action, SIGNAL( activated() ), | 692 | connect( day1_action, SIGNAL( activated() ), |
693 | mView->viewManager(), SLOT( showDayView() ) ); | 693 | mView->viewManager(), SLOT( showDayView() ) ); |
694 | 694 | ||
695 | icon = loadPixmap( pathString + "workweek" ); | 695 | icon = loadPixmap( pathString + "workweek" ); |
696 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 696 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
697 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 697 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
698 | day5_action->addTo( viewMenu ); | 698 | day5_action->addTo( viewMenu ); |
699 | connect( day5_action, SIGNAL( activated() ), | 699 | connect( day5_action, SIGNAL( activated() ), |
700 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 700 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
701 | 701 | ||
702 | icon = loadPixmap( pathString + "week" ); | 702 | icon = loadPixmap( pathString + "week" ); |
703 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 703 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
704 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 704 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
705 | day7_action->addTo( viewMenu ); | 705 | day7_action->addTo( viewMenu ); |
706 | connect( day7_action, SIGNAL( activated() ), | 706 | connect( day7_action, SIGNAL( activated() ), |
707 | mView->viewManager(), SLOT( showWeekView() ) ); | 707 | mView->viewManager(), SLOT( showWeekView() ) ); |
708 | 708 | ||
709 | icon = loadPixmap( pathString + "month" ); | 709 | icon = loadPixmap( pathString + "month" ); |
710 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 710 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
711 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 711 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
712 | month_action->addTo( viewMenu ); | 712 | month_action->addTo( viewMenu ); |
713 | connect( month_action, SIGNAL( activated() ), | 713 | connect( month_action, SIGNAL( activated() ), |
714 | mView->viewManager(), SLOT( showMonthView() ) ); | 714 | mView->viewManager(), SLOT( showMonthView() ) ); |
715 | 715 | ||
716 | icon = loadPixmap( pathString + "workweek2" ); | ||
717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | ||
718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | ||
719 | day6_action->addTo( viewMenu ); | ||
720 | connect( day6_action, SIGNAL( activated() ), | ||
721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | ||
722 | |||
716 | icon = loadPixmap( pathString + "todo" ); | 723 | icon = loadPixmap( pathString + "todo" ); |
717 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 724 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
718 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 725 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
719 | todoview_action->addTo( viewMenu ); | 726 | todoview_action->addTo( viewMenu ); |
720 | connect( todoview_action, SIGNAL( activated() ), | 727 | connect( todoview_action, SIGNAL( activated() ), |
721 | mView->viewManager(), SLOT( showTodoView() ) ); | 728 | mView->viewManager(), SLOT( showTodoView() ) ); |
722 | 729 | ||
723 | icon = loadPixmap( pathString + "journal" ); | 730 | icon = loadPixmap( pathString + "journal" ); |
724 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 731 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
725 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 732 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
726 | viewjournal_action->addTo( viewMenu ); | 733 | viewjournal_action->addTo( viewMenu ); |
727 | connect( viewjournal_action, SIGNAL( activated() ), | 734 | connect( viewjournal_action, SIGNAL( activated() ), |
728 | mView->viewManager(), SLOT( showJournalView() ) ); | 735 | mView->viewManager(), SLOT( showJournalView() ) ); |
729 | 736 | ||
730 | icon = loadPixmap( pathString + "xdays" ); | 737 | icon = loadPixmap( pathString + "xdays" ); |
731 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 738 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
732 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 739 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
733 | xdays_action->addTo( viewMenu ); | 740 | xdays_action->addTo( viewMenu ); |
734 | connect( xdays_action, SIGNAL( activated() ), | 741 | connect( xdays_action, SIGNAL( activated() ), |
735 | mView->viewManager(), SLOT( showNextXView() ) ); | 742 | mView->viewManager(), SLOT( showNextXView() ) ); |
736 | 743 | ||
737 | icon = loadPixmap( pathString + "whatsnext" ); | 744 | icon = loadPixmap( pathString + "whatsnext" ); |
738 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 745 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
739 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 746 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
740 | whatsnext_action->addTo( viewMenu ); | 747 | whatsnext_action->addTo( viewMenu ); |
741 | connect( whatsnext_action, SIGNAL( activated() ), | 748 | connect( whatsnext_action, SIGNAL( activated() ), |
742 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 749 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
743 | 750 | ||
744 | #if 0 | 751 | #if 0 |
745 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 752 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
746 | action->addTo( viewMenu ); | 753 | action->addTo( viewMenu ); |
747 | connect( action, SIGNAL( activated() ), | 754 | connect( action, SIGNAL( activated() ), |
748 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 755 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
749 | #endif | 756 | #endif |
750 | 757 | ||
751 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 758 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
752 | this ); | 759 | this ); |
753 | mNewSubTodoAction->addTo( actionMenu ); | 760 | mNewSubTodoAction->addTo( actionMenu ); |
754 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 761 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
755 | mView, SLOT( newSubTodo() ) ); | 762 | mView, SLOT( newSubTodo() ) ); |
756 | 763 | ||
757 | actionMenu->insertSeparator(); | 764 | actionMenu->insertSeparator(); |
758 | 765 | ||
759 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 766 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
760 | mShowAction->addTo( actionMenu ); | 767 | mShowAction->addTo( actionMenu ); |
761 | connect( mShowAction, SIGNAL( activated() ), | 768 | connect( mShowAction, SIGNAL( activated() ), |
762 | mView, SLOT( showIncidence() ) ); | 769 | mView, SLOT( showIncidence() ) ); |
763 | 770 | ||
764 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 771 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
765 | mEditAction->addTo( actionMenu ); | 772 | mEditAction->addTo( actionMenu ); |
766 | connect( mEditAction, SIGNAL( activated() ), | 773 | connect( mEditAction, SIGNAL( activated() ), |
767 | mView, SLOT( editIncidence() ) ); | 774 | mView, SLOT( editIncidence() ) ); |
768 | 775 | ||
769 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 776 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
770 | mDeleteAction->addTo( actionMenu ); | 777 | mDeleteAction->addTo( actionMenu ); |
771 | connect( mDeleteAction, SIGNAL( activated() ), | 778 | connect( mDeleteAction, SIGNAL( activated() ), |
772 | mView, SLOT( deleteIncidence() ) ); | 779 | mView, SLOT( deleteIncidence() ) ); |
773 | 780 | ||
774 | 781 | ||
775 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 782 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
776 | mCloneAction->addTo( actionMenu ); | 783 | mCloneAction->addTo( actionMenu ); |
777 | connect( mCloneAction, SIGNAL( activated() ), | 784 | connect( mCloneAction, SIGNAL( activated() ), |
778 | mView, SLOT( cloneIncidence() ) ); | 785 | mView, SLOT( cloneIncidence() ) ); |
779 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 786 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
780 | mMoveAction->addTo( actionMenu ); | 787 | mMoveAction->addTo( actionMenu ); |
781 | connect( mMoveAction, SIGNAL( activated() ), | 788 | connect( mMoveAction, SIGNAL( activated() ), |
782 | mView, SLOT( moveIncidence() ) ); | 789 | mView, SLOT( moveIncidence() ) ); |
783 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 790 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
784 | mBeamAction->addTo( actionMenu ); | 791 | mBeamAction->addTo( actionMenu ); |
785 | connect( mBeamAction, SIGNAL( activated() ), | 792 | connect( mBeamAction, SIGNAL( activated() ), |
786 | mView, SLOT( beamIncidence() ) ); | 793 | mView, SLOT( beamIncidence() ) ); |
787 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 794 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
788 | mCancelAction->addTo( actionMenu ); | 795 | mCancelAction->addTo( actionMenu ); |
789 | connect( mCancelAction, SIGNAL( activated() ), | 796 | connect( mCancelAction, SIGNAL( activated() ), |
790 | mView, SLOT( toggleCancelIncidence() ) ); | 797 | mView, SLOT( toggleCancelIncidence() ) ); |
791 | 798 | ||
792 | actionMenu->insertSeparator(); | 799 | actionMenu->insertSeparator(); |
793 | 800 | ||
794 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 801 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
795 | this ); | 802 | this ); |
796 | action->addTo( actionMenu ); | 803 | action->addTo( actionMenu ); |
797 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 804 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
798 | 805 | ||
799 | icon = loadPixmap( pathString + "search" ); | 806 | icon = loadPixmap( pathString + "search" ); |
800 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 807 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
801 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 808 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
802 | search_action->addTo( actionMenu ); | 809 | search_action->addTo( actionMenu ); |
803 | connect( search_action, SIGNAL( activated() ), | 810 | connect( search_action, SIGNAL( activated() ), |
804 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 811 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
805 | 812 | ||
806 | 813 | ||
807 | 814 | ||
808 | if ( KOPrefs::instance()->mShowFullMenu ) { | 815 | if ( KOPrefs::instance()->mShowFullMenu ) { |
809 | actionMenu->insertSeparator(); | 816 | actionMenu->insertSeparator(); |
810 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 817 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
811 | 818 | ||
812 | } | 819 | } |
813 | // actionMenu->insertSeparator(); | 820 | // actionMenu->insertSeparator(); |
814 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 821 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
815 | this ); | 822 | this ); |
816 | action->addTo( importMenu ); | 823 | action->addTo( importMenu ); |
817 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 824 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
818 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 825 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
819 | this ); | 826 | this ); |
820 | action->addTo( importMenu ); | 827 | action->addTo( importMenu ); |
821 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 828 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
822 | importMenu->insertSeparator(); | 829 | importMenu->insertSeparator(); |
823 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 830 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
824 | this ); | 831 | this ); |
825 | action->addTo( importMenu ); | 832 | action->addTo( importMenu ); |
826 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 833 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
827 | #ifndef DESKTOP_VERSION | 834 | #ifndef DESKTOP_VERSION |
828 | importMenu->insertSeparator(); | 835 | importMenu->insertSeparator(); |
829 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 836 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
830 | this ); | 837 | this ); |
831 | action->addTo( importMenu ); | 838 | action->addTo( importMenu ); |
832 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 839 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
833 | #else | 840 | #else |
834 | #ifdef _OL_IMPORT_ | 841 | #ifdef _OL_IMPORT_ |
835 | importMenu->insertSeparator(); | 842 | importMenu->insertSeparator(); |
836 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 843 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
837 | this ); | 844 | this ); |
838 | action->addTo( importMenu ); | 845 | action->addTo( importMenu ); |
839 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 846 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
840 | #endif | 847 | #endif |
841 | #endif | 848 | #endif |
842 | 849 | ||
843 | importMenu->insertSeparator(); | 850 | importMenu->insertSeparator(); |
844 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 851 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
845 | this ); | 852 | this ); |
846 | action->addTo( importMenu ); | 853 | action->addTo( importMenu ); |
847 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 854 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
848 | 855 | ||
849 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 856 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
850 | this ); | 857 | this ); |
851 | action->addTo( importMenu ); | 858 | action->addTo( importMenu ); |
852 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 859 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
853 | 860 | ||
854 | importMenu->insertSeparator(); | 861 | importMenu->insertSeparator(); |
855 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 862 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
856 | this ); | 863 | this ); |
857 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 864 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
858 | 865 | ||
859 | 866 | ||
860 | //LR | 867 | //LR |
861 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 868 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
862 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 869 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
863 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 870 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
864 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 871 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
865 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); | 872 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); |
866 | 873 | ||
867 | importMenu->insertSeparator(); | 874 | importMenu->insertSeparator(); |
868 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 875 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
869 | this ); | 876 | this ); |
870 | action->addTo( importMenu ); | 877 | action->addTo( importMenu ); |
871 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 878 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
872 | #ifndef DESKTOP_VERSION | 879 | #ifndef DESKTOP_VERSION |
873 | importMenu->insertSeparator(); | 880 | importMenu->insertSeparator(); |
874 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 881 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
875 | this ); | 882 | this ); |
876 | brAction->addTo( importMenu ); | 883 | brAction->addTo( importMenu ); |
877 | brAction->setToggleAction (true ) ; | 884 | brAction->setToggleAction (true ) ; |
878 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 885 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
879 | 886 | ||
880 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 887 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
881 | this ); | 888 | this ); |
882 | action->addTo( importMenu ); | 889 | action->addTo( importMenu ); |
883 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 890 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
884 | 891 | ||
885 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 892 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
886 | this ); | 893 | this ); |
887 | action->addTo( importMenu ); | 894 | action->addTo( importMenu ); |
888 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
889 | #else | 896 | #else |
890 | importMenu->insertSeparator(); | 897 | importMenu->insertSeparator(); |
891 | icon = loadPixmap( pathString + "print" ); | 898 | icon = loadPixmap( pathString + "print" ); |
892 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 899 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
893 | action->addTo( importMenu ); | 900 | action->addTo( importMenu ); |
894 | connect( action, SIGNAL( activated() ), | 901 | connect( action, SIGNAL( activated() ), |
895 | this, SLOT( printCal() ) ); | 902 | this, SLOT( printCal() ) ); |
896 | 903 | ||
897 | icon = loadPixmap( pathString + "print" ); | 904 | icon = loadPixmap( pathString + "print" ); |
898 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 905 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
899 | action->addTo( importMenu ); | 906 | action->addTo( importMenu ); |
900 | connect( action, SIGNAL( activated() ), | 907 | connect( action, SIGNAL( activated() ), |
901 | this, SLOT( printSel() ) ); | 908 | this, SLOT( printSel() ) ); |
902 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 909 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
903 | action->addTo( importMenu ); | 910 | action->addTo( importMenu ); |
904 | connect( action, SIGNAL( activated() ), | 911 | connect( action, SIGNAL( activated() ), |
905 | mView->viewManager(), SIGNAL( printWNV() ) ); | 912 | mView->viewManager(), SIGNAL( printWNV() ) ); |
906 | #endif | 913 | #endif |
907 | importMenu->insertSeparator(); | 914 | importMenu->insertSeparator(); |
908 | action = new QAction( "beam all", i18n("Save"), 0, | 915 | action = new QAction( "beam all", i18n("Save"), 0, |
909 | this ); | 916 | this ); |
910 | action->addTo( importMenu ); | 917 | action->addTo( importMenu ); |
911 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 918 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
912 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 919 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
913 | this ); | 920 | this ); |
914 | action->addTo( importMenu ); | 921 | action->addTo( importMenu ); |
915 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 922 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
916 | 923 | ||
917 | //menuBar->insertItem( "Configure",configureMenu ); | 924 | //menuBar->insertItem( "Configure",configureMenu ); |
918 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 925 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
919 | icon = loadPixmap( "korganizer/korganizer" ); | 926 | icon = loadPixmap( "korganizer/korganizer" ); |
920 | 927 | ||
921 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 928 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
922 | action->addTo( helpMenu ); | 929 | action->addTo( helpMenu ); |
923 | connect( action, SIGNAL( activated() ), | 930 | connect( action, SIGNAL( activated() ), |
924 | SLOT( whatsNew() ) ); | 931 | SLOT( whatsNew() ) ); |
925 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 932 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
926 | action->addTo( helpMenu ); | 933 | action->addTo( helpMenu ); |
927 | connect( action, SIGNAL( activated() ), | 934 | connect( action, SIGNAL( activated() ), |
928 | SLOT( features() ) ); | 935 | SLOT( features() ) ); |
929 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 936 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
930 | action->addTo( helpMenu ); | 937 | action->addTo( helpMenu ); |
931 | connect( action, SIGNAL( activated() ), | 938 | connect( action, SIGNAL( activated() ), |
932 | SLOT( keyBindings() ) ); | 939 | SLOT( keyBindings() ) ); |
933 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 940 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
934 | action->addTo( helpMenu ); | 941 | action->addTo( helpMenu ); |
935 | connect( action, SIGNAL( activated() ), | 942 | connect( action, SIGNAL( activated() ), |
936 | SLOT( synchowto() ) ); | 943 | SLOT( synchowto() ) ); |
937 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 944 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
938 | action->addTo( helpMenu ); | 945 | action->addTo( helpMenu ); |
939 | connect( action, SIGNAL( activated() ), | 946 | connect( action, SIGNAL( activated() ), |
940 | SLOT( kdesynchowto() ) ); | 947 | SLOT( kdesynchowto() ) ); |
941 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 948 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
942 | action->addTo( helpMenu ); | 949 | action->addTo( helpMenu ); |
943 | connect( action, SIGNAL( activated() ), | 950 | connect( action, SIGNAL( activated() ), |
944 | SLOT( multisynchowto() ) ); | 951 | SLOT( multisynchowto() ) ); |
945 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 952 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
946 | action->addTo( helpMenu ); | 953 | action->addTo( helpMenu ); |
947 | connect( action, SIGNAL( activated() ), | 954 | connect( action, SIGNAL( activated() ), |
948 | SLOT( aboutAutoSaving() ) ); | 955 | SLOT( aboutAutoSaving() ) ); |
949 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 956 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
950 | action->addTo( helpMenu ); | 957 | action->addTo( helpMenu ); |
951 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
952 | SLOT( aboutKnownBugs() ) ); | 959 | SLOT( aboutKnownBugs() ) ); |
953 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 960 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
954 | action->addTo( helpMenu ); | 961 | action->addTo( helpMenu ); |
955 | connect( action, SIGNAL( activated() ), | 962 | connect( action, SIGNAL( activated() ), |
956 | SLOT( usertrans() ) ); | 963 | SLOT( usertrans() ) ); |
957 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 964 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
958 | action->addTo( helpMenu ); | 965 | action->addTo( helpMenu ); |
959 | connect( action, SIGNAL( activated() ), | 966 | connect( action, SIGNAL( activated() ), |
960 | SLOT( faq() ) ); | 967 | SLOT( faq() ) ); |
961 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 968 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
962 | action->addTo( helpMenu ); | 969 | action->addTo( helpMenu ); |
963 | connect( action, SIGNAL( activated() ), | 970 | connect( action, SIGNAL( activated() ), |
964 | SLOT( licence() ) ); | 971 | SLOT( licence() ) ); |
965 | action = new QAction( "about", i18n("About..."), 0, this ); | 972 | action = new QAction( "about", i18n("About..."), 0, this ); |
966 | action->addTo( helpMenu ); | 973 | action->addTo( helpMenu ); |
967 | connect( action, SIGNAL( activated() ), | 974 | connect( action, SIGNAL( activated() ), |
968 | SLOT( about() ) ); | 975 | SLOT( about() ) ); |
969 | //menuBar->insertSeparator(); | 976 | //menuBar->insertSeparator(); |
970 | 977 | ||
971 | // ****************************************************** | 978 | // ****************************************************** |
972 | // menubar icons | 979 | // menubar icons |
973 | 980 | ||
974 | 981 | ||
975 | iconToolBar->setHorizontalStretchable (true ); | 982 | iconToolBar->setHorizontalStretchable (true ); |
976 | //menuBar->insertItem( iconToolBar ); | 983 | //menuBar->insertItem( iconToolBar ); |
977 | //xdays_action | 984 | //xdays_action |
978 | if (p-> mShowIconNewEvent) | 985 | if (p-> mShowIconNewEvent) |
979 | ne_action->addTo( iconToolBar ); | 986 | ne_action->addTo( iconToolBar ); |
980 | if (p->mShowIconNewTodo ) | 987 | if (p->mShowIconNewTodo ) |
981 | nt_action->addTo( iconToolBar ); | 988 | nt_action->addTo( iconToolBar ); |
982 | if (p-> mShowIconSearch) | 989 | if (p-> mShowIconSearch) |
983 | search_action->addTo( iconToolBar ); | 990 | search_action->addTo( iconToolBar ); |
984 | if (p-> mShowIconNext) | 991 | if (p-> mShowIconNext) |
985 | whatsnext_action->addTo( iconToolBar ); | 992 | whatsnext_action->addTo( iconToolBar ); |
986 | if (p-> mShowIconNextDays) | 993 | if (p-> mShowIconNextDays) |
987 | xdays_action->addTo( iconToolBar ); | 994 | xdays_action->addTo( iconToolBar ); |
988 | if (p-> mShowIconList) | 995 | if (p-> mShowIconList) |
989 | showlist_action->addTo( iconToolBar ); | 996 | showlist_action->addTo( iconToolBar ); |
990 | if (p-> mShowIconDay1) | 997 | if (p-> mShowIconDay1) |
991 | day1_action->addTo( iconToolBar ); | 998 | day1_action->addTo( iconToolBar ); |
992 | if (p-> mShowIconDay5) | 999 | if (p-> mShowIconDay5) |
993 | day5_action->addTo( iconToolBar ); | 1000 | day5_action->addTo( iconToolBar ); |
994 | if (p-> mShowIconDay7) | 1001 | if (p-> mShowIconDay7) |
995 | day7_action->addTo( iconToolBar ); | 1002 | day7_action->addTo( iconToolBar ); |
996 | if (p-> mShowIconMonth) | 1003 | if (p-> mShowIconMonth) |
997 | month_action->addTo( iconToolBar ); | 1004 | month_action->addTo( iconToolBar ); |
1005 | if (p-> mShowIconDay6) | ||
1006 | day6_action->addTo( iconToolBar ); | ||
998 | if (p-> mShowIconTodoview) | 1007 | if (p-> mShowIconTodoview) |
999 | todoview_action->addTo( iconToolBar ); | 1008 | todoview_action->addTo( iconToolBar ); |
1000 | if (p-> mShowIconJournal) | 1009 | if (p-> mShowIconJournal) |
1001 | viewjournal_action->addTo( iconToolBar ); | 1010 | viewjournal_action->addTo( iconToolBar ); |
1002 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1011 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1003 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 1012 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
1004 | if (p-> mShowIconBackFast) { | 1013 | if (p-> mShowIconBackFast) { |
1005 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1014 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1006 | connect( action, SIGNAL( activated() ), | 1015 | connect( action, SIGNAL( activated() ), |
1007 | mView, SLOT( goPreviousMonth() ) ); | 1016 | mView, SLOT( goPreviousMonth() ) ); |
1008 | action->addTo( iconToolBar ); | 1017 | action->addTo( iconToolBar ); |
1009 | } | 1018 | } |
1010 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1019 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1011 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 1020 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
1012 | if (p-> mShowIconBack) { | 1021 | if (p-> mShowIconBack) { |
1013 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1022 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1014 | connect( action, SIGNAL( activated() ), | 1023 | connect( action, SIGNAL( activated() ), |
1015 | mView, SLOT( goPrevious() ) ); | 1024 | mView, SLOT( goPrevious() ) ); |
1016 | action->addTo( iconToolBar ); | 1025 | action->addTo( iconToolBar ); |
1017 | } | 1026 | } |
1018 | icon = loadPixmap( pathString + "today" ); | 1027 | icon = loadPixmap( pathString + "today" ); |
1019 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1028 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1020 | if (p-> mShowIconToday) | 1029 | if (p-> mShowIconToday) |
1021 | today_action->addTo( iconToolBar ); | 1030 | today_action->addTo( iconToolBar ); |
1022 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1031 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1023 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1032 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1024 | if (p-> mShowIconForward) { | 1033 | if (p-> mShowIconForward) { |
1025 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1034 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1026 | connect( action, SIGNAL( activated() ), | 1035 | connect( action, SIGNAL( activated() ), |
1027 | mView, SLOT( goNext() ) ); | 1036 | mView, SLOT( goNext() ) ); |
1028 | action->addTo( iconToolBar ); | 1037 | action->addTo( iconToolBar ); |
1029 | } | 1038 | } |
1030 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1039 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1031 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1040 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1032 | if (p-> mShowIconForwardFast) { | 1041 | if (p-> mShowIconForwardFast) { |
1033 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1042 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1034 | connect( action, SIGNAL( activated() ), | 1043 | connect( action, SIGNAL( activated() ), |
1035 | mView, SLOT( goNextMonth() ) ); | 1044 | mView, SLOT( goNextMonth() ) ); |
1036 | action->addTo( iconToolBar ); | 1045 | action->addTo( iconToolBar ); |
1037 | } | 1046 | } |
1038 | 1047 | ||
1039 | 1048 | ||
1040 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 1049 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
1041 | 1050 | ||
1042 | if (p-> mShowIconNewEvent) | 1051 | if (p-> mShowIconNewEvent) |
1043 | configureToolBarMenu->setItemChecked( 10, true ); | 1052 | configureToolBarMenu->setItemChecked( 10, true ); |
1044 | if (p->mShowIconNewTodo ) | 1053 | if (p->mShowIconNewTodo ) |
1045 | configureToolBarMenu->setItemChecked( 20, true ); | 1054 | configureToolBarMenu->setItemChecked( 20, true ); |
1046 | if (p-> mShowIconSearch) | 1055 | if (p-> mShowIconSearch) |
1047 | configureToolBarMenu->setItemChecked( 120, true ); | 1056 | configureToolBarMenu->setItemChecked( 120, true ); |
1048 | if (p-> mShowIconList) | 1057 | if (p-> mShowIconList) |
1049 | configureToolBarMenu->setItemChecked( 30, true ); | 1058 | configureToolBarMenu->setItemChecked( 30, true ); |
1050 | if (p-> mShowIconDay1) | 1059 | if (p-> mShowIconDay1) |
1051 | configureToolBarMenu->setItemChecked( 40, true ); | 1060 | configureToolBarMenu->setItemChecked( 40, true ); |
1052 | if (p-> mShowIconDay5) | 1061 | if (p-> mShowIconDay5) |
1053 | configureToolBarMenu->setItemChecked( 50, true ); | 1062 | configureToolBarMenu->setItemChecked( 50, true ); |
1063 | if (p-> mShowIconDay6) | ||
1064 | configureToolBarMenu->setItemChecked( 75, true ); | ||
1054 | if (p-> mShowIconDay7) | 1065 | if (p-> mShowIconDay7) |
1055 | configureToolBarMenu->setItemChecked( 60, true ); | 1066 | configureToolBarMenu->setItemChecked( 60, true ); |
1056 | if (p-> mShowIconMonth) | 1067 | if (p-> mShowIconMonth) |
1057 | configureToolBarMenu->setItemChecked( 70, true ); | 1068 | configureToolBarMenu->setItemChecked( 70, true ); |
1058 | if (p-> mShowIconTodoview) | 1069 | if (p-> mShowIconTodoview) |
1059 | configureToolBarMenu->setItemChecked( 80, true ); | 1070 | configureToolBarMenu->setItemChecked( 80, true ); |
1060 | if (p-> mShowIconBackFast) | 1071 | if (p-> mShowIconBackFast) |
1061 | configureToolBarMenu->setItemChecked( 200, true ); | 1072 | configureToolBarMenu->setItemChecked( 200, true ); |
1062 | if (p-> mShowIconBack) | 1073 | if (p-> mShowIconBack) |
1063 | configureToolBarMenu->setItemChecked( 210, true ); | 1074 | configureToolBarMenu->setItemChecked( 210, true ); |
1064 | if (p-> mShowIconToday) | 1075 | if (p-> mShowIconToday) |
1065 | configureToolBarMenu->setItemChecked( 130, true ); | 1076 | configureToolBarMenu->setItemChecked( 130, true ); |
1066 | if (p-> mShowIconForward) | 1077 | if (p-> mShowIconForward) |
1067 | configureToolBarMenu->setItemChecked( 220, true ); | 1078 | configureToolBarMenu->setItemChecked( 220, true ); |
1068 | if (p-> mShowIconForwardFast) | 1079 | if (p-> mShowIconForwardFast) |
1069 | configureToolBarMenu->setItemChecked( 230, true ); | 1080 | configureToolBarMenu->setItemChecked( 230, true ); |
1070 | if (p-> mShowIconNextDays) | 1081 | if (p-> mShowIconNextDays) |
1071 | configureToolBarMenu->setItemChecked( 100, true ); | 1082 | configureToolBarMenu->setItemChecked( 100, true ); |
1072 | if (p-> mShowIconNext) | 1083 | if (p-> mShowIconNext) |
1073 | configureToolBarMenu->setItemChecked( 110, true ); | 1084 | configureToolBarMenu->setItemChecked( 110, true ); |
1074 | if (p-> mShowIconJournal) | 1085 | if (p-> mShowIconJournal) |
1075 | configureToolBarMenu->setItemChecked( 90, true ); | 1086 | configureToolBarMenu->setItemChecked( 90, true ); |
1076 | if (p-> mShowIconWhatsThis) | 1087 | if (p-> mShowIconWhatsThis) |
1077 | configureToolBarMenu->setItemChecked( 300, true ); | 1088 | configureToolBarMenu->setItemChecked( 300, true ); |
1078 | 1089 | ||
1079 | QLabel* dummy = new QLabel( iconToolBar ); | 1090 | QLabel* dummy = new QLabel( iconToolBar ); |
1080 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1091 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1081 | if (!p-> mShowIconStretch) | 1092 | if (!p-> mShowIconStretch) |
1082 | iconToolBar->setStretchableWidget ( dummy ) ; | 1093 | iconToolBar->setStretchableWidget ( dummy ) ; |
1083 | else | 1094 | else |
1084 | configureToolBarMenu->setItemChecked( 5, true ); | 1095 | configureToolBarMenu->setItemChecked( 5, true ); |
1085 | if (p-> mShowIconWhatsThis) | 1096 | if (p-> mShowIconWhatsThis) |
1086 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1097 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1087 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1098 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1088 | configureAgenda( p->mHourSize ); | 1099 | configureAgenda( p->mHourSize ); |
1089 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1100 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1090 | } | 1101 | } |
1091 | 1102 | ||
1092 | void MainWindow::exportToPhone( int mode ) | 1103 | void MainWindow::exportToPhone( int mode ) |
1093 | { | 1104 | { |
1094 | 1105 | ||
1095 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1106 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1096 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1107 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1097 | KOex2phonePrefs ex2phone; | 1108 | KOex2phonePrefs ex2phone; |
1098 | 1109 | ||
1099 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1110 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1100 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1111 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1101 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1112 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1102 | if ( mode == 1 ) | 1113 | if ( mode == 1 ) |
1103 | ex2phone.setCaption(i18n("Export complete calendar")); | 1114 | ex2phone.setCaption(i18n("Export complete calendar")); |
1104 | if ( mode == 2 ) | 1115 | if ( mode == 2 ) |
1105 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1116 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1106 | 1117 | ||
1107 | if ( !ex2phone.exec() ) { | 1118 | if ( !ex2phone.exec() ) { |
1108 | return; | 1119 | return; |
1109 | } | 1120 | } |
1110 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1121 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1111 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1122 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1112 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1123 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1113 | 1124 | ||
1114 | int inFuture = 0; | 1125 | int inFuture = 0; |
1115 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1126 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1116 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1127 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1117 | QPtrList<Incidence> delSel; | 1128 | QPtrList<Incidence> delSel; |
1118 | if ( mode == 1 ) | 1129 | if ( mode == 1 ) |
1119 | delSel = mCalendar->rawIncidences(); | 1130 | delSel = mCalendar->rawIncidences(); |
1120 | if ( mode == 2 ) | 1131 | if ( mode == 2 ) |
1121 | delSel = mCalendar->incidences(); | 1132 | delSel = mCalendar->incidences(); |
1122 | CalendarLocal* cal = new CalendarLocal(); | 1133 | CalendarLocal* cal = new CalendarLocal(); |
1123 | cal->setLocalTime(); | 1134 | cal->setLocalTime(); |
1124 | Incidence *incidence = delSel.first(); | 1135 | Incidence *incidence = delSel.first(); |
1125 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1136 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1126 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1137 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1127 | while ( incidence ) { | 1138 | while ( incidence ) { |
1128 | if ( incidence->type() != "Journal" ) { | 1139 | if ( incidence->type() != "Journal" ) { |
1129 | bool add = true; | 1140 | bool add = true; |
1130 | if ( inFuture ) { | 1141 | if ( inFuture ) { |
1131 | QDateTime dt; | 1142 | QDateTime dt; |
1132 | if ( incidence->type() == "Todo" ) { | 1143 | if ( incidence->type() == "Todo" ) { |
1133 | Todo * t = (Todo*)incidence; | 1144 | Todo * t = (Todo*)incidence; |
1134 | if ( t->hasDueDate() ) | 1145 | if ( t->hasDueDate() ) |
1135 | dt = t->dtDue(); | 1146 | dt = t->dtDue(); |
1136 | else | 1147 | else |
1137 | dt = cur.addSecs( 62 ); | 1148 | dt = cur.addSecs( 62 ); |
1138 | } | 1149 | } |
1139 | else { | 1150 | else { |
1140 | bool ok; | 1151 | bool ok; |
1141 | dt = incidence->getNextOccurence( cur, &ok ); | 1152 | dt = incidence->getNextOccurence( cur, &ok ); |
1142 | if ( !ok ) | 1153 | if ( !ok ) |
1143 | dt = cur.addSecs( -62 ); | 1154 | dt = cur.addSecs( -62 ); |
1144 | } | 1155 | } |
1145 | if ( dt < cur || dt > end ) { | 1156 | if ( dt < cur || dt > end ) { |
1146 | add = false; | 1157 | add = false; |
1147 | } | 1158 | } |
1148 | } | 1159 | } |
1149 | if ( add ) { | 1160 | if ( add ) { |
1150 | Incidence *in = incidence->clone(); | 1161 | Incidence *in = incidence->clone(); |
1151 | cal->addIncidence( in ); | 1162 | cal->addIncidence( in ); |
1152 | } | 1163 | } |
1153 | } | 1164 | } |
1154 | incidence = delSel.next(); | 1165 | incidence = delSel.next(); |
1155 | } | 1166 | } |
1156 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1167 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1157 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1168 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1158 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1169 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1159 | 1170 | ||
1160 | setCaption( i18n("Writing to phone...")); | 1171 | setCaption( i18n("Writing to phone...")); |
1161 | if ( PhoneFormat::writeToPhone( cal ) ) | 1172 | if ( PhoneFormat::writeToPhone( cal ) ) |
1162 | setCaption( i18n("Export to phone successful!")); | 1173 | setCaption( i18n("Export to phone successful!")); |
1163 | else | 1174 | else |
1164 | setCaption( i18n("Error exporting to phone!")); | 1175 | setCaption( i18n("Error exporting to phone!")); |
1165 | delete cal; | 1176 | delete cal; |
1166 | } | 1177 | } |
1167 | 1178 | ||
1168 | 1179 | ||
1169 | void MainWindow::setDefaultPreferences() | 1180 | void MainWindow::setDefaultPreferences() |
1170 | { | 1181 | { |
1171 | KOPrefs *p = KOPrefs::instance(); | 1182 | KOPrefs *p = KOPrefs::instance(); |
1172 | 1183 | ||
1173 | p->mCompactDialogs = true; | 1184 | p->mCompactDialogs = true; |
1174 | p->mConfirm = true; | 1185 | p->mConfirm = true; |
1175 | // p->mEnableQuickTodo = false; | 1186 | // p->mEnableQuickTodo = false; |
1176 | 1187 | ||
1177 | } | 1188 | } |
1178 | 1189 | ||
1179 | QString MainWindow::resourcePath() | 1190 | QString MainWindow::resourcePath() |
1180 | { | 1191 | { |
1181 | return KGlobal::iconLoader()->iconPath(); | 1192 | return KGlobal::iconLoader()->iconPath(); |
1182 | } | 1193 | } |
1183 | 1194 | ||
1184 | void MainWindow::displayText( QString text ,QString cap ) | 1195 | void MainWindow::displayText( QString text ,QString cap ) |
1185 | { | 1196 | { |
1186 | QDialog dia( this, "name", true ); ; | 1197 | QDialog dia( this, "name", true ); ; |
1187 | dia.setCaption( cap ); | 1198 | dia.setCaption( cap ); |
1188 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1199 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1189 | lay->setSpacing( 3 ); | 1200 | lay->setSpacing( 3 ); |
1190 | lay->setMargin( 3 ); | 1201 | lay->setMargin( 3 ); |
1191 | QTextBrowser tb ( &dia ); | 1202 | QTextBrowser tb ( &dia ); |
1192 | lay->addWidget( &tb ); | 1203 | lay->addWidget( &tb ); |
1193 | tb.setText( text ); | 1204 | tb.setText( text ); |
1194 | #ifdef DESKTOP_VERSION | 1205 | #ifdef DESKTOP_VERSION |
1195 | dia.resize( 640, 480); | 1206 | dia.resize( 640, 480); |
1196 | #else | 1207 | #else |
1197 | dia.showMaximized(); | 1208 | dia.showMaximized(); |
1198 | #endif | 1209 | #endif |
1199 | dia.exec(); | 1210 | dia.exec(); |
1200 | } | 1211 | } |
1201 | 1212 | ||
1202 | void MainWindow::features() | 1213 | void MainWindow::features() |
1203 | { | 1214 | { |
1204 | 1215 | ||
1205 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1216 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1206 | } | 1217 | } |
1207 | 1218 | ||
1208 | void MainWindow::usertrans() | 1219 | void MainWindow::usertrans() |
1209 | { | 1220 | { |
1210 | 1221 | ||
1211 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1222 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1212 | } | 1223 | } |
1213 | 1224 | ||
1214 | void MainWindow::kdesynchowto() | 1225 | void MainWindow::kdesynchowto() |
1215 | { | 1226 | { |
1216 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1227 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1217 | } | 1228 | } |
1218 | void MainWindow::multisynchowto() | 1229 | void MainWindow::multisynchowto() |
1219 | { | 1230 | { |
1220 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1231 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1221 | } | 1232 | } |
1222 | void MainWindow::synchowto() | 1233 | void MainWindow::synchowto() |
1223 | { | 1234 | { |
1224 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1235 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1225 | } | 1236 | } |
1226 | void MainWindow::faq() | 1237 | void MainWindow::faq() |
1227 | { | 1238 | { |
1228 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1239 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1229 | 1240 | ||
1230 | } | 1241 | } |
1231 | void MainWindow::whatsNew() | 1242 | void MainWindow::whatsNew() |
1232 | { | 1243 | { |
1233 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1244 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1234 | 1245 | ||
1235 | } | 1246 | } |
1236 | void MainWindow::licence() | 1247 | void MainWindow::licence() |
1237 | { | 1248 | { |
1238 | KApplication::showLicence(); | 1249 | KApplication::showLicence(); |
1239 | 1250 | ||
1240 | } | 1251 | } |
1241 | void MainWindow::about() | 1252 | void MainWindow::about() |
1242 | { | 1253 | { |
1243 | QString version; | 1254 | QString version; |
1244 | #include <../version> | 1255 | #include <../version> |
1245 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1256 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1246 | i18n("KOrganizer/Platform-independent\n") + | 1257 | i18n("KOrganizer/Platform-independent\n") + |
1247 | "(KO/Pi) " + version + " - " + | 1258 | "(KO/Pi) " + version + " - " + |
1248 | 1259 | ||
1249 | #ifdef DESKTOP_VERSION | 1260 | #ifdef DESKTOP_VERSION |
1250 | i18n("Desktop Edition\n") + | 1261 | i18n("Desktop Edition\n") + |
1251 | #else | 1262 | #else |
1252 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1263 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1253 | #endif | 1264 | #endif |
1254 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1265 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1255 | } | 1266 | } |
1256 | void MainWindow::keyBindings() | 1267 | void MainWindow::keyBindings() |
1257 | { | 1268 | { |
1258 | QString cap = i18n("KO/Pi Keys + Colors"); | 1269 | QString cap = i18n("KO/Pi Keys + Colors"); |
1259 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1270 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1260 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1271 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1261 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1272 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1262 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1273 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1263 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1274 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1264 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1275 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1265 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1276 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1266 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1277 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1267 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1278 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1268 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1279 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1269 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1280 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1270 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1281 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1271 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1282 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1272 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1283 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1273 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1284 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1274 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1285 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1275 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1286 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1276 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1287 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1277 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1288 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1278 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1289 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1279 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1290 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1280 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1291 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1281 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1292 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1282 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1293 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1283 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1294 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1284 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1295 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1285 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1296 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1286 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1297 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1287 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1298 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1288 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1299 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1289 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1300 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1290 | i18n("<p><h3>In list view:</h3></p>\n") + | 1301 | i18n("<p><h3>In list view:</h3></p>\n") + |
1291 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1302 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1292 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1303 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1293 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1304 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1294 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1305 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1295 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1306 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1296 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1307 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1297 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1308 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1298 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1309 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1299 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1310 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1300 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1311 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1301 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1312 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1302 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1313 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1303 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1314 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1304 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1315 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1305 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1316 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1306 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1317 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1307 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1318 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1308 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1319 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1309 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1320 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
@@ -1546,512 +1557,513 @@ void MainWindow::saveStopTimer() | |||
1546 | if (mSaveTimer.isActive() ) | 1557 | if (mSaveTimer.isActive() ) |
1547 | qDebug("ti active "); | 1558 | qDebug("ti active "); |
1548 | else | 1559 | else |
1549 | qDebug("KO: Save timer stopped"); | 1560 | qDebug("KO: Save timer stopped"); |
1550 | } | 1561 | } |
1551 | void MainWindow::save() | 1562 | void MainWindow::save() |
1552 | { | 1563 | { |
1553 | if ( !mCalendarModifiedFlag ) { | 1564 | if ( !mCalendarModifiedFlag ) { |
1554 | qDebug("KO: Calendar not modified. Nothing saved."); | 1565 | qDebug("KO: Calendar not modified. Nothing saved."); |
1555 | return; | 1566 | return; |
1556 | } | 1567 | } |
1557 | if ( mSyncManager->blockSave() ) | 1568 | if ( mSyncManager->blockSave() ) |
1558 | return; | 1569 | return; |
1559 | mSyncManager->setBlockSave(true); | 1570 | mSyncManager->setBlockSave(true); |
1560 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1571 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1561 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1572 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1562 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1573 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1563 | qDebug("KO: Start saving data to file!"); | 1574 | qDebug("KO: Start saving data to file!"); |
1564 | mView->saveCalendar( defaultFileName() ); | 1575 | mView->saveCalendar( defaultFileName() ); |
1565 | mCalendarModifiedFlag = false; | 1576 | mCalendarModifiedFlag = false; |
1566 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1577 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1567 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1578 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1568 | QString savemes; | 1579 | QString savemes; |
1569 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1580 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1570 | setCaption(savemes); | 1581 | setCaption(savemes); |
1571 | } else | 1582 | } else |
1572 | setCaption(i18n("Saving cancelled!")); | 1583 | setCaption(i18n("Saving cancelled!")); |
1573 | mSyncManager->setBlockSave( false ); | 1584 | mSyncManager->setBlockSave( false ); |
1574 | } | 1585 | } |
1575 | 1586 | ||
1576 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1587 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1577 | { | 1588 | { |
1578 | if ( !e->isAutoRepeat() ) { | 1589 | if ( !e->isAutoRepeat() ) { |
1579 | mFlagKeyPressed = false; | 1590 | mFlagKeyPressed = false; |
1580 | } | 1591 | } |
1581 | } | 1592 | } |
1582 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1593 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1583 | { | 1594 | { |
1584 | qApp->processEvents(); | 1595 | qApp->processEvents(); |
1585 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1596 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1586 | e->ignore(); | 1597 | e->ignore(); |
1587 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1598 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1588 | return; | 1599 | return; |
1589 | } | 1600 | } |
1590 | if (! e->isAutoRepeat() ) | 1601 | if (! e->isAutoRepeat() ) |
1591 | mFlagKeyPressed = true; | 1602 | mFlagKeyPressed = true; |
1592 | KOPrefs *p = KOPrefs::instance(); | 1603 | KOPrefs *p = KOPrefs::instance(); |
1593 | bool showSelectedDates = false; | 1604 | bool showSelectedDates = false; |
1594 | int size; | 1605 | int size; |
1595 | int pro = 0; | 1606 | int pro = 0; |
1596 | //qDebug("MainWindow::keyPressEvent "); | 1607 | //qDebug("MainWindow::keyPressEvent "); |
1597 | switch ( e->key() ) { | 1608 | switch ( e->key() ) { |
1598 | case Qt::Key_Right: | 1609 | case Qt::Key_Right: |
1599 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1610 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1600 | mView->goNextMonth(); | 1611 | mView->goNextMonth(); |
1601 | else | 1612 | else |
1602 | mView->goNext(); | 1613 | mView->goNext(); |
1603 | showSelectedDates = true; | 1614 | showSelectedDates = true; |
1604 | break; | 1615 | break; |
1605 | case Qt::Key_Left: | 1616 | case Qt::Key_Left: |
1606 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1617 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1607 | mView->goPreviousMonth(); | 1618 | mView->goPreviousMonth(); |
1608 | else | 1619 | else |
1609 | mView->goPrevious(); | 1620 | mView->goPrevious(); |
1610 | showSelectedDates = true; | 1621 | showSelectedDates = true; |
1611 | break; | 1622 | break; |
1612 | case Qt::Key_Down: | 1623 | case Qt::Key_Down: |
1613 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1624 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1614 | break; | 1625 | break; |
1615 | case Qt::Key_Up: | 1626 | case Qt::Key_Up: |
1616 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1627 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1617 | break; | 1628 | break; |
1618 | case Qt::Key_I: | 1629 | case Qt::Key_I: |
1619 | mView->showIncidence(); | 1630 | mView->showIncidence(); |
1620 | break; | 1631 | break; |
1621 | case Qt::Key_Delete: | 1632 | case Qt::Key_Delete: |
1622 | case Qt::Key_Backspace: | 1633 | case Qt::Key_Backspace: |
1623 | mView->deleteIncidence(); | 1634 | mView->deleteIncidence(); |
1624 | break; | 1635 | break; |
1625 | case Qt::Key_D: | 1636 | case Qt::Key_D: |
1626 | mView->viewManager()->showDayView(); | 1637 | mView->viewManager()->showDayView(); |
1627 | showSelectedDates = true; | 1638 | showSelectedDates = true; |
1628 | break; | 1639 | break; |
1629 | case Qt::Key_O: | 1640 | case Qt::Key_O: |
1630 | mView->toggleFilerEnabled( ); | 1641 | mView->toggleFilerEnabled( ); |
1631 | break; | 1642 | break; |
1632 | case Qt::Key_0: | 1643 | case Qt::Key_0: |
1633 | case Qt::Key_1: | 1644 | case Qt::Key_1: |
1634 | case Qt::Key_2: | 1645 | case Qt::Key_2: |
1635 | case Qt::Key_3: | 1646 | case Qt::Key_3: |
1636 | case Qt::Key_4: | 1647 | case Qt::Key_4: |
1637 | case Qt::Key_5: | 1648 | case Qt::Key_5: |
1638 | case Qt::Key_6: | 1649 | case Qt::Key_6: |
1639 | case Qt::Key_7: | 1650 | case Qt::Key_7: |
1640 | case Qt::Key_8: | 1651 | case Qt::Key_8: |
1641 | case Qt::Key_9: | 1652 | case Qt::Key_9: |
1642 | pro = e->key()-48; | 1653 | pro = e->key()-48; |
1643 | if ( pro == 0 ) | 1654 | if ( pro == 0 ) |
1644 | pro = 10; | 1655 | pro = 10; |
1645 | if ( e->state() == Qt::ControlButton) | 1656 | if ( e->state() == Qt::ControlButton) |
1646 | pro += 10; | 1657 | pro += 10; |
1647 | break; | 1658 | break; |
1648 | case Qt::Key_M: | 1659 | case Qt::Key_M: |
1649 | mView->viewManager()->showMonthView(); | 1660 | mView->viewManager()->showMonthView(); |
1650 | showSelectedDates = true; | 1661 | showSelectedDates = true; |
1651 | break; | 1662 | break; |
1652 | case Qt::Key_Insert: | 1663 | case Qt::Key_Insert: |
1653 | mView->newEvent(); | 1664 | mView->newEvent(); |
1654 | break; | 1665 | break; |
1655 | case Qt::Key_S : | 1666 | case Qt::Key_S : |
1656 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1667 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1657 | mView->newSubTodo(); | 1668 | mView->newSubTodo(); |
1658 | else | 1669 | else |
1659 | mView->dialogManager()->showSearchDialog(); | 1670 | mView->dialogManager()->showSearchDialog(); |
1660 | break; | 1671 | break; |
1661 | case Qt::Key_Y : | 1672 | case Qt::Key_Y : |
1662 | case Qt::Key_Z : | 1673 | case Qt::Key_Z : |
1663 | mView->viewManager()->showWorkWeekView(); | 1674 | mView->viewManager()->showWorkWeekView(); |
1664 | showSelectedDates = true; | 1675 | showSelectedDates = true; |
1665 | break; | 1676 | break; |
1666 | case Qt::Key_U : | 1677 | case Qt::Key_U : |
1667 | mView->viewManager()->showWeekView(); | 1678 | mView->viewManager()->showWeekView(); |
1668 | showSelectedDates = true; | 1679 | showSelectedDates = true; |
1669 | break; | 1680 | break; |
1670 | case Qt::Key_H : | 1681 | case Qt::Key_H : |
1671 | keyBindings(); | 1682 | keyBindings(); |
1672 | break; | 1683 | break; |
1673 | case Qt::Key_W: | 1684 | case Qt::Key_W: |
1674 | mView->viewManager()->showWhatsNextView(); | 1685 | mView->viewManager()->showWhatsNextView(); |
1675 | break; | 1686 | break; |
1676 | case Qt::Key_L: | 1687 | case Qt::Key_L: |
1677 | mView->viewManager()->showListView(); | 1688 | mView->viewManager()->showListView(); |
1678 | break; | 1689 | break; |
1679 | case Qt::Key_N: | 1690 | case Qt::Key_N: |
1680 | mView->viewManager()->showNextXView(); | 1691 | mView->viewManager()->showNextXView(); |
1681 | showSelectedDates = true; | 1692 | showSelectedDates = true; |
1682 | break; | 1693 | break; |
1683 | case Qt::Key_V: | 1694 | case Qt::Key_V: |
1684 | mView->viewManager()->showTodoView(); | 1695 | mView->viewManager()->showTodoView(); |
1685 | break; | 1696 | break; |
1686 | case Qt::Key_C: | 1697 | case Qt::Key_C: |
1687 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1698 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1688 | break; | 1699 | break; |
1689 | case Qt::Key_P: | 1700 | case Qt::Key_P: |
1690 | mView->showDatePicker( ); | 1701 | mView->showDatePicker( ); |
1691 | break; | 1702 | break; |
1692 | case Qt::Key_F: | 1703 | case Qt::Key_F: |
1693 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1704 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1694 | mView->editFilters(); | 1705 | mView->editFilters(); |
1695 | else | 1706 | else |
1696 | mView->toggleFilter(); | 1707 | mView->toggleFilter(); |
1697 | break; | 1708 | break; |
1698 | case Qt::Key_X: | 1709 | case Qt::Key_X: |
1699 | mView->toggleDateNavigatorWidget(); | 1710 | mView->toggleDateNavigatorWidget(); |
1700 | break; | 1711 | break; |
1701 | case Qt::Key_Space: | 1712 | case Qt::Key_Space: |
1702 | mView->toggleExpand(); | 1713 | mView->toggleExpand(); |
1703 | break; | 1714 | break; |
1704 | case Qt::Key_A: | 1715 | case Qt::Key_A: |
1705 | mView->toggleAllDaySize(); | 1716 | mView->toggleAllDaySize(); |
1706 | break; | 1717 | break; |
1707 | case Qt::Key_T: | 1718 | case Qt::Key_T: |
1708 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1719 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1709 | mView->newTodo(); | 1720 | mView->newTodo(); |
1710 | else { | 1721 | else { |
1711 | mView->goToday(); | 1722 | mView->goToday(); |
1712 | showSelectedDates = true; | 1723 | showSelectedDates = true; |
1713 | } | 1724 | } |
1714 | break; | 1725 | break; |
1715 | case Qt::Key_J: | 1726 | case Qt::Key_J: |
1716 | mView->viewManager()->showJournalView(); | 1727 | mView->viewManager()->showJournalView(); |
1717 | break; | 1728 | break; |
1718 | case Qt::Key_B: | 1729 | case Qt::Key_B: |
1719 | mView->editIncidenceDescription();; | 1730 | mView->editIncidenceDescription();; |
1720 | break; | 1731 | break; |
1721 | // case Qt::Key_Return: | 1732 | // case Qt::Key_Return: |
1722 | case Qt::Key_E: | 1733 | case Qt::Key_E: |
1723 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1734 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1724 | mView->newEvent(); | 1735 | mView->newEvent(); |
1725 | else | 1736 | else |
1726 | mView->editIncidence(); | 1737 | mView->editIncidence(); |
1727 | break; | 1738 | break; |
1728 | case Qt::Key_Plus: | 1739 | case Qt::Key_Plus: |
1729 | size = p->mHourSize +2; | 1740 | size = p->mHourSize +2; |
1730 | if ( size <= 22 ) | 1741 | if ( size <= 22 ) |
1731 | configureAgenda( size ); | 1742 | configureAgenda( size ); |
1732 | break; | 1743 | break; |
1733 | case Qt::Key_Minus: | 1744 | case Qt::Key_Minus: |
1734 | size = p->mHourSize - 2; | 1745 | size = p->mHourSize - 2; |
1735 | if ( size >= 4 ) | 1746 | if ( size >= 4 ) |
1736 | configureAgenda( size ); | 1747 | configureAgenda( size ); |
1737 | break; | 1748 | break; |
1738 | 1749 | ||
1739 | 1750 | ||
1740 | default: | 1751 | default: |
1741 | e->ignore(); | 1752 | e->ignore(); |
1742 | } | 1753 | } |
1743 | if ( pro > 0 ) { | 1754 | if ( pro > 0 ) { |
1744 | mView->selectFilter( pro-1 ); | 1755 | mView->selectFilter( pro-1 ); |
1745 | } | 1756 | } |
1746 | if ( showSelectedDates ) { | 1757 | if ( showSelectedDates ) { |
1747 | ;// setCaptionToDates(); | 1758 | ;// setCaptionToDates(); |
1748 | } | 1759 | } |
1749 | 1760 | ||
1750 | } | 1761 | } |
1751 | 1762 | ||
1752 | void MainWindow::fillFilterMenu() | 1763 | void MainWindow::fillFilterMenu() |
1753 | { | 1764 | { |
1754 | selectFilterMenu->clear(); | 1765 | selectFilterMenu->clear(); |
1755 | bool disable = false; | 1766 | bool disable = false; |
1756 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1767 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1757 | selectFilterMenu->insertSeparator(); | 1768 | selectFilterMenu->insertSeparator(); |
1758 | if ( mView->filterView()->filtersEnabled() ) { | 1769 | if ( mView->filterView()->filtersEnabled() ) { |
1759 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1770 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1760 | } | 1771 | } |
1761 | else { | 1772 | else { |
1762 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1773 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1763 | disable = true; | 1774 | disable = true; |
1764 | } | 1775 | } |
1765 | selectFilterMenu->insertSeparator(); | 1776 | selectFilterMenu->insertSeparator(); |
1766 | QPtrList<CalFilter> fili = mView->filters(); | 1777 | QPtrList<CalFilter> fili = mView->filters(); |
1767 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1778 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1768 | CalFilter *filter = fili.first(); | 1779 | CalFilter *filter = fili.first(); |
1769 | int iii = 2; | 1780 | int iii = 2; |
1770 | while(filter) { | 1781 | while(filter) { |
1771 | selectFilterMenu->insertItem( filter->name(), iii ); | 1782 | selectFilterMenu->insertItem( filter->name(), iii ); |
1772 | if ( filter == curfilter) | 1783 | if ( filter == curfilter) |
1773 | selectFilterMenu->setItemChecked( iii, true ); | 1784 | selectFilterMenu->setItemChecked( iii, true ); |
1774 | if ( disable ) | 1785 | if ( disable ) |
1775 | selectFilterMenu->setItemEnabled( iii, false ); | 1786 | selectFilterMenu->setItemEnabled( iii, false ); |
1776 | filter = fili.next(); | 1787 | filter = fili.next(); |
1777 | ++iii; | 1788 | ++iii; |
1778 | } | 1789 | } |
1779 | } | 1790 | } |
1780 | void MainWindow::selectFilter( int fil ) | 1791 | void MainWindow::selectFilter( int fil ) |
1781 | { | 1792 | { |
1782 | if ( fil == 0 ) { | 1793 | if ( fil == 0 ) { |
1783 | mView->editFilters( ); | 1794 | mView->editFilters( ); |
1784 | } else if ( fil == 1 ){ | 1795 | } else if ( fil == 1 ){ |
1785 | mView->toggleFilerEnabled( ); | 1796 | mView->toggleFilerEnabled( ); |
1786 | } else { | 1797 | } else { |
1787 | mView->selectFilter( fil-2 ); | 1798 | mView->selectFilter( fil-2 ); |
1788 | } | 1799 | } |
1789 | } | 1800 | } |
1790 | void MainWindow::configureToolBar( int item ) | 1801 | void MainWindow::configureToolBar( int item ) |
1791 | { | 1802 | { |
1792 | 1803 | ||
1793 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1804 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1794 | KOPrefs *p = KOPrefs::instance(); | 1805 | KOPrefs *p = KOPrefs::instance(); |
1795 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1806 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1796 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1807 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1797 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1808 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1798 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1809 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1799 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1810 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1800 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1811 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1801 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1812 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1813 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | ||
1802 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1814 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1803 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1815 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1804 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1816 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1805 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1817 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1806 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1818 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1807 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1819 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1808 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1820 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1809 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1821 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1810 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1822 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1811 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1823 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1812 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1824 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1813 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1825 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1814 | // initActions(); | 1826 | // initActions(); |
1815 | } | 1827 | } |
1816 | 1828 | ||
1817 | void MainWindow::setCaptionToDates() | 1829 | void MainWindow::setCaptionToDates() |
1818 | { | 1830 | { |
1819 | QString selDates; | 1831 | QString selDates; |
1820 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1832 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1821 | if (mView->startDate() < mView->endDate() ) | 1833 | if (mView->startDate() < mView->endDate() ) |
1822 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1834 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1823 | else { | 1835 | else { |
1824 | QString addString; | 1836 | QString addString; |
1825 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | 1837 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) |
1826 | addString = i18n("Today"); | 1838 | addString = i18n("Today"); |
1827 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | 1839 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) |
1828 | addString = i18n("Tomorrow"); | 1840 | addString = i18n("Tomorrow"); |
1829 | if ( !addString.isEmpty() ) | 1841 | if ( !addString.isEmpty() ) |
1830 | selDates = addString+", "+selDates ; | 1842 | selDates = addString+", "+selDates ; |
1831 | } | 1843 | } |
1832 | setCaption( i18n("Dates: ") + selDates ); | 1844 | setCaption( i18n("Dates: ") + selDates ); |
1833 | 1845 | ||
1834 | } | 1846 | } |
1835 | void MainWindow::showConfigureAgenda( ) | 1847 | void MainWindow::showConfigureAgenda( ) |
1836 | { | 1848 | { |
1837 | int iii; | 1849 | int iii; |
1838 | for ( iii = 1;iii<= 10 ;++iii ){ | 1850 | for ( iii = 1;iii<= 10 ;++iii ){ |
1839 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1851 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
1840 | } | 1852 | } |
1841 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 1853 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
1842 | } | 1854 | } |
1843 | void MainWindow::configureAgenda( int item ) | 1855 | void MainWindow::configureAgenda( int item ) |
1844 | { | 1856 | { |
1845 | if ( KOPrefs::instance()->mHourSize == item ) | 1857 | if ( KOPrefs::instance()->mHourSize == item ) |
1846 | return; | 1858 | return; |
1847 | KOPrefs::instance()->mHourSize=item; | 1859 | KOPrefs::instance()->mHourSize=item; |
1848 | mView->viewManager()->agendaView()->updateConfig(); | 1860 | mView->viewManager()->agendaView()->updateConfig(); |
1849 | } | 1861 | } |
1850 | 1862 | ||
1851 | void MainWindow::saveCalendar() | 1863 | void MainWindow::saveCalendar() |
1852 | { | 1864 | { |
1853 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1865 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1854 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1866 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1855 | 1867 | ||
1856 | if ( fn == "" ) | 1868 | if ( fn == "" ) |
1857 | return; | 1869 | return; |
1858 | QFileInfo info; | 1870 | QFileInfo info; |
1859 | info.setFile( fn ); | 1871 | info.setFile( fn ); |
1860 | QString mes; | 1872 | QString mes; |
1861 | bool createbup = true; | 1873 | bool createbup = true; |
1862 | if ( info. exists() ) { | 1874 | if ( info. exists() ) { |
1863 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1875 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1864 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1876 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1865 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1877 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1866 | 0, 1 ); | 1878 | 0, 1 ); |
1867 | if ( result != 0 ) { | 1879 | if ( result != 0 ) { |
1868 | createbup = false; | 1880 | createbup = false; |
1869 | } | 1881 | } |
1870 | } | 1882 | } |
1871 | if ( createbup ) { | 1883 | if ( createbup ) { |
1872 | mView->saveCalendar( fn ); | 1884 | mView->saveCalendar( fn ); |
1873 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1885 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1874 | KOPrefs::instance()->mLastSaveFile = fn; | 1886 | KOPrefs::instance()->mLastSaveFile = fn; |
1875 | setCaption(mes); | 1887 | setCaption(mes); |
1876 | } | 1888 | } |
1877 | } | 1889 | } |
1878 | void MainWindow::loadCalendar() | 1890 | void MainWindow::loadCalendar() |
1879 | { | 1891 | { |
1880 | 1892 | ||
1881 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1893 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1882 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1894 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1883 | 1895 | ||
1884 | if ( fn == "" ) | 1896 | if ( fn == "" ) |
1885 | return; | 1897 | return; |
1886 | QFileInfo info; | 1898 | QFileInfo info; |
1887 | info.setFile( fn ); | 1899 | info.setFile( fn ); |
1888 | QString mess; | 1900 | QString mess; |
1889 | bool loadbup = true; | 1901 | bool loadbup = true; |
1890 | if ( info. exists() ) { | 1902 | if ( info. exists() ) { |
1891 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1903 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1892 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1904 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1893 | mess, | 1905 | mess, |
1894 | i18n("Load!"), i18n("Cancel"), 0, | 1906 | i18n("Load!"), i18n("Cancel"), 0, |
1895 | 0, 1 ); | 1907 | 0, 1 ); |
1896 | if ( result != 0 ) { | 1908 | if ( result != 0 ) { |
1897 | loadbup = false; | 1909 | loadbup = false; |
1898 | } | 1910 | } |
1899 | } else { | 1911 | } else { |
1900 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1912 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1901 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1913 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1902 | 0, 1 ); | 1914 | 0, 1 ); |
1903 | 1915 | ||
1904 | return; | 1916 | return; |
1905 | } | 1917 | } |
1906 | if ( loadbup ) { | 1918 | if ( loadbup ) { |
1907 | mView->openCalendar( fn ); | 1919 | mView->openCalendar( fn ); |
1908 | KOPrefs::instance()->mLastLoadFile = fn; | 1920 | KOPrefs::instance()->mLastLoadFile = fn; |
1909 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1921 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1910 | setCaption(mess); | 1922 | setCaption(mess); |
1911 | } | 1923 | } |
1912 | 1924 | ||
1913 | } | 1925 | } |
1914 | void MainWindow::quickImportIcal() | 1926 | void MainWindow::quickImportIcal() |
1915 | { | 1927 | { |
1916 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1928 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1917 | } | 1929 | } |
1918 | void MainWindow::importFile( QString fn, bool quick ) | 1930 | void MainWindow::importFile( QString fn, bool quick ) |
1919 | { | 1931 | { |
1920 | QFileInfo info; | 1932 | QFileInfo info; |
1921 | info.setFile( fn ); | 1933 | info.setFile( fn ); |
1922 | QString mess; | 1934 | QString mess; |
1923 | bool loadbup = true; | 1935 | bool loadbup = true; |
1924 | if ( !info. exists() ) { | 1936 | if ( !info. exists() ) { |
1925 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1937 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1926 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1938 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1927 | mess ); | 1939 | mess ); |
1928 | return; | 1940 | return; |
1929 | } | 1941 | } |
1930 | int result = 0; | 1942 | int result = 0; |
1931 | if ( !quick ) { | 1943 | if ( !quick ) { |
1932 | 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 )); | 1944 | 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 )); |
1933 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1945 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1934 | mess, | 1946 | mess, |
1935 | "Import", "Cancel", 0, | 1947 | "Import", "Cancel", 0, |
1936 | 0, 1 ); | 1948 | 0, 1 ); |
1937 | } | 1949 | } |
1938 | if ( result == 0 ) { | 1950 | if ( result == 0 ) { |
1939 | if ( mView->openCalendar( fn, true )) { | 1951 | if ( mView->openCalendar( fn, true )) { |
1940 | KOPrefs::instance()->mLastImportFile = fn; | 1952 | KOPrefs::instance()->mLastImportFile = fn; |
1941 | setCaption(i18n("Imported file successfully")); | 1953 | setCaption(i18n("Imported file successfully")); |
1942 | } else { | 1954 | } else { |
1943 | setCaption(i18n("Error importing file")); | 1955 | setCaption(i18n("Error importing file")); |
1944 | } | 1956 | } |
1945 | } | 1957 | } |
1946 | } | 1958 | } |
1947 | 1959 | ||
1948 | void MainWindow::importIcal() | 1960 | void MainWindow::importIcal() |
1949 | { | 1961 | { |
1950 | 1962 | ||
1951 | QString fn =KOPrefs::instance()->mLastImportFile; | 1963 | QString fn =KOPrefs::instance()->mLastImportFile; |
1952 | 1964 | ||
1953 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 1965 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
1954 | if ( fn == "" ) | 1966 | if ( fn == "" ) |
1955 | return; | 1967 | return; |
1956 | importFile( fn, true ); | 1968 | importFile( fn, true ); |
1957 | 1969 | ||
1958 | } | 1970 | } |
1959 | 1971 | ||
1960 | void MainWindow::exportVCalendar() | 1972 | void MainWindow::exportVCalendar() |
1961 | { | 1973 | { |
1962 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1974 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1963 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1975 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1964 | if ( fn == "" ) | 1976 | if ( fn == "" ) |
1965 | return; | 1977 | return; |
1966 | QFileInfo info; | 1978 | QFileInfo info; |
1967 | info.setFile( fn ); | 1979 | info.setFile( fn ); |
1968 | QString mes; | 1980 | QString mes; |
1969 | bool createbup = true; | 1981 | bool createbup = true; |
1970 | if ( info. exists() ) { | 1982 | if ( info. exists() ) { |
1971 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1983 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1972 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1984 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1973 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1985 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1974 | 0, 1 ); | 1986 | 0, 1 ); |
1975 | if ( result != 0 ) { | 1987 | if ( result != 0 ) { |
1976 | createbup = false; | 1988 | createbup = false; |
1977 | } | 1989 | } |
1978 | } | 1990 | } |
1979 | if ( createbup ) { | 1991 | if ( createbup ) { |
1980 | if ( mView->exportVCalendar( fn ) ) { | 1992 | if ( mView->exportVCalendar( fn ) ) { |
1981 | KOPrefs::instance()->mLastVcalFile = fn; | 1993 | KOPrefs::instance()->mLastVcalFile = fn; |
1982 | if ( fn.length() > 20 ) | 1994 | if ( fn.length() > 20 ) |
1983 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1995 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1984 | else | 1996 | else |
1985 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1997 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1986 | setCaption(mes); | 1998 | setCaption(mes); |
1987 | } | 1999 | } |
1988 | } | 2000 | } |
1989 | 2001 | ||
1990 | } | 2002 | } |
1991 | QString MainWindow::sentSyncFile() | 2003 | QString MainWindow::sentSyncFile() |
1992 | { | 2004 | { |
1993 | #ifdef DESKTOP_VERSION | 2005 | #ifdef DESKTOP_VERSION |
1994 | return locateLocal( "tmp", "copysynccal.ics" ); | 2006 | return locateLocal( "tmp", "copysynccal.ics" ); |
1995 | #else | 2007 | #else |
1996 | return QString( "/tmp/copysynccal.ics" ); | 2008 | return QString( "/tmp/copysynccal.ics" ); |
1997 | #endif | 2009 | #endif |
1998 | } | 2010 | } |
1999 | 2011 | ||
2000 | void MainWindow::syncFileRequest() | 2012 | void MainWindow::syncFileRequest() |
2001 | { | 2013 | { |
2002 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2014 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2003 | mSyncManager->slotSyncMenu( 999 ); | 2015 | mSyncManager->slotSyncMenu( 999 ); |
2004 | } | 2016 | } |
2005 | 2017 | ||
2006 | setCaption(i18n("Saving Data to temp file ..." )); | 2018 | setCaption(i18n("Saving Data to temp file ..." )); |
2007 | mView->saveCalendar( sentSyncFile() ); | 2019 | mView->saveCalendar( sentSyncFile() ); |
2008 | setCaption(i18n("Data saved to temp file!" )); | 2020 | setCaption(i18n("Data saved to temp file!" )); |
2009 | 2021 | ||
2010 | } | 2022 | } |
2011 | void MainWindow::getFile( bool success ) | 2023 | void MainWindow::getFile( bool success ) |
2012 | { | 2024 | { |
2013 | if ( ! success ) { | 2025 | if ( ! success ) { |
2014 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2026 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2015 | return; | 2027 | return; |
2016 | } | 2028 | } |
2017 | mView->openCalendar( sentSyncFile() ); | 2029 | mView->openCalendar( sentSyncFile() ); |
2018 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2030 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2019 | mSyncManager->slotSyncMenu( 999 ); | 2031 | mSyncManager->slotSyncMenu( 999 ); |
2020 | } | 2032 | } |
2021 | setCaption( i18n("Pi-Sync successful!") ); | 2033 | setCaption( i18n("Pi-Sync successful!") ); |
2022 | } | 2034 | } |
2023 | 2035 | ||
2024 | void MainWindow::printSel( ) | 2036 | void MainWindow::printSel( ) |
2025 | { | 2037 | { |
2026 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2038 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2027 | } | 2039 | } |
2028 | 2040 | ||
2029 | void MainWindow::printCal() | 2041 | void MainWindow::printCal() |
2030 | { | 2042 | { |
2031 | mView->print();//mCp->showDialog(); | 2043 | mView->print();//mCp->showDialog(); |
2032 | } | 2044 | } |
2033 | 2045 | ||
2034 | 2046 | ||
2035 | #include "libkdepim/kdatepicker.h" | 2047 | #include "libkdepim/kdatepicker.h" |
2036 | #include <kdatetbl.h> | 2048 | #include <kdatetbl.h> |
2037 | void MainWindow::weekAction() | 2049 | void MainWindow::weekAction() |
2038 | { | 2050 | { |
2039 | int month; | 2051 | int month; |
2040 | KPopupFrame* popup = new KPopupFrame(this); | 2052 | KPopupFrame* popup = new KPopupFrame(this); |
2041 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2053 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2042 | // ----- | 2054 | // ----- |
2043 | picker->resize(picker->sizeHint()); | 2055 | picker->resize(picker->sizeHint()); |
2044 | popup->setMainWidget(picker); | 2056 | popup->setMainWidget(picker); |
2045 | picker->setFocus(); | 2057 | picker->setFocus(); |
2046 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2058 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2047 | int x = 0; | 2059 | int x = 0; |
2048 | int y = iconToolBar->height(); | 2060 | int y = iconToolBar->height(); |
2049 | int dX = 0; | 2061 | int dX = 0; |
2050 | int dY = 0; | 2062 | int dY = 0; |
2051 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2063 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2052 | if ( iconToolBar->y() > height()/2 ) { | 2064 | if ( iconToolBar->y() > height()/2 ) { |
2053 | dY = picker->sizeHint().height()+8; | 2065 | dY = picker->sizeHint().height()+8; |
2054 | y = 0; | 2066 | y = 0; |
2055 | } | 2067 | } |
2056 | } else { | 2068 | } else { |
2057 | if ( iconToolBar->x() > width()/2 ) { // right side | 2069 | if ( iconToolBar->x() > width()/2 ) { // right side |
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index b591232..934e153 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -1,200 +1,222 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2003 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 | 24 | ||
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qframe.h> | 29 | #include <qframe.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qpopupmenu.h> | 31 | #include <qpopupmenu.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | 33 | ||
34 | #include <kdebug.h> | 34 | #include <kdebug.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kglobal.h> | 36 | #include <kglobal.h> |
37 | #include <kiconloader.h> | 37 | #include <kiconloader.h> |
38 | #include "libkdepim/kdatepicker.h" | 38 | #include "libkdepim/kdatepicker.h" |
39 | #include <knotifyclient.h> | 39 | #include <knotifyclient.h> |
40 | #include "kdatetbl.h" | 40 | #include "kdatetbl.h" |
41 | 41 | ||
42 | #include "koglobals.h" | 42 | #include "koglobals.h" |
43 | #include <kglobalsettings.h> | 43 | #include <kglobalsettings.h> |
44 | #include "koprefs.h" | 44 | #include "koprefs.h" |
45 | #ifndef KORG_NOPLUGINS | 45 | #ifndef KORG_NOPLUGINS |
46 | #include "kocore.h" | 46 | #include "kocore.h" |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #include <kcalendarsystem.h> | 49 | #include <kcalendarsystem.h> |
50 | 50 | ||
51 | #include "navigatorbar.h" | 51 | #include "navigatorbar.h" |
52 | 52 | ||
53 | NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) | 53 | NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) |
54 | : QWidget( parent, name ) | 54 | : QWidget( parent, name ) |
55 | { | 55 | { |
56 | QBoxLayout *topLayout = new QHBoxLayout( this ); | 56 | QBoxLayout *topLayout = new QHBoxLayout( this ); |
57 | 57 | ||
58 | // Set up the control buttons and date label | 58 | // Set up the control buttons and date label |
59 | mCtrlFrame = new QFrame( this ); | 59 | mCtrlFrame = new QFrame( this ); |
60 | mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); | 60 | mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); |
61 | mCtrlFrame->setLineWidth(1); | 61 | mCtrlFrame->setLineWidth(1); |
62 | 62 | ||
63 | topLayout->addWidget( mCtrlFrame ); | 63 | topLayout->addWidget( mCtrlFrame ); |
64 | 64 | ||
65 | QFont tfont = font(); | 65 | QFont tfont = font(); |
66 | if ( QApplication::desktop()->width() >= 480 ) | 66 | if ( QApplication::desktop()->width() >= 480 ) |
67 | tfont.setPointSize(tfont.pointSize()+2); | 67 | tfont.setPointSize(tfont.pointSize()+2); |
68 | tfont.setBold(true); | 68 | tfont.setBold(true); |
69 | 69 | ||
70 | bool isRTL = KOGlobals::self()->reverseLayout(); | 70 | bool isRTL = KOGlobals::self()->reverseLayout(); |
71 | #ifndef DESKTOP_VERSION | 71 | #ifndef DESKTOP_VERSION |
72 | bool isDesktop = false; | 72 | bool isDesktop = false; |
73 | #else | 73 | #else |
74 | bool isDesktop = true; | 74 | bool isDesktop = true; |
75 | #endif | 75 | #endif |
76 | if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) | 76 | if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) |
77 | isDesktop = true; | 77 | isDesktop = true; |
78 | // Create backward navigation buttons | 78 | // Create backward navigation buttons |
79 | mPrevYear = new QPushButton( mCtrlFrame ); | 79 | mPrevYear = new QPushButton( mCtrlFrame ); |
80 | mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); | 80 | mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); |
81 | QToolTip::add( mPrevYear, i18n("Previous Year") ); | 81 | QToolTip::add( mPrevYear, i18n("Previous Year") ); |
82 | 82 | ||
83 | mPrevMonth = new QPushButton( mCtrlFrame ); | 83 | mPrevMonth = new QPushButton( mCtrlFrame ); |
84 | mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); | 84 | mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); |
85 | QToolTip::add( mPrevMonth, i18n("Previous Month") ); | 85 | QToolTip::add( mPrevMonth, i18n("Previous Month") ); |
86 | 86 | ||
87 | // Create forward navigation buttons | 87 | // Create forward navigation buttons |
88 | mNextMonth = new QPushButton( mCtrlFrame ); | 88 | mNextMonth = new QPushButton( mCtrlFrame ); |
89 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); | 89 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); |
90 | QToolTip::add( mNextMonth, i18n("Next Month") ); | 90 | QToolTip::add( mNextMonth, i18n("Next Month") ); |
91 | 91 | ||
92 | mPrevWeek = new QPushButton( mCtrlFrame ); | ||
93 | mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); | ||
94 | QToolTip::add( mPrevWeek, i18n("Previous Week") ); | ||
95 | |||
96 | // Create forward navigation buttons | ||
97 | mNextWeek = new QPushButton( mCtrlFrame ); | ||
98 | mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); | ||
99 | QToolTip::add( mNextWeek, i18n("Next Week") ); | ||
100 | |||
92 | mNextYear = new QPushButton( mCtrlFrame ); | 101 | mNextYear = new QPushButton( mCtrlFrame ); |
93 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); | 102 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); |
94 | QToolTip::add( mNextYear, i18n("Next Year") ); | 103 | QToolTip::add( mNextYear, i18n("Next Year") ); |
95 | mSelectMonth = new QPushButton( mCtrlFrame ); | 104 | mSelectMonth = new QPushButton( mCtrlFrame ); |
96 | // Create month name label | 105 | // Create month name label |
97 | //selectMonth->setFont( tfont ); | 106 | //selectMonth->setFont( tfont ); |
98 | // selectMonth->setAlignment( AlignCenter ); | 107 | // selectMonth->setAlignment( AlignCenter ); |
99 | //mDateLabel = new QLabel( selectMonth ); | 108 | //mDateLabel = new QLabel( selectMonth ); |
100 | //mDateLabel->setFont( tfont ); | 109 | //mDateLabel->setFont( tfont ); |
101 | //mDateLabel->setAlignment( AlignCenter ); | 110 | //mDateLabel->setAlignment( AlignCenter ); |
102 | if ( QString ( name ) == QString("useBigPixmaps") ) { | 111 | if ( QString ( name ) == QString("useBigPixmaps") ) { |
103 | mNextMonth->setFlat( true); | 112 | mNextMonth->setFlat( true); |
113 | mNextWeek->setFlat( true); | ||
104 | mNextYear->setFlat( true); | 114 | mNextYear->setFlat( true); |
105 | mSelectMonth->setFlat( true); | 115 | mSelectMonth->setFlat( true); |
106 | mPrevYear->setFlat( true); | 116 | mPrevYear->setFlat( true); |
107 | mPrevMonth->setFlat( true); | 117 | mPrevMonth->setFlat( true); |
118 | mPrevWeek->setFlat( true); | ||
119 | } else { | ||
120 | mPrevWeek->hide(); | ||
121 | mNextWeek->hide(); | ||
108 | } | 122 | } |
109 | mSelectMonth->setFont( tfont ); | 123 | mSelectMonth->setFont( tfont ); |
110 | // Set minimum width to width of widest month name label | 124 | // Set minimum width to width of widest month name label |
111 | int i; | 125 | int i; |
112 | int maxwidth = 0; | 126 | int maxwidth = 0; |
113 | QFontMetrics fm ( mSelectMonth->font() ); | 127 | QFontMetrics fm ( mSelectMonth->font() ); |
114 | int width = fm.width("September '00" ); | 128 | int width = fm.width("September '00" ); |
115 | // for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); | 129 | // for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); |
116 | // ++i ) { | 130 | // ++i ) { |
117 | // //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i, | 131 | // //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i, |
118 | // // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" ); | 132 | // // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" ); |
119 | // int width = fm.width("September 2000" ); | 133 | // int width = fm.width("September 2000" ); |
120 | // if ( width > maxwidth ) maxwidth = width; | 134 | // if ( width > maxwidth ) maxwidth = width; |
121 | // } | 135 | // } |
122 | maxwidth = width+2; | 136 | maxwidth = width+2; |
123 | int size = fm.height()+2; | 137 | int size = fm.height()+2; |
124 | if ( QApplication::desktop()->width() >= 480 ) { | 138 | if ( QApplication::desktop()->width() >= 480 ) { |
125 | size += 6; | 139 | size += 6; |
126 | maxwidth+= 6; | 140 | maxwidth+= 6; |
127 | } | 141 | } |
128 | 142 | ||
129 | mSelectMonth->setFixedWidth( maxwidth ); | 143 | mSelectMonth->setFixedWidth( maxwidth ); |
130 | mSelectMonth->setFixedHeight( size ); | 144 | mSelectMonth->setFixedHeight( size ); |
131 | mPrevYear->setFixedHeight( size ); | 145 | mPrevYear->setFixedHeight( size ); |
132 | mPrevMonth->setFixedHeight( size ); | 146 | mPrevMonth->setFixedHeight( size ); |
133 | mNextMonth->setFixedHeight( size ); | 147 | mPrevWeek->setFixedHeight( size ); |
148 | mNextMonth->setFixedHeight( size ); | ||
149 | mNextWeek->setFixedHeight( size ); | ||
134 | mNextYear->setFixedHeight ( size ); | 150 | mNextYear->setFixedHeight ( size ); |
135 | // set up control frame layout | 151 | // set up control frame layout |
136 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); | 152 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); |
137 | ctrlLayout->addWidget( mPrevYear, 3 ); | 153 | ctrlLayout->addWidget( mPrevYear, 3 ); |
138 | ctrlLayout->addWidget( mPrevMonth, 3 ); | 154 | ctrlLayout->addWidget( mPrevMonth, 3 ); |
155 | ctrlLayout->addWidget( mPrevWeek, 3 ); | ||
139 | //ctrlLayout->addStretch( 1 ); | 156 | //ctrlLayout->addStretch( 1 ); |
140 | // ctrlLayout->addSpacing( 1 ); | 157 | // ctrlLayout->addSpacing( 1 ); |
141 | // ctrlLayout->addWidget( mDateLabel ); | 158 | // ctrlLayout->addWidget( mDateLabel ); |
142 | ctrlLayout->addWidget( mSelectMonth ); | 159 | ctrlLayout->addWidget( mSelectMonth ); |
143 | // ctrlLayout->addSpacing( 1 ); | 160 | // ctrlLayout->addSpacing( 1 ); |
144 | // ctrlLayout->addStretch( 1 ); | 161 | // ctrlLayout->addStretch( 1 ); |
162 | ctrlLayout->addWidget( mNextWeek, 3 ); | ||
145 | ctrlLayout->addWidget( mNextMonth, 3 ); | 163 | ctrlLayout->addWidget( mNextMonth, 3 ); |
146 | ctrlLayout->addWidget( mNextYear, 3 ); | 164 | ctrlLayout->addWidget( mNextYear, 3 ); |
147 | 165 | ||
148 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 166 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
149 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 167 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
150 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 168 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
169 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); | ||
170 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); | ||
151 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 171 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
152 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 172 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
153 | mPrevYear->setFocusPolicy(NoFocus); | 173 | mPrevYear->setFocusPolicy(NoFocus); |
154 | mPrevMonth->setFocusPolicy(NoFocus); | 174 | mPrevMonth->setFocusPolicy(NoFocus); |
155 | mNextMonth->setFocusPolicy(NoFocus); | 175 | mNextMonth->setFocusPolicy(NoFocus); |
176 | mPrevWeek->setFocusPolicy(NoFocus); | ||
177 | mNextWeek->setFocusPolicy(NoFocus); | ||
156 | mNextYear->setFocusPolicy(NoFocus); | 178 | mNextYear->setFocusPolicy(NoFocus); |
157 | mSelectMonth->setFocusPolicy(NoFocus); | 179 | mSelectMonth->setFocusPolicy(NoFocus); |
158 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 180 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
159 | 181 | ||
160 | } | 182 | } |
161 | 183 | ||
162 | NavigatorBar::~NavigatorBar() | 184 | NavigatorBar::~NavigatorBar() |
163 | { | 185 | { |
164 | } | 186 | } |
165 | 187 | ||
166 | void NavigatorBar::selectMonth() | 188 | void NavigatorBar::selectMonth() |
167 | { | 189 | { |
168 | 190 | ||
169 | int month; | 191 | int month; |
170 | KPopupFrame* popup = new KPopupFrame(this); | 192 | KPopupFrame* popup = new KPopupFrame(this); |
171 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); | 193 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); |
172 | // ----- | 194 | // ----- |
173 | picker->resize(picker->sizeHint()); | 195 | picker->resize(picker->sizeHint()); |
174 | popup->setMainWidget(picker); | 196 | popup->setMainWidget(picker); |
175 | picker->setFocus(); | 197 | picker->setFocus(); |
176 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 198 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
177 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) | 199 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) |
178 | { | 200 | { |
179 | month = picker->getResult(); | 201 | month = picker->getResult(); |
180 | emit monthSelected ( month ); | 202 | emit monthSelected ( month ); |
181 | } else { | 203 | } else { |
182 | KNotifyClient::beep(); | 204 | KNotifyClient::beep(); |
183 | } | 205 | } |
184 | delete popup; | 206 | delete popup; |
185 | } | 207 | } |
186 | void NavigatorBar::selectDates( const KCal::DateList &dateList ) | 208 | void NavigatorBar::selectDates( const KCal::DateList &dateList ) |
187 | { | 209 | { |
188 | if (dateList.count() > 0) { | 210 | if (dateList.count() > 0) { |
189 | QDate date = dateList.first(); | 211 | QDate date = dateList.first(); |
190 | 212 | ||
191 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); | 213 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); |
192 | 214 | ||
193 | // compute the label at the top of the navigator | 215 | // compute the label at the top of the navigator |
194 | QString dtstr = i18n(calSys->monthName( date )) + " '" + | 216 | QString dtstr = i18n(calSys->monthName( date )) + " '" + |
195 | QString::number( calSys->year( date ) ).right(2); | 217 | QString::number( calSys->year( date ) ).right(2); |
196 | 218 | ||
197 | mSelectMonth->setText( dtstr ); | 219 | mSelectMonth->setText( dtstr ); |
198 | } | 220 | } |
199 | } | 221 | } |
200 | 222 | ||
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 93240a6..803c817 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h | |||
@@ -1,65 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2003 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 NAVIGATORBAR_H | 24 | #ifndef NAVIGATORBAR_H |
25 | #define NAVIGATORBAR_H | 25 | #define NAVIGATORBAR_H |
26 | 26 | ||
27 | #include <libkcal/incidencebase.h> | 27 | #include <libkcal/incidencebase.h> |
28 | 28 | ||
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | 30 | ||
31 | class QPushButton; | 31 | class QPushButton; |
32 | class QFrame; | 32 | class QFrame; |
33 | class QLabel; | 33 | class QLabel; |
34 | 34 | ||
35 | class NavigatorBar: public QWidget | 35 | class NavigatorBar: public QWidget |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); | 39 | NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); |
40 | ~NavigatorBar(); | 40 | ~NavigatorBar(); |
41 | 41 | ||
42 | public slots: | 42 | public slots: |
43 | void selectDates( const KCal::DateList & ); | 43 | void selectDates( const KCal::DateList & ); |
44 | void selectMonth(); | 44 | void selectMonth(); |
45 | 45 | ||
46 | signals: | 46 | signals: |
47 | void goNextMonth(); | 47 | void goNextMonth(); |
48 | void goPrevMonth(); | 48 | void goPrevMonth(); |
49 | void goNextWeek(); | ||
50 | void goPrevWeek(); | ||
49 | void goNextYear(); | 51 | void goNextYear(); |
50 | void goPrevYear(); | 52 | void goPrevYear(); |
51 | void monthSelected( int ); | 53 | void monthSelected( int ); |
52 | 54 | ||
53 | private: | 55 | private: |
54 | QFrame *mCtrlFrame; | 56 | QFrame *mCtrlFrame; |
55 | 57 | ||
56 | QPushButton *mPrevYear; | 58 | QPushButton *mPrevYear; |
57 | QPushButton *mPrevMonth; | 59 | QPushButton *mPrevMonth; |
58 | QPushButton *mNextMonth; | 60 | QPushButton *mNextMonth; |
61 | QPushButton *mPrevWeek; | ||
62 | QPushButton *mNextWeek; | ||
59 | QPushButton *mNextYear; | 63 | QPushButton *mNextYear; |
60 | QPushButton *mSelectMonth; | 64 | QPushButton *mSelectMonth; |
61 | 65 | ||
62 | //QLabel *mDateLabel; | 66 | //QLabel *mDateLabel; |
63 | }; | 67 | }; |
64 | 68 | ||
65 | #endif | 69 | #endif |