-rw-r--r-- | bin/kdepim/WhatsNew.txt | 1 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 72 | ||||
-rw-r--r-- | libkcal/event.cpp | 20 | ||||
-rw-r--r-- | libkcal/event.h | 1 |
4 files changed, 71 insertions, 23 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 1f06f1e..c0d63e5 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,263 +1,264 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.16 ************ | 3 | ********** VERSION 2.1.16 ************ |
4 | 4 | ||
5 | Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. | 5 | Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. |
6 | Added columns for datetime in todo view: Last modified, created and last modified subtodo | 6 | Added columns for datetime in todo view: Last modified, created and last modified subtodo |
7 | Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. | 7 | Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. |
8 | Made conflict detection up to 4 times faster. | ||
8 | 9 | ||
9 | ********** VERSION 2.1.15 ************ | 10 | ********** VERSION 2.1.15 ************ |
10 | 11 | ||
11 | Fixed two layout problems on the Z: | 12 | Fixed two layout problems on the Z: |
12 | Made the with of the newly added buttons on the Quick-Todo smaller. | 13 | Made the with of the newly added buttons on the Quick-Todo smaller. |
13 | Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. | 14 | Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. |
14 | 15 | ||
15 | 16 | ||
16 | ********** VERSION 2.1.14 ************ | 17 | ********** VERSION 2.1.14 ************ |
17 | 18 | ||
18 | Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. | 19 | Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. |
19 | Added a button to add a subtodo quickly. | 20 | Added a button to add a subtodo quickly. |
20 | 21 | ||
21 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). | 22 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). |
22 | Added an option to change the layout of the list week to column mode. | 23 | Added an option to change the layout of the list week to column mode. |
23 | 24 | ||
24 | Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. | 25 | Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. |
25 | 26 | ||
26 | Fixed pi-sync problems with the new multi calendar feature. | 27 | Fixed pi-sync problems with the new multi calendar feature. |
27 | Now pi-sync behaviour should be: | 28 | Now pi-sync behaviour should be: |
28 | 1) Local sends file request ( as usual ) | 29 | 1) Local sends file request ( as usual ) |
29 | 2) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. | 30 | 2) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. |
30 | 3) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). | 31 | 3) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). |
31 | If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. | 32 | If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. |
32 | 4) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. | 33 | 4) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. |
33 | If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. | 34 | If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. |
34 | 35 | ||
35 | Summary: | 36 | Summary: |
36 | No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner. | 37 | No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner. |
37 | If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour. | 38 | If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour. |
38 | Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars. | 39 | Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars. |
39 | 40 | ||
40 | ********** VERSION 2.1.13 ************ | 41 | ********** VERSION 2.1.13 ************ |
41 | 42 | ||
42 | Fixed a problem in KA/Pi search. | 43 | Fixed a problem in KA/Pi search. |
43 | Fixed some minor problems in KO/Pi. | 44 | Fixed some minor problems in KO/Pi. |
44 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. | 45 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. |
45 | 46 | ||
46 | Fixed memory usage problems in KA/Pi: | 47 | Fixed memory usage problems in KA/Pi: |
47 | When loading data KA/Pi did load the file data twice. | 48 | When loading data KA/Pi did load the file data twice. |
48 | Example: | 49 | Example: |
49 | A 600k file did consume 1200k memory during loading process. | 50 | A 600k file did consume 1200k memory during loading process. |
50 | This is fixed, it does now consume only 600k during loading process. | 51 | This is fixed, it does now consume only 600k during loading process. |
51 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. | 52 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. |
52 | This is fixed. | 53 | This is fixed. |
53 | Example: | 54 | Example: |
54 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. | 55 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. |
55 | When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. | 56 | When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. |
56 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. | 57 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. |
57 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. | 58 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. |
58 | The saving of data may be a bit slower now. | 59 | The saving of data may be a bit slower now. |
59 | 60 | ||
60 | Fixed memory usage problems in KO/Pi: | 61 | Fixed memory usage problems in KO/Pi: |
61 | When KO/Pi did save the data to file, it did not release the used buffers after saving. | 62 | When KO/Pi did save the data to file, it did not release the used buffers after saving. |
62 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. | 63 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. |
63 | This is fixed. | 64 | This is fixed. |
64 | Example: | 65 | Example: |
65 | When saving a 400k file KO/Pi do now use 400k less memory now. | 66 | When saving a 400k file KO/Pi do now use 400k less memory now. |
66 | 67 | ||
67 | Optimized memory usage in KO/Pi Agenda view: | 68 | Optimized memory usage in KO/Pi Agenda view: |
68 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. | 69 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. |
69 | These buffers were not made smaller (i.e. downsized) because of performance reasons. | 70 | These buffers were not made smaller (i.e. downsized) because of performance reasons. |
70 | The handling of these buffers are now much smarter: | 71 | The handling of these buffers are now much smarter: |
71 | Two (of six) buffers are removed completely. | 72 | Two (of six) buffers are removed completely. |
72 | The remaing four buffers are now downsized after not using the agenda view for 45 seconds. | 73 | The remaing four buffers are now downsized after not using the agenda view for 45 seconds. |
73 | Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi. | 74 | Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi. |
74 | 75 | ||
75 | Worst case example ( for a maximum size agenda content): | 76 | Worst case example ( for a maximum size agenda content): |
76 | When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem. | 77 | When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem. |
77 | 78 | ||
78 | When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower. | 79 | When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower. |
79 | 80 | ||
80 | Summary: | 81 | Summary: |
81 | Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. | 82 | Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. |
82 | 83 | ||
83 | ********** VERSION 2.1.12 ************ | 84 | ********** VERSION 2.1.12 ************ |
84 | 85 | ||
85 | KO/Pi: | 86 | KO/Pi: |
86 | Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. | 87 | Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. |
87 | Fixed a problem with the month view when file was saved but KO/Pi was not the active window. | 88 | Fixed a problem with the month view when file was saved but KO/Pi was not the active window. |
88 | Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). | 89 | Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). |
89 | Fixed some other small problems. | 90 | Fixed some other small problems. |
90 | 91 | ||
91 | ********** VERSION 2.1.11 ************ | 92 | ********** VERSION 2.1.11 ************ |
92 | 93 | ||
93 | KO/Pi: | 94 | KO/Pi: |
94 | Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. | 95 | Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. |
95 | Added features to handle (and add ) more than one journal entry per day. | 96 | Added features to handle (and add ) more than one journal entry per day. |
96 | Added option for a journal title. | 97 | Added option for a journal title. |
97 | 98 | ||
98 | Added info about the calendar, the item belongs to, to the event/todo/journal viewer. | 99 | Added info about the calendar, the item belongs to, to the event/todo/journal viewer. |
99 | Fixed a problem of the alarm of completed recurring todos. | 100 | Fixed a problem of the alarm of completed recurring todos. |
100 | Added to the event/todo editor to set quickly the category of an item. | 101 | Added to the event/todo editor to set quickly the category of an item. |
101 | 102 | ||
102 | 103 | ||
103 | Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. | 104 | Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. |
104 | 105 | ||
105 | Added KA/Pi multi sync to the multi sync called from the alarm applet. | 106 | Added KA/Pi multi sync to the multi sync called from the alarm applet. |
106 | 107 | ||
107 | ********** VERSION 2.1.10 ************ | 108 | ********** VERSION 2.1.10 ************ |
108 | 109 | ||
109 | KO/Pi: | 110 | KO/Pi: |
110 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | 111 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. |
111 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. | 112 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. |
112 | Fixed a bug in searching for a small timerange, i.e. one day. | 113 | Fixed a bug in searching for a small timerange, i.e. one day. |
113 | 114 | ||
114 | KA/Pi: | 115 | KA/Pi: |
115 | Fixed two problems in csv export. | 116 | Fixed two problems in csv export. |
116 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. | 117 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. |
117 | 118 | ||
118 | ********** VERSION 2.1.9 ************ | 119 | ********** VERSION 2.1.9 ************ |
119 | 120 | ||
120 | KO/Pi: | 121 | KO/Pi: |
121 | Fixed some problems of the new search options in the search dialog. | 122 | Fixed some problems of the new search options in the search dialog. |
122 | Fixed some problems in the new resource config options. | 123 | Fixed some problems in the new resource config options. |
123 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. | 124 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. |
124 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: | 125 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: |
125 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. | 126 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. |
126 | 127 | ||
127 | Fixed a problem in recurrence range in syncing with DTM. | 128 | Fixed a problem in recurrence range in syncing with DTM. |
128 | 129 | ||
129 | KA/Pi: | 130 | KA/Pi: |
130 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) | 131 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) |
131 | 132 | ||
132 | PwM/Pi: | 133 | PwM/Pi: |
133 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. | 134 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. |
134 | 135 | ||
135 | ********** VERSION 2.1.8 ************ | 136 | ********** VERSION 2.1.8 ************ |
136 | 137 | ||
137 | KO/Pi: | 138 | KO/Pi: |
138 | Added info about the completion state of a todo in the ListView/Searchdialog. | 139 | Added info about the completion state of a todo in the ListView/Searchdialog. |
139 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 140 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
140 | Fixed some updating problems when changing the filter. | 141 | Fixed some updating problems when changing the filter. |
141 | 142 | ||
142 | KA/Pi: | 143 | KA/Pi: |
143 | In the addressee selection dialog now the formatted name is shown, if not empty. | 144 | In the addressee selection dialog now the formatted name is shown, if not empty. |
144 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 145 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
145 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 146 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
146 | 147 | ||
147 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 148 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
148 | Fixed the sorting for size in the file selector on the Z. | 149 | Fixed the sorting for size in the file selector on the Z. |
149 | 150 | ||
150 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 151 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
151 | 152 | ||
152 | ********** VERSION 2.1.7 ************ | 153 | ********** VERSION 2.1.7 ************ |
153 | 154 | ||
154 | KO/Pi: | 155 | KO/Pi: |
155 | Fixed several problems in the new Resource handling. | 156 | Fixed several problems in the new Resource handling. |
156 | Added more options to the search dialog. | 157 | Added more options to the search dialog. |
157 | Fixed a problem in the Month view. | 158 | Fixed a problem in the Month view. |
158 | Added more options to the dialog when setting a todo to stopped. | 159 | Added more options to the dialog when setting a todo to stopped. |
159 | 160 | ||
160 | Fixed two small problems in KO/Pi Alarm applet. | 161 | Fixed two small problems in KO/Pi Alarm applet. |
161 | 162 | ||
162 | ********** VERSION 2.1.6 ************ | 163 | ********** VERSION 2.1.6 ************ |
163 | 164 | ||
164 | This release is for testing only. | 165 | This release is for testing only. |
165 | 166 | ||
166 | KO/Pi: | 167 | KO/Pi: |
167 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 168 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
168 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 169 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
169 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 170 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
170 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 171 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
171 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 172 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
172 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 173 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
173 | 174 | ||
174 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 175 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
175 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | 176 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. |
176 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 177 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
177 | 178 | ||
178 | A calendar is enabled in the resource view if the "eye" column is checked. | 179 | A calendar is enabled in the resource view if the "eye" column is checked. |
179 | You can set a calendar to be the default for new items( "+" column ). | 180 | You can set a calendar to be the default for new items( "+" column ). |
180 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 181 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
181 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | 182 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... |
182 | 183 | ||
183 | 184 | ||
184 | ********** VERSION 2.1.5 ************ | 185 | ********** VERSION 2.1.5 ************ |
185 | 186 | ||
186 | This is the new stable version. | 187 | This is the new stable version. |
187 | Bugfix: | 188 | Bugfix: |
188 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 189 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
189 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 190 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
190 | Added config option to not display completed todos in agenda view. | 191 | Added config option to not display completed todos in agenda view. |
191 | Addressee view is now using the formatted name, if defined. | 192 | Addressee view is now using the formatted name, if defined. |
192 | That makes it possible to display "lastname, firstname" in that view now. | 193 | That makes it possible to display "lastname, firstname" in that view now. |
193 | To set the formatted name for all contacts, please use menu: | 194 | To set the formatted name for all contacts, please use menu: |
194 | Edit->Change->Set formatted name. | 195 | Edit->Change->Set formatted name. |
195 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 196 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
196 | 197 | ||
197 | ********** VERSION 2.1.4 ************ | 198 | ********** VERSION 2.1.4 ************ |
198 | 199 | ||
199 | Fixed two more bugs in the KA/Pi CSV import dialog: | 200 | Fixed two more bugs in the KA/Pi CSV import dialog: |
200 | Made it possible to read multi-line fields and import it to the "Note" field. | 201 | Made it possible to read multi-line fields and import it to the "Note" field. |
201 | Fixed a problem in mapping custom fields, whatever a custem field is... | 202 | Fixed a problem in mapping custom fields, whatever a custem field is... |
202 | 203 | ||
203 | ********** VERSION 2.1.3 ************ | 204 | ********** VERSION 2.1.3 ************ |
204 | 205 | ||
205 | Changed the menu structure of the alarm applet: | 206 | Changed the menu structure of the alarm applet: |
206 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 207 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
207 | 208 | ||
208 | Fixed several problems in the KA/Pi CSV import dialog: | 209 | Fixed several problems in the KA/Pi CSV import dialog: |
209 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 210 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
210 | 211 | ||
211 | 212 | ||
212 | ********** VERSION 2.1.2 ************ | 213 | ********** VERSION 2.1.2 ************ |
213 | 214 | ||
214 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 215 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
215 | 216 | ||
216 | Fixed a problem when importing data from Outlook with mutiple categories set. | 217 | Fixed a problem when importing data from Outlook with mutiple categories set. |
217 | 218 | ||
218 | Changed display of days in datenavigator: | 219 | Changed display of days in datenavigator: |
219 | Birthdays are now blue, not dark green. | 220 | Birthdays are now blue, not dark green. |
220 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 221 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
221 | When journal view is shown, only holidays are shown and days with journals are blue. | 222 | When journal view is shown, only holidays are shown and days with journals are blue. |
222 | 223 | ||
223 | Added Backup options to global config: | 224 | Added Backup options to global config: |
224 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). | 225 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). |
225 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. | 226 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. |
226 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. | 227 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. |
227 | 228 | ||
228 | ********** VERSION 2.1.1 ************ | 229 | ********** VERSION 2.1.1 ************ |
229 | 230 | ||
230 | Stable release 2.1.1! | 231 | Stable release 2.1.1! |
231 | 232 | ||
232 | KO/Pi: | 233 | KO/Pi: |
233 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. | 234 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. |
234 | 235 | ||
235 | ********** VERSION 2.1.0 ************ | 236 | ********** VERSION 2.1.0 ************ |
236 | 237 | ||
237 | Stable release 2.1.0! | 238 | Stable release 2.1.0! |
238 | 239 | ||
239 | Summary of changes/fixes compared to version 2.0.6: | 240 | Summary of changes/fixes compared to version 2.0.6: |
240 | 241 | ||
241 | Many bugs of version 2.0.6 fixed. | 242 | Many bugs of version 2.0.6 fixed. |
242 | Most of them were small bugs, but some of them were important. | 243 | Most of them were small bugs, but some of them were important. |
243 | It is recommended to use version 2.1.0 and not version 2.0.6. | 244 | It is recommended to use version 2.1.0 and not version 2.0.6. |
244 | 245 | ||
245 | Important changes: | 246 | Important changes: |
246 | 247 | ||
247 | Added recurring todos to KO/Pi. | 248 | Added recurring todos to KO/Pi. |
248 | 249 | ||
249 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. | 250 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. |
250 | 251 | ||
251 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 252 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
252 | 253 | ||
253 | Datenavigator can now display many months. Very useful on the desktop. | 254 | Datenavigator can now display many months. Very useful on the desktop. |
254 | 255 | ||
255 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. | 256 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. |
256 | 257 | ||
257 | Made alarm sound working on Linux desktop. | 258 | Made alarm sound working on Linux desktop. |
258 | 259 | ||
259 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. | 260 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. |
260 | 261 | ||
261 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. | 262 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. |
262 | 263 | ||
263 | Many other usebility enhancements. | 264 | Many other usebility enhancements. |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a9e402e..427d71b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -406,581 +406,598 @@ void CalendarView::init() | |||
406 | mTodoList->setNavigator( mNavigator ); | 406 | mTodoList->setNavigator( mNavigator ); |
407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
408 | 408 | ||
409 | #ifdef KORG_NORESOURCEVIEW | 409 | #ifdef KORG_NORESOURCEVIEW |
410 | mResourceView = 0; | 410 | mResourceView = 0; |
411 | #else | 411 | #else |
412 | if ( mResourceManager ) { | 412 | if ( mResourceManager ) { |
413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
414 | mResourceView->updateView(); | 414 | mResourceView->updateView(); |
415 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 415 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
416 | SLOT( updateView() ) ); | 416 | SLOT( updateView() ) ); |
417 | } else { | 417 | } else { |
418 | mResourceView = 0; | 418 | mResourceView = 0; |
419 | } | 419 | } |
420 | #endif | 420 | #endif |
421 | QWidget *rightBox = new QWidget( mPanner ); | 421 | QWidget *rightBox = new QWidget( mPanner ); |
422 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 422 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
423 | 423 | ||
424 | mRightFrame = new QWidgetStack( rightBox ); | 424 | mRightFrame = new QWidgetStack( rightBox ); |
425 | rightLayout->addWidget( mRightFrame, 1 ); | 425 | rightLayout->addWidget( mRightFrame, 1 ); |
426 | 426 | ||
427 | mLeftFrame = mLeftSplitter; | 427 | mLeftFrame = mLeftSplitter; |
428 | #else | 428 | #else |
429 | //QWidget *mainBox = new QWidget( this ); | 429 | //QWidget *mainBox = new QWidget( this ); |
430 | //QWidget *leftFrame = new QWidget( mainBox ); | 430 | //QWidget *leftFrame = new QWidget( mainBox ); |
431 | //QBoxLayout * mainBoxLayout; | 431 | //QBoxLayout * mainBoxLayout; |
432 | if ( KOPrefs::instance()->mVerticalScreen ) { | 432 | if ( KOPrefs::instance()->mVerticalScreen ) { |
433 | //mainBoxLayout = new QVBoxLayout(mainBox); | 433 | //mainBoxLayout = new QVBoxLayout(mainBox); |
434 | //leftFrameLayout = new QHBoxLayout(leftFrame ); | 434 | //leftFrameLayout = new QHBoxLayout(leftFrame ); |
435 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); | 435 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); |
436 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 436 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
437 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; | 437 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; |
438 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 438 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
439 | } else { | 439 | } else { |
440 | //mainBoxLayout = new QHBoxLayout(mainBox); | 440 | //mainBoxLayout = new QHBoxLayout(mainBox); |
441 | //leftFrameLayout = new QVBoxLayout(leftFrame ); | 441 | //leftFrameLayout = new QVBoxLayout(leftFrame ); |
442 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 442 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
443 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); | 443 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); |
444 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); | 444 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); |
445 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 445 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
446 | } | 446 | } |
447 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 447 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
448 | //QBoxLayout * leftFrameLayout; | 448 | //QBoxLayout * leftFrameLayout; |
449 | topLayout->addWidget( mMainFrame ); | 449 | topLayout->addWidget( mMainFrame ); |
450 | #ifdef DESKTOP_VERSION | 450 | #ifdef DESKTOP_VERSION |
451 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); | 451 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); |
452 | topLayout->addWidget( mDateScrollBar ); | 452 | topLayout->addWidget( mDateScrollBar ); |
453 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); | 453 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); |
454 | if ( QApplication::desktop()->width() < 800 ) | 454 | if ( QApplication::desktop()->width() < 800 ) |
455 | mDateScrollBar->hide(); | 455 | mDateScrollBar->hide(); |
456 | #endif | 456 | #endif |
457 | //mainBoxLayout->addWidget (mLeftFrame); | 457 | //mainBoxLayout->addWidget (mLeftFrame); |
458 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, | 458 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, |
459 | "CalendarView::DateNavigator" ); | 459 | "CalendarView::DateNavigator" ); |
460 | #if 0 | 460 | #if 0 |
461 | // FIXME | 461 | // FIXME |
462 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 462 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
463 | "CalendarView::DateNavigator", QDate::currentDate()); | 463 | "CalendarView::DateNavigator", QDate::currentDate()); |
464 | #endif | 464 | #endif |
465 | // mDateNavigator->blockSignals( true ); | 465 | // mDateNavigator->blockSignals( true ); |
466 | //leftFrameLayout->addWidget( mDateNavigator ); | 466 | //leftFrameLayout->addWidget( mDateNavigator ); |
467 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 467 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
468 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 468 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
469 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); | 469 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); |
470 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 470 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
471 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 471 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
472 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); | 472 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 474 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
475 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 475 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
476 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 476 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
477 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 477 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
478 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | 478 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); |
479 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 479 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
480 | 480 | ||
481 | mTodoList->setNavigator( mNavigator ); | 481 | mTodoList->setNavigator( mNavigator ); |
482 | #if 0 | 482 | #if 0 |
483 | if ( QApplication::desktop()->width() < 480 ) { | 483 | if ( QApplication::desktop()->width() < 480 ) { |
484 | leftFrameLayout->addWidget(mFilterView); | 484 | leftFrameLayout->addWidget(mFilterView); |
485 | leftFrameLayout->addWidget(mTodoList, 2 ); | 485 | leftFrameLayout->addWidget(mTodoList, 2 ); |
486 | 486 | ||
487 | } else { | 487 | } else { |
488 | leftFrameLayout->addWidget(mTodoList,2 ); | 488 | leftFrameLayout->addWidget(mTodoList,2 ); |
489 | leftFrameLayout->addWidget(mFilterView ); | 489 | leftFrameLayout->addWidget(mFilterView ); |
490 | } | 490 | } |
491 | #endif | 491 | #endif |
492 | mFilterView->hide(); | 492 | mFilterView->hide(); |
493 | mCalEditView->hide(); | 493 | mCalEditView->hide(); |
494 | QWidget *rightBox = new QWidget( mMainFrame ); | 494 | QWidget *rightBox = new QWidget( mMainFrame ); |
495 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 495 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
496 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 496 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
497 | mRightFrame = new QWidgetStack( rightBox ); | 497 | mRightFrame = new QWidgetStack( rightBox ); |
498 | rightLayout->addWidget( mRightFrame, 10 ); | 498 | rightLayout->addWidget( mRightFrame, 10 ); |
499 | 499 | ||
500 | //mLeftFrame = (QWidget *)leftFrame; | 500 | //mLeftFrame = (QWidget *)leftFrame; |
501 | if ( KOPrefs::instance()->mVerticalScreen ) { | 501 | if ( KOPrefs::instance()->mVerticalScreen ) { |
502 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 502 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
503 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 503 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
504 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 504 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
505 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 505 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
506 | } else { | 506 | } else { |
507 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 507 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
508 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 508 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
509 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 509 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
510 | } | 510 | } |
511 | if ( !KOPrefs::instance()->mShowDateNavigator) | 511 | if ( !KOPrefs::instance()->mShowDateNavigator) |
512 | mDateNavigator->hide(); | 512 | mDateNavigator->hide(); |
513 | //qDebug("Calendarview Size %d %d ", width(), height()); | 513 | //qDebug("Calendarview Size %d %d ", width(), height()); |
514 | #endif | 514 | #endif |
515 | 515 | ||
516 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 516 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
517 | SLOT( showDates( const KCal::DateList & ) ) ); | 517 | SLOT( showDates( const KCal::DateList & ) ) ); |
518 | 518 | ||
519 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 519 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
520 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 520 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
521 | 521 | ||
522 | 522 | ||
523 | 523 | ||
524 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), | 524 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), |
525 | mViewManager, SLOT( showMonth( const QDate & ) ) ); | 525 | mViewManager, SLOT( showMonth( const QDate & ) ) ); |
526 | 526 | ||
527 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 527 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
528 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 528 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
529 | 529 | ||
530 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 530 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
531 | mNavigator, SLOT( selectPreviousYear() ) ); | 531 | mNavigator, SLOT( selectPreviousYear() ) ); |
532 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 532 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
533 | mNavigator, SLOT( selectNextYear() ) ); | 533 | mNavigator, SLOT( selectNextYear() ) ); |
534 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 534 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
535 | mNavigator, SLOT( selectPreviousMonth() ) ); | 535 | mNavigator, SLOT( selectPreviousMonth() ) ); |
536 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 536 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
537 | mNavigator, SLOT( selectNextMonth() ) ); | 537 | mNavigator, SLOT( selectNextMonth() ) ); |
538 | 538 | ||
539 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 539 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
540 | mNavigator, SLOT( selectPrevious() ) ); | 540 | mNavigator, SLOT( selectPrevious() ) ); |
541 | connect( mDateNavigator, SIGNAL( goNext() ), | 541 | connect( mDateNavigator, SIGNAL( goNext() ), |
542 | mNavigator, SLOT( selectNext() ) ); | 542 | mNavigator, SLOT( selectNext() ) ); |
543 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 543 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
544 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 544 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
545 | 545 | ||
546 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 546 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
547 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 547 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
548 | #if 0 | 548 | #if 0 |
549 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 549 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
550 | SLOT( incidenceAdded( Incidence *) ) ); | 550 | SLOT( incidenceAdded( Incidence *) ) ); |
551 | #endif | 551 | #endif |
552 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 552 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
553 | 553 | ||
554 | connect( this, SIGNAL( configChanged() ), | 554 | connect( this, SIGNAL( configChanged() ), |
555 | mDateNavigator, SLOT( updateConfig() ) ); | 555 | mDateNavigator, SLOT( updateConfig() ) ); |
556 | 556 | ||
557 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 557 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
558 | SLOT( newTodo() ) ); | 558 | SLOT( newTodo() ) ); |
559 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 559 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
560 | SLOT( newSubTodo( Todo * ) ) ); | 560 | SLOT( newSubTodo( Todo * ) ) ); |
561 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 561 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
562 | SLOT( editTodo( Todo * ) ) ); | 562 | SLOT( editTodo( Todo * ) ) ); |
563 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 563 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
564 | SLOT( showTodo( Todo *) ) ); | 564 | SLOT( showTodo( Todo *) ) ); |
565 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 565 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
566 | SLOT( deleteTodo( Todo *) ) ); | 566 | SLOT( deleteTodo( Todo *) ) ); |
567 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 567 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
568 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 568 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
569 | SLOT( purgeCompleted() ) ); | 569 | SLOT( purgeCompleted() ) ); |
570 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 570 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
571 | SIGNAL( todoModified( Todo *, int ) ) ); | 571 | SIGNAL( todoModified( Todo *, int ) ) ); |
572 | 572 | ||
573 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), | 573 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), |
574 | this, SLOT ( cloneIncidence( Incidence * ) ) ); | 574 | this, SLOT ( cloneIncidence( Incidence * ) ) ); |
575 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), | 575 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), |
576 | this, SLOT (cancelIncidence( Incidence * ) ) ); | 576 | this, SLOT (cancelIncidence( Incidence * ) ) ); |
577 | 577 | ||
578 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), | 578 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), |
579 | this, SLOT ( moveIncidence( Incidence * ) ) ); | 579 | this, SLOT ( moveIncidence( Incidence * ) ) ); |
580 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), | 580 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), |
581 | this, SLOT ( beamIncidence( Incidence * ) ) ); | 581 | this, SLOT ( beamIncidence( Incidence * ) ) ); |
582 | 582 | ||
583 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), | 583 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), |
584 | this, SLOT ( todo_unsub( Todo * ) ) ); | 584 | this, SLOT ( todo_unsub( Todo * ) ) ); |
585 | 585 | ||
586 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 586 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
587 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); | 587 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); |
588 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, | 588 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, |
589 | SLOT( updateTodo( Todo *, int ) ) ); | 589 | SLOT( updateTodo( Todo *, int ) ) ); |
590 | connect( this, SIGNAL( todoModified( Todo *, int )), this, | 590 | connect( this, SIGNAL( todoModified( Todo *, int )), this, |
591 | SLOT( changeTodoDisplay( Todo *, int ) ) ); | 591 | SLOT( changeTodoDisplay( Todo *, int ) ) ); |
592 | 592 | ||
593 | 593 | ||
594 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); | 594 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); |
595 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); | 595 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); |
596 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); | 596 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); |
597 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); | 597 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); |
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | 602 | ||
603 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), | 603 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), |
604 | SLOT(checkClipboard())); | 604 | SLOT(checkClipboard())); |
605 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 605 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
606 | SLOT( processTodoListSelection( Incidence * ) ) ); | 606 | SLOT( processTodoListSelection( Incidence * ) ) ); |
607 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 607 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
608 | 608 | ||
609 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 609 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
610 | 610 | ||
611 | mDateFrame = new QVBox(0,0,WType_Popup); | 611 | mDateFrame = new QVBox(0,0,WType_Popup); |
612 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 612 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
613 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 613 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
614 | mDateFrame->setLineWidth(3); | 614 | mDateFrame->setLineWidth(3); |
615 | mDateFrame->hide(); | 615 | mDateFrame->hide(); |
616 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 616 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
617 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 617 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
618 | 618 | ||
619 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 619 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
620 | 620 | ||
621 | mEventEditor = mDialogManager->getEventEditor(); | 621 | mEventEditor = mDialogManager->getEventEditor(); |
622 | mTodoEditor = mDialogManager->getTodoEditor(); | 622 | mTodoEditor = mDialogManager->getTodoEditor(); |
623 | 623 | ||
624 | mFlagEditDescription = false; | 624 | mFlagEditDescription = false; |
625 | 625 | ||
626 | mSuspendTimer = new QTimer( this ); | 626 | mSuspendTimer = new QTimer( this ); |
627 | mAlarmTimer = new QTimer( this ); | 627 | mAlarmTimer = new QTimer( this ); |
628 | mRecheckAlarmTimer = new QTimer( this ); | 628 | mRecheckAlarmTimer = new QTimer( this ); |
629 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 629 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
630 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 630 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
631 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 631 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
632 | mAlarmDialog = new AlarmDialog( this ); | 632 | mAlarmDialog = new AlarmDialog( this ); |
633 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 633 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
634 | mAlarmDialog->setServerNotification( false ); | 634 | mAlarmDialog->setServerNotification( false ); |
635 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 635 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
636 | 636 | ||
637 | 637 | ||
638 | #ifndef DESKTOP_VERSION | 638 | #ifndef DESKTOP_VERSION |
639 | //US listen for arriving address resultsets | 639 | //US listen for arriving address resultsets |
640 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 640 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
641 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 641 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
642 | #endif | 642 | #endif |
643 | mDateNavigator->setCalendar( mCalendar ); | 643 | mDateNavigator->setCalendar( mCalendar ); |
644 | } | 644 | } |
645 | 645 | ||
646 | 646 | ||
647 | CalendarView::~CalendarView() | 647 | CalendarView::~CalendarView() |
648 | { | 648 | { |
649 | // kdDebug() << "~CalendarView()" << endl; | 649 | // kdDebug() << "~CalendarView()" << endl; |
650 | //qDebug("CalendarView::~CalendarView() "); | 650 | //qDebug("CalendarView::~CalendarView() "); |
651 | delete mDialogManager; | 651 | delete mDialogManager; |
652 | delete mViewManager; | 652 | delete mViewManager; |
653 | delete mStorage; | 653 | delete mStorage; |
654 | delete mDateFrame ; | 654 | delete mDateFrame ; |
655 | delete mEventViewerDialog; | 655 | delete mEventViewerDialog; |
656 | //kdDebug() << "~CalendarView() done" << endl; | 656 | //kdDebug() << "~CalendarView() done" << endl; |
657 | } | 657 | } |
658 | 658 | ||
659 | 659 | ||
660 | void CalendarView::nextConflict( bool all, bool allday ) | 660 | void CalendarView::nextConflict( bool all, bool allday ) |
661 | { | 661 | { |
662 | 662 | static bool block = false; | |
663 | if ( block ) return; | ||
664 | block = true; | ||
663 | QPtrList<Event> testlist = mCalendar->events(); | 665 | QPtrList<Event> testlist = mCalendar->events(); |
664 | Event * test = testlist.first(); | 666 | Event * test = testlist.first(); |
665 | while ( test ) { | 667 | while ( test ) { |
666 | test->setTagged( false ); | 668 | test->setTagged( false ); |
667 | test = testlist.next(); | 669 | test = testlist.next(); |
668 | } | 670 | } |
669 | QTime st ( 0,0,0); | 671 | QTime st ( 0,0,0); |
670 | if ( mViewManager->currentView() == mViewManager->agendaView() ) | 672 | if ( mViewManager->currentView() == mViewManager->agendaView() ) |
671 | st = mViewManager->agendaView()->agenda()->getEndTime(); | 673 | st = mViewManager->agendaView()->agenda()->getEndTime(); |
672 | //qDebug("time %s ", st.toString().latin1()); | 674 | //qDebug("time %s ", st.toString().latin1()); |
673 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); | 675 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); |
674 | QDateTime conflict; | 676 | QDateTime conflict; |
675 | QDateTime retVal; | 677 | QDateTime retVal; |
676 | bool found = false; | 678 | bool found = false; |
677 | Event * cE = 0; | 679 | Event * cE = 0; |
678 | Event * cE2 = 0; | 680 | Event * cE2 = 0; |
679 | QPtrList<Event> testlist2 = testlist; | 681 | QPtrList<Event> testlist2 = testlist; |
680 | test = testlist.first(); | 682 | test = testlist.first(); |
681 | bool skip = false; | 683 | bool skip = false; |
682 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); | 684 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); |
685 | //QTime tm; | ||
686 | //tm.start(); | ||
683 | while ( test ) { | 687 | while ( test ) { |
684 | qApp->processEvents(); | 688 | qApp->processEvents(); |
685 | skip = false; | 689 | skip = false; |
686 | if ( !all ) skip = ( allday != test->doesFloat() ); | 690 | if ( !all ) skip = ( allday != test->doesFloat() ); |
687 | if ( !skip ) { | 691 | if ( !skip ) { |
692 | if ( found ) | ||
693 | skip = !test->matchTime( &startDT, &conflict ); | ||
694 | else | ||
695 | skip = !test->matchTime( &startDT, 0 ); | ||
696 | } | ||
697 | if ( !skip ) { | ||
688 | Event * test2 = testlist2.first(); | 698 | Event * test2 = testlist2.first(); |
689 | while ( test2 ) { | 699 | while ( test2 ) { |
690 | skip = false; | 700 | skip = test2->isTagged(); |
691 | if ( !all ) skip = ( allday != test2->doesFloat() ); | 701 | if ( !skip && !all ) skip = ( allday != test2->doesFloat() ); |
702 | if ( !skip ) { | ||
703 | if ( found ) | ||
704 | skip = !test2->matchTime( &startDT, &conflict ); | ||
705 | else | ||
706 | skip = !test2->matchTime( &startDT, 0 ); | ||
707 | } | ||
692 | if ( !skip ) { | 708 | if ( !skip ) { |
693 | if ( !test2->isTagged() ) { | 709 | if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { |
694 | if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { | 710 | //qDebug("overlap "); |
695 | //qDebug("overlap "); | 711 | if ( ! found ) { |
696 | if ( ! found ) { | 712 | if ( retVal >= startDT ) { |
697 | if ( retVal >= startDT ) { | 713 | conflict = retVal; |
698 | conflict = retVal; | 714 | cE = test; |
699 | cE = test; | 715 | cE2 = test2; |
700 | cE2 = test2; | 716 | found = true; |
701 | found = true; | 717 | } |
702 | } | 718 | } else { |
703 | } else { | 719 | if ( retVal >= startDT && retVal < conflict ) { |
704 | if ( retVal >= startDT && retVal < conflict ) { | 720 | conflict = retVal; |
705 | conflict = retVal; | 721 | cE = test; |
706 | cE = test; | 722 | cE2 = test2; |
707 | cE2 = test2; | ||
708 | } | ||
709 | } | 723 | } |
710 | } | 724 | } |
711 | } | 725 | } |
712 | } | 726 | } |
713 | test2 = testlist2.next(); | 727 | test2 = testlist2.next(); |
714 | } | 728 | } |
715 | } | 729 | } |
716 | test->setTagged( true ); | 730 | test->setTagged( true ); |
717 | test = testlist.next(); | 731 | test = testlist.next(); |
718 | } | 732 | } |
733 | //qDebug("Search time : %d", tm.elapsed()); | ||
719 | if ( found ) { | 734 | if ( found ) { |
720 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 735 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
721 | mViewManager->showDayView(); | 736 | mViewManager->showDayView(); |
722 | mNavigator->slotDaySelect( conflict.date() ); | 737 | mNavigator->slotDaySelect( conflict.date() ); |
723 | int hour = conflict.time().hour(); | 738 | int hour = conflict.time().hour(); |
724 | mViewManager->agendaView()->setStartHour( hour ); | 739 | mViewManager->agendaView()->setStartHour( hour ); |
725 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); | 740 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); |
741 | block = false; | ||
726 | return; | 742 | return; |
727 | } | 743 | } |
728 | 744 | ||
729 | topLevelWidget()->setCaption( i18n("No conflict found") ); | 745 | topLevelWidget()->setCaption( i18n("No conflict found") ); |
730 | qDebug("No conflict found "); | 746 | qDebug("No conflict found "); |
747 | block = false; | ||
731 | return; | 748 | return; |
732 | } | 749 | } |
733 | 750 | ||
734 | void CalendarView::conflictAll() | 751 | void CalendarView::conflictAll() |
735 | { | 752 | { |
736 | nextConflict ( true, true ); | 753 | nextConflict ( true, true ); |
737 | } | 754 | } |
738 | void CalendarView::conflictAllday() | 755 | void CalendarView::conflictAllday() |
739 | { | 756 | { |
740 | nextConflict ( false, true ); | 757 | nextConflict ( false, true ); |
741 | } | 758 | } |
742 | void CalendarView::conflictNotAll() | 759 | void CalendarView::conflictNotAll() |
743 | { | 760 | { |
744 | nextConflict ( false, false ); | 761 | nextConflict ( false, false ); |
745 | } | 762 | } |
746 | 763 | ||
747 | void CalendarView::setCalReadOnly( int id, bool readO ) | 764 | void CalendarView::setCalReadOnly( int id, bool readO ) |
748 | { | 765 | { |
749 | if ( readO ) { | 766 | if ( readO ) { |
750 | emit save(); | 767 | emit save(); |
751 | } | 768 | } |
752 | mCalendar->setReadOnly( id, readO ); | 769 | mCalendar->setReadOnly( id, readO ); |
753 | } | 770 | } |
754 | void CalendarView::setScrollBarStep(int val ) | 771 | void CalendarView::setScrollBarStep(int val ) |
755 | { | 772 | { |
756 | #ifdef DESKTOP_VERSION | 773 | #ifdef DESKTOP_VERSION |
757 | mDateScrollBar->setLineStep ( val ); | 774 | mDateScrollBar->setLineStep ( val ); |
758 | #endif | 775 | #endif |
759 | } | 776 | } |
760 | void CalendarView::scrollBarValue(int val ) | 777 | void CalendarView::scrollBarValue(int val ) |
761 | { | 778 | { |
762 | #ifdef DESKTOP_VERSION | 779 | #ifdef DESKTOP_VERSION |
763 | if ( QApplication::desktop()->width() < 800 ) return; | 780 | if ( QApplication::desktop()->width() < 800 ) return; |
764 | static bool block = false; | 781 | static bool block = false; |
765 | if ( block ) return; | 782 | if ( block ) return; |
766 | block = true; | 783 | block = true; |
767 | int count = mNavigator->selectedDates().count(); | 784 | int count = mNavigator->selectedDates().count(); |
768 | int day = mNavigator->selectedDates().first().dayOfYear(); | 785 | int day = mNavigator->selectedDates().first().dayOfYear(); |
769 | int stepdays = val; | 786 | int stepdays = val; |
770 | if ( mDateScrollBar->lineStep () <= count ) { | 787 | if ( mDateScrollBar->lineStep () <= count ) { |
771 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 788 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
772 | //qDebug("VAL %d ",val ); | 789 | //qDebug("VAL %d ",val ); |
773 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 790 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
774 | stepdays = day+stepdays; | 791 | stepdays = day+stepdays; |
775 | if ( stepdays < 0 ) stepdays = 0; | 792 | if ( stepdays < 0 ) stepdays = 0; |
776 | } | 793 | } |
777 | if ( stepdays == day ) { | 794 | if ( stepdays == day ) { |
778 | block = false; | 795 | block = false; |
779 | return; | 796 | return; |
780 | } | 797 | } |
781 | int year = mNavigator->selectedDates().first().year(); | 798 | int year = mNavigator->selectedDates().first().year(); |
782 | QDate d ( year,1,1 ); | 799 | QDate d ( year,1,1 ); |
783 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); | 800 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); |
784 | block = false; | 801 | block = false; |
785 | #endif | 802 | #endif |
786 | 803 | ||
787 | } | 804 | } |
788 | void CalendarView::updateView(const QDate &start, const QDate &end) | 805 | void CalendarView::updateView(const QDate &start, const QDate &end) |
789 | { | 806 | { |
790 | #ifdef DESKTOP_VERSION | 807 | #ifdef DESKTOP_VERSION |
791 | if ( ! mDateScrollBar->draggingSlider () ) { | 808 | if ( ! mDateScrollBar->draggingSlider () ) { |
792 | int dof = start.dayOfYear(); | 809 | int dof = start.dayOfYear(); |
793 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); | 810 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); |
794 | if ( dof != mDateScrollBar->value() ) { | 811 | if ( dof != mDateScrollBar->value() ) { |
795 | mDateScrollBar->blockSignals( true ); | 812 | mDateScrollBar->blockSignals( true ); |
796 | mDateScrollBar->setValue( start.dayOfYear()); | 813 | mDateScrollBar->setValue( start.dayOfYear()); |
797 | mDateScrollBar->blockSignals( false ); | 814 | mDateScrollBar->blockSignals( false ); |
798 | } | 815 | } |
799 | } | 816 | } |
800 | #endif | 817 | #endif |
801 | mTodoList->updateView(); | 818 | mTodoList->updateView(); |
802 | mViewManager->updateView(start, end); | 819 | mViewManager->updateView(start, end); |
803 | //mDateNavigator->updateView(); | 820 | //mDateNavigator->updateView(); |
804 | } | 821 | } |
805 | 822 | ||
806 | 823 | ||
807 | 824 | ||
808 | void CalendarView::checkFiles() | 825 | void CalendarView::checkFiles() |
809 | { | 826 | { |
810 | QString message; | 827 | QString message; |
811 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 828 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
812 | KopiCalendarFile * cal = calendars.first(); | 829 | KopiCalendarFile * cal = calendars.first(); |
813 | while ( cal ) { | 830 | while ( cal ) { |
814 | if ( cal->mErrorOnLoad ) { | 831 | if ( cal->mErrorOnLoad ) { |
815 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; | 832 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; |
816 | } | 833 | } |
817 | cal = calendars.next(); | 834 | cal = calendars.next(); |
818 | } | 835 | } |
819 | if ( !message.isEmpty() ) { | 836 | if ( !message.isEmpty() ) { |
820 | message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); | 837 | message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); |
821 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); | 838 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); |
822 | } | 839 | } |
823 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); | 840 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); |
824 | } | 841 | } |
825 | void CalendarView::checkAlarms() | 842 | void CalendarView::checkAlarms() |
826 | { | 843 | { |
827 | 844 | ||
828 | 845 | ||
829 | KConfig *config = KOGlobals::config(); | 846 | KConfig *config = KOGlobals::config(); |
830 | config->setGroup( "AppRun" ); | 847 | config->setGroup( "AppRun" ); |
831 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 848 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
832 | int daysto = dt.daysTo( QDate::currentDate() ); | 849 | int daysto = dt.daysTo( QDate::currentDate() ); |
833 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); | 850 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); |
834 | dt = dt.addDays( days ); | 851 | dt = dt.addDays( days ); |
835 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 852 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
836 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; | 853 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; |
837 | //qDebug("KO: Reading program stop %d ", secs); | 854 | //qDebug("KO: Reading program stop %d ", secs); |
838 | //secs -= ( 3600 * 24*3 ); // debug only | 855 | //secs -= ( 3600 * 24*3 ); // debug only |
839 | QDateTime latest = dt.addSecs ( secs ); | 856 | QDateTime latest = dt.addSecs ( secs ); |
840 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | 857 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); |
841 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); | 858 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); |
842 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | 859 | QPtrList<Incidence> el = mCalendar->rawIncidences(); |
843 | QPtrList<Incidence> al; | 860 | QPtrList<Incidence> al; |
844 | Incidence* inL = el.first(); | 861 | Incidence* inL = el.first(); |
845 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); | 862 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); |
846 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); | 863 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); |
847 | while ( inL ) { | 864 | while ( inL ) { |
848 | bool ok = false; | 865 | bool ok = false; |
849 | int offset = 0; | 866 | int offset = 0; |
850 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | 867 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; |
851 | if ( ok ) { | 868 | if ( ok ) { |
852 | //qDebug("OK %s",next.toString().latin1()); | 869 | //qDebug("OK %s",next.toString().latin1()); |
853 | if ( next < cur ) { | 870 | if ( next < cur ) { |
854 | al.append( inL ); | 871 | al.append( inL ); |
855 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 872 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
856 | } | 873 | } |
857 | } | 874 | } |
858 | inL = el.next(); | 875 | inL = el.next(); |
859 | } | 876 | } |
860 | if ( al.count() ) { | 877 | if ( al.count() ) { |
861 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); | 878 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); |
862 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); | 879 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); |
863 | QVBoxLayout* lay = new QVBoxLayout( dia ); | 880 | QVBoxLayout* lay = new QVBoxLayout( dia ); |
864 | lay->setSpacing( 0 ); | 881 | lay->setSpacing( 0 ); |
865 | lay->setMargin( 0 ); | 882 | lay->setMargin( 0 ); |
866 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); | 883 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); |
867 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | 884 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); |
868 | lay->addWidget( matb ); | 885 | lay->addWidget( matb ); |
869 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { | 886 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { |
870 | int wid = 210; | 887 | int wid = 210; |
871 | int x = QApplication::desktop()->width() - wid - 7; | 888 | int x = QApplication::desktop()->width() - wid - 7; |
872 | int y = QApplication::desktop()->height() - wid - 70; | 889 | int y = QApplication::desktop()->height() - wid - 70; |
873 | dia->setGeometry ( x,y,wid,wid); | 890 | dia->setGeometry ( x,y,wid,wid); |
874 | } else { | 891 | } else { |
875 | int si = 220; | 892 | int si = 220; |
876 | if ( QApplication::desktop()->width() > 470 ) | 893 | if ( QApplication::desktop()->width() > 470 ) |
877 | si = 400; | 894 | si = 400; |
878 | dia->resize(si,si/2); | 895 | dia->resize(si,si/2); |
879 | } | 896 | } |
880 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); | 897 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); |
881 | dia->show(); | 898 | dia->show(); |
882 | 899 | ||
883 | } | 900 | } |
884 | } | 901 | } |
885 | void CalendarView::showDay( QDate d ) | 902 | void CalendarView::showDay( QDate d ) |
886 | { | 903 | { |
887 | dateNavigator()->blockSignals( true ); | 904 | dateNavigator()->blockSignals( true ); |
888 | dateNavigator()->selectDate( d ); | 905 | dateNavigator()->selectDate( d ); |
889 | dateNavigator()->blockSignals( false ); | 906 | dateNavigator()->blockSignals( false ); |
890 | mViewManager->showDayView(); | 907 | mViewManager->showDayView(); |
891 | //dateNavigator()->selectDate( d ); | 908 | //dateNavigator()->selectDate( d ); |
892 | } | 909 | } |
893 | void CalendarView::timerAlarm() | 910 | void CalendarView::timerAlarm() |
894 | { | 911 | { |
895 | //qDebug("CalendarView::timerAlarm() "); | 912 | //qDebug("CalendarView::timerAlarm() "); |
896 | computeAlarm(mAlarmNotification ); | 913 | computeAlarm(mAlarmNotification ); |
897 | } | 914 | } |
898 | 915 | ||
899 | void CalendarView::suspendAlarm() | 916 | void CalendarView::suspendAlarm() |
900 | { | 917 | { |
901 | //qDebug(" CalendarView::suspendAlarm() "); | 918 | //qDebug(" CalendarView::suspendAlarm() "); |
902 | computeAlarm(mSuspendAlarmNotification ); | 919 | computeAlarm(mSuspendAlarmNotification ); |
903 | 920 | ||
904 | } | 921 | } |
905 | 922 | ||
906 | void CalendarView::startAlarm( QString mess , QString filename) | 923 | void CalendarView::startAlarm( QString mess , QString filename) |
907 | { | 924 | { |
908 | 925 | ||
909 | topLevelWidget()->showNormal(); | 926 | topLevelWidget()->showNormal(); |
910 | topLevelWidget()->setActiveWindow(); | 927 | topLevelWidget()->setActiveWindow(); |
911 | topLevelWidget()->raise(); | 928 | topLevelWidget()->raise(); |
912 | 929 | ||
913 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 930 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
914 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); | 931 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); |
915 | 932 | ||
916 | } | 933 | } |
917 | 934 | ||
918 | void CalendarView::checkNextTimerAlarm() | 935 | void CalendarView::checkNextTimerAlarm() |
919 | { | 936 | { |
920 | mCalendar->checkAlarmForIncidence( 0, true ); | 937 | mCalendar->checkAlarmForIncidence( 0, true ); |
921 | } | 938 | } |
922 | 939 | ||
923 | void CalendarView::computeAlarm( QString msg ) | 940 | void CalendarView::computeAlarm( QString msg ) |
924 | { | 941 | { |
925 | 942 | ||
926 | QString mess = msg; | 943 | QString mess = msg; |
927 | QString mAlarmMessage = mess.mid( 9 ); | 944 | QString mAlarmMessage = mess.mid( 9 ); |
928 | QString filename = MainWindow::resourcePath(); | 945 | QString filename = MainWindow::resourcePath(); |
929 | filename += "koalarm.wav"; | 946 | filename += "koalarm.wav"; |
930 | QString tempfilename; | 947 | QString tempfilename; |
931 | if ( mess.left( 13 ) == "suspend_alarm") { | 948 | if ( mess.left( 13 ) == "suspend_alarm") { |
932 | bool error = false; | 949 | bool error = false; |
933 | int len = mess.mid( 13 ).find("+++"); | 950 | int len = mess.mid( 13 ).find("+++"); |
934 | if ( len < 2 ) | 951 | if ( len < 2 ) |
935 | error = true; | 952 | error = true; |
936 | else { | 953 | else { |
937 | tempfilename = mess.mid( 13, len ); | 954 | tempfilename = mess.mid( 13, len ); |
938 | if ( !QFile::exists( tempfilename ) ) | 955 | if ( !QFile::exists( tempfilename ) ) |
939 | error = true; | 956 | error = true; |
940 | } | 957 | } |
941 | if ( ! error ) { | 958 | if ( ! error ) { |
942 | filename = tempfilename; | 959 | filename = tempfilename; |
943 | } | 960 | } |
944 | mAlarmMessage = mess.mid( 13+len+3 ); | 961 | mAlarmMessage = mess.mid( 13+len+3 ); |
945 | //qDebug("suspend file %s ",tempfilename.latin1() ); | 962 | //qDebug("suspend file %s ",tempfilename.latin1() ); |
946 | startAlarm( mAlarmMessage, filename); | 963 | startAlarm( mAlarmMessage, filename); |
947 | return; | 964 | return; |
948 | } | 965 | } |
949 | if ( mess.left( 11 ) == "timer_alarm") { | 966 | if ( mess.left( 11 ) == "timer_alarm") { |
950 | //mTimerTime = 0; | 967 | //mTimerTime = 0; |
951 | startAlarm( mess.mid( 11 ), filename ); | 968 | startAlarm( mess.mid( 11 ), filename ); |
952 | return; | 969 | return; |
953 | } | 970 | } |
954 | if ( mess.left( 10 ) == "proc_alarm") { | 971 | if ( mess.left( 10 ) == "proc_alarm") { |
955 | bool error = false; | 972 | bool error = false; |
956 | int len = mess.mid( 10 ).find("+++"); | 973 | int len = mess.mid( 10 ).find("+++"); |
957 | if ( len < 2 ) | 974 | if ( len < 2 ) |
958 | error = true; | 975 | error = true; |
959 | else { | 976 | else { |
960 | tempfilename = mess.mid( 10, len ); | 977 | tempfilename = mess.mid( 10, len ); |
961 | if ( !QFile::exists( tempfilename ) ) | 978 | if ( !QFile::exists( tempfilename ) ) |
962 | error = true; | 979 | error = true; |
963 | } | 980 | } |
964 | if ( error ) { | 981 | if ( error ) { |
965 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 982 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
966 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 983 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
967 | } else { | 984 | } else { |
968 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 985 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
969 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 986 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
970 | #ifndef _WIN32_ | 987 | #ifndef _WIN32_ |
971 | if ( vfork () == 0 ) { | 988 | if ( vfork () == 0 ) { |
972 | execl ( tempfilename.latin1(), 0 ); | 989 | execl ( tempfilename.latin1(), 0 ); |
973 | return; | 990 | return; |
974 | } | 991 | } |
975 | #else | 992 | #else |
976 | QProcess* p = new QProcess(); | 993 | QProcess* p = new QProcess(); |
977 | p->addArgument( tempfilename.latin1() ); | 994 | p->addArgument( tempfilename.latin1() ); |
978 | p->start(); | 995 | p->start(); |
979 | return; | 996 | return; |
980 | #endif | 997 | #endif |
981 | 998 | ||
982 | return; | 999 | return; |
983 | } | 1000 | } |
984 | 1001 | ||
985 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 1002 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
986 | } | 1003 | } |
@@ -2519,523 +2536,532 @@ void CalendarView::writeSettings() | |||
2519 | QStringList list ;//= config->readListEntry("MainLayout"); | 2536 | QStringList list ;//= config->readListEntry("MainLayout"); |
2520 | int x,y,w,h; | 2537 | int x,y,w,h; |
2521 | QWidget* wid; | 2538 | QWidget* wid; |
2522 | wid = topLevelWidget(); | 2539 | wid = topLevelWidget(); |
2523 | x = wid->geometry().x(); | 2540 | x = wid->geometry().x(); |
2524 | y = wid->geometry().y(); | 2541 | y = wid->geometry().y(); |
2525 | w = wid->width(); | 2542 | w = wid->width(); |
2526 | h = wid->height(); | 2543 | h = wid->height(); |
2527 | list.clear(); | 2544 | list.clear(); |
2528 | list << QString::number( x ); | 2545 | list << QString::number( x ); |
2529 | list << QString::number( y ); | 2546 | list << QString::number( y ); |
2530 | list << QString::number( w ); | 2547 | list << QString::number( w ); |
2531 | list << QString::number( h ); | 2548 | list << QString::number( h ); |
2532 | config->writeEntry("MainLayout",list ); | 2549 | config->writeEntry("MainLayout",list ); |
2533 | 2550 | ||
2534 | wid = mEventEditor; | 2551 | wid = mEventEditor; |
2535 | x = wid->geometry().x(); | 2552 | x = wid->geometry().x(); |
2536 | y = wid->geometry().y(); | 2553 | y = wid->geometry().y(); |
2537 | w = wid->width(); | 2554 | w = wid->width(); |
2538 | h = wid->height(); | 2555 | h = wid->height(); |
2539 | list.clear(); | 2556 | list.clear(); |
2540 | list << QString::number( x ); | 2557 | list << QString::number( x ); |
2541 | list << QString::number( y ); | 2558 | list << QString::number( y ); |
2542 | list << QString::number( w ); | 2559 | list << QString::number( w ); |
2543 | list << QString::number( h ); | 2560 | list << QString::number( h ); |
2544 | config->writeEntry("EditEventLayout",list ); | 2561 | config->writeEntry("EditEventLayout",list ); |
2545 | 2562 | ||
2546 | wid = mTodoEditor; | 2563 | wid = mTodoEditor; |
2547 | x = wid->geometry().x(); | 2564 | x = wid->geometry().x(); |
2548 | y = wid->geometry().y(); | 2565 | y = wid->geometry().y(); |
2549 | w = wid->width(); | 2566 | w = wid->width(); |
2550 | h = wid->height(); | 2567 | h = wid->height(); |
2551 | list.clear(); | 2568 | list.clear(); |
2552 | list << QString::number( x ); | 2569 | list << QString::number( x ); |
2553 | list << QString::number( y ); | 2570 | list << QString::number( y ); |
2554 | list << QString::number( w ); | 2571 | list << QString::number( w ); |
2555 | list << QString::number( h ); | 2572 | list << QString::number( h ); |
2556 | config->writeEntry("EditTodoLayout",list ); | 2573 | config->writeEntry("EditTodoLayout",list ); |
2557 | wid = getEventViewerDialog(); | 2574 | wid = getEventViewerDialog(); |
2558 | x = wid->geometry().x(); | 2575 | x = wid->geometry().x(); |
2559 | y = wid->geometry().y(); | 2576 | y = wid->geometry().y(); |
2560 | w = wid->width(); | 2577 | w = wid->width(); |
2561 | h = wid->height(); | 2578 | h = wid->height(); |
2562 | list.clear(); | 2579 | list.clear(); |
2563 | list << QString::number( x ); | 2580 | list << QString::number( x ); |
2564 | list << QString::number( y ); | 2581 | list << QString::number( y ); |
2565 | list << QString::number( w ); | 2582 | list << QString::number( w ); |
2566 | list << QString::number( h ); | 2583 | list << QString::number( h ); |
2567 | config->writeEntry("ViewerLayout",list ); | 2584 | config->writeEntry("ViewerLayout",list ); |
2568 | wid = mDialogManager->getSearchDialog(); | 2585 | wid = mDialogManager->getSearchDialog(); |
2569 | if ( wid ) { | 2586 | if ( wid ) { |
2570 | x = wid->geometry().x(); | 2587 | x = wid->geometry().x(); |
2571 | y = wid->geometry().y(); | 2588 | y = wid->geometry().y(); |
2572 | w = wid->width(); | 2589 | w = wid->width(); |
2573 | h = wid->height(); | 2590 | h = wid->height(); |
2574 | list.clear(); | 2591 | list.clear(); |
2575 | list << QString::number( x ); | 2592 | list << QString::number( x ); |
2576 | list << QString::number( y ); | 2593 | list << QString::number( y ); |
2577 | list << QString::number( w ); | 2594 | list << QString::number( w ); |
2578 | list << QString::number( h ); | 2595 | list << QString::number( h ); |
2579 | config->writeEntry("SearchLayout",list ); | 2596 | config->writeEntry("SearchLayout",list ); |
2580 | } | 2597 | } |
2581 | #endif | 2598 | #endif |
2582 | 2599 | ||
2583 | 2600 | ||
2584 | config->sync(); | 2601 | config->sync(); |
2585 | } | 2602 | } |
2586 | 2603 | ||
2587 | void CalendarView::readFilterSettings(KConfig *config) | 2604 | void CalendarView::readFilterSettings(KConfig *config) |
2588 | { | 2605 | { |
2589 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 2606 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
2590 | 2607 | ||
2591 | mFilters.clear(); | 2608 | mFilters.clear(); |
2592 | 2609 | ||
2593 | config->setGroup("General"); | 2610 | config->setGroup("General"); |
2594 | QStringList filterList = config->readListEntry("CalendarFilters"); | 2611 | QStringList filterList = config->readListEntry("CalendarFilters"); |
2595 | 2612 | ||
2596 | QStringList::ConstIterator it = filterList.begin(); | 2613 | QStringList::ConstIterator it = filterList.begin(); |
2597 | QStringList::ConstIterator end = filterList.end(); | 2614 | QStringList::ConstIterator end = filterList.end(); |
2598 | while(it != end) { | 2615 | while(it != end) { |
2599 | // kdDebug() << " filter: " << (*it) << endl; | 2616 | // kdDebug() << " filter: " << (*it) << endl; |
2600 | 2617 | ||
2601 | CalFilter *filter; | 2618 | CalFilter *filter; |
2602 | filter = new CalFilter(*it); | 2619 | filter = new CalFilter(*it); |
2603 | config->setGroup("Filter_" + (*it).utf8()); | 2620 | config->setGroup("Filter_" + (*it).utf8()); |
2604 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 2621 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
2605 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 2622 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
2606 | filter->setCategoryList(config->readListEntry("CategoryList")); | 2623 | filter->setCategoryList(config->readListEntry("CategoryList")); |
2607 | mFilters.append(filter); | 2624 | mFilters.append(filter); |
2608 | 2625 | ||
2609 | ++it; | 2626 | ++it; |
2610 | } | 2627 | } |
2611 | 2628 | ||
2612 | if (mFilters.count() == 0) { | 2629 | if (mFilters.count() == 0) { |
2613 | CalFilter *filter = new CalFilter(i18n("Default")); | 2630 | CalFilter *filter = new CalFilter(i18n("Default")); |
2614 | mFilters.append(filter); | 2631 | mFilters.append(filter); |
2615 | } | 2632 | } |
2616 | mFilterView->updateFilters(); | 2633 | mFilterView->updateFilters(); |
2617 | config->setGroup("FilterView"); | 2634 | config->setGroup("FilterView"); |
2618 | 2635 | ||
2619 | mFilterView->blockSignals(true); | 2636 | mFilterView->blockSignals(true); |
2620 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 2637 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
2621 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 2638 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
2622 | mFilterView->blockSignals(false); | 2639 | mFilterView->blockSignals(false); |
2623 | // We do it manually to avoid it being done twice by the above calls | 2640 | // We do it manually to avoid it being done twice by the above calls |
2624 | updateFilter(); | 2641 | updateFilter(); |
2625 | } | 2642 | } |
2626 | 2643 | ||
2627 | void CalendarView::writeFilterSettings(KConfig *config) | 2644 | void CalendarView::writeFilterSettings(KConfig *config) |
2628 | { | 2645 | { |
2629 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 2646 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
2630 | 2647 | ||
2631 | QStringList filterList; | 2648 | QStringList filterList; |
2632 | 2649 | ||
2633 | CalFilter *filter = mFilters.first(); | 2650 | CalFilter *filter = mFilters.first(); |
2634 | while(filter) { | 2651 | while(filter) { |
2635 | // kdDebug() << " fn: " << filter->name() << endl; | 2652 | // kdDebug() << " fn: " << filter->name() << endl; |
2636 | filterList << filter->name(); | 2653 | filterList << filter->name(); |
2637 | config->setGroup("Filter_" + filter->name().utf8()); | 2654 | config->setGroup("Filter_" + filter->name().utf8()); |
2638 | config->writeEntry("Criteria",filter->criteria()); | 2655 | config->writeEntry("Criteria",filter->criteria()); |
2639 | config->writeEntry("CategoryList",filter->categoryList()); | 2656 | config->writeEntry("CategoryList",filter->categoryList()); |
2640 | filter = mFilters.next(); | 2657 | filter = mFilters.next(); |
2641 | } | 2658 | } |
2642 | config->setGroup("General"); | 2659 | config->setGroup("General"); |
2643 | config->writeEntry("CalendarFilters",filterList); | 2660 | config->writeEntry("CalendarFilters",filterList); |
2644 | 2661 | ||
2645 | config->setGroup("FilterView"); | 2662 | config->setGroup("FilterView"); |
2646 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 2663 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
2647 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2664 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2648 | } | 2665 | } |
2649 | 2666 | ||
2650 | 2667 | ||
2651 | void CalendarView::goToday() | 2668 | void CalendarView::goToday() |
2652 | { | 2669 | { |
2653 | if ( mViewManager->currentView()->isMonthView() ) | 2670 | if ( mViewManager->currentView()->isMonthView() ) |
2654 | mNavigator->selectTodayMonth(); | 2671 | mNavigator->selectTodayMonth(); |
2655 | else | 2672 | else |
2656 | mNavigator->selectToday(); | 2673 | mNavigator->selectToday(); |
2657 | } | 2674 | } |
2658 | 2675 | ||
2659 | void CalendarView::goNext() | 2676 | void CalendarView::goNext() |
2660 | { | 2677 | { |
2661 | mNavigator->selectNext(); | 2678 | mNavigator->selectNext(); |
2662 | } | 2679 | } |
2663 | 2680 | ||
2664 | void CalendarView::goPrevious() | 2681 | void CalendarView::goPrevious() |
2665 | { | 2682 | { |
2666 | mNavigator->selectPrevious(); | 2683 | mNavigator->selectPrevious(); |
2667 | } | 2684 | } |
2668 | void CalendarView::goNextMonth() | 2685 | void CalendarView::goNextMonth() |
2669 | { | 2686 | { |
2670 | mNavigator->selectNextMonth(); | 2687 | mNavigator->selectNextMonth(); |
2671 | } | 2688 | } |
2672 | 2689 | ||
2673 | void CalendarView::goPreviousMonth() | 2690 | void CalendarView::goPreviousMonth() |
2674 | { | 2691 | { |
2675 | mNavigator->selectPreviousMonth(); | 2692 | mNavigator->selectPreviousMonth(); |
2676 | } | 2693 | } |
2677 | 2694 | ||
2678 | void CalendarView::updateConfig() | 2695 | void CalendarView::updateConfig() |
2679 | { | 2696 | { |
2680 | if ( KOPrefs::instance()->mUseAppColors ) | 2697 | if ( KOPrefs::instance()->mUseAppColors ) |
2681 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2698 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2682 | emit configChanged(); | 2699 | emit configChanged(); |
2683 | mTodoList->updateConfig(); | 2700 | mTodoList->updateConfig(); |
2684 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2701 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2685 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2702 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2686 | // To make the "fill window" configurations work | 2703 | // To make the "fill window" configurations work |
2687 | //mViewManager->raiseCurrentView(); | 2704 | //mViewManager->raiseCurrentView(); |
2688 | } | 2705 | } |
2689 | 2706 | ||
2690 | 2707 | ||
2691 | void CalendarView::eventChanged(Event *event) | 2708 | void CalendarView::eventChanged(Event *event) |
2692 | { | 2709 | { |
2693 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2710 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2694 | //updateUnmanagedViews(); | 2711 | //updateUnmanagedViews(); |
2695 | } | 2712 | } |
2696 | 2713 | ||
2697 | void CalendarView::eventAdded(Event *event) | 2714 | void CalendarView::eventAdded(Event *event) |
2698 | { | 2715 | { |
2699 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2716 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2700 | } | 2717 | } |
2701 | 2718 | ||
2702 | void CalendarView::eventToBeDeleted(Event *) | 2719 | void CalendarView::eventToBeDeleted(Event *) |
2703 | { | 2720 | { |
2704 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2721 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2705 | } | 2722 | } |
2706 | 2723 | ||
2707 | void CalendarView::eventDeleted() | 2724 | void CalendarView::eventDeleted() |
2708 | { | 2725 | { |
2709 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2726 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2710 | } | 2727 | } |
2711 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2728 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2712 | { | 2729 | { |
2713 | changeIncidenceDisplay((Incidence *)which, action); | 2730 | changeIncidenceDisplay((Incidence *)which, action); |
2714 | mDateNavigator->updateView(); //LR | 2731 | mDateNavigator->updateView(); //LR |
2715 | //mDialogManager->updateSearchDialog(); | 2732 | //mDialogManager->updateSearchDialog(); |
2716 | 2733 | ||
2717 | if (which) { | 2734 | if (which) { |
2718 | mViewManager->updateWNview(); | 2735 | mViewManager->updateWNview(); |
2719 | //mTodoList->updateView(); | 2736 | //mTodoList->updateView(); |
2720 | } | 2737 | } |
2721 | 2738 | ||
2722 | } | 2739 | } |
2723 | 2740 | ||
2724 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2741 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2725 | { | 2742 | { |
2726 | updateUnmanagedViews(); | 2743 | updateUnmanagedViews(); |
2727 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2744 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2728 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2745 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2729 | mCalendar->checkAlarmForIncidence( 0, true ); | 2746 | mCalendar->checkAlarmForIncidence( 0, true ); |
2730 | if ( mEventViewerDialog ) | 2747 | if ( mEventViewerDialog ) |
2731 | mEventViewerDialog->hide(); | 2748 | mEventViewerDialog->hide(); |
2732 | } | 2749 | } |
2733 | else | 2750 | else |
2734 | mCalendar->checkAlarmForIncidence( which , false ); | 2751 | mCalendar->checkAlarmForIncidence( which , false ); |
2735 | } | 2752 | } |
2736 | 2753 | ||
2737 | // most of the changeEventDisplays() right now just call the view's | 2754 | // most of the changeEventDisplays() right now just call the view's |
2738 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2755 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2739 | void CalendarView::changeEventDisplay(Event *which, int action) | 2756 | void CalendarView::changeEventDisplay(Event *which, int action) |
2740 | { | 2757 | { |
2741 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2758 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2742 | changeIncidenceDisplay((Incidence *)which, action); | 2759 | changeIncidenceDisplay((Incidence *)which, action); |
2743 | static bool clearallviews = false; | 2760 | static bool clearallviews = false; |
2744 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | 2761 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { |
2745 | if ( clearallviews ) { | 2762 | if ( clearallviews ) { |
2746 | clearAllViews(); | 2763 | clearAllViews(); |
2747 | clearallviews = false; | 2764 | clearallviews = false; |
2748 | } | 2765 | } |
2749 | return; | 2766 | return; |
2750 | } | 2767 | } |
2751 | clearallviews = true; | 2768 | clearallviews = true; |
2752 | mDateNavigator->updateView(); | 2769 | mDateNavigator->updateView(); |
2753 | //mDialogManager->updateSearchDialog(); | 2770 | //mDialogManager->updateSearchDialog(); |
2754 | if (which) { | 2771 | if (which) { |
2755 | // If there is an event view visible update the display | 2772 | // If there is an event view visible update the display |
2756 | mViewManager->currentView()->changeEventDisplay(which,action); | 2773 | mViewManager->currentView()->changeEventDisplay(which,action); |
2757 | // TODO: check, if update needed | 2774 | // TODO: check, if update needed |
2758 | // if (which->getTodoStatus()) { | 2775 | // if (which->getTodoStatus()) { |
2759 | mTodoList->updateView(); | 2776 | mTodoList->updateView(); |
2760 | if ( action != KOGlobals::EVENTDELETED ) { | 2777 | if ( action != KOGlobals::EVENTDELETED ) { |
2761 | mConflictingEvent = which ; | 2778 | mConflictingEvent = which ; |
2762 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); | 2779 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); |
2763 | } | 2780 | } |
2764 | // } | 2781 | // } |
2765 | } else { | 2782 | } else { |
2766 | mViewManager->currentView()->updateView(); | 2783 | mViewManager->currentView()->updateView(); |
2767 | } | 2784 | } |
2768 | } | 2785 | } |
2769 | void CalendarView::checkConflictForEvent() | 2786 | void CalendarView::checkConflictForEvent() |
2770 | { | 2787 | { |
2771 | 2788 | ||
2772 | if (!KOPrefs::instance()->mConfirm) | 2789 | if (!KOPrefs::instance()->mConfirm) |
2773 | return; | 2790 | return; |
2774 | if ( ! mConflictingEvent ) return; | 2791 | if ( ! mConflictingEvent ) return; |
2775 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); | 2792 | QDateTime current = QDateTime::currentDateTime(); |
2793 | if ( ! mConflictingEvent->matchTime( ¤t, 0 ) ) { | ||
2794 | mConflictingEvent = 0; | ||
2795 | return; | ||
2796 | } | ||
2776 | QPtrList<Event> testlist = mCalendar->events(); | 2797 | QPtrList<Event> testlist = mCalendar->events(); |
2777 | Event * test = testlist.first(); | 2798 | Event * test = testlist.first(); |
2778 | QDateTime conflict; | 2799 | QDateTime conflict; |
2779 | QDateTime retVal; | 2800 | QDateTime retVal; |
2780 | bool found = false; | 2801 | bool found = false; |
2781 | Event * cE = 0; | 2802 | Event * cE = 0; |
2782 | QDateTime current = QDateTime::currentDateTime(); | 2803 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); |
2783 | while ( test ) { | 2804 | while ( test ) { |
2784 | qApp->processEvents(); | 2805 | qApp->processEvents(); |
2785 | if ( !test->doesFloat() ) { | 2806 | bool skip = false; |
2807 | if ( found ) | ||
2808 | skip = !test->matchTime( ¤t, &conflict ); | ||
2809 | else | ||
2810 | skip = !test->matchTime( ¤t, 0 ); | ||
2811 | if ( !skip && !test->doesFloat() ) { | ||
2786 | if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { | 2812 | if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |
2787 | if ( ! found ) { | 2813 | if ( ! found ) { |
2788 | conflict = retVal; | 2814 | conflict = retVal; |
2789 | cE = test; | 2815 | cE = test; |
2790 | } else { | 2816 | } else { |
2791 | if ( retVal < conflict ) { | 2817 | if ( retVal < conflict ) { |
2792 | conflict = retVal; | 2818 | conflict = retVal; |
2793 | cE = test; | 2819 | cE = test; |
2794 | } | 2820 | } |
2795 | } | 2821 | } |
2796 | found = true; | 2822 | found = true; |
2797 | } | 2823 | } |
2798 | } | 2824 | } |
2799 | test = testlist.next(); | 2825 | test = testlist.next(); |
2800 | } | 2826 | } |
2801 | if ( found ) { | 2827 | if ( found ) { |
2802 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; | 2828 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; |
2803 | qApp->processEvents(); | 2829 | qApp->processEvents(); |
2804 | int km = KMessageBox::warningContinueCancel(this,mess, | 2830 | int km = KMessageBox::warningContinueCancel(this,mess, |
2805 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); | 2831 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); |
2806 | if ( km != KMessageBox::Continue ) | 2832 | if ( km != KMessageBox::Continue ) |
2807 | return; | 2833 | return; |
2808 | 2834 | ||
2809 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 2835 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
2810 | mViewManager->showDayView(); | 2836 | mViewManager->showDayView(); |
2811 | mNavigator->slotDaySelect( conflict.date() ); | 2837 | mNavigator->slotDaySelect( conflict.date() ); |
2812 | int hour = conflict.time().hour(); | 2838 | int hour = conflict.time().hour(); |
2813 | mViewManager->agendaView()->setStartHour( hour ); | 2839 | mViewManager->agendaView()->setStartHour( hour ); |
2814 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); | 2840 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); |
2815 | } else | 2841 | } else |
2816 | topLevelWidget()->setCaption( i18n("No conflict found") ); | 2842 | topLevelWidget()->setCaption( i18n("No conflict found") ); |
2817 | mConflictingEvent = 0; | 2843 | mConflictingEvent = 0; |
2818 | return; | 2844 | return; |
2819 | 2845 | ||
2820 | } | 2846 | } |
2821 | 2847 | ||
2822 | void CalendarView::updateTodoViews() | 2848 | void CalendarView::updateTodoViews() |
2823 | { | 2849 | { |
2824 | mTodoList->updateView(); | 2850 | mTodoList->updateView(); |
2825 | mViewManager->currentView()->updateView(); | 2851 | mViewManager->currentView()->updateView(); |
2826 | 2852 | ||
2827 | } | 2853 | } |
2828 | 2854 | ||
2829 | 2855 | ||
2830 | 2856 | ||
2831 | void CalendarView::clearAllViews() | 2857 | void CalendarView::clearAllViews() |
2832 | { | 2858 | { |
2833 | mTodoList->clearList(); | 2859 | mTodoList->clearList(); |
2834 | mViewManager->clearAllViews(); | 2860 | mViewManager->clearAllViews(); |
2835 | SearchDialog * sd = mDialogManager->getSearchDialog(); | 2861 | SearchDialog * sd = mDialogManager->getSearchDialog(); |
2836 | if ( sd ) { | 2862 | if ( sd ) { |
2837 | KOListView* kol = sd->listview(); | 2863 | KOListView* kol = sd->listview(); |
2838 | if ( kol ) | 2864 | if ( kol ) |
2839 | kol->clearList(); | 2865 | kol->clearList(); |
2840 | } | 2866 | } |
2841 | } | 2867 | } |
2842 | void CalendarView::updateView() | 2868 | void CalendarView::updateView() |
2843 | { | 2869 | { |
2844 | static bool clearallviews = false; | 2870 | static bool clearallviews = false; |
2845 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | 2871 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { |
2846 | if ( clearallviews ) { | 2872 | if ( clearallviews ) { |
2847 | clearAllViews(); | 2873 | clearAllViews(); |
2848 | clearallviews = false; | 2874 | clearallviews = false; |
2849 | } | 2875 | } |
2850 | return; | 2876 | return; |
2851 | } | 2877 | } |
2852 | clearallviews = true; | 2878 | clearallviews = true; |
2853 | DateList tmpList = mNavigator->selectedDates(); | 2879 | DateList tmpList = mNavigator->selectedDates(); |
2854 | 2880 | ||
2855 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2881 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2856 | mTodoList->updateView(); | 2882 | mTodoList->updateView(); |
2857 | // We assume that the navigator only selects consecutive days. | 2883 | // We assume that the navigator only selects consecutive days. |
2858 | updateView( tmpList.first(), tmpList.last() ); | 2884 | updateView( tmpList.first(), tmpList.last() ); |
2859 | } | 2885 | } |
2860 | 2886 | ||
2861 | void CalendarView::updateUnmanagedViews() | 2887 | void CalendarView::updateUnmanagedViews() |
2862 | { | 2888 | { |
2863 | mDateNavigator->updateDayMatrix(); | 2889 | mDateNavigator->updateDayMatrix(); |
2864 | } | 2890 | } |
2865 | 2891 | ||
2866 | int CalendarView::msgItemDelete(const QString name) | 2892 | int CalendarView::msgItemDelete(const QString name) |
2867 | { | 2893 | { |
2868 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2894 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2869 | i18n("This item will be\npermanently deleted."), | 2895 | i18n("This item will be\npermanently deleted."), |
2870 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2896 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2871 | } | 2897 | } |
2872 | 2898 | ||
2873 | 2899 | ||
2874 | void CalendarView::edit_cut() | 2900 | void CalendarView::edit_cut() |
2875 | { | 2901 | { |
2876 | Event *anEvent=0; | 2902 | Event *anEvent=0; |
2877 | 2903 | ||
2878 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2904 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2879 | 2905 | ||
2880 | if (mViewManager->currentView()->isEventView()) { | 2906 | if (mViewManager->currentView()->isEventView()) { |
2881 | if ( incidence && incidence->typeID() == eventID ) { | 2907 | if ( incidence && incidence->typeID() == eventID ) { |
2882 | anEvent = static_cast<Event *>(incidence); | 2908 | anEvent = static_cast<Event *>(incidence); |
2883 | } | 2909 | } |
2884 | } | 2910 | } |
2885 | 2911 | ||
2886 | if (!anEvent) { | 2912 | if (!anEvent) { |
2887 | KNotifyClient::beep(); | 2913 | KNotifyClient::beep(); |
2888 | return; | 2914 | return; |
2889 | } | 2915 | } |
2890 | DndFactory factory( mCalendar ); | 2916 | DndFactory factory( mCalendar ); |
2891 | factory.cutIncidence(anEvent); | 2917 | factory.cutIncidence(anEvent); |
2892 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2918 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2893 | } | 2919 | } |
2894 | 2920 | ||
2895 | void CalendarView::edit_copy() | 2921 | void CalendarView::edit_copy() |
2896 | { | 2922 | { |
2897 | Event *anEvent=0; | 2923 | Event *anEvent=0; |
2898 | 2924 | ||
2899 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2925 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2900 | 2926 | ||
2901 | if (mViewManager->currentView()->isEventView()) { | 2927 | if (mViewManager->currentView()->isEventView()) { |
2902 | if ( incidence && incidence->typeID() == eventID ) { | 2928 | if ( incidence && incidence->typeID() == eventID ) { |
2903 | anEvent = static_cast<Event *>(incidence); | 2929 | anEvent = static_cast<Event *>(incidence); |
2904 | } | 2930 | } |
2905 | } | 2931 | } |
2906 | 2932 | ||
2907 | if (!anEvent) { | 2933 | if (!anEvent) { |
2908 | KNotifyClient::beep(); | 2934 | KNotifyClient::beep(); |
2909 | return; | 2935 | return; |
2910 | } | 2936 | } |
2911 | DndFactory factory( mCalendar ); | 2937 | DndFactory factory( mCalendar ); |
2912 | factory.copyIncidence(anEvent); | 2938 | factory.copyIncidence(anEvent); |
2913 | } | 2939 | } |
2914 | 2940 | ||
2915 | void CalendarView::edit_paste() | 2941 | void CalendarView::edit_paste() |
2916 | { | 2942 | { |
2917 | QDate date = mNavigator->selectedDates().first(); | 2943 | QDate date = mNavigator->selectedDates().first(); |
2918 | 2944 | ||
2919 | DndFactory factory( mCalendar ); | 2945 | DndFactory factory( mCalendar ); |
2920 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); | 2946 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); |
2921 | 2947 | ||
2922 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2948 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2923 | } | 2949 | } |
2924 | void CalendarView::edit_global_options() | 2950 | void CalendarView::edit_global_options() |
2925 | { | 2951 | { |
2926 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; | 2952 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; |
2927 | emit save(); | 2953 | emit save(); |
2928 | emit saveStopTimer(); | 2954 | emit saveStopTimer(); |
2929 | mDialogManager->showGlobalOptionsDialog(); | 2955 | mDialogManager->showGlobalOptionsDialog(); |
2930 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { | 2956 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { |
2931 | emit saveStopTimer(); | 2957 | emit saveStopTimer(); |
2932 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), | 2958 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), |
2933 | i18n("Timezone settings"),i18n("Reload"))) { | 2959 | i18n("Timezone settings"),i18n("Reload"))) { |
2934 | qDebug("KO: TZ reload cancelled "); | 2960 | qDebug("KO: TZ reload cancelled "); |
2935 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2961 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2936 | return; | 2962 | return; |
2937 | } | 2963 | } |
2938 | qDebug("KO: Timezone change "); | 2964 | qDebug("KO: Timezone change "); |
2939 | loadCalendars(); | 2965 | loadCalendars(); |
2940 | setModified(true); | 2966 | setModified(true); |
2941 | } | 2967 | } |
2942 | else | 2968 | else |
2943 | qDebug("KO: No tz change "); | 2969 | qDebug("KO: No tz change "); |
2944 | } | 2970 | } |
2945 | void CalendarView::edit_options() | 2971 | void CalendarView::edit_options() |
2946 | { | 2972 | { |
2947 | mDialogManager->showOptionsDialog(); | 2973 | mDialogManager->showOptionsDialog(); |
2948 | } | 2974 | } |
2949 | 2975 | ||
2950 | 2976 | ||
2951 | void CalendarView::slotSelectPickerDate( QDate d) | 2977 | void CalendarView::slotSelectPickerDate( QDate d) |
2952 | { | 2978 | { |
2953 | mDateFrame->hide(); | 2979 | mDateFrame->hide(); |
2954 | if ( mDatePickerMode == 1 ) { | 2980 | if ( mDatePickerMode == 1 ) { |
2955 | mNavigator->slotDaySelect( d ); | 2981 | mNavigator->slotDaySelect( d ); |
2956 | } else if ( mDatePickerMode == 2 ) { | 2982 | } else if ( mDatePickerMode == 2 ) { |
2957 | if ( mMoveIncidence->typeID() == todoID ) { | 2983 | if ( mMoveIncidence->typeID() == todoID ) { |
2958 | Todo * to = (Todo *) mMoveIncidence; | 2984 | Todo * to = (Todo *) mMoveIncidence; |
2959 | QTime tim; | 2985 | QTime tim; |
2960 | int len = 0; | 2986 | int len = 0; |
2961 | if ( to->hasStartDate() && to->hasDueDate() ) | 2987 | if ( to->hasStartDate() && to->hasDueDate() ) |
2962 | len = to->dtStart().secsTo( to->dtDue()); | 2988 | len = to->dtStart().secsTo( to->dtDue()); |
2963 | if ( to->hasDueDate() ) | 2989 | if ( to->hasDueDate() ) |
2964 | tim = to->dtDue().time(); | 2990 | tim = to->dtDue().time(); |
2965 | else { | 2991 | else { |
2966 | tim = QTime ( 0,0,0 ); | 2992 | tim = QTime ( 0,0,0 ); |
2967 | to->setFloats( true ); | 2993 | to->setFloats( true ); |
2968 | to->setHasDueDate( true ); | 2994 | to->setHasDueDate( true ); |
2969 | } | 2995 | } |
2970 | QDateTime dt ( d,tim ); | 2996 | QDateTime dt ( d,tim ); |
2971 | to->setDtDue( dt ); | 2997 | to->setDtDue( dt ); |
2972 | 2998 | ||
2973 | if ( to->hasStartDate() ) { | 2999 | if ( to->hasStartDate() ) { |
2974 | if ( len>0 ) | 3000 | if ( len>0 ) |
2975 | to->setDtStart(to->dtDue().addSecs( -len )); | 3001 | to->setDtStart(to->dtDue().addSecs( -len )); |
2976 | else | 3002 | else |
2977 | if (to->dtStart() > to->dtDue() ) | 3003 | if (to->dtStart() > to->dtDue() ) |
2978 | to->setDtStart(to->dtDue().addDays( -3 )); | 3004 | to->setDtStart(to->dtDue().addDays( -3 )); |
2979 | } | 3005 | } |
2980 | 3006 | ||
2981 | todoChanged( to ); | 3007 | todoChanged( to ); |
2982 | } else if ( mMoveIncidence->typeID() == eventID ) { | 3008 | } else if ( mMoveIncidence->typeID() == eventID ) { |
2983 | if ( mMoveIncidence->doesRecur() ) { | 3009 | if ( mMoveIncidence->doesRecur() ) { |
2984 | #if 0 | 3010 | #if 0 |
2985 | // PENDING implement this | 3011 | // PENDING implement this |
2986 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | 3012 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); |
2987 | mCalendar()->addIncidence( newInc ); | 3013 | mCalendar()->addIncidence( newInc ); |
2988 | if ( mMoveIncidence->typeID() == todoID ) | 3014 | if ( mMoveIncidence->typeID() == todoID ) |
2989 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | 3015 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); |
2990 | else | 3016 | else |
2991 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | 3017 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); |
2992 | mMoveIncidence = newInc; | 3018 | mMoveIncidence = newInc; |
2993 | 3019 | ||
2994 | #endif | 3020 | #endif |
2995 | } | 3021 | } |
2996 | QTime tim = mMoveIncidence->dtStart().time(); | 3022 | QTime tim = mMoveIncidence->dtStart().time(); |
2997 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 3023 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2998 | QDateTime dt ( d,tim ); | 3024 | QDateTime dt ( d,tim ); |
2999 | mMoveIncidence->setDtStart( dt ); | 3025 | mMoveIncidence->setDtStart( dt ); |
3000 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 3026 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
3001 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 3027 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
3002 | } else if ( mMoveIncidence->typeID() == journalID ) { | 3028 | } else if ( mMoveIncidence->typeID() == journalID ) { |
3003 | QTime tim = mMoveIncidence->dtStart().time(); | 3029 | QTime tim = mMoveIncidence->dtStart().time(); |
3004 | QDateTime dt ( d,tim ); | 3030 | QDateTime dt ( d,tim ); |
3005 | mMoveIncidence->setDtStart( dt ); | 3031 | mMoveIncidence->setDtStart( dt ); |
3006 | updateView(); | 3032 | updateView(); |
3007 | } | 3033 | } |
3008 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 3034 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
3009 | } | 3035 | } |
3010 | } | 3036 | } |
3011 | 3037 | ||
3012 | void CalendarView::removeCategories() | 3038 | void CalendarView::removeCategories() |
3013 | { | 3039 | { |
3014 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 3040 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
3015 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 3041 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
3016 | QStringList catIncList; | 3042 | QStringList catIncList; |
3017 | QStringList newCatList; | 3043 | QStringList newCatList; |
3018 | Incidence* inc = incList.first(); | 3044 | Incidence* inc = incList.first(); |
3019 | uint i; | 3045 | uint i; |
3020 | while ( inc ) { | 3046 | while ( inc ) { |
3021 | newCatList.clear(); | 3047 | newCatList.clear(); |
3022 | catIncList = inc->categories() ; | 3048 | catIncList = inc->categories() ; |
3023 | for( i = 0; i< catIncList.count(); ++i ) { | 3049 | for( i = 0; i< catIncList.count(); ++i ) { |
3024 | if ( catList.contains (catIncList[i])) | 3050 | if ( catList.contains (catIncList[i])) |
3025 | newCatList.append( catIncList[i] ); | 3051 | newCatList.append( catIncList[i] ); |
3026 | } | 3052 | } |
3027 | newCatList.sort(); | 3053 | newCatList.sort(); |
3028 | inc->setCategories( newCatList.join(",") ); | 3054 | inc->setCategories( newCatList.join(",") ); |
3029 | inc = incList.next(); | 3055 | inc = incList.next(); |
3030 | } | 3056 | } |
3031 | } | 3057 | } |
3032 | 3058 | ||
3033 | int CalendarView::addCategories() | 3059 | int CalendarView::addCategories() |
3034 | { | 3060 | { |
3035 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 3061 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
3036 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 3062 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
3037 | QStringList catIncList; | 3063 | QStringList catIncList; |
3038 | Incidence* inc = incList.first(); | 3064 | Incidence* inc = incList.first(); |
3039 | uint i; | 3065 | uint i; |
3040 | int count = 0; | 3066 | int count = 0; |
3041 | while ( inc ) { | 3067 | while ( inc ) { |
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 5285559..ad66639 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -1,395 +1,415 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <kglobal.h> | 21 | #include <kglobal.h> |
22 | #include <klocale.h> | 22 | #include <klocale.h> |
23 | #include <kdebug.h> | 23 | #include <kdebug.h> |
24 | 24 | ||
25 | #include "event.h" | 25 | #include "event.h" |
26 | 26 | ||
27 | using namespace KCal; | 27 | using namespace KCal; |
28 | 28 | ||
29 | Event::Event() : | 29 | Event::Event() : |
30 | mHasEndDate( false ), mTransparency( Opaque ) | 30 | mHasEndDate( false ), mTransparency( Opaque ) |
31 | { | 31 | { |
32 | } | 32 | } |
33 | 33 | ||
34 | Event::Event(const Event &e) : Incidence(e) | 34 | Event::Event(const Event &e) : Incidence(e) |
35 | { | 35 | { |
36 | mDtEnd = e.mDtEnd; | 36 | mDtEnd = e.mDtEnd; |
37 | mHasEndDate = e.mHasEndDate; | 37 | mHasEndDate = e.mHasEndDate; |
38 | mTransparency = e.mTransparency; | 38 | mTransparency = e.mTransparency; |
39 | } | 39 | } |
40 | 40 | ||
41 | Event::~Event() | 41 | Event::~Event() |
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
45 | Incidence *Event::clone() | 45 | Incidence *Event::clone() |
46 | { | 46 | { |
47 | return new Event(*this); | 47 | return new Event(*this); |
48 | } | 48 | } |
49 | 49 | ||
50 | bool KCal::operator==( const Event& e1, const Event& e2 ) | 50 | bool KCal::operator==( const Event& e1, const Event& e2 ) |
51 | { | 51 | { |
52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && | 52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && |
53 | e1.dtEnd() == e2.dtEnd() && | 53 | e1.dtEnd() == e2.dtEnd() && |
54 | e1.hasEndDate() == e2.hasEndDate() && | 54 | e1.hasEndDate() == e2.hasEndDate() && |
55 | e1.transparency() == e2.transparency(); | 55 | e1.transparency() == e2.transparency(); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | bool Event::contains ( Event* from ) | 59 | bool Event::contains ( Event* from ) |
60 | { | 60 | { |
61 | 61 | ||
62 | if ( !from->summary().isEmpty() ) | 62 | if ( !from->summary().isEmpty() ) |
63 | if ( !summary().startsWith( from->summary() )) | 63 | if ( !summary().startsWith( from->summary() )) |
64 | return false; | 64 | return false; |
65 | if ( from->dtStart().isValid() ) | 65 | if ( from->dtStart().isValid() ) |
66 | if (dtStart() != from->dtStart() ) | 66 | if (dtStart() != from->dtStart() ) |
67 | return false; | 67 | return false; |
68 | if ( from->dtEnd().isValid() ) | 68 | if ( from->dtEnd().isValid() ) |
69 | if ( dtEnd() != from->dtEnd() ) | 69 | if ( dtEnd() != from->dtEnd() ) |
70 | return false; | 70 | return false; |
71 | if ( !from->location().isEmpty() ) | 71 | if ( !from->location().isEmpty() ) |
72 | if ( !location().startsWith( from->location() ) ) | 72 | if ( !location().startsWith( from->location() ) ) |
73 | return false; | 73 | return false; |
74 | if ( !from->description().isEmpty() ) | 74 | if ( !from->description().isEmpty() ) |
75 | if ( !description().startsWith( from->description() )) | 75 | if ( !description().startsWith( from->description() )) |
76 | return false; | 76 | return false; |
77 | if ( from->alarms().count() ) { | 77 | if ( from->alarms().count() ) { |
78 | Alarm *a = from->alarms().first(); | 78 | Alarm *a = from->alarms().first(); |
79 | if ( a->enabled() ){ | 79 | if ( a->enabled() ){ |
80 | if ( !alarms().count() ) | 80 | if ( !alarms().count() ) |
81 | return false; | 81 | return false; |
82 | Alarm *b = alarms().first(); | 82 | Alarm *b = alarms().first(); |
83 | if( ! b->enabled() ) | 83 | if( ! b->enabled() ) |
84 | return false; | 84 | return false; |
85 | if ( ! (a->offset() == b->offset() )) | 85 | if ( ! (a->offset() == b->offset() )) |
86 | return false; | 86 | return false; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | QStringList cat = categories(); | 89 | QStringList cat = categories(); |
90 | QStringList catFrom = from->categories(); | 90 | QStringList catFrom = from->categories(); |
91 | QString nCat; | 91 | QString nCat; |
92 | unsigned int iii; | 92 | unsigned int iii; |
93 | for ( iii = 0; iii < catFrom.count();++iii ) { | 93 | for ( iii = 0; iii < catFrom.count();++iii ) { |
94 | nCat = catFrom[iii]; | 94 | nCat = catFrom[iii]; |
95 | if ( !nCat.isEmpty() ) | 95 | if ( !nCat.isEmpty() ) |
96 | if ( !cat.contains( nCat )) { | 96 | if ( !cat.contains( nCat )) { |
97 | return false; | 97 | return false; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | if ( from->doesRecur() ) | 100 | if ( from->doesRecur() ) |
101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) | 101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) |
102 | return false; | 102 | return false; |
103 | return true; | 103 | return true; |
104 | } | 104 | } |
105 | 105 | ||
106 | void Event::setDtEnd(const QDateTime &dtEnd) | 106 | void Event::setDtEnd(const QDateTime &dtEnd) |
107 | { | 107 | { |
108 | if (mReadOnly) return; | 108 | if (mReadOnly) return; |
109 | 109 | ||
110 | mDtEnd = getEvenTime( dtEnd ); | 110 | mDtEnd = getEvenTime( dtEnd ); |
111 | 111 | ||
112 | setHasEndDate(true); | 112 | setHasEndDate(true); |
113 | setHasDuration(false); | 113 | setHasDuration(false); |
114 | 114 | ||
115 | updated(); | 115 | updated(); |
116 | } | 116 | } |
117 | 117 | ||
118 | QDateTime Event::dtEnd() const | 118 | QDateTime Event::dtEnd() const |
119 | { | 119 | { |
120 | if (hasEndDate()) return mDtEnd; | 120 | if (hasEndDate()) return mDtEnd; |
121 | if (hasDuration()) return dtStart().addSecs(duration()); | 121 | if (hasDuration()) return dtStart().addSecs(duration()); |
122 | 122 | ||
123 | return dtStart(); | 123 | return dtStart(); |
124 | } | 124 | } |
125 | 125 | ||
126 | QString Event::dtEndTimeStr() const | 126 | QString Event::dtEndTimeStr() const |
127 | { | 127 | { |
128 | return KGlobal::locale()->formatTime(mDtEnd.time()); | 128 | return KGlobal::locale()->formatTime(mDtEnd.time()); |
129 | } | 129 | } |
130 | 130 | ||
131 | QString Event::dtEndDateStr(bool shortfmt) const | 131 | QString Event::dtEndDateStr(bool shortfmt) const |
132 | { | 132 | { |
133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); | 133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); |
134 | } | 134 | } |
135 | 135 | ||
136 | QString Event::dtEndStr(bool shortfmt) const | 136 | QString Event::dtEndStr(bool shortfmt) const |
137 | { | 137 | { |
138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); | 138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); |
139 | } | 139 | } |
140 | 140 | ||
141 | void Event::setHasEndDate(bool b) | 141 | void Event::setHasEndDate(bool b) |
142 | { | 142 | { |
143 | mHasEndDate = b; | 143 | mHasEndDate = b; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool Event::hasEndDate() const | 146 | bool Event::hasEndDate() const |
147 | { | 147 | { |
148 | return mHasEndDate; | 148 | return mHasEndDate; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Event::isMultiDay() const | 151 | bool Event::isMultiDay() const |
152 | { | 152 | { |
153 | bool multi = !(dtStart().date() == dtEnd().date()); | 153 | bool multi = !(dtStart().date() == dtEnd().date()); |
154 | return multi; | 154 | return multi; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Event::setTransparency(Event::Transparency transparency) | 157 | void Event::setTransparency(Event::Transparency transparency) |
158 | { | 158 | { |
159 | if (mReadOnly) return; | 159 | if (mReadOnly) return; |
160 | mTransparency = transparency; | 160 | mTransparency = transparency; |
161 | updated(); | 161 | updated(); |
162 | } | 162 | } |
163 | 163 | ||
164 | Event::Transparency Event::transparency() const | 164 | Event::Transparency Event::transparency() const |
165 | { | 165 | { |
166 | return mTransparency; | 166 | return mTransparency; |
167 | } | 167 | } |
168 | 168 | ||
169 | void Event::setDuration(int seconds) | 169 | void Event::setDuration(int seconds) |
170 | { | 170 | { |
171 | setHasEndDate(false); | 171 | setHasEndDate(false); |
172 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
173 | } | 173 | } |
174 | bool Event::matchTime(QDateTime*startDT, QDateTime* endDT) | ||
175 | { | ||
176 | if ( ! doesRecur() ) { | ||
177 | if ( doesFloat() ) { | ||
178 | if ( mDtEnd.addDays( 1 ) < *startDT) | ||
179 | return false; | ||
180 | if ( endDT && mDtStart > * endDT) | ||
181 | return false; | ||
182 | } else { | ||
183 | if ( mDtEnd < *startDT ) | ||
184 | return false; | ||
185 | if ( endDT && mDtStart > * endDT) | ||
186 | return false; | ||
187 | } | ||
188 | } else { | ||
189 | if ( endDT && mDtStart > * endDT) | ||
190 | return false; | ||
191 | } | ||
192 | return true; | ||
193 | } | ||
174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) | 194 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) |
175 | { | 195 | { |
176 | if ( testEvent == this ) | 196 | if ( testEvent == this ) |
177 | return false; | 197 | return false; |
178 | if ( ! doesRecur() && !testEvent->doesRecur() ) { | 198 | if ( ! doesRecur() && !testEvent->doesRecur() ) { |
179 | QDateTime te; | 199 | QDateTime te; |
180 | if ( testEvent->doesFloat() ) | 200 | if ( testEvent->doesFloat() ) |
181 | te = testEvent->mDtEnd.addDays( 1 ); | 201 | te = testEvent->mDtEnd.addDays( 1 ); |
182 | else | 202 | else |
183 | te = testEvent->mDtEnd; | 203 | te = testEvent->mDtEnd; |
184 | QDateTime e; | 204 | QDateTime e; |
185 | if ( doesFloat() ) | 205 | if ( doesFloat() ) |
186 | e = mDtEnd.addDays( 1 ); | 206 | e = mDtEnd.addDays( 1 ); |
187 | else | 207 | else |
188 | e = mDtEnd; | 208 | e = mDtEnd; |
189 | if ( mDtStart < te && testEvent->mDtStart < e ) { | 209 | if ( mDtStart < te && testEvent->mDtStart < e ) { |
190 | if ( mDtStart < testEvent->mDtStart ) | 210 | if ( mDtStart < testEvent->mDtStart ) |
191 | *overlapDT = testEvent->mDtStart; | 211 | *overlapDT = testEvent->mDtStart; |
192 | else | 212 | else |
193 | *overlapDT = mDtStart; | 213 | *overlapDT = mDtStart; |
194 | if ( startDT ) | 214 | if ( startDT ) |
195 | return (*overlapDT >= *startDT ); | 215 | return (*overlapDT >= *startDT ); |
196 | return true; | 216 | return true; |
197 | } | 217 | } |
198 | return false; | 218 | return false; |
199 | } | 219 | } |
200 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { | 220 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { |
201 | if ( mDtStart.time() >= testEvent->mDtEnd.time() || testEvent->mDtStart.time() >= mDtEnd.time() ) { | 221 | if ( mDtStart.time() >= testEvent->mDtEnd.time() || testEvent->mDtStart.time() >= mDtEnd.time() ) { |
202 | // no need to test. times mismatch | 222 | // no need to test. times mismatch |
203 | //fprintf(stderr,"timi "); | 223 | //fprintf(stderr,"timi "); |
204 | return false; | 224 | return false; |
205 | } | 225 | } |
206 | } | 226 | } |
207 | Event *nonRecur = 0; | 227 | Event *nonRecur = 0; |
208 | Event *recurEvent = 0; | 228 | Event *recurEvent = 0; |
209 | if ( ! doesRecur() ) { | 229 | if ( ! doesRecur() ) { |
210 | nonRecur = this; | 230 | nonRecur = this; |
211 | recurEvent = testEvent; | 231 | recurEvent = testEvent; |
212 | } | 232 | } |
213 | else if ( !testEvent->doesRecur() ) { | 233 | else if ( !testEvent->doesRecur() ) { |
214 | nonRecur = testEvent; | 234 | nonRecur = testEvent; |
215 | recurEvent = this; | 235 | recurEvent = this; |
216 | } | 236 | } |
217 | if ( nonRecur ) { | 237 | if ( nonRecur ) { |
218 | QDateTime enr; | 238 | QDateTime enr; |
219 | if ( nonRecur->doesFloat() ) | 239 | if ( nonRecur->doesFloat() ) |
220 | enr = nonRecur->mDtEnd.addDays( 1 ); | 240 | enr = nonRecur->mDtEnd.addDays( 1 ); |
221 | else | 241 | else |
222 | enr = nonRecur->mDtEnd; | 242 | enr = nonRecur->mDtEnd; |
223 | if ( enr < recurEvent->mDtStart ) | 243 | if ( enr < recurEvent->mDtStart ) |
224 | return false; | 244 | return false; |
225 | if ( startDT && enr < *startDT ) | 245 | if ( startDT && enr < *startDT ) |
226 | return false; | 246 | return false; |
227 | 247 | ||
228 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); | 248 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); |
229 | if ( recurEvent->doesFloat() ) | 249 | if ( recurEvent->doesFloat() ) |
230 | recDuration += 86400; | 250 | recDuration += 86400; |
231 | bool ok = false; | 251 | bool ok = false; |
232 | QDateTime recStart; | 252 | QDateTime recStart; |
233 | if ( startDT ) { | 253 | if ( startDT ) { |
234 | recStart = recurEvent->recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); | 254 | recStart = recurEvent->recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); |
235 | } | 255 | } |
236 | if ( recStart.isValid() ) { | 256 | if ( recStart.isValid() ) { |
237 | //qDebug("%s start at %s ", startDT-> toString().latin1(), recStart.toString().latin1()); | 257 | //qDebug("%s start at %s ", startDT-> toString().latin1(), recStart.toString().latin1()); |
238 | recStart = recStart.addSecs( -300); | 258 | recStart = recStart.addSecs( -300); |
239 | } | 259 | } |
240 | else | 260 | else |
241 | recStart = recurEvent->mDtStart.addSecs( -300); | 261 | recStart = recurEvent->mDtStart.addSecs( -300); |
242 | ok = true; | 262 | ok = true; |
243 | 263 | ||
244 | while ( ok ) { | 264 | while ( ok ) { |
245 | recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok ); | 265 | recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok ); |
246 | if ( ok ) { | 266 | if ( ok ) { |
247 | if ( recStart > enr ) | 267 | if ( recStart > enr ) |
248 | return false; | 268 | return false; |
249 | QDateTime recEnd = recStart.addSecs( recDuration ); | 269 | QDateTime recEnd = recStart.addSecs( recDuration ); |
250 | if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) { | 270 | if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) { |
251 | if ( nonRecur->mDtStart < recStart ) | 271 | if ( nonRecur->mDtStart < recStart ) |
252 | *overlapDT = recStart; | 272 | *overlapDT = recStart; |
253 | else | 273 | else |
254 | *overlapDT = nonRecur->mDtStart; | 274 | *overlapDT = nonRecur->mDtStart; |
255 | if ( startDT ) { | 275 | if ( startDT ) { |
256 | if ( *overlapDT >= *startDT ) | 276 | if ( *overlapDT >= *startDT ) |
257 | return true; | 277 | return true; |
258 | } else | 278 | } else |
259 | return true; | 279 | return true; |
260 | } | 280 | } |
261 | } | 281 | } |
262 | } | 282 | } |
263 | return false; | 283 | return false; |
264 | } | 284 | } |
265 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { | 285 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { |
266 | if ( recurrence()->doesRecur() == Recurrence::rWeekly && testEvent->recurrence()->doesRecur() == Recurrence::rWeekly ) { | 286 | if ( recurrence()->doesRecur() == Recurrence::rWeekly && testEvent->recurrence()->doesRecur() == Recurrence::rWeekly ) { |
267 | bool found = false; | 287 | bool found = false; |
268 | uint i; | 288 | uint i; |
269 | for ( i=0; i< recurrence()->days().size();++i ) { | 289 | for ( i=0; i< recurrence()->days().size();++i ) { |
270 | found = found || (recurrence()->days().testBit( i ) && testEvent->recurrence()->days().testBit( i ) ); | 290 | found = found || (recurrence()->days().testBit( i ) && testEvent->recurrence()->days().testBit( i ) ); |
271 | } | 291 | } |
272 | if ( ! found ) { | 292 | if ( ! found ) { |
273 | //qDebug("recurring days mismatch %s -- %s", summary().latin1(),testEvent->summary().latin1()); | 293 | //qDebug("recurring days mismatch %s -- %s", summary().latin1(),testEvent->summary().latin1()); |
274 | return false; | 294 | return false; |
275 | } | 295 | } |
276 | 296 | ||
277 | } | 297 | } |
278 | } | 298 | } |
279 | bool ok = true; | 299 | bool ok = true; |
280 | QDateTime incidenceStart;// = mDtStart; | 300 | QDateTime incidenceStart;// = mDtStart; |
281 | QDateTime testincidenceStart;// = testEvent->mDtStart; | 301 | QDateTime testincidenceStart;// = testEvent->mDtStart; |
282 | if ( startDT ) { | 302 | if ( startDT ) { |
283 | incidenceStart = recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); | 303 | incidenceStart = recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); |
284 | testincidenceStart = testEvent->recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); | 304 | testincidenceStart = testEvent->recurrence()->getPreviousDateTime( startDT->addSecs( 61 ), &ok ); |
285 | } | 305 | } |
286 | if ( !testincidenceStart.isValid() ) | 306 | if ( !testincidenceStart.isValid() ) |
287 | testincidenceStart = testEvent->mDtStart; | 307 | testincidenceStart = testEvent->mDtStart; |
288 | if ( !incidenceStart.isValid() ) | 308 | if ( !incidenceStart.isValid() ) |
289 | incidenceStart = mDtStart; | 309 | incidenceStart = mDtStart; |
290 | int duration = mDtStart.secsTo( mDtEnd ); | 310 | int duration = mDtStart.secsTo( mDtEnd ); |
291 | if ( doesFloat() ) | 311 | if ( doesFloat() ) |
292 | duration += 86400; | 312 | duration += 86400; |
293 | int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd ); | 313 | int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd ); |
294 | if ( testEvent->doesFloat() ) | 314 | if ( testEvent->doesFloat() ) |
295 | testduration += 86400; | 315 | testduration += 86400; |
296 | bool computeThis = false; | 316 | bool computeThis = false; |
297 | if ( incidenceStart < testincidenceStart ) | 317 | if ( incidenceStart < testincidenceStart ) |
298 | computeThis = true; | 318 | computeThis = true; |
299 | if ( computeThis ) | 319 | if ( computeThis ) |
300 | incidenceStart = incidenceStart.addSecs( -300 ); | 320 | incidenceStart = incidenceStart.addSecs( -300 ); |
301 | else | 321 | else |
302 | testincidenceStart = testincidenceStart.addSecs( -300 ); | 322 | testincidenceStart = testincidenceStart.addSecs( -300 ); |
303 | int count = 0; | 323 | int count = 0; |
304 | ok = true; | 324 | ok = true; |
305 | int countbreak = 2000; | 325 | int countbreak = 2000; |
306 | QDateTime stopSearch; | 326 | QDateTime stopSearch; |
307 | bool testStop = false; | 327 | bool testStop = false; |
308 | if ( startDT ) { | 328 | if ( startDT ) { |
309 | stopSearch = startDT->addDays( 365*3 ); | 329 | stopSearch = startDT->addDays( 365*3 ); |
310 | testStop = true; | 330 | testStop = true; |
311 | } | 331 | } |
312 | while ( ok ) { | 332 | while ( ok ) { |
313 | ++count; | 333 | ++count; |
314 | if ( count > countbreak ) break; | 334 | if ( count > countbreak ) break; |
315 | if ( computeThis ) { | 335 | if ( computeThis ) { |
316 | if ( testStop ) | 336 | if ( testStop ) |
317 | if ( testincidenceStart > stopSearch ) | 337 | if ( testincidenceStart > stopSearch ) |
318 | break; | 338 | break; |
319 | incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok ); | 339 | incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok ); |
320 | } | 340 | } |
321 | else { | 341 | else { |
322 | if ( testStop ) | 342 | if ( testStop ) |
323 | if ( incidenceStart > stopSearch ) | 343 | if ( incidenceStart > stopSearch ) |
324 | break; | 344 | break; |
325 | testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok ); | 345 | testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok ); |
326 | } | 346 | } |
327 | if ( ok ) { | 347 | if ( ok ) { |
328 | if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) { | 348 | if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) { |
329 | if ( incidenceStart < testincidenceStart ) | 349 | if ( incidenceStart < testincidenceStart ) |
330 | *overlapDT = testincidenceStart; | 350 | *overlapDT = testincidenceStart; |
331 | else | 351 | else |
332 | *overlapDT = incidenceStart; | 352 | *overlapDT = incidenceStart; |
333 | if ( startDT ) { | 353 | if ( startDT ) { |
334 | if ( *overlapDT >= *startDT ) | 354 | if ( *overlapDT >= *startDT ) |
335 | return true; | 355 | return true; |
336 | } else | 356 | } else |
337 | return true; | 357 | return true; |
338 | } | 358 | } |
339 | computeThis = ( incidenceStart < testincidenceStart ); | 359 | computeThis = ( incidenceStart < testincidenceStart ); |
340 | } | 360 | } |
341 | 361 | ||
342 | } | 362 | } |
343 | //qDebug("%d rec counter stopped at %d - %s %s", ok ,count, summary().latin1(),testEvent->summary().latin1() ); | 363 | //qDebug("%d rec counter stopped at %d - %s %s", ok ,count, summary().latin1(),testEvent->summary().latin1() ); |
344 | return false; | 364 | return false; |
345 | } | 365 | } |
346 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const | 366 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const |
347 | { | 367 | { |
348 | *ok = false; | 368 | *ok = false; |
349 | if ( !alarmEnabled() ) | 369 | if ( !alarmEnabled() ) |
350 | return QDateTime (); | 370 | return QDateTime (); |
351 | bool yes; | 371 | bool yes; |
352 | QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); | 372 | QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); |
353 | if ( ! yes || cancelled() ) { | 373 | if ( ! yes || cancelled() ) { |
354 | *ok = false; | 374 | *ok = false; |
355 | return QDateTime (); | 375 | return QDateTime (); |
356 | } | 376 | } |
357 | 377 | ||
358 | bool enabled = false; | 378 | bool enabled = false; |
359 | Alarm* alarm; | 379 | Alarm* alarm; |
360 | int off = 0; | 380 | int off = 0; |
361 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 381 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
362 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 382 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
363 | // *ok = false; | 383 | // *ok = false; |
364 | // return incidenceStart; | 384 | // return incidenceStart; |
365 | // } | 385 | // } |
366 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 386 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
367 | if (alarm->enabled()) { | 387 | if (alarm->enabled()) { |
368 | if ( alarm->hasTime () ) { | 388 | if ( alarm->hasTime () ) { |
369 | if ( alarm->time() < alarmStart ) { | 389 | if ( alarm->time() < alarmStart ) { |
370 | alarmStart = alarm->time(); | 390 | alarmStart = alarm->time(); |
371 | enabled = true; | 391 | enabled = true; |
372 | off = alarmStart.secsTo( incidenceStart ); | 392 | off = alarmStart.secsTo( incidenceStart ); |
373 | } | 393 | } |
374 | 394 | ||
375 | } else { | 395 | } else { |
376 | int secs = alarm->startOffset().asSeconds(); | 396 | int secs = alarm->startOffset().asSeconds(); |
377 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 397 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
378 | alarmStart = incidenceStart.addSecs( secs ); | 398 | alarmStart = incidenceStart.addSecs( secs ); |
379 | enabled = true; | 399 | enabled = true; |
380 | off = -secs; | 400 | off = -secs; |
381 | } | 401 | } |
382 | } | 402 | } |
383 | } | 403 | } |
384 | } | 404 | } |
385 | if ( enabled ) { | 405 | if ( enabled ) { |
386 | if ( alarmStart > start_dt ) { | 406 | if ( alarmStart > start_dt ) { |
387 | *ok = true; | 407 | *ok = true; |
388 | * offset = off; | 408 | * offset = off; |
389 | return alarmStart; | 409 | return alarmStart; |
390 | } | 410 | } |
391 | } | 411 | } |
392 | *ok = false; | 412 | *ok = false; |
393 | return QDateTime (); | 413 | return QDateTime (); |
394 | 414 | ||
395 | } | 415 | } |
diff --git a/libkcal/event.h b/libkcal/event.h index e6055a5..2da9770 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -1,93 +1,94 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef EVENT_H | 21 | #ifndef EVENT_H |
22 | #define EVENT_H | 22 | #define EVENT_H |
23 | // | 23 | // |
24 | // Event component, representing a VEVENT object | 24 | // Event component, representing a VEVENT object |
25 | // | 25 | // |
26 | 26 | ||
27 | #include "incidence.h" | 27 | #include "incidence.h" |
28 | namespace KCal { | 28 | namespace KCal { |
29 | 29 | ||
30 | /** | 30 | /** |
31 | This class provides an Event in the sense of RFC2445. | 31 | This class provides an Event in the sense of RFC2445. |
32 | */ | 32 | */ |
33 | class Event : public Incidence | 33 | class Event : public Incidence |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | enum Transparency { Opaque, Transparent }; | 36 | enum Transparency { Opaque, Transparent }; |
37 | typedef ListBase<Event> List; | 37 | typedef ListBase<Event> List; |
38 | Event(); | 38 | Event(); |
39 | Event(const Event &); | 39 | Event(const Event &); |
40 | ~Event(); | 40 | ~Event(); |
41 | bool matchTime(QDateTime*startDT, QDateTime* endDT); | ||
41 | 42 | ||
42 | QCString type() const { return "Event"; } | 43 | QCString type() const { return "Event"; } |
43 | IncTypeID typeID() const { return eventID; } | 44 | IncTypeID typeID() const { return eventID; } |
44 | 45 | ||
45 | Incidence *clone(); | 46 | Incidence *clone(); |
46 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; | 47 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; |
47 | 48 | ||
48 | /** for setting an event's ending date/time with a QDateTime. */ | 49 | /** for setting an event's ending date/time with a QDateTime. */ |
49 | void setDtEnd(const QDateTime &dtEnd); | 50 | void setDtEnd(const QDateTime &dtEnd); |
50 | /** Return the event's ending date/time as a QDateTime. */ | 51 | /** Return the event's ending date/time as a QDateTime. */ |
51 | virtual QDateTime dtEnd() const; | 52 | virtual QDateTime dtEnd() const; |
52 | /** returns an event's end time as a string formatted according to the | 53 | /** returns an event's end time as a string formatted according to the |
53 | users locale settings */ | 54 | users locale settings */ |
54 | QString dtEndTimeStr() const; | 55 | QString dtEndTimeStr() const; |
55 | /** returns an event's end date as a string formatted according to the | 56 | /** returns an event's end date as a string formatted according to the |
56 | users locale settings */ | 57 | users locale settings */ |
57 | QString dtEndDateStr(bool shortfmt=true) const; | 58 | QString dtEndDateStr(bool shortfmt=true) const; |
58 | /** returns an event's end date and time as a string formatted according | 59 | /** returns an event's end date and time as a string formatted according |
59 | to the users locale settings */ | 60 | to the users locale settings */ |
60 | QString dtEndStr(bool shortfmt=true) const; | 61 | QString dtEndStr(bool shortfmt=true) const; |
61 | void setHasEndDate(bool); | 62 | void setHasEndDate(bool); |
62 | /** Return whether the event has an end date/time. */ | 63 | /** Return whether the event has an end date/time. */ |
63 | bool hasEndDate() const; | 64 | bool hasEndDate() const; |
64 | 65 | ||
65 | /** Return true if the event spans multiple days, otherwise return false. */ | 66 | /** Return true if the event spans multiple days, otherwise return false. */ |
66 | bool isMultiDay() const; | 67 | bool isMultiDay() const; |
67 | 68 | ||
68 | /** set the event's time transparency level. */ | 69 | /** set the event's time transparency level. */ |
69 | void setTransparency(Transparency transparency); | 70 | void setTransparency(Transparency transparency); |
70 | /** get the event's time transparency level. */ | 71 | /** get the event's time transparency level. */ |
71 | Transparency transparency() const; | 72 | Transparency transparency() const; |
72 | 73 | ||
73 | void setDuration(int seconds); | 74 | void setDuration(int seconds); |
74 | 75 | ||
75 | bool contains ( Event*); | 76 | bool contains ( Event*); |
76 | 77 | ||
77 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); | 78 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); |
78 | 79 | ||
79 | private: | 80 | private: |
80 | bool accept(Visitor &v) { return v.visit(this); } | 81 | bool accept(Visitor &v) { return v.visit(this); } |
81 | 82 | ||
82 | QDateTime mDtEnd; | 83 | QDateTime mDtEnd; |
83 | bool mHasEndDate; | 84 | bool mHasEndDate; |
84 | Transparency mTransparency; | 85 | Transparency mTransparency; |
85 | }; | 86 | }; |
86 | 87 | ||
87 | bool operator==( const Event&, const Event& ); | 88 | bool operator==( const Event&, const Event& ); |
88 | 89 | ||
89 | 90 | ||
90 | } | 91 | } |
91 | 92 | ||
92 | 93 | ||
93 | #endif | 94 | #endif |