-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | desktop/rpm/kdepim_rpm | 2 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 10 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 35 | ||||
-rw-r--r-- | version | 2 |
5 files changed, 17 insertions, 37 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index beeaf60..05c1afd 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,258 +1,263 @@ | |||
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.12 ************ | ||
4 | |||
5 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. | ||
6 | |||
7 | |||
3 | ********** VERSION 2.0.11 ************ | 8 | ********** VERSION 2.0.11 ************ |
4 | 9 | ||
5 | Fixed some problems in pi-sync mode | 10 | Fixed some problems in pi-sync mode |
6 | (e.g. details of events were not synced properly) | 11 | (e.g. details of events were not synced properly) |
7 | 12 | ||
8 | ********** VERSION 2.0.10 ************ | 13 | ********** VERSION 2.0.10 ************ |
9 | 14 | ||
10 | KO/Pi: | 15 | KO/Pi: |
11 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. | 16 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. |
12 | This is fixed. | 17 | This is fixed. |
13 | Changed the search dialog a bit to make it more user friendly. | 18 | Changed the search dialog a bit to make it more user friendly. |
14 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). | 19 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). |
15 | 20 | ||
16 | Added config option to hide the week number in KO/Pi toolbar. | 21 | Added config option to hide the week number in KO/Pi toolbar. |
17 | 22 | ||
18 | ********** VERSION 2.0.9 ************ | 23 | ********** VERSION 2.0.9 ************ |
19 | 24 | ||
20 | Made month view icons for multiday events a bit nicer. | 25 | Made month view icons for multiday events a bit nicer. |
21 | Some minor fixes in KO/Pi | 26 | Some minor fixes in KO/Pi |
22 | (e.g. go to today did not work for new week view properly). | 27 | (e.g. go to today did not work for new week view properly). |
23 | 28 | ||
24 | 29 | ||
25 | ********** VERSION 2.0.8 ************ | 30 | ********** VERSION 2.0.8 ************ |
26 | 31 | ||
27 | Fixed a problem in dependency info in the ipk files for the Zaurus. | 32 | Fixed a problem in dependency info in the ipk files for the Zaurus. |
28 | 33 | ||
29 | 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. | 34 | 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. |
30 | 35 | ||
31 | Added a "go today" button to the datepicker. | 36 | Added a "go today" button to the datepicker. |
32 | 37 | ||
33 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) | 38 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) |
34 | and made it configureable to show these values. | 39 | and made it configureable to show these values. |
35 | 40 | ||
36 | Fixed a problem for events (from external iCal files) that do have a duration but no end date. | 41 | Fixed a problem for events (from external iCal files) that do have a duration but no end date. |
37 | 42 | ||
38 | 43 | ||
39 | ********** VERSION 2.0.7 ************ | 44 | ********** VERSION 2.0.7 ************ |
40 | 45 | ||
41 | Added global application font settings | 46 | Added global application font settings |
42 | (for all KDE-Pim/Pi apps) to the general settings. | 47 | (for all KDE-Pim/Pi apps) to the general settings. |
43 | 48 | ||
44 | Fixed a problem in OM/Pi when trying to login to some IMAP servers | 49 | Fixed a problem in OM/Pi when trying to login to some IMAP servers |
45 | (like the IMAP server of Apple: mail.mac.com ) | 50 | (like the IMAP server of Apple: mail.mac.com ) |
46 | 51 | ||
47 | Added recurring todos to KO/Pi. | 52 | Added recurring todos to KO/Pi. |
48 | 53 | ||
49 | 54 | ||
50 | ********** VERSION 2.0.6 ************ | 55 | ********** VERSION 2.0.6 ************ |
51 | 56 | ||
52 | Some bugfixes in the pi-sync mode. | 57 | Some bugfixes in the pi-sync mode. |
53 | Added German translation for pi-sync mode. | 58 | Added German translation for pi-sync mode. |
54 | 59 | ||
55 | KO/Pi: | 60 | KO/Pi: |
56 | Made the todolist using alternate background. | 61 | Made the todolist using alternate background. |
57 | 62 | ||
58 | Other minor fixes in KO/Pi. | 63 | Other minor fixes in KO/Pi. |
59 | 64 | ||
60 | 65 | ||
61 | ********** VERSION 2.0.5 ************ | 66 | ********** VERSION 2.0.5 ************ |
62 | 67 | ||
63 | Bugfixes in KO/Pi. | 68 | Bugfixes in KO/Pi. |
64 | 69 | ||
65 | ********** VERSION 2.0.4 ************ | 70 | ********** VERSION 2.0.4 ************ |
66 | 71 | ||
67 | KO/Pi: | 72 | KO/Pi: |
68 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. | 73 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. |
69 | 74 | ||
70 | Added a general "select week number" to the toolbar. | 75 | Added a general "select week number" to the toolbar. |
71 | 76 | ||
72 | Fixed some small problem of the new features introduced in version 2.0.3. | 77 | Fixed some small problem of the new features introduced in version 2.0.3. |
73 | 78 | ||
74 | Made it possible to specify one specific category as category color, | 79 | Made it possible to specify one specific category as category color, |
75 | if more than one categories are selected. | 80 | if more than one categories are selected. |
76 | 81 | ||
77 | Fixed a bug in saving colors for categories with non-ascii characters. | 82 | Fixed a bug in saving colors for categories with non-ascii characters. |
78 | (Like, e.g. German Umlauts). | 83 | (Like, e.g. German Umlauts). |
79 | Propably you have to set your colors again for those categories. | 84 | Propably you have to set your colors again for those categories. |
80 | 85 | ||
81 | 86 | ||
82 | ********** VERSION 2.0.3 ************ | 87 | ********** VERSION 2.0.3 ************ |
83 | 88 | ||
84 | KO/Pi: | 89 | KO/Pi: |
85 | Added feature for changing alarm settings for many items at once: | 90 | Added feature for changing alarm settings for many items at once: |
86 | Open list view (or search dialog), select the desired items and choose in | 91 | Open list view (or search dialog), select the desired items and choose in |
87 | the popup menu: Set alarm for selected... | 92 | the popup menu: Set alarm for selected... |
88 | 93 | ||
89 | Added to the event/todo viewer the option to send an email to | 94 | Added to the event/todo viewer the option to send an email to |
90 | all attendees or all selected (with RSVP) attendees. | 95 | all attendees or all selected (with RSVP) attendees. |
91 | 96 | ||
92 | Made the week-month mode changing in month view faster. | 97 | Made the week-month mode changing in month view faster. |
93 | 98 | ||
94 | Made month view better useable with keyboard. | 99 | Made month view better useable with keyboard. |
95 | Now TAB key jumps to next cell with an event/todo. | 100 | Now TAB key jumps to next cell with an event/todo. |
96 | Scroll in cell with coursor keys, scroll in time (next week) with | 101 | Scroll in cell with coursor keys, scroll in time (next week) with |
97 | Shift/Control + coursorkeys. | 102 | Shift/Control + coursorkeys. |
98 | 103 | ||
99 | Fixed bug that the todo view flat mode was reset after first view update. | 104 | Fixed bug that the todo view flat mode was reset after first view update. |
100 | 105 | ||
101 | If a todo is displayed closed in the todo view, | 106 | If a todo is displayed closed in the todo view, |
102 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. | 107 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. |
103 | 108 | ||
104 | Added info about the numbers of years to the caption (title) information about a birthday event. | 109 | Added info about the numbers of years to the caption (title) information about a birthday event. |
105 | 110 | ||
106 | Made completion date in todo editor editable. | 111 | Made completion date in todo editor editable. |
107 | 112 | ||
108 | Added possibility to save/load templates for journals. | 113 | Added possibility to save/load templates for journals. |
109 | (Which is just a simple "save text to file" or "insert text from file". | 114 | (Which is just a simple "save text to file" or "insert text from file". |
110 | 115 | ||
111 | ********** VERSION 2.0.2 ************ | 116 | ********** VERSION 2.0.2 ************ |
112 | 117 | ||
113 | KO/Pi: | 118 | KO/Pi: |
114 | Fixed the layout problem of the day label buttons | 119 | Fixed the layout problem of the day label buttons |
115 | of the agenda view introduced in version 2.0.1. | 120 | of the agenda view introduced in version 2.0.1. |
116 | 121 | ||
117 | Added WhatsThis support for the todo view and the list view. | 122 | Added WhatsThis support for the todo view and the list view. |
118 | 123 | ||
119 | Added a quite useful feature to the montview. | 124 | Added a quite useful feature to the montview. |
120 | Just click on the week numbers on the left. | 125 | Just click on the week numbers on the left. |
121 | And in the top right corner of month view/agenda view | 126 | And in the top right corner of month view/agenda view |
122 | there is now a "week number quick selector". | 127 | there is now a "week number quick selector". |
123 | (Click on the black triangle). | 128 | (Click on the black triangle). |
124 | 129 | ||
125 | Made the quite difficult timezone change in KO/Pi easy. | 130 | Made the quite difficult timezone change in KO/Pi easy. |
126 | 131 | ||
127 | OM/Pi: | 132 | OM/Pi: |
128 | Fixed too small icons on desktop. | 133 | Fixed too small icons on desktop. |
129 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 134 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
130 | Added signature file setting to smtp account config. | 135 | Added signature file setting to smtp account config. |
131 | And the signature can be edited and saved in the edit mail dialog. | 136 | And the signature can be edited and saved in the edit mail dialog. |
132 | That does mean: | 137 | That does mean: |
133 | Simply edit the signature for the selected smtp account in the | 138 | Simply edit the signature for the selected smtp account in the |
134 | edit new mail dialog and press the "save signature" button there. | 139 | edit new mail dialog and press the "save signature" button there. |
135 | Then the signature is saved to the file specified in the smtp account settings. | 140 | Then the signature is saved to the file specified in the smtp account settings. |
136 | If there is no file specified, it is saved automatically to the file | 141 | If there is no file specified, it is saved automatically to the file |
137 | kdepim/apps/kopiemail/<accountname>.sig. | 142 | kdepim/apps/kopiemail/<accountname>.sig. |
138 | 143 | ||
139 | 144 | ||
140 | 145 | ||
141 | ********** VERSION 2.0.1 ************ | 146 | ********** VERSION 2.0.1 ************ |
142 | 147 | ||
143 | Oooops ... I forgot to test on the Zaurus 5500 ... | 148 | Oooops ... I forgot to test on the Zaurus 5500 ... |
144 | 149 | ||
145 | Fixed many problems of new (english) strings (and german translations) | 150 | Fixed many problems of new (english) strings (and german translations) |
146 | introduced in the latest versions, where the text was not fitting on the | 151 | introduced in the latest versions, where the text was not fitting on the |
147 | 240x320 display of the Zaurus 5500. | 152 | 240x320 display of the Zaurus 5500. |
148 | 153 | ||
149 | KO/Pi: | 154 | KO/Pi: |
150 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 155 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
151 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 156 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
152 | 157 | ||
153 | Added items to the todolist popup menu for: | 158 | Added items to the todolist popup menu for: |
154 | Display all opened, all closed or all todos flat. | 159 | Display all opened, all closed or all todos flat. |
155 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 160 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
156 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 161 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
157 | Fixed several bugs in setting the completed datetime for todos. | 162 | Fixed several bugs in setting the completed datetime for todos. |
158 | Added info about completed datetime of todos to the todo viewer. | 163 | Added info about completed datetime of todos to the todo viewer. |
159 | Now displaying a completed todo (with completed datetime set) in the agenda view | 164 | Now displaying a completed todo (with completed datetime set) in the agenda view |
160 | at the time of the completion. Such that now it is possible to see in the agenda view | 165 | at the time of the completion. Such that now it is possible to see in the agenda view |
161 | when what todo was completed. | 166 | when what todo was completed. |
162 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 167 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
163 | Now the behaviour is: | 168 | Now the behaviour is: |
164 | Setting a parent to complete sets all (sub)childs to complete. | 169 | Setting a parent to complete sets all (sub)childs to complete. |
165 | Setting a parent to uncomplete does not change the childs. | 170 | Setting a parent to uncomplete does not change the childs. |
166 | Setting a child to uncomplete sets all parent to uncomplete. | 171 | Setting a child to uncomplete sets all parent to uncomplete. |
167 | Setting a child to complete does not change the parents. | 172 | Setting a child to complete does not change the parents. |
168 | 173 | ||
169 | Smart updating and double buffering of the daymatrix. | 174 | Smart updating and double buffering of the daymatrix. |
170 | Showing holidays in the day matrix. | 175 | Showing holidays in the day matrix. |
171 | Many other small performance updates. | 176 | Many other small performance updates. |
172 | 177 | ||
173 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 178 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
174 | 179 | ||
175 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 180 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
176 | 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. | 181 | 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. |
177 | 182 | ||
178 | 183 | ||
179 | ********** VERSION 2.0.0 ************ | 184 | ********** VERSION 2.0.0 ************ |
180 | 185 | ||
181 | Stable release 2.0.0! | 186 | Stable release 2.0.0! |
182 | 187 | ||
183 | KO/Pi: | 188 | KO/Pi: |
184 | Fixed problem in edit dialog recreation at startup. | 189 | Fixed problem in edit dialog recreation at startup. |
185 | Made "toggle view*" menu items enabled context sensitive. | 190 | Made "toggle view*" menu items enabled context sensitive. |
186 | Changed agenda size menu to items 1-10. | 191 | Changed agenda size menu to items 1-10. |
187 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 192 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
188 | Usebility enhancements in the KO/Pi menus. | 193 | Usebility enhancements in the KO/Pi menus. |
189 | Birthday import now adds year to summary. | 194 | Birthday import now adds year to summary. |
190 | What's Next view shows age in years for birthday. | 195 | What's Next view shows age in years for birthday. |
191 | 196 | ||
192 | OM/Pi: | 197 | OM/Pi: |
193 | Added three info lines to display subject, from and to of selected mails. | 198 | Added three info lines to display subject, from and to of selected mails. |
194 | 199 | ||
195 | KA/Pi: | 200 | KA/Pi: |
196 | Fixed jump bar behaviour on Zaurus. | 201 | Fixed jump bar behaviour on Zaurus. |
197 | Now KA/Pi search field supports searching for a range of starting characters. | 202 | Now KA/Pi search field supports searching for a range of starting characters. |
198 | E.g. to search for all contact beginning with b to n, type | 203 | E.g. to search for all contact beginning with b to n, type |
199 | b-n | 204 | b-n |
200 | in the search field. | 205 | in the search field. |
201 | 206 | ||
202 | ********** VERSION 1.9.20 ************ | 207 | ********** VERSION 1.9.20 ************ |
203 | 208 | ||
204 | KO/Pi: | 209 | KO/Pi: |
205 | Added for the "dislplay one day" agenda mode | 210 | Added for the "dislplay one day" agenda mode |
206 | info in the caption and in the day lables: | 211 | info in the caption and in the day lables: |
207 | Now it is displayed, if the selected day is from "day before yesterday" | 212 | Now it is displayed, if the selected day is from "day before yesterday" |
208 | to "day after tomorrow". | 213 | to "day after tomorrow". |
209 | Made it possible to delete a Todo, which has sub-todos. | 214 | Made it possible to delete a Todo, which has sub-todos. |
210 | Fixed two small problems in the todo view. | 215 | Fixed two small problems in the todo view. |
211 | Added missing German translation for filter edit and print dialog. | 216 | Added missing German translation for filter edit and print dialog. |
212 | Made search dialog closeable by cancel key. | 217 | Made search dialog closeable by cancel key. |
213 | 218 | ||
214 | Made it possible to select in the date picker the (ligt grey ) | 219 | Made it possible to select in the date picker the (ligt grey ) |
215 | dates of the prev./next month with the mouse. | 220 | dates of the prev./next month with the mouse. |
216 | 221 | ||
217 | OM/Pi: | 222 | OM/Pi: |
218 | "Delete mail" icon in main window now deletes all selected mails. | 223 | "Delete mail" icon in main window now deletes all selected mails. |
219 | Fixed the problem, that the state flag of imap mails was ignored. | 224 | Fixed the problem, that the state flag of imap mails was ignored. |
220 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view | 225 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view |
221 | to indecate that they are already seen. | 226 | to indecate that they are already seen. |
222 | Fixed the problem that the body of some mails was not displayed in the | 227 | Fixed the problem that the body of some mails was not displayed in the |
223 | mail viewer when fetching them from the imap server directly to read them. | 228 | mail viewer when fetching them from the imap server directly to read them. |
224 | Made it (configurable) possible to show the "To:" field in the list view. | 229 | Made it (configurable) possible to show the "To:" field in the list view. |
225 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | 230 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. |
226 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the | 231 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the |
227 | local storage folder (specified in account settings) of the account of the mail. | 232 | local storage folder (specified in account settings) of the account of the mail. |
228 | Removed some memory leaks in OM/Pi. | 233 | Removed some memory leaks in OM/Pi. |
229 | 234 | ||
230 | 235 | ||
231 | ********** VERSION 1.9.19 ************ | 236 | ********** VERSION 1.9.19 ************ |
232 | 237 | ||
233 | Added a lot of missing translations to KA/Pi, | 238 | Added a lot of missing translations to KA/Pi, |
234 | Added some missing translations to KO/Pi and OM/Pi. | 239 | Added some missing translations to KO/Pi and OM/Pi. |
235 | 240 | ||
236 | Fixed some minor problems in KA/Pi + KO/Pi. | 241 | Fixed some minor problems in KA/Pi + KO/Pi. |
237 | 242 | ||
238 | Fixed a crash when closing PwM/Pi. | 243 | Fixed a crash when closing PwM/Pi. |
239 | Added German translation for PwM/Pi. | 244 | Added German translation for PwM/Pi. |
240 | 245 | ||
241 | Made view change and Month View update faster in KO/Pi. | 246 | Made view change and Month View update faster in KO/Pi. |
242 | 247 | ||
243 | 248 | ||
244 | ********** VERSION 1.9.18 ************ | 249 | ********** VERSION 1.9.18 ************ |
245 | 250 | ||
246 | FYI: The VERSION 1.9.17 was a testing release only. | 251 | FYI: The VERSION 1.9.17 was a testing release only. |
247 | Please read the changelog of VERSION 1.9.17 as well. | 252 | Please read the changelog of VERSION 1.9.17 as well. |
248 | 253 | ||
249 | Cleaned up the syncing config dialog. | 254 | Cleaned up the syncing config dialog. |
250 | Added sync config options for date range for events. | 255 | Added sync config options for date range for events. |
251 | Added sync config options for filters on incoming data. | 256 | Added sync config options for filters on incoming data. |
252 | Added sync config options for filters on outgoing data. | 257 | Added sync config options for filters on outgoing data. |
253 | Please read the updated SyncHowTo about the new filter settings. | 258 | Please read the updated SyncHowTo about the new filter settings. |
254 | These filter settings make it now possible to sync with shared | 259 | These filter settings make it now possible to sync with shared |
255 | calendars without writing back private or confidential data | 260 | calendars without writing back private or confidential data |
256 | (via the outgoing filters). | 261 | (via the outgoing filters). |
257 | To sync only with particular parts of a shared calendar, | 262 | To sync only with particular parts of a shared calendar, |
258 | the incoming filter settings can be used. | 263 | the incoming filter settings can be used. |
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm index b6a8491..0d4c9d6 100644 --- a/desktop/rpm/kdepim_rpm +++ b/desktop/rpm/kdepim_rpm | |||
@@ -1,84 +1,84 @@ | |||
1 | Summary: A collection of PIM programs | 1 | Summary: A collection of PIM programs |
2 | Name: KDE-Pim-Pi | 2 | Name: KDE-Pim-Pi |
3 | Version: 2.0.11 | 3 | Version: 2.0.12 |
4 | Release: SuSE_9.2 | 4 | Release: SuSE_9.2 |
5 | Copyright:GPL | 5 | Copyright:GPL |
6 | Group: Productivity/Pim | 6 | Group: Productivity/Pim |
7 | Source:http://sourceforge.net/projects/kdepimpi/ | 7 | Source:http://sourceforge.net/projects/kdepimpi/ |
8 | URL:http://sourceforge.net/projects/kdepimpi/ | 8 | URL:http://sourceforge.net/projects/kdepimpi/ |
9 | Packager: zautrix | 9 | Packager: zautrix |
10 | 10 | ||
11 | %description | 11 | %description |
12 | This package contains the platform-independent PIM programs from | 12 | This package contains the platform-independent PIM programs from |
13 | www.pi-sync.net, compiled for SuSE 9.2: | 13 | www.pi-sync.net, compiled for SuSE 9.2: |
14 | KTimeTacker/Pi | 14 | KTimeTacker/Pi |
15 | KPhone/Pi | 15 | KPhone/Pi |
16 | KAddressbook/Pi | 16 | KAddressbook/Pi |
17 | KOrganizer/Pi | 17 | KOrganizer/Pi |
18 | PasswordManager/Pi | 18 | PasswordManager/Pi |
19 | KOPieMail/Pi | 19 | KOPieMail/Pi |
20 | 20 | ||
21 | These applications do not need anything from the KDE-desktop | 21 | These applications do not need anything from the KDE-desktop |
22 | at all to run on Linux. However, there is a dependency from | 22 | at all to run on Linux. However, there is a dependency from |
23 | two KDE libs, because a small command line program is included | 23 | two KDE libs, because a small command line program is included |
24 | to make it possible to sync with the KDE-desktop applications. | 24 | to make it possible to sync with the KDE-desktop applications. |
25 | 25 | ||
26 | These applications are independent from the KDE-desktop | 26 | These applications are independent from the KDE-desktop |
27 | environment. That means, nothing of your existing | 27 | environment. That means, nothing of your existing |
28 | KDE-desktop setup will be changed, or any data | 28 | KDE-desktop setup will be changed, or any data |
29 | (calendar-addressbook) used by the KDE-desktop | 29 | (calendar-addressbook) used by the KDE-desktop |
30 | applications will be changed or accessed. | 30 | applications will be changed or accessed. |
31 | These applications stores their data and config in | 31 | These applications stores their data and config in |
32 | $HOME/kdepim/ | 32 | $HOME/kdepim/ |
33 | However, because the same file format is used, | 33 | However, because the same file format is used, |
34 | an easy exchange of data with the KDE-desktop | 34 | an easy exchange of data with the KDE-desktop |
35 | is possible. | 35 | is possible. |
36 | A small command line program is included | 36 | A small command line program is included |
37 | to make it possible to sync with the KDE-desktop applications. | 37 | to make it possible to sync with the KDE-desktop applications. |
38 | You do not need to call this program from the commandline, | 38 | You do not need to call this program from the commandline, |
39 | it is called from the KDE-Pim/Pi apps when you choose there: | 39 | it is called from the KDE-Pim/Pi apps when you choose there: |
40 | Sync with KDE_Desktop. | 40 | Sync with KDE_Desktop. |
41 | If something is going wrong, please start the | 41 | If something is going wrong, please start the |
42 | KDE-Pim/Pi program itself from the console to get detailed output. | 42 | KDE-Pim/Pi program itself from the console to get detailed output. |
43 | 43 | ||
44 | After installation, you should have a | 44 | After installation, you should have a |
45 | PIM-pi | 45 | PIM-pi |
46 | folder in your KDE start menu, where you can | 46 | folder in your KDE start menu, where you can |
47 | start the applications from. | 47 | start the applications from. |
48 | 48 | ||
49 | These programs makes it possible to sync your Zaurus easily | 49 | These programs makes it possible to sync your Zaurus easily |
50 | (with the KDE-Pim/Pi programs running on the Zaurus) | 50 | (with the KDE-Pim/Pi programs running on the Zaurus) |
51 | with the KDE-desktop calendar/addressbook data. | 51 | with the KDE-desktop calendar/addressbook data. |
52 | If you want to use that, you have to update your | 52 | If you want to use that, you have to update your |
53 | KDE-desktop to version 3.3.0 or higher. | 53 | KDE-desktop to version 3.3.0 or higher. |
54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. | 54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. |
55 | Actually - after the (non difficult) configuration is set up - | 55 | Actually - after the (non difficult) configuration is set up - |
56 | with two mouseklicks on the Zaurus, | 56 | with two mouseklicks on the Zaurus, |
57 | the Zaurus syncs with the corresponding KDE-Pim/Pi | 57 | the Zaurus syncs with the corresponding KDE-Pim/Pi |
58 | program on the Linux Desktop which syncs automatically | 58 | program on the Linux Desktop which syncs automatically |
59 | with the KDE-desktop data. | 59 | with the KDE-desktop data. |
60 | 60 | ||
61 | If you want to use the KDE-desktop calendar/addressbook applications, | 61 | If you want to use the KDE-desktop calendar/addressbook applications, |
62 | just install these apps in this package and use them as a syncing tool for the | 62 | just install these apps in this package and use them as a syncing tool for the |
63 | Zaurus <-> KDE-desktop sync. | 63 | Zaurus <-> KDE-desktop sync. |
64 | The sync requires a network connection from your Zaurus to | 64 | The sync requires a network connection from your Zaurus to |
65 | the PC. A detailed Sync HowTo is available in the | 65 | the PC. A detailed Sync HowTo is available in the |
66 | Help menu of the applications. | 66 | Help menu of the applications. |
67 | 67 | ||
68 | These applications makes it also possible, that you can sync | 68 | These applications makes it also possible, that you can sync |
69 | (or just export the data to) your mobile phone with your | 69 | (or just export the data to) your mobile phone with your |
70 | data of the KDE-desktop calendar/addressbook applications. | 70 | data of the KDE-desktop calendar/addressbook applications. |
71 | This is tested and working for Nokia mobile phones, | 71 | This is tested and working for Nokia mobile phones, |
72 | it may work with others as well. | 72 | it may work with others as well. |
73 | (More info about that: -> Sync HowTo) | 73 | (More info about that: -> Sync HowTo) |
74 | 74 | ||
75 | NOTE: | 75 | NOTE: |
76 | When using SuSE 9.1 you have to update your KDE to 3.3.x | 76 | When using SuSE 9.1 you have to update your KDE to 3.3.x |
77 | and you have to make an online update in SuSE 9.1 to make it | 77 | and you have to make an online update in SuSE 9.1 to make it |
78 | possible to get the infrared connection working, such that | 78 | possible to get the infrared connection working, such that |
79 | you can sync your (Nokia) mobile phone via infrared. | 79 | you can sync your (Nokia) mobile phone via infrared. |
80 | 80 | ||
81 | %files | 81 | %files |
82 | /opt/kde3/share/applnk/PIM-pi/ | 82 | /opt/kde3/share/applnk/PIM-pi/ |
83 | /opt/kdepimpi/ | 83 | /opt/kdepimpi/ |
84 | /usr/lib/libmicro* | 84 | /usr/lib/libmicro* |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 4ff6899..db66413 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -748,522 +748,516 @@ void KOAgendaView::createDayLabels() | |||
748 | str = dayName.left( 1 ) + " " +QString::number( date.day()); | 748 | str = dayName.left( 1 ) + " " +QString::number( date.day()); |
749 | 749 | ||
750 | break; | 750 | break; |
751 | case 5: | 751 | case 5: |
752 | str = dayName.left( 2 ) + " " +QString::number( date.day()); | 752 | str = dayName.left( 2 ) + " " +QString::number( date.day()); |
753 | 753 | ||
754 | break; | 754 | break; |
755 | case 6: | 755 | case 6: |
756 | str = dayName.left( 3 ) + " " +QString::number( date.day()); | 756 | str = dayName.left( 3 ) + " " +QString::number( date.day()); |
757 | break; | 757 | break; |
758 | 758 | ||
759 | default: | 759 | default: |
760 | break; | 760 | break; |
761 | } | 761 | } |
762 | if ( oneday ) { | 762 | if ( oneday ) { |
763 | QString addString; | 763 | QString addString; |
764 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 764 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
765 | addString = i18n("Today"); | 765 | addString = i18n("Today"); |
766 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 766 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
767 | addString = i18n("Tomorrow"); | 767 | addString = i18n("Tomorrow"); |
768 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 768 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
769 | addString = i18n("Yesterday"); | 769 | addString = i18n("Yesterday"); |
770 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 770 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
771 | addString = i18n("Day before yesterday"); | 771 | addString = i18n("Day before yesterday"); |
772 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 772 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
773 | addString = i18n("Day after tomorrow"); | 773 | addString = i18n("Day after tomorrow"); |
774 | if ( !addString.isEmpty() ) { | 774 | if ( !addString.isEmpty() ) { |
775 | str = addString+", " + str; | 775 | str = addString+", " + str; |
776 | } | 776 | } |
777 | } | 777 | } |
778 | dayLabel->setText(str); | 778 | dayLabel->setText(str); |
779 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 779 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
780 | if (date == QDate::currentDate()) { | 780 | if (date == QDate::currentDate()) { |
781 | QFont bFont = dlf; | 781 | QFont bFont = dlf; |
782 | bFont.setBold( true ); | 782 | bFont.setBold( true ); |
783 | dayLabel->setFont(bFont); | 783 | dayLabel->setFont(bFont); |
784 | } | 784 | } |
785 | //dayLayout->addWidget(dayLabel); | 785 | //dayLayout->addWidget(dayLabel); |
786 | 786 | ||
787 | #ifndef KORG_NOPLUGINS | 787 | #ifndef KORG_NOPLUGINS |
788 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); | 788 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); |
789 | CalendarDecoration *it; | 789 | CalendarDecoration *it; |
790 | for(it = cds.first(); it; it = cds.next()) { | 790 | for(it = cds.first(); it; it = cds.next()) { |
791 | QString text = it->shortText( date ); | 791 | QString text = it->shortText( date ); |
792 | if ( !text.isEmpty() ) { | 792 | if ( !text.isEmpty() ) { |
793 | QLabel *label = new QLabel(text,mDayLabels); | 793 | QLabel *label = new QLabel(text,mDayLabels); |
794 | label->setAlignment(AlignCenter); | 794 | label->setAlignment(AlignCenter); |
795 | dayLayout->addWidget(label); | 795 | dayLayout->addWidget(label); |
796 | } | 796 | } |
797 | } | 797 | } |
798 | 798 | ||
799 | for(it = cds.first(); it; it = cds.next()) { | 799 | for(it = cds.first(); it; it = cds.next()) { |
800 | QWidget *wid = it->smallWidget(mDayLabels,date); | 800 | QWidget *wid = it->smallWidget(mDayLabels,date); |
801 | if ( wid ) { | 801 | if ( wid ) { |
802 | // wid->setHeight(20); | 802 | // wid->setHeight(20); |
803 | dayLayout->addWidget(wid); | 803 | dayLayout->addWidget(wid); |
804 | } | 804 | } |
805 | } | 805 | } |
806 | #endif | 806 | #endif |
807 | } | 807 | } |
808 | if ( ! appendLabels ) { | 808 | if ( ! appendLabels ) { |
809 | dayLabel = mDayLabelsList.next(); | 809 | dayLabel = mDayLabelsList.next(); |
810 | if ( !dayLabel ) | 810 | if ( !dayLabel ) |
811 | appendLabels = true; | 811 | appendLabels = true; |
812 | } | 812 | } |
813 | if ( appendLabels ) { | 813 | if ( appendLabels ) { |
814 | dayLabel = getNewDaylabel(); | 814 | dayLabel = getNewDaylabel(); |
815 | } | 815 | } |
816 | //dayLabel->hide();//test only | 816 | //dayLabel->hide();//test only |
817 | 817 | ||
818 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; | 818 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; |
819 | if ( offset < 0 ) offset = 0; | 819 | if ( offset < 0 ) offset = 0; |
820 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 820 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
821 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); | 821 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); |
822 | dayLabel->setFont( dlf ); | 822 | dayLabel->setFont( dlf ); |
823 | dayLabel->show(); | 823 | dayLabel->show(); |
824 | dayLabel->setNum( -2 ); | 824 | dayLabel->setNum( -2 ); |
825 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 825 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
826 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 826 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
827 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 827 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
828 | if ( !appendLabels ) { | 828 | if ( !appendLabels ) { |
829 | dayLabel = mDayLabelsList.next(); | 829 | dayLabel = mDayLabelsList.next(); |
830 | while ( dayLabel ) { | 830 | while ( dayLabel ) { |
831 | //qDebug("!dayLabel %d",dayLabel ); | 831 | //qDebug("!dayLabel %d",dayLabel ); |
832 | dayLabel->hide(); | 832 | dayLabel->hide(); |
833 | dayLabel = mDayLabelsList.next(); | 833 | dayLabel = mDayLabelsList.next(); |
834 | } | 834 | } |
835 | } | 835 | } |
836 | //mDayLabelsFrame->show(); | 836 | //mDayLabelsFrame->show(); |
837 | //mDayLabels->show(); | 837 | //mDayLabels->show(); |
838 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); | 838 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); |
839 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); | 839 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); |
840 | mDayLabelsFrame->setFixedHeight( newHight ); | 840 | mDayLabelsFrame->setFixedHeight( newHight ); |
841 | } | 841 | } |
842 | 842 | ||
843 | int KOAgendaView::maxDatesHint() | 843 | int KOAgendaView::maxDatesHint() |
844 | { | 844 | { |
845 | // Not sure about the max number of events, so return 0 for now. | 845 | // Not sure about the max number of events, so return 0 for now. |
846 | return 0; | 846 | return 0; |
847 | } | 847 | } |
848 | 848 | ||
849 | int KOAgendaView::currentDateCount() | 849 | int KOAgendaView::currentDateCount() |
850 | { | 850 | { |
851 | return mSelectedDates.count(); | 851 | return mSelectedDates.count(); |
852 | } | 852 | } |
853 | 853 | ||
854 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 854 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
855 | { | 855 | { |
856 | QPtrList<Incidence> selected; | 856 | QPtrList<Incidence> selected; |
857 | Incidence *incidence; | 857 | Incidence *incidence; |
858 | 858 | ||
859 | incidence = mAgenda->selectedIncidence(); | 859 | incidence = mAgenda->selectedIncidence(); |
860 | if (incidence) selected.append(incidence); | 860 | if (incidence) selected.append(incidence); |
861 | 861 | ||
862 | incidence = mAllDayAgenda->selectedIncidence(); | 862 | incidence = mAllDayAgenda->selectedIncidence(); |
863 | if (incidence) selected.append(incidence); | 863 | if (incidence) selected.append(incidence); |
864 | 864 | ||
865 | return selected; | 865 | return selected; |
866 | } | 866 | } |
867 | 867 | ||
868 | DateList KOAgendaView::selectedDates() | 868 | DateList KOAgendaView::selectedDates() |
869 | { | 869 | { |
870 | DateList selected; | 870 | DateList selected; |
871 | QDate qd; | 871 | QDate qd; |
872 | 872 | ||
873 | qd = mAgenda->selectedIncidenceDate(); | 873 | qd = mAgenda->selectedIncidenceDate(); |
874 | if (qd.isValid()) selected.append(qd); | 874 | if (qd.isValid()) selected.append(qd); |
875 | 875 | ||
876 | qd = mAllDayAgenda->selectedIncidenceDate(); | 876 | qd = mAllDayAgenda->selectedIncidenceDate(); |
877 | if (qd.isValid()) selected.append(qd); | 877 | if (qd.isValid()) selected.append(qd); |
878 | 878 | ||
879 | return selected; | 879 | return selected; |
880 | } | 880 | } |
881 | 881 | ||
882 | 882 | ||
883 | void KOAgendaView::updateView() | 883 | void KOAgendaView::updateView() |
884 | { | 884 | { |
885 | if ( mBlockUpdating ) | 885 | if ( mBlockUpdating ) |
886 | return; | 886 | return; |
887 | // kdDebug() << "KOAgendaView::updateView()" << endl; | 887 | // kdDebug() << "KOAgendaView::updateView()" << endl; |
888 | fillAgenda(); | 888 | fillAgenda(); |
889 | 889 | ||
890 | } | 890 | } |
891 | 891 | ||
892 | 892 | ||
893 | /* | 893 | /* |
894 | Update configuration settings for the agenda view. This method is not | 894 | Update configuration settings for the agenda view. This method is not |
895 | complete. | 895 | complete. |
896 | */ | 896 | */ |
897 | void KOAgendaView::updateConfig() | 897 | void KOAgendaView::updateConfig() |
898 | { | 898 | { |
899 | if ( mBlockUpdating ) | 899 | if ( mBlockUpdating ) |
900 | return; | 900 | return; |
901 | 901 | ||
902 | 902 | ||
903 | 903 | ||
904 | // update config for children | 904 | // update config for children |
905 | mTimeLabels->updateConfig(); | 905 | mTimeLabels->updateConfig(); |
906 | mAgenda->storePosition(); | 906 | mAgenda->storePosition(); |
907 | mAgenda->updateConfig(); | 907 | mAgenda->updateConfig(); |
908 | mAllDayAgenda->updateConfig(); | 908 | mAllDayAgenda->updateConfig(); |
909 | // widget synchronization | 909 | // widget synchronization |
910 | //TODO: find a better way, maybe signal/slot | 910 | //TODO: find a better way, maybe signal/slot |
911 | mTimeLabels->positionChanged(); | 911 | mTimeLabels->positionChanged(); |
912 | 912 | ||
913 | // for some reason, this needs to be called explicitly | 913 | // for some reason, this needs to be called explicitly |
914 | mTimeLabels->repaint(); | 914 | mTimeLabels->repaint(); |
915 | 915 | ||
916 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 916 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
917 | 917 | ||
918 | // ToolTips displaying summary of events | 918 | // ToolTips displaying summary of events |
919 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 919 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
920 | ->mEnableToolTips); | 920 | ->mEnableToolTips); |
921 | 921 | ||
922 | //setHolidayMasks(); | 922 | //setHolidayMasks(); |
923 | 923 | ||
924 | //createDayLabels(); called by via updateView(); | 924 | //createDayLabels(); called by via updateView(); |
925 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 925 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
926 | updateView(); | 926 | updateView(); |
927 | mAgenda->restorePosition(); | 927 | mAgenda->restorePosition(); |
928 | } | 928 | } |
929 | 929 | ||
930 | 930 | ||
931 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 931 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) |
932 | { | 932 | { |
933 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; | 933 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; |
934 | //qDebug("KOAgendaView::updateEventDates "); | 934 | //qDebug("KOAgendaView::updateEventDates "); |
935 | QDateTime startDt,endDt; | 935 | QDateTime startDt,endDt; |
936 | QDate startDate; | 936 | QDate startDate; |
937 | int lenInSecs; | 937 | int lenInSecs; |
938 | // if ( type == KOAgenda::RESIZETOP ) | 938 | // if ( type == KOAgenda::RESIZETOP ) |
939 | // qDebug("RESIZETOP "); | 939 | // qDebug("RESIZETOP "); |
940 | // if ( type == KOAgenda::RESIZEBOTTOM ) | 940 | // if ( type == KOAgenda::RESIZEBOTTOM ) |
941 | // qDebug("RESIZEBOTTOM "); | 941 | // qDebug("RESIZEBOTTOM "); |
942 | // if ( type == KOAgenda::MOVE ) | 942 | // if ( type == KOAgenda::MOVE ) |
943 | // qDebug("MOVE "); | 943 | // qDebug("MOVE "); |
944 | if ( item->incidence()->type() == "Event" ) { | 944 | if ( item->incidence()->type() == "Event" ) { |
945 | startDt =item->incidence()->dtStart(); | 945 | startDt =item->incidence()->dtStart(); |
946 | endDt = item->incidence()->dtEnd(); | 946 | endDt = item->incidence()->dtEnd(); |
947 | lenInSecs = startDt.secsTo( endDt ); | 947 | lenInSecs = startDt.secsTo( endDt ); |
948 | } | 948 | } |
949 | 949 | ||
950 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); | 950 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); |
951 | 951 | ||
952 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { | 952 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { |
953 | startDate = mSelectedDates[item->mLastMoveXPos]; | 953 | startDate = mSelectedDates[item->mLastMoveXPos]; |
954 | } else { | 954 | } else { |
955 | if (item->cellX() < 0) { | 955 | if (item->cellX() < 0) { |
956 | startDate = (mSelectedDates.first()).addDays(item->cellX()); | 956 | startDate = (mSelectedDates.first()).addDays(item->cellX()); |
957 | } else { | 957 | } else { |
958 | startDate = mSelectedDates[item->cellX()]; | 958 | startDate = mSelectedDates[item->cellX()]; |
959 | } | 959 | } |
960 | } | 960 | } |
961 | startDt.setDate(startDate); | 961 | startDt.setDate(startDate); |
962 | 962 | ||
963 | if (item->incidence()->doesFloat()) { | 963 | if (item->incidence()->doesFloat()) { |
964 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 964 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
965 | } else { | 965 | } else { |
966 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 966 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
967 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 967 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
968 | if ( item->incidence()->type() == "Event" ) { | 968 | if ( item->incidence()->type() == "Event" ) { |
969 | if ( type == KOAgenda::MOVE ) { | 969 | if ( type == KOAgenda::MOVE ) { |
970 | endDt = startDt.addSecs(lenInSecs); | 970 | endDt = startDt.addSecs(lenInSecs); |
971 | 971 | ||
972 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 972 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
973 | if (item->lastMultiItem()) { | 973 | if (item->lastMultiItem()) { |
974 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 974 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
975 | endDt.setDate(startDate. | 975 | endDt.setDate(startDate. |
976 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 976 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
977 | } else { | 977 | } else { |
978 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 978 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
979 | endDt.setDate(startDate); | 979 | endDt.setDate(startDate); |
980 | } | 980 | } |
981 | } | 981 | } |
982 | } else { | 982 | } else { |
983 | // todo | 983 | // todo |
984 | if (item->lastMultiItem()) { | 984 | if (item->lastMultiItem()) { |
985 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 985 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
986 | endDt.setDate(startDate. | 986 | endDt.setDate(startDate. |
987 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 987 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
988 | } else { | 988 | } else { |
989 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 989 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
990 | if ( item->cellYBottom() > 0 ) | 990 | if ( item->cellYBottom() > 0 ) |
991 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 991 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
992 | else | 992 | else |
993 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 993 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
994 | endDt.setDate(startDate); | 994 | endDt.setDate(startDate); |
995 | } | 995 | } |
996 | } | 996 | } |
997 | } | 997 | } |
998 | if ( item->incidence()->type() == "Event" ) { | 998 | if ( item->incidence()->type() == "Event" ) { |
999 | item->incidence()->setDtStart(startDt); | 999 | item->incidence()->setDtStart(startDt); |
1000 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 1000 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1001 | } else if ( item->incidence()->type() == "Todo" ) { | 1001 | } else if ( item->incidence()->type() == "Todo" ) { |
1002 | Todo* to = static_cast<Todo*>(item->incidence()); | 1002 | Todo* to = static_cast<Todo*>(item->incidence()); |
1003 | 1003 | ||
1004 | int len = 0; | ||
1005 | if ( to->hasStartDate() && to->hasDueDate() ) | ||
1006 | len = to->dtStart().secsTo( to->dtDue()); | ||
1007 | to->setDtDue(endDt); | 1004 | to->setDtDue(endDt); |
1008 | if ( to->hasStartDate() ) { | 1005 | if ( to->hasStartDate() ) { |
1009 | if ( len>0 ) | 1006 | if (to->dtStart() >= to->dtDue() ) |
1010 | to->setDtStart(to->dtDue().addSecs( -len )); | 1007 | to->setDtStart(to->dtDue().addDays( -2 )); |
1011 | else | ||
1012 | if (to->dtStart() > to->dtDue() ) | ||
1013 | to->setDtStart(to->dtDue().addDays( -3 )); | ||
1014 | } | 1008 | } |
1015 | 1009 | ||
1016 | } | 1010 | } |
1017 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1011 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1018 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1012 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1019 | item->setItemDate(startDt.date()); | 1013 | item->setItemDate(startDt.date()); |
1020 | //item->updateItem(); | 1014 | //item->updateItem(); |
1021 | if ( item->incidence()->type() == "Todo" ) { | 1015 | if ( item->incidence()->type() == "Todo" ) { |
1022 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); | 1016 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); |
1023 | 1017 | ||
1024 | } | 1018 | } |
1025 | else | 1019 | else |
1026 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); | 1020 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); |
1027 | item->updateItem(); | 1021 | item->updateItem(); |
1028 | } | 1022 | } |
1029 | 1023 | ||
1030 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) | 1024 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) |
1031 | { | 1025 | { |
1032 | // kdDebug() << "KOAgendaView::selectDates" << endl; | 1026 | // kdDebug() << "KOAgendaView::selectDates" << endl; |
1033 | 1027 | ||
1034 | mSelectedDates.clear(); | 1028 | mSelectedDates.clear(); |
1035 | // qDebug("KOAgendaView::showDates "); | 1029 | // qDebug("KOAgendaView::showDates "); |
1036 | QDate d = start; | 1030 | QDate d = start; |
1037 | while (d <= end) { | 1031 | while (d <= end) { |
1038 | mSelectedDates.append(d); | 1032 | mSelectedDates.append(d); |
1039 | d = d.addDays( 1 ); | 1033 | d = d.addDays( 1 ); |
1040 | } | 1034 | } |
1041 | 1035 | ||
1042 | // and update the view | 1036 | // and update the view |
1043 | fillAgenda(); | 1037 | fillAgenda(); |
1044 | } | 1038 | } |
1045 | 1039 | ||
1046 | 1040 | ||
1047 | void KOAgendaView::showEvents(QPtrList<Event>) | 1041 | void KOAgendaView::showEvents(QPtrList<Event>) |
1048 | { | 1042 | { |
1049 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; | 1043 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; |
1050 | } | 1044 | } |
1051 | 1045 | ||
1052 | void KOAgendaView::changeEventDisplay(Event *, int) | 1046 | void KOAgendaView::changeEventDisplay(Event *, int) |
1053 | { | 1047 | { |
1054 | // qDebug("KOAgendaView::changeEventDisplay "); | 1048 | // qDebug("KOAgendaView::changeEventDisplay "); |
1055 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; | 1049 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; |
1056 | // this should be re-written to be MUCH smarter. Right now we | 1050 | // this should be re-written to be MUCH smarter. Right now we |
1057 | // are just playing dumb. | 1051 | // are just playing dumb. |
1058 | fillAgenda(); | 1052 | fillAgenda(); |
1059 | } | 1053 | } |
1060 | 1054 | ||
1061 | void KOAgendaView::fillAgenda(const QDate &) | 1055 | void KOAgendaView::fillAgenda(const QDate &) |
1062 | { | 1056 | { |
1063 | // qDebug("KOAgendaView::fillAgenda "); | 1057 | // qDebug("KOAgendaView::fillAgenda "); |
1064 | fillAgenda(); | 1058 | fillAgenda(); |
1065 | } | 1059 | } |
1066 | 1060 | ||
1067 | void KOAgendaView::fillAgenda() | 1061 | void KOAgendaView::fillAgenda() |
1068 | { | 1062 | { |
1069 | if ( globalFlagBlockStartup ) | 1063 | if ( globalFlagBlockStartup ) |
1070 | return; | 1064 | return; |
1071 | if ( globalFlagBlockAgenda == 1 ) | 1065 | if ( globalFlagBlockAgenda == 1 ) |
1072 | return; | 1066 | return; |
1073 | //if ( globalFlagBlockAgenda == 2 ) | 1067 | //if ( globalFlagBlockAgenda == 2 ) |
1074 | //globalFlagBlockAgenda = 0; | 1068 | //globalFlagBlockAgenda = 0; |
1075 | // globalFlagBlockPainting = false; | 1069 | // globalFlagBlockPainting = false; |
1076 | if ( globalFlagBlockAgenda == 0 ) | 1070 | if ( globalFlagBlockAgenda == 0 ) |
1077 | globalFlagBlockAgenda = 1; | 1071 | globalFlagBlockAgenda = 1; |
1078 | // clearView(); | 1072 | // clearView(); |
1079 | //qDebug("fillAgenda()++++ "); | 1073 | //qDebug("fillAgenda()++++ "); |
1080 | globalFlagBlockAgendaItemPaint = 1; | 1074 | globalFlagBlockAgendaItemPaint = 1; |
1081 | 1075 | ||
1082 | mAllDayAgenda->changeColumns(mSelectedDates.count()); | 1076 | mAllDayAgenda->changeColumns(mSelectedDates.count()); |
1083 | mAgenda->changeColumns(mSelectedDates.count()); | 1077 | mAgenda->changeColumns(mSelectedDates.count()); |
1084 | qApp->processEvents(); | 1078 | qApp->processEvents(); |
1085 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); | 1079 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); |
1086 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); | 1080 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); |
1087 | setHolidayMasks(); | 1081 | setHolidayMasks(); |
1088 | 1082 | ||
1089 | //mAgenda->hideUnused(); | 1083 | //mAgenda->hideUnused(); |
1090 | //mAllDayAgenda->hideUnused(); | 1084 | //mAllDayAgenda->hideUnused(); |
1091 | 1085 | ||
1092 | // mAgenda->blockNextRepaint( false ); | 1086 | // mAgenda->blockNextRepaint( false ); |
1093 | // mAgenda->viewport()->repaint(); | 1087 | // mAgenda->viewport()->repaint(); |
1094 | // mAgenda->blockNextRepaint( true ); | 1088 | // mAgenda->blockNextRepaint( true ); |
1095 | mMinY.resize(mSelectedDates.count()); | 1089 | mMinY.resize(mSelectedDates.count()); |
1096 | mMaxY.resize(mSelectedDates.count()); | 1090 | mMaxY.resize(mSelectedDates.count()); |
1097 | 1091 | ||
1098 | QPtrList<Event> dayEvents; | 1092 | QPtrList<Event> dayEvents; |
1099 | 1093 | ||
1100 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1094 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1101 | // Therefore, gtodoset all of them. | 1095 | // Therefore, gtodoset all of them. |
1102 | QPtrList<Todo> todos = calendar()->todos(); | 1096 | QPtrList<Todo> todos = calendar()->todos(); |
1103 | 1097 | ||
1104 | mAgenda->setDateList(mSelectedDates); | 1098 | mAgenda->setDateList(mSelectedDates); |
1105 | 1099 | ||
1106 | QDate today = QDate::currentDate(); | 1100 | QDate today = QDate::currentDate(); |
1107 | 1101 | ||
1108 | DateList::ConstIterator dit; | 1102 | DateList::ConstIterator dit; |
1109 | int curCol = 0; | 1103 | int curCol = 0; |
1110 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 1104 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
1111 | QDate currentDate = *dit; | 1105 | QDate currentDate = *dit; |
1112 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() | 1106 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() |
1113 | // << endl; | 1107 | // << endl; |
1114 | 1108 | ||
1115 | dayEvents = calendar()->events(currentDate,true); | 1109 | dayEvents = calendar()->events(currentDate,true); |
1116 | 1110 | ||
1117 | // Default values, which can never be reached | 1111 | // Default values, which can never be reached |
1118 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; | 1112 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; |
1119 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; | 1113 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; |
1120 | 1114 | ||
1121 | unsigned int numEvent; | 1115 | unsigned int numEvent; |
1122 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { | 1116 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { |
1123 | Event *event = dayEvents.at(numEvent); | 1117 | Event *event = dayEvents.at(numEvent); |
1124 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | 1118 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) |
1125 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | 1119 | if ( event->uid().left(15) == QString("last-syncEvent-") ) |
1126 | continue; | 1120 | continue; |
1127 | // kdDebug() << " Event: " << event->summary() << endl; | 1121 | // kdDebug() << " Event: " << event->summary() << endl; |
1128 | 1122 | ||
1129 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; | 1123 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; |
1130 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; | 1124 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; |
1131 | 1125 | ||
1132 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; | 1126 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; |
1133 | 1127 | ||
1134 | if (event->doesFloat()) { | 1128 | if (event->doesFloat()) { |
1135 | if (event->recurrence()->doesRecur()) { | 1129 | if (event->recurrence()->doesRecur()) { |
1136 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); | 1130 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); |
1137 | } else { | 1131 | } else { |
1138 | if (beginX <= 0 && curCol == 0) { | 1132 | if (beginX <= 0 && curCol == 0) { |
1139 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1133 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1140 | } else if (beginX == curCol) { | 1134 | } else if (beginX == curCol) { |
1141 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1135 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1142 | } | 1136 | } |
1143 | } | 1137 | } |
1144 | } else if (event->isMultiDay()) { | 1138 | } else if (event->isMultiDay()) { |
1145 | if ( event->doesRecur () ) { | 1139 | if ( event->doesRecur () ) { |
1146 | QDate dateit = currentDate; | 1140 | QDate dateit = currentDate; |
1147 | int count = 0; | 1141 | int count = 0; |
1148 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; | 1142 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; |
1149 | while (! event->recursOn( dateit ) && count <= max ) { | 1143 | while (! event->recursOn( dateit ) && count <= max ) { |
1150 | ++count; | 1144 | ++count; |
1151 | dateit = dateit.addDays( -1 ); | 1145 | dateit = dateit.addDays( -1 ); |
1152 | } | 1146 | } |
1153 | bool ok; | 1147 | bool ok; |
1154 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); | 1148 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); |
1155 | if ( ok ) | 1149 | if ( ok ) |
1156 | { | 1150 | { |
1157 | int secs = event->dtStart().secsTo( event->dtEnd() ); | 1151 | int secs = event->dtStart().secsTo( event->dtEnd() ); |
1158 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; | 1152 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; |
1159 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; | 1153 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; |
1160 | endX = currentDate.daysTo(nextOcend.date()) + curCol; | 1154 | endX = currentDate.daysTo(nextOcend.date()) + curCol; |
1161 | 1155 | ||
1162 | } | 1156 | } |
1163 | } | 1157 | } |
1164 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1158 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1165 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1159 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1166 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); | 1160 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); |
1167 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { | 1161 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { |
1168 | //qDebug("insert!!! "); | 1162 | //qDebug("insert!!! "); |
1169 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); | 1163 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); |
1170 | } | 1164 | } |
1171 | if (beginX == curCol) { | 1165 | if (beginX == curCol) { |
1172 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1166 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1173 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1167 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1174 | } else if (endX == curCol) { | 1168 | } else if (endX == curCol) { |
1175 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1169 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1176 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1170 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1177 | } else { | 1171 | } else { |
1178 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1172 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1179 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1173 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1180 | } | 1174 | } |
1181 | } else { | 1175 | } else { |
1182 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1176 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1183 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1177 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1184 | if (endY < startY) endY = startY; | 1178 | if (endY < startY) endY = startY; |
1185 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); | 1179 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); |
1186 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1180 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1187 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1181 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1188 | } | 1182 | } |
1189 | } | 1183 | } |
1190 | // ---------- [display Todos -------------- | 1184 | // ---------- [display Todos -------------- |
1191 | unsigned int numTodo; | 1185 | unsigned int numTodo; |
1192 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { | 1186 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { |
1193 | Todo *todo = todos.at(numTodo); | 1187 | Todo *todo = todos.at(numTodo); |
1194 | 1188 | ||
1195 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1189 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1196 | 1190 | ||
1197 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1191 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1198 | // Already completed items can be displayed on their original due date | 1192 | // Already completed items can be displayed on their original due date |
1199 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1193 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1200 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1194 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; |
1201 | bool fillIn = false; | 1195 | bool fillIn = false; |
1202 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1196 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1203 | fillIn = true; | 1197 | fillIn = true; |
1204 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1198 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1205 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1199 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1206 | if ( fillIn ) { | 1200 | if ( fillIn ) { |
1207 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue | 1201 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue |
1208 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1202 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1209 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); | 1203 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); |
1210 | } | 1204 | } |
1211 | else { | 1205 | else { |
1212 | QDateTime dt; | 1206 | QDateTime dt; |
1213 | if ( todo->hasCompletedDate() ) | 1207 | if ( todo->hasCompletedDate() ) |
1214 | dt = todo->completed(); | 1208 | dt = todo->completed(); |
1215 | else | 1209 | else |
1216 | dt = todo->dtDue();; | 1210 | dt = todo->dtDue();; |
1217 | 1211 | ||
1218 | 1212 | ||
1219 | int endY = mAgenda->timeToY(dt.time()) - 1; | 1213 | int endY = mAgenda->timeToY(dt.time()) - 1; |
1220 | int hi = (18/KOPrefs::instance()->mHourSize); | 1214 | int hi = (18/KOPrefs::instance()->mHourSize); |
1221 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); | 1215 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); |
1222 | int startY = endY -hi; | 1216 | int startY = endY -hi; |
1223 | 1217 | ||
1224 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); | 1218 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); |
1225 | 1219 | ||
1226 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1220 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1227 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1221 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1228 | } | 1222 | } |
1229 | } | 1223 | } |
1230 | } | 1224 | } |
1231 | // ---------- display Todos] -------------- | 1225 | // ---------- display Todos] -------------- |
1232 | 1226 | ||
1233 | ++curCol; | 1227 | ++curCol; |
1234 | } | 1228 | } |
1235 | mAgenda->hideUnused(); | 1229 | mAgenda->hideUnused(); |
1236 | mAllDayAgenda->hideUnused(); | 1230 | mAllDayAgenda->hideUnused(); |
1237 | mAgenda->checkScrollBoundaries(); | 1231 | mAgenda->checkScrollBoundaries(); |
1238 | 1232 | ||
1239 | deleteSelectedDateTime(); | 1233 | deleteSelectedDateTime(); |
1240 | 1234 | ||
1241 | createDayLabels(); | 1235 | createDayLabels(); |
1242 | emit incidenceSelected( 0 ); | 1236 | emit incidenceSelected( 0 ); |
1243 | 1237 | ||
1244 | if ( globalFlagBlockAgenda == 2 ) { | 1238 | if ( globalFlagBlockAgenda == 2 ) { |
1245 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 1239 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
1246 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1240 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1247 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1241 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1248 | setStartHour( QTime::currentTime ().hour() ); | 1242 | setStartHour( QTime::currentTime ().hour() ); |
1249 | // qApp->processEvents(); | 1243 | // qApp->processEvents(); |
1250 | } | 1244 | } |
1251 | qApp->processEvents(); | 1245 | qApp->processEvents(); |
1252 | //qDebug("qApp->processEvents(); END "); | 1246 | //qDebug("qApp->processEvents(); END "); |
1253 | globalFlagBlockAgenda = 0; | 1247 | globalFlagBlockAgenda = 0; |
1254 | 1248 | ||
1255 | // mAgenda->hideUnused(); | 1249 | // mAgenda->hideUnused(); |
1256 | //mAllDayAgenda->hideUnused(); | 1250 | //mAllDayAgenda->hideUnused(); |
1257 | mAllDayAgenda->drawContentsToPainter(); | 1251 | mAllDayAgenda->drawContentsToPainter(); |
1258 | mAgenda->drawContentsToPainter(); | 1252 | mAgenda->drawContentsToPainter(); |
1259 | repaintAgenda(); | 1253 | repaintAgenda(); |
1260 | // mAgenda->finishUpdate(); | 1254 | // mAgenda->finishUpdate(); |
1261 | //mAllDayAgenda->finishUpdate(); | 1255 | //mAllDayAgenda->finishUpdate(); |
1262 | 1256 | ||
1263 | // repaintAgenda(); | 1257 | // repaintAgenda(); |
1264 | //qApp->processEvents(); | 1258 | //qApp->processEvents(); |
1265 | // globalFlagBlockAgenda = 0; | 1259 | // globalFlagBlockAgenda = 0; |
1266 | } | 1260 | } |
1267 | void KOAgendaView::repaintAgenda() | 1261 | void KOAgendaView::repaintAgenda() |
1268 | { | 1262 | { |
1269 | // mAllDayAgenda->drawContentsToPainter(); | 1263 | // mAllDayAgenda->drawContentsToPainter(); |
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index f9f037a..51e2524 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -99,357 +99,338 @@ void KOTodoEditor::setupGeneral() | |||
99 | { | 99 | { |
100 | mGeneral = new KOEditorGeneralTodo(this); | 100 | mGeneral = new KOEditorGeneralTodo(this); |
101 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); | 101 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); |
102 | 102 | ||
103 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); | 103 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); |
104 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), | 104 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), |
105 | // mGeneral,SLOT(setCategories(const QString &))); | 105 | // mGeneral,SLOT(setCategories(const QString &))); |
106 | 106 | ||
107 | if (KOPrefs::instance()->mCompactDialogs) { | 107 | if (KOPrefs::instance()->mCompactDialogs) { |
108 | QFrame *topFrame = addPage(i18n("General")); | 108 | QFrame *topFrame = addPage(i18n("General")); |
109 | 109 | ||
110 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 110 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
111 | if ( QApplication::desktop()->width() < 480 ) { | 111 | if ( QApplication::desktop()->width() < 480 ) { |
112 | topLayout->setMargin(1); | 112 | topLayout->setMargin(1); |
113 | topLayout->setSpacing(1); | 113 | topLayout->setSpacing(1); |
114 | } else { | 114 | } else { |
115 | topLayout->setMargin(marginHint()-1); | 115 | topLayout->setMargin(marginHint()-1); |
116 | topLayout->setSpacing(spacingHint()-1); | 116 | topLayout->setSpacing(spacingHint()-1); |
117 | } | 117 | } |
118 | mGeneral->initHeader(topFrame,topLayout); | 118 | mGeneral->initHeader(topFrame,topLayout); |
119 | mGeneral->initTime(topFrame,topLayout); | 119 | mGeneral->initTime(topFrame,topLayout); |
120 | mGeneral->initAlarm(topFrame,topLayout); | 120 | mGeneral->initAlarm(topFrame,topLayout); |
121 | mGeneral->enableAlarm( false ); | 121 | mGeneral->enableAlarm( false ); |
122 | 122 | ||
123 | 123 | ||
124 | QBoxLayout *priorityLayout; | 124 | QBoxLayout *priorityLayout; |
125 | if ( QApplication::desktop()->width() < 500 ) | 125 | if ( QApplication::desktop()->width() < 500 ) |
126 | priorityLayout = new QVBoxLayout( topLayout ); | 126 | priorityLayout = new QVBoxLayout( topLayout ); |
127 | else | 127 | else |
128 | priorityLayout = new QHBoxLayout( topLayout ); | 128 | priorityLayout = new QHBoxLayout( topLayout ); |
129 | QWidget* prioWidget = new QWidget (topFrame); | 129 | QWidget* prioWidget = new QWidget (topFrame); |
130 | priorityLayout->addWidget( prioWidget ); | 130 | priorityLayout->addWidget( prioWidget ); |
131 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); | 131 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); |
132 | 132 | ||
133 | 133 | ||
134 | QIconSet icon; | 134 | QIconSet icon; |
135 | if ( QApplication::desktop()->width() < 321 ) | 135 | if ( QApplication::desktop()->width() < 321 ) |
136 | icon = SmallIcon("fileimport16"); | 136 | icon = SmallIcon("fileimport16"); |
137 | else | 137 | else |
138 | icon = SmallIcon("fileimport"); | 138 | icon = SmallIcon("fileimport"); |
139 | QPushButton * loadTemplate = new QPushButton( prioWidget); | 139 | QPushButton * loadTemplate = new QPushButton( prioWidget); |
140 | loadTemplate->setIconSet (icon ) ; | 140 | loadTemplate->setIconSet (icon ) ; |
141 | int size = loadTemplate->sizeHint().height(); | 141 | int size = loadTemplate->sizeHint().height(); |
142 | loadTemplate->setFixedSize( size, size ); | 142 | loadTemplate->setFixedSize( size, size ); |
143 | if ( QApplication::desktop()->width() < 321 ) | 143 | if ( QApplication::desktop()->width() < 321 ) |
144 | icon = SmallIcon("fileexport16"); | 144 | icon = SmallIcon("fileexport16"); |
145 | else | 145 | else |
146 | icon = SmallIcon("fileexport"); | 146 | icon = SmallIcon("fileexport"); |
147 | QPushButton * saveTemplate = new QPushButton( prioWidget); | 147 | QPushButton * saveTemplate = new QPushButton( prioWidget); |
148 | saveTemplate->setIconSet (icon ) ; | 148 | saveTemplate->setIconSet (icon ) ; |
149 | saveTemplate->setFixedSize( size, size ); | 149 | saveTemplate->setFixedSize( size, size ); |
150 | 150 | ||
151 | priorityLayout2->addWidget(loadTemplate); | 151 | priorityLayout2->addWidget(loadTemplate); |
152 | priorityLayout2->addWidget(saveTemplate); | 152 | priorityLayout2->addWidget(saveTemplate); |
153 | mGeneral->initPriority(prioWidget,priorityLayout2); | 153 | mGeneral->initPriority(prioWidget,priorityLayout2); |
154 | mGeneral->initCategories( topFrame, priorityLayout ); | 154 | mGeneral->initCategories( topFrame, priorityLayout ); |
155 | topLayout->addStretch(1); | 155 | topLayout->addStretch(1); |
156 | 156 | ||
157 | QFrame *topFrame2 = addPage(i18n("Details")); | 157 | QFrame *topFrame2 = addPage(i18n("Details")); |
158 | 158 | ||
159 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 159 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); |
160 | topLayout2->setMargin(marginHint()); | 160 | topLayout2->setMargin(marginHint()); |
161 | topLayout2->setSpacing(spacingHint()); | 161 | topLayout2->setSpacing(spacingHint()); |
162 | 162 | ||
163 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); | 163 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); |
164 | mGeneral->initCompletion(topFrame2,completionLayout); | 164 | mGeneral->initCompletion(topFrame2,completionLayout); |
165 | 165 | ||
166 | 166 | ||
167 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 167 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
168 | mGeneral->initDescription(topFrame2,topLayout2); | 168 | mGeneral->initDescription(topFrame2,topLayout2); |
169 | 169 | ||
170 | // QHBox * hb = new QHBox ( topFrame2 ); | 170 | // QHBox * hb = new QHBox ( topFrame2 ); |
171 | // topLayout2->addWidget(hb); | 171 | // topLayout2->addWidget(hb); |
172 | // hb->setSpacing( 3 ); | 172 | // hb->setSpacing( 3 ); |
173 | 173 | ||
174 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 174 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
175 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 175 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
176 | 176 | ||
177 | } else { | 177 | } else { |
178 | QFrame *topFrame = addPage(i18n("General")); | 178 | QFrame *topFrame = addPage(i18n("General")); |
179 | 179 | ||
180 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 180 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
181 | topLayout->setSpacing(spacingHint()); | 181 | topLayout->setSpacing(spacingHint()); |
182 | 182 | ||
183 | mGeneral->initHeader(topFrame,topLayout); | 183 | mGeneral->initHeader(topFrame,topLayout); |
184 | mGeneral->initTime(topFrame,topLayout); | 184 | mGeneral->initTime(topFrame,topLayout); |
185 | mGeneral->initStatus(topFrame,topLayout); | 185 | mGeneral->initStatus(topFrame,topLayout); |
186 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 186 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); |
187 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 187 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
188 | mGeneral->initDescription(topFrame,topLayout); | 188 | mGeneral->initDescription(topFrame,topLayout); |
189 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 189 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); |
190 | mGeneral->initCategories( topFrame, detailsLayout ); | 190 | mGeneral->initCategories( topFrame, detailsLayout ); |
191 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 191 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
192 | } | 192 | } |
193 | mGeneral->finishSetup(); | 193 | mGeneral->finishSetup(); |
194 | 194 | ||
195 | } | 195 | } |
196 | 196 | ||
197 | void KOTodoEditor::editTodo(Todo *todo, bool editDescription) | 197 | void KOTodoEditor::editTodo(Todo *todo, bool editDescription) |
198 | { | 198 | { |
199 | //init(); | 199 | //init(); |
200 | 200 | ||
201 | mTodo = todo; | 201 | mTodo = todo; |
202 | readTodo(mTodo); | 202 | readTodo(mTodo); |
203 | if ( editDescription ) { | 203 | if ( editDescription ) { |
204 | showPage( 1 ); | 204 | showPage( 1 ); |
205 | mGeneral->setFocusOn( 1 ); | 205 | mGeneral->setFocusOn( 1 ); |
206 | } else { | 206 | } else { |
207 | showPage( 0 ); | 207 | showPage( 0 ); |
208 | mGeneral->setFocusOn( 2 ); | 208 | mGeneral->setFocusOn( 2 ); |
209 | } | 209 | } |
210 | checkRecurrence(); | 210 | checkRecurrence(); |
211 | } | 211 | } |
212 | 212 | ||
213 | void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay) | 213 | void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay) |
214 | { | 214 | { |
215 | //init(); | 215 | //init(); |
216 | 216 | ||
217 | mTodo = 0; | 217 | mTodo = 0; |
218 | setDefaults(due,relatedTodo,allDay); | 218 | setDefaults(due,relatedTodo,allDay); |
219 | } | 219 | } |
220 | 220 | ||
221 | void KOTodoEditor::loadDefaults() | 221 | void KOTodoEditor::loadDefaults() |
222 | { | 222 | { |
223 | setDefaults(QDateTime::currentDateTime().addDays(7),0,false); | 223 | setDefaults(QDateTime::currentDateTime().addDays(7),0,false); |
224 | } | 224 | } |
225 | 225 | ||
226 | bool KOTodoEditor::processInput( bool emitTime ) | 226 | bool KOTodoEditor::processInput( bool emitTime ) |
227 | { | 227 | { |
228 | if (!validateInput()) return false; | 228 | if (!validateInput()) return false; |
229 | 229 | ||
230 | Todo *todo = 0; | 230 | Todo *todo = 0; |
231 | 231 | ||
232 | if (mTodo) todo = mTodo; | 232 | if (mTodo) todo = mTodo; |
233 | else { | 233 | else { |
234 | todo = new Todo; | 234 | todo = new Todo; |
235 | todo->setOrganizer(KOPrefs::instance()->email()); | 235 | todo->setOrganizer(KOPrefs::instance()->email()); |
236 | } | 236 | } |
237 | 237 | ||
238 | writeTodo(todo); | 238 | writeTodo(todo); |
239 | if ( emitTime ) { | 239 | if ( emitTime ) { |
240 | globalFlagBlockAgenda = 1; | 240 | globalFlagBlockAgenda = 1; |
241 | emit showAgendaView( false ); | 241 | emit showAgendaView( false ); |
242 | if ( todo->hasDueDate() ) | 242 | if ( todo->hasDueDate() ) |
243 | emit jumpToTime( todo->dtDue().date() ); | 243 | emit jumpToTime( todo->dtDue().date() ); |
244 | globalFlagBlockAgenda = 2; | 244 | globalFlagBlockAgenda = 2; |
245 | } | 245 | } |
246 | if (mTodo) { | 246 | if (mTodo) { |
247 | todo->setRevision(todo->revision()+1); | 247 | todo->setRevision(todo->revision()+1); |
248 | emit todoChanged(todo); | 248 | emit todoChanged(todo); |
249 | } else { | 249 | } else { |
250 | mCalendar->addTodo(todo); | 250 | mCalendar->addTodo(todo); |
251 | mTodo = todo; | 251 | mTodo = todo; |
252 | emit todoAdded(todo); | 252 | emit todoAdded(todo); |
253 | } | 253 | } |
254 | 254 | ||
255 | return true; | 255 | return true; |
256 | } | 256 | } |
257 | 257 | ||
258 | void KOTodoEditor::deleteTodo() | 258 | void KOTodoEditor::deleteTodo() |
259 | { | 259 | { |
260 | if (mTodo) { | 260 | if (mTodo) { |
261 | if (KOPrefs::instance()->mConfirm) { | 261 | if (KOPrefs::instance()->mConfirm) { |
262 | switch (msgItemDelete()) { | 262 | switch (msgItemDelete()) { |
263 | case KMessageBox::Continue: // OK | 263 | case KMessageBox::Continue: // OK |
264 | emit todoToBeDeleted(mTodo); | 264 | emit todoToBeDeleted(mTodo); |
265 | emit dialogClose(mTodo); | 265 | emit dialogClose(mTodo); |
266 | mCalendar->deleteTodo(mTodo); | 266 | mCalendar->deleteTodo(mTodo); |
267 | emit todoDeleted(); | 267 | emit todoDeleted(); |
268 | reject(); | 268 | reject(); |
269 | break; | 269 | break; |
270 | } | 270 | } |
271 | } | 271 | } |
272 | else { | 272 | else { |
273 | emit todoToBeDeleted(mTodo); | 273 | emit todoToBeDeleted(mTodo); |
274 | emit dialogClose(mTodo); | 274 | emit dialogClose(mTodo); |
275 | mCalendar->deleteTodo(mTodo); | 275 | mCalendar->deleteTodo(mTodo); |
276 | emit todoDeleted(); | 276 | emit todoDeleted(); |
277 | reject(); | 277 | reject(); |
278 | } | 278 | } |
279 | } else { | 279 | } else { |
280 | reject(); | 280 | reject(); |
281 | } | 281 | } |
282 | } | 282 | } |
283 | 283 | ||
284 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) | 284 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) |
285 | { | 285 | { |
286 | mRelatedTodo = relatedEvent; | 286 | mRelatedTodo = relatedEvent; |
287 | 287 | ||
288 | mGeneral->setDefaults(due,allDay); | 288 | mGeneral->setDefaults(due,allDay); |
289 | mDetails->setDefaults(); | 289 | mDetails->setDefaults(); |
290 | showPage( 0 ); | 290 | showPage( 0 ); |
291 | if ( mRelatedTodo ) { | 291 | if ( mRelatedTodo ) { |
292 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); | 292 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); |
293 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); | 293 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); |
294 | if ( mRelatedTodo->priority() < 3 ) | 294 | if ( mRelatedTodo->priority() < 3 ) |
295 | mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); | 295 | mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); |
296 | mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); | 296 | mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); |
297 | int len = mRelatedTodo->summary().length(); | 297 | int len = mRelatedTodo->summary().length(); |
298 | mGeneral->mSummaryEdit->lineEdit()->setFocus(); | 298 | mGeneral->mSummaryEdit->lineEdit()->setFocus(); |
299 | mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); | 299 | mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); |
300 | mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); | 300 | mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); |
301 | 301 | ||
302 | } else | 302 | } else |
303 | mGeneral->setFocusOn( 2 ); | 303 | mGeneral->setFocusOn( 2 ); |
304 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); | 304 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); |
305 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ),true); | 305 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ),true); |
306 | } | 306 | } |
307 | void KOTodoEditor::checkRecurrence() | 307 | void KOTodoEditor::checkRecurrence() |
308 | { | 308 | { |
309 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 309 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
310 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true ); | 310 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true ); |
311 | 311 | ||
312 | if ( mTodo ) | 312 | if ( mTodo ) |
313 | mRecurrence->readEvent( mTodo ); | 313 | mRecurrence->readEvent( mTodo ); |
314 | else { | 314 | else { |
315 | bool time = mGeneral->mTimeButton->isChecked(); | 315 | bool time = mGeneral->mTimeButton->isChecked(); |
316 | QDateTime from,to; | 316 | QDateTime from,to; |
317 | if ( time ) { | 317 | if ( time ) { |
318 | to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; | 318 | to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; |
319 | from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; | 319 | from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; |
320 | } else { | 320 | } else { |
321 | to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; | 321 | to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; |
322 | from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; | 322 | from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; |
323 | } | 323 | } |
324 | if ( to < from ) | 324 | if ( to < from ) |
325 | to = from; | 325 | to = from; |
326 | mRecurrence->setDefaults(from,to,!time); | 326 | mRecurrence->setDefaults(from,to,!time); |
327 | } | 327 | } |
328 | } else { | 328 | } else { |
329 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); | 329 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); |
330 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ),true); | 330 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ),true); |
331 | } | 331 | } |
332 | } | 332 | } |
333 | void KOTodoEditor::readTodo(Todo *todo) | 333 | void KOTodoEditor::readTodo(Todo *todo) |
334 | { | 334 | { |
335 | mGeneral->readTodo(todo); | 335 | mGeneral->readTodo(todo); |
336 | mDetails->readEvent(todo); | 336 | mDetails->readEvent(todo); |
337 | mRelatedTodo = 0;//todo->relatedTo(); | 337 | mRelatedTodo = 0;//todo->relatedTo(); |
338 | // categories | 338 | // categories |
339 | // mCategoryDialog->setSelected(todo->categories()); | 339 | // mCategoryDialog->setSelected(todo->categories()); |
340 | 340 | ||
341 | // We should handle read-only events here. | 341 | // We should handle read-only events here. |
342 | } | 342 | } |
343 | 343 | ||
344 | void KOTodoEditor::writeTodo(Todo *event) | 344 | void KOTodoEditor::writeTodo(Todo *event) |
345 | { | 345 | { |
346 | mGeneral->writeTodo(event); | 346 | mGeneral->writeTodo(event); |
347 | mDetails->writeEvent(event); | 347 | mDetails->writeEvent(event); |
348 | 348 | ||
349 | // set related event, i.e. parent to-do in this case. | 349 | // set related event, i.e. parent to-do in this case. |
350 | if (mRelatedTodo) { | 350 | if (mRelatedTodo) { |
351 | event->setRelatedTo(mRelatedTodo); | 351 | event->setRelatedTo(mRelatedTodo); |
352 | } | 352 | } |
353 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 353 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
354 | mRecurrence->writeEvent(event); | 354 | mRecurrence->writeEvent(event); |
355 | event->setRecurrenceID( event->dtStart().addSecs(-1) ); | 355 | if ( event->doesRecur() ) { |
356 | event->setRecurDates(); | 356 | event->setRecurrenceID( event->dtStart().addSecs(-1) ); |
357 | #if 0 | 357 | event->setRecurDates(); |
358 | bool ok; | 358 | } else { |
359 | QDateTime next = event->getNextOccurence( event->dtStart().addSecs(-1), &ok ); | ||
360 | if ( ok ) { | ||
361 | QDateTime from,to; | ||
362 | bool time = mGeneral->mTimeButton->isChecked(); | ||
363 | if ( time ) { | ||
364 | to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; | ||
365 | from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; | ||
366 | } else { | ||
367 | to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; | ||
368 | from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; | ||
369 | } | ||
370 | if ( to < from ) | ||
371 | to = from; | ||
372 | int secs = from.secsTo( to ); | ||
373 | event->setRecurrenceID( next ); | ||
374 | event->setDtStart( next ); | ||
375 | event->setDtDue( next.addSecs( secs ) ); | ||
376 | } | ||
377 | else { | ||
378 | event->setHasRecurrenceID( false ); | 359 | event->setHasRecurrenceID( false ); |
379 | event->recurrence()->unsetRecurs(); | ||
380 | } | 360 | } |
381 | #endif | 361 | } else { |
382 | } else | 362 | event->setHasRecurrenceID( false ); |
383 | event->recurrence()->unsetRecurs(); | 363 | event->recurrence()->unsetRecurs(); |
364 | } | ||
384 | } | 365 | } |
385 | 366 | ||
386 | bool KOTodoEditor::validateInput() | 367 | bool KOTodoEditor::validateInput() |
387 | { | 368 | { |
388 | if (!mGeneral->validateInput()) return false; | 369 | if (!mGeneral->validateInput()) return false; |
389 | if (!mDetails->validateInput()) return false; | 370 | if (!mDetails->validateInput()) return false; |
390 | return true; | 371 | return true; |
391 | } | 372 | } |
392 | 373 | ||
393 | int KOTodoEditor::msgItemDelete() | 374 | int KOTodoEditor::msgItemDelete() |
394 | { | 375 | { |
395 | return KMessageBox::warningContinueCancel(this, | 376 | return KMessageBox::warningContinueCancel(this, |
396 | i18n("This item will be permanently deleted."), | 377 | i18n("This item will be permanently deleted."), |
397 | i18n("KOrganizer Confirmation"),i18n("Delete")); | 378 | i18n("KOrganizer Confirmation"),i18n("Delete")); |
398 | } | 379 | } |
399 | 380 | ||
400 | void KOTodoEditor::modified (int modification) | 381 | void KOTodoEditor::modified (int modification) |
401 | { | 382 | { |
402 | if (modification == KOGlobals::CATEGORY_MODIFIED || | 383 | if (modification == KOGlobals::CATEGORY_MODIFIED || |
403 | KOGlobals::UNKNOWN_MODIFIED == modification ) | 384 | KOGlobals::UNKNOWN_MODIFIED == modification ) |
404 | // mCategoryDialog->setSelected (mTodo->categories ()); | 385 | // mCategoryDialog->setSelected (mTodo->categories ()); |
405 | mGeneral->modified (mTodo, modification); | 386 | mGeneral->modified (mTodo, modification); |
406 | 387 | ||
407 | } | 388 | } |
408 | 389 | ||
409 | void KOTodoEditor::slotLoadTemplate() | 390 | void KOTodoEditor::slotLoadTemplate() |
410 | { | 391 | { |
411 | 392 | ||
412 | QString fileName =locateLocal( "templates", "todos" ); | 393 | QString fileName =locateLocal( "templates", "todos" ); |
413 | QDir t_dir; | 394 | QDir t_dir; |
414 | if ( !t_dir.exists(fileName) ) | 395 | if ( !t_dir.exists(fileName) ) |
415 | t_dir.mkdir ( fileName ); | 396 | t_dir.mkdir ( fileName ); |
416 | fileName += "/todo"; | 397 | fileName += "/todo"; |
417 | fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); | 398 | fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); |
418 | if ( fileName.length() == 0 ) | 399 | if ( fileName.length() == 0 ) |
419 | return; | 400 | return; |
420 | CalendarLocal cal; | 401 | CalendarLocal cal; |
421 | ICalFormat format; | 402 | ICalFormat format; |
422 | if ( !format.load( &cal, fileName ) ) { | 403 | if ( !format.load( &cal, fileName ) ) { |
423 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 404 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
424 | .arg( fileName ) ); | 405 | .arg( fileName ) ); |
425 | return ; | 406 | return ; |
426 | } | 407 | } |
427 | QPtrList<Todo> todos = cal.todos(); | 408 | QPtrList<Todo> todos = cal.todos(); |
428 | Todo * todo = todos.first(); | 409 | Todo * todo = todos.first(); |
429 | if ( !todo ) { | 410 | if ( !todo ) { |
430 | KMessageBox::error( this, | 411 | KMessageBox::error( this, |
431 | i18n("Template does not\ncontain a valid Todo.")); | 412 | i18n("Template does not\ncontain a valid Todo.")); |
432 | } else { | 413 | } else { |
433 | readTodo( todo ); | 414 | readTodo( todo ); |
434 | } | 415 | } |
435 | 416 | ||
436 | } | 417 | } |
437 | 418 | ||
438 | void KOTodoEditor::slotSaveTemplate() | 419 | void KOTodoEditor::slotSaveTemplate() |
439 | { | 420 | { |
440 | QString fileName =locateLocal( "templates", "todos" ); | 421 | QString fileName =locateLocal( "templates", "todos" ); |
441 | QDir t_dir; | 422 | QDir t_dir; |
442 | if ( !t_dir.exists(fileName) ) | 423 | if ( !t_dir.exists(fileName) ) |
443 | t_dir.mkdir ( fileName ); | 424 | t_dir.mkdir ( fileName ); |
444 | fileName += "/todo"; | 425 | fileName += "/todo"; |
445 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this ); | 426 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this ); |
446 | if ( fileName.length() > 0 ) | 427 | if ( fileName.length() > 0 ) |
447 | saveTemplate( fileName ); | 428 | saveTemplate( fileName ); |
448 | } | 429 | } |
449 | 430 | ||
450 | void KOTodoEditor::saveTemplate( const QString &templateName ) | 431 | void KOTodoEditor::saveTemplate( const QString &templateName ) |
451 | { | 432 | { |
452 | Todo *todo = new Todo; | 433 | Todo *todo = new Todo; |
453 | writeTodo( todo ); | 434 | writeTodo( todo ); |
454 | saveAsTemplate( todo, templateName ); | 435 | saveAsTemplate( todo, templateName ); |
455 | } | 436 | } |
@@ -1 +1 @@ | |||
version = "2.0.11"; | version = "2.0.12"; | ||