-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 14 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 80 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 71 |
5 files changed, 142 insertions, 29 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 79de197..814c541 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,242 +1,244 @@ | |||
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.14 ************ | 3 | ********** VERSION 2.1.14 ************ |
4 | 4 | ||
5 | 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. | 5 | 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. |
6 | Added a button to add a subtodo quickly. | 6 | Added a button to add a subtodo quickly. |
7 | 7 | ||
8 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q" ). | ||
9 | |||
8 | 10 | ||
9 | ********** VERSION 2.1.13 ************ | 11 | ********** VERSION 2.1.13 ************ |
10 | 12 | ||
11 | Fixed a problem in KA/Pi search. | 13 | Fixed a problem in KA/Pi search. |
12 | Fixed some minor problems in KO/Pi. | 14 | Fixed some minor problems in KO/Pi. |
13 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. | 15 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. |
14 | 16 | ||
15 | Fixed memory usage problems in KA/Pi: | 17 | Fixed memory usage problems in KA/Pi: |
16 | When loading data KA/Pi did load the file data twice. | 18 | When loading data KA/Pi did load the file data twice. |
17 | Example: | 19 | Example: |
18 | A 600k file did consume 1200k memory during loading process. | 20 | A 600k file did consume 1200k memory during loading process. |
19 | This is fixed, it does now consume only 600k during loading process. | 21 | This is fixed, it does now consume only 600k during loading process. |
20 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. | 22 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. |
21 | This is fixed. | 23 | This is fixed. |
22 | Example: | 24 | Example: |
23 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. | 25 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. |
24 | 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. | 26 | 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. |
25 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. | 27 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. |
26 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. | 28 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. |
27 | The saving of data may be a bit slower now. | 29 | The saving of data may be a bit slower now. |
28 | 30 | ||
29 | Fixed memory usage problems in KO/Pi: | 31 | Fixed memory usage problems in KO/Pi: |
30 | When KO/Pi did save the data to file, it did not release the used buffers after saving. | 32 | When KO/Pi did save the data to file, it did not release the used buffers after saving. |
31 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. | 33 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. |
32 | This is fixed. | 34 | This is fixed. |
33 | Example: | 35 | Example: |
34 | When saving a 400k file KO/Pi do now use 400k less memory now. | 36 | When saving a 400k file KO/Pi do now use 400k less memory now. |
35 | 37 | ||
36 | Optimized memory usage in KO/Pi Agenda view: | 38 | Optimized memory usage in KO/Pi Agenda view: |
37 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. | 39 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. |
38 | These buffers were not made smaller (i.e. downsized) because of performance reasons. | 40 | These buffers were not made smaller (i.e. downsized) because of performance reasons. |
39 | The handling of these buffers are now much smarter: | 41 | The handling of these buffers are now much smarter: |
40 | Two (of six) buffers are removed completely. | 42 | Two (of six) buffers are removed completely. |
41 | The remaing four buffers are now downsized after not using the agenda view for 45 seconds. | 43 | The remaing four buffers are now downsized after not using the agenda view for 45 seconds. |
42 | 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. | 44 | 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. |
43 | 45 | ||
44 | Worst case example ( for a maximum size agenda content): | 46 | Worst case example ( for a maximum size agenda content): |
45 | 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. | 47 | 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. |
46 | 48 | ||
47 | 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. | 49 | 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. |
48 | 50 | ||
49 | Summary: | 51 | Summary: |
50 | Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. | 52 | Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. |
51 | 53 | ||
52 | ********** VERSION 2.1.12 ************ | 54 | ********** VERSION 2.1.12 ************ |
53 | 55 | ||
54 | KO/Pi: | 56 | KO/Pi: |
55 | Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. | 57 | Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. |
56 | Fixed a problem with the month view when file was saved but KO/Pi was not the active window. | 58 | Fixed a problem with the month view when file was saved but KO/Pi was not the active window. |
57 | Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). | 59 | Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). |
58 | Fixed some other small problems. | 60 | Fixed some other small problems. |
59 | 61 | ||
60 | ********** VERSION 2.1.11 ************ | 62 | ********** VERSION 2.1.11 ************ |
61 | 63 | ||
62 | KO/Pi: | 64 | KO/Pi: |
63 | Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. | 65 | Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. |
64 | Added features to handle (and add ) more than one journal entry per day. | 66 | Added features to handle (and add ) more than one journal entry per day. |
65 | Added option for a journal title. | 67 | Added option for a journal title. |
66 | 68 | ||
67 | Added info about the calendar, the item belongs to, to the event/todo/journal viewer. | 69 | Added info about the calendar, the item belongs to, to the event/todo/journal viewer. |
68 | Fixed a problem of the alarm of completed recurring todos. | 70 | Fixed a problem of the alarm of completed recurring todos. |
69 | Added to the event/todo editor to set quickly the category of an item. | 71 | Added to the event/todo editor to set quickly the category of an item. |
70 | 72 | ||
71 | 73 | ||
72 | Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. | 74 | Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. |
73 | 75 | ||
74 | Added KA/Pi multi sync to the multi sync called from the alarm applet. | 76 | Added KA/Pi multi sync to the multi sync called from the alarm applet. |
75 | 77 | ||
76 | ********** VERSION 2.1.10 ************ | 78 | ********** VERSION 2.1.10 ************ |
77 | 79 | ||
78 | KO/Pi: | 80 | KO/Pi: |
79 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | 81 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. |
80 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. | 82 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. |
81 | Fixed a bug in searching for a small timerange, i.e. one day. | 83 | Fixed a bug in searching for a small timerange, i.e. one day. |
82 | 84 | ||
83 | KA/Pi: | 85 | KA/Pi: |
84 | Fixed two problems in csv export. | 86 | Fixed two problems in csv export. |
85 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. | 87 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. |
86 | 88 | ||
87 | ********** VERSION 2.1.9 ************ | 89 | ********** VERSION 2.1.9 ************ |
88 | 90 | ||
89 | KO/Pi: | 91 | KO/Pi: |
90 | Fixed some problems of the new search options in the search dialog. | 92 | Fixed some problems of the new search options in the search dialog. |
91 | Fixed some problems in the new resource config options. | 93 | Fixed some problems in the new resource config options. |
92 | 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. | 94 | 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. |
93 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: | 95 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: |
94 | 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. | 96 | 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. |
95 | 97 | ||
96 | Fixed a problem in recurrence range in syncing with DTM. | 98 | Fixed a problem in recurrence range in syncing with DTM. |
97 | 99 | ||
98 | KA/Pi: | 100 | KA/Pi: |
99 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) | 101 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) |
100 | 102 | ||
101 | PwM/Pi: | 103 | PwM/Pi: |
102 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. | 104 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. |
103 | 105 | ||
104 | ********** VERSION 2.1.8 ************ | 106 | ********** VERSION 2.1.8 ************ |
105 | 107 | ||
106 | KO/Pi: | 108 | KO/Pi: |
107 | Added info about the completion state of a todo in the ListView/Searchdialog. | 109 | Added info about the completion state of a todo in the ListView/Searchdialog. |
108 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 110 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
109 | Fixed some updating problems when changing the filter. | 111 | Fixed some updating problems when changing the filter. |
110 | 112 | ||
111 | KA/Pi: | 113 | KA/Pi: |
112 | In the addressee selection dialog now the formatted name is shown, if not empty. | 114 | In the addressee selection dialog now the formatted name is shown, if not empty. |
113 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 115 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
114 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 116 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
115 | 117 | ||
116 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 118 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
117 | Fixed the sorting for size in the file selector on the Z. | 119 | Fixed the sorting for size in the file selector on the Z. |
118 | 120 | ||
119 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 121 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
120 | 122 | ||
121 | ********** VERSION 2.1.7 ************ | 123 | ********** VERSION 2.1.7 ************ |
122 | 124 | ||
123 | KO/Pi: | 125 | KO/Pi: |
124 | Fixed several problems in the new Resource handling. | 126 | Fixed several problems in the new Resource handling. |
125 | Added more options to the search dialog. | 127 | Added more options to the search dialog. |
126 | Fixed a problem in the Month view. | 128 | Fixed a problem in the Month view. |
127 | Added more options to the dialog when setting a todo to stopped. | 129 | Added more options to the dialog when setting a todo to stopped. |
128 | 130 | ||
129 | Fixed two small problems in KO/Pi Alarm applet. | 131 | Fixed two small problems in KO/Pi Alarm applet. |
130 | 132 | ||
131 | ********** VERSION 2.1.6 ************ | 133 | ********** VERSION 2.1.6 ************ |
132 | 134 | ||
133 | This release is for testing only. | 135 | This release is for testing only. |
134 | 136 | ||
135 | KO/Pi: | 137 | KO/Pi: |
136 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 138 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
137 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 139 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
138 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 140 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
139 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 141 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
140 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 142 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
141 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 143 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
142 | 144 | ||
143 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 145 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
144 | 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. | 146 | 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. |
145 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 147 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
146 | 148 | ||
147 | A calendar is enabled in the resource view if the "eye" column is checked. | 149 | A calendar is enabled in the resource view if the "eye" column is checked. |
148 | You can set a calendar to be the default for new items( "+" column ). | 150 | You can set a calendar to be the default for new items( "+" column ). |
149 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 151 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
150 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | 152 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... |
151 | 153 | ||
152 | 154 | ||
153 | ********** VERSION 2.1.5 ************ | 155 | ********** VERSION 2.1.5 ************ |
154 | 156 | ||
155 | This is the new stable version. | 157 | This is the new stable version. |
156 | Bugfix: | 158 | Bugfix: |
157 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 159 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
158 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 160 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
159 | Added config option to not display completed todos in agenda view. | 161 | Added config option to not display completed todos in agenda view. |
160 | Addressee view is now using the formatted name, if defined. | 162 | Addressee view is now using the formatted name, if defined. |
161 | That makes it possible to display "lastname, firstname" in that view now. | 163 | That makes it possible to display "lastname, firstname" in that view now. |
162 | To set the formatted name for all contacts, please use menu: | 164 | To set the formatted name for all contacts, please use menu: |
163 | Edit->Change->Set formatted name. | 165 | Edit->Change->Set formatted name. |
164 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 166 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
165 | 167 | ||
166 | ********** VERSION 2.1.4 ************ | 168 | ********** VERSION 2.1.4 ************ |
167 | 169 | ||
168 | Fixed two more bugs in the KA/Pi CSV import dialog: | 170 | Fixed two more bugs in the KA/Pi CSV import dialog: |
169 | Made it possible to read multi-line fields and import it to the "Note" field. | 171 | Made it possible to read multi-line fields and import it to the "Note" field. |
170 | Fixed a problem in mapping custom fields, whatever a custem field is... | 172 | Fixed a problem in mapping custom fields, whatever a custem field is... |
171 | 173 | ||
172 | ********** VERSION 2.1.3 ************ | 174 | ********** VERSION 2.1.3 ************ |
173 | 175 | ||
174 | Changed the menu structure of the alarm applet: | 176 | Changed the menu structure of the alarm applet: |
175 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 177 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
176 | 178 | ||
177 | Fixed several problems in the KA/Pi CSV import dialog: | 179 | Fixed several problems in the KA/Pi CSV import dialog: |
178 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 180 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
179 | 181 | ||
180 | 182 | ||
181 | ********** VERSION 2.1.2 ************ | 183 | ********** VERSION 2.1.2 ************ |
182 | 184 | ||
183 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 185 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
184 | 186 | ||
185 | Fixed a problem when importing data from Outlook with mutiple categories set. | 187 | Fixed a problem when importing data from Outlook with mutiple categories set. |
186 | 188 | ||
187 | Changed display of days in datenavigator: | 189 | Changed display of days in datenavigator: |
188 | Birthdays are now blue, not dark green. | 190 | Birthdays are now blue, not dark green. |
189 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 191 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
190 | When journal view is shown, only holidays are shown and days with journals are blue. | 192 | When journal view is shown, only holidays are shown and days with journals are blue. |
191 | 193 | ||
192 | Added Backup options to global config: | 194 | Added Backup options to global config: |
193 | 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 ). | 195 | 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 ). |
194 | 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. | 196 | 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. |
195 | 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. | 197 | 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. |
196 | 198 | ||
197 | ********** VERSION 2.1.1 ************ | 199 | ********** VERSION 2.1.1 ************ |
198 | 200 | ||
199 | Stable release 2.1.1! | 201 | Stable release 2.1.1! |
200 | 202 | ||
201 | KO/Pi: | 203 | KO/Pi: |
202 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. | 204 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. |
203 | 205 | ||
204 | ********** VERSION 2.1.0 ************ | 206 | ********** VERSION 2.1.0 ************ |
205 | 207 | ||
206 | Stable release 2.1.0! | 208 | Stable release 2.1.0! |
207 | 209 | ||
208 | Summary of changes/fixes compared to version 2.0.6: | 210 | Summary of changes/fixes compared to version 2.0.6: |
209 | 211 | ||
210 | Many bugs of version 2.0.6 fixed. | 212 | Many bugs of version 2.0.6 fixed. |
211 | Most of them were small bugs, but some of them were important. | 213 | Most of them were small bugs, but some of them were important. |
212 | It is recommended to use version 2.1.0 and not version 2.0.6. | 214 | It is recommended to use version 2.1.0 and not version 2.0.6. |
213 | 215 | ||
214 | Important changes: | 216 | Important changes: |
215 | 217 | ||
216 | Added recurring todos to KO/Pi. | 218 | Added recurring todos to KO/Pi. |
217 | 219 | ||
218 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. | 220 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. |
219 | 221 | ||
220 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 222 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
221 | 223 | ||
222 | Datenavigator can now display many months. Very useful on the desktop. | 224 | Datenavigator can now display many months. Very useful on the desktop. |
223 | 225 | ||
224 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. | 226 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. |
225 | 227 | ||
226 | Made alarm sound working on Linux desktop. | 228 | Made alarm sound working on Linux desktop. |
227 | 229 | ||
228 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. | 230 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. |
229 | 231 | ||
230 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. | 232 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. |
231 | 233 | ||
232 | Many other usebility enhancements. | 234 | Many other usebility enhancements. |
233 | Special thanks to Ben for his suggestions! | 235 | Special thanks to Ben for his suggestions! |
234 | 236 | ||
235 | You can find the complete changelog | 237 | You can find the complete changelog |
236 | from version 1.7.7 to 2.1.0 | 238 | from version 1.7.7 to 2.1.0 |
237 | in the source package or on | 239 | in the source package or on |
238 | 240 | ||
239 | http://www.pi-sync.net/html/changelog.html | 241 | http://www.pi-sync.net/html/changelog.html |
240 | 242 | ||
241 | 243 | ||
242 | 244 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index bcc23dc..b225594 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1241,266 +1241,280 @@ | |||
1241 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1241 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1242 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1242 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1243 | { "Received sync request","Sync Anfrage erhalten" }, | 1243 | { "Received sync request","Sync Anfrage erhalten" }, |
1244 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1244 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1245 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1245 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1246 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1246 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1247 | { "Sending file...","Sende Datei..." }, | 1247 | { "Sending file...","Sende Datei..." }, |
1248 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1248 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1249 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1249 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1250 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1250 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1251 | { "Writing file to disk...","Speichere Datei..." }, | 1251 | { "Writing file to disk...","Speichere Datei..." }, |
1252 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1252 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1253 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1253 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1254 | { "Synchronize!","Synchronisiere!" }, | 1254 | { "Synchronize!","Synchronisiere!" }, |
1255 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1255 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1256 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1256 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1257 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1257 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1258 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1258 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1259 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1259 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1260 | { "List week view","Listenwochenansicht" }, | 1260 | { "List week view","Listenwochenansicht" }, |
1261 | { "List week","Listenwochenansicht" }, | 1261 | { "List week","Listenwochenansicht" }, |
1262 | { "Next Week","Nächste Woche" }, | 1262 | { "Next Week","Nächste Woche" }, |
1263 | { "Previous Week","Vorherige Woche" }, | 1263 | { "Previous Week","Vorherige Woche" }, |
1264 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1264 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1265 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1265 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1266 | { "Details","Details" }, | 1266 | { "Details","Details" }, |
1267 | { "Created time","Erstellt Zeit" }, | 1267 | { "Created time","Erstellt Zeit" }, |
1268 | { "Last modified time","Geändert Zeit" }, | 1268 | { "Last modified time","Geändert Zeit" }, |
1269 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1269 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1270 | { "View Options","Anzeige Optionen" }, | 1270 | { "View Options","Anzeige Optionen" }, |
1271 | { "<b>Created: ","<b>Erstellt am: " }, | 1271 | { "<b>Created: ","<b>Erstellt am: " }, |
1272 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1272 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1273 | { "Journal: ","Journal: " }, | 1273 | { "Journal: ","Journal: " }, |
1274 | { "yearly","jährlich" }, | 1274 | { "yearly","jährlich" }, |
1275 | { "(%1) ","%1-" }, | 1275 | { "(%1) ","%1-" }, |
1276 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1276 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1277 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1277 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1278 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1278 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1279 | { "Summary/Loc.","Titel/Ort" }, | 1279 | { "Summary/Loc.","Titel/Ort" }, |
1280 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1280 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1281 | { "Week Number","Wochennummer" }, | 1281 | { "Week Number","Wochennummer" }, |
1282 | { "Import","Importiere" }, | 1282 | { "Import","Importiere" }, |
1283 | { "Export","Exportiere" }, | 1283 | { "Export","Exportiere" }, |
1284 | { "Beam","Beame" }, | 1284 | { "Beam","Beame" }, |
1285 | { "Export","Exportiere" }, | 1285 | { "Export","Exportiere" }, |
1286 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1286 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1287 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1287 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1288 | { "Journal/Details...","Journale/Details..." }, | 1288 | { "Journal/Details...","Journale/Details..." }, |
1289 | { "Agenda View","Agenda Ansicht" }, | 1289 | { "Agenda View","Agenda Ansicht" }, |
1290 | { "Show current time","Zeige aktuelle Zeit" }, | 1290 | { "Show current time","Zeige aktuelle Zeit" }, |
1291 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1291 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1292 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, | 1292 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, |
1293 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | 1293 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, |
1294 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | 1294 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, |
1295 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, | 1295 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, |
1296 | { "%1 days\n","%1 Tagen\n" }, | 1296 | { "%1 days\n","%1 Tagen\n" }, |
1297 | { "1 day\n","1 Tag\n" }, | 1297 | { "1 day\n","1 Tag\n" }, |
1298 | { "%1 hours\n","%1 Stunden\n" }, | 1298 | { "%1 hours\n","%1 Stunden\n" }, |
1299 | { "1 hour\n","1 Stunde\n" }, | 1299 | { "1 hour\n","1 Stunde\n" }, |
1300 | { "%1 minutes\n","%1 Minuten\n" }, | 1300 | { "%1 minutes\n","%1 Minuten\n" }, |
1301 | { "1 minute\n","1 Minute\n" }, | 1301 | { "1 minute\n","1 Minute\n" }, |
1302 | { "Only one toolbar","Nur eine Toolbar" }, | 1302 | { "Only one toolbar","Nur eine Toolbar" }, |
1303 | { "Print","Drucke" }, | 1303 | { "Print","Drucke" }, |
1304 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, | 1304 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, |
1305 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, | 1305 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, |
1306 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, | 1306 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, |
1307 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, | 1307 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, |
1308 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, | 1308 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, |
1309 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1309 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1310 | { "Print unscaled","Drucke unskaliert" }, | 1310 | { "Print unscaled","Drucke unskaliert" }, |
1311 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1311 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1312 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1312 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1313 | { "Printout Mode","Druck Modus" }, | 1313 | { "Printout Mode","Druck Modus" }, |
1314 | { "Filter menu icon","Filtermenu Icon" }, | 1314 | { "Filter menu icon","Filtermenu Icon" }, |
1315 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, | 1315 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, |
1316 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, | 1316 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, |
1317 | { "%1d","%1t" }, | 1317 | { "%1d","%1t" }, |
1318 | { "%1h","%1std" }, | 1318 | { "%1h","%1std" }, |
1319 | { "%1min","%1min" }, | 1319 | { "%1min","%1min" }, |
1320 | { "( %1 before )","( %1 vorher )" }, | 1320 | { "( %1 before )","( %1 vorher )" }, |
1321 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, | 1321 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, |
1322 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, | 1322 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, |
1323 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, | 1323 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, |
1324 | { "Show Sync Events","Zeige Sync-Ereignisse" }, | 1324 | { "Show Sync Events","Zeige Sync-Ereignisse" }, |
1325 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, | 1325 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, |
1326 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, | 1326 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, |
1327 | { " on "," am " }, | 1327 | { " on "," am " }, |
1328 | { "On: ","Am: " }, | 1328 | { "On: ","Am: " }, |
1329 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, | 1329 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, |
1330 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, | 1330 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, |
1331 | { "Color for running todos:","Farbe für laufende Todos:" }, | 1331 | { "Color for running todos:","Farbe für laufende Todos:" }, |
1332 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, | 1332 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, |
1333 | { "Todo is started","Todo ist gestartet" }, | 1333 | { "Todo is started","Todo ist gestartet" }, |
1334 | { "Stop todo","Stoppe Todo" }, | 1334 | { "Stop todo","Stoppe Todo" }, |
1335 | { "Todo is stopped","Todo ist gestoppt" }, | 1335 | { "Todo is stopped","Todo ist gestoppt" }, |
1336 | { "Start todo","Starte Todo" }, | 1336 | { "Start todo","Starte Todo" }, |
1337 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, | 1337 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, |
1338 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, | 1338 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, |
1339 | { "Todo has subtodos","Todo hat Untertodos" }, | 1339 | { "Todo has subtodos","Todo hat Untertodos" }, |
1340 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1340 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1341 | { "Colors","Farben" }, | 1341 | { "Colors","Farben" }, |
1342 | { "Click on new parent item","Klicke auf neues Übertodo" }, | 1342 | { "Click on new parent item","Klicke auf neues Übertodo" }, |
1343 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, | 1343 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, |
1344 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, | 1344 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, |
1345 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, | 1345 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, |
1346 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, | 1346 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, |
1347 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 1347 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
1348 | { "times","Zeiten" }, | 1348 | { "times","Zeiten" }, |
1349 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, | 1349 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, |
1350 | { "Backup enabled","Backup angeschaltet" }, | 1350 | { "Backup enabled","Backup angeschaltet" }, |
1351 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 1351 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
1352 | { "Number of Backups:","Anzahl der Backups" }, | 1352 | { "Number of Backups:","Anzahl der Backups" }, |
1353 | { "Make backup every ","Mache ein Backup alle " }, | 1353 | { "Make backup every ","Mache ein Backup alle " }, |
1354 | { " days"," Tage" }, | 1354 | { " days"," Tage" }, |
1355 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, | 1355 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, |
1356 | { "Backup Failed!","Backup Problem!" }, | 1356 | { "Backup Failed!","Backup Problem!" }, |
1357 | { "Try again now","Versuche jetzt nochmal" }, | 1357 | { "Try again now","Versuche jetzt nochmal" }, |
1358 | { "Try again later","Versuche später nochmal" }, | 1358 | { "Try again later","Versuche später nochmal" }, |
1359 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1359 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1360 | { "Disable backup","Schalte Backup ab" }, | 1360 | { "Disable backup","Schalte Backup ab" }, |
1361 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1361 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1362 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1362 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1363 | { "Choose action","Wähle Aktion" }, | 1363 | { "Choose action","Wähle Aktion" }, |
1364 | { "Comment for todo:","Kommentar zum Todo:" }, | 1364 | { "Comment for todo:","Kommentar zum Todo:" }, |
1365 | { "Stop+note","Stop+Notiz" }, | 1365 | { "Stop+note","Stop+Notiz" }, |
1366 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, | 1366 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, |
1367 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, | 1367 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, |
1368 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, | 1368 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1369 | { "Print complete list...","Drucke komplette Liste..." }, | 1369 | { "Print complete list...","Drucke komplette Liste..." }, |
1370 | { "Hide all selected","Verstecke Ausgewählte" }, | 1370 | { "Hide all selected","Verstecke Ausgewählte" }, |
1371 | { "Add items","hinzufügen" }, | 1371 | { "Add items","hinzufügen" }, |
1372 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, | 1372 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, |
1373 | { "Print List View...","Drucke Listenansicht..." }, | 1373 | { "Print List View...","Drucke Listenansicht..." }, |
1374 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, | 1374 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, |
1375 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, | 1375 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, |
1376 | { "Global Settings...","Globale Einstellungen..." }, | 1376 | { "Global Settings...","Globale Einstellungen..." }, |
1377 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, | 1377 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, |
1378 | { "(disabled)","(abgeschaltet)" }, | 1378 | { "(disabled)","(abgeschaltet)" }, |
1379 | { "New Calendar","Neuer Kalender" }, | 1379 | { "New Calendar","Neuer Kalender" }, |
1380 | { "Calendar","Kalender" }, | 1380 | { "Calendar","Kalender" }, |
1381 | { "Filter selector","Filterauswahl" }, | 1381 | { "Filter selector","Filterauswahl" }, |
1382 | { "Filtermenu","Filtermenu" }, | 1382 | { "Filtermenu","Filtermenu" }, |
1383 | { "Toggle Fullscreen","Vollbild umschalten" }, | 1383 | { "Toggle Fullscreen","Vollbild umschalten" }, |
1384 | { "Toggle Resource View","Resourcenansicht umschalten" }, | 1384 | { "Toggle Resource View","Resourcenansicht umschalten" }, |
1385 | { "Storage HowTo...","Speicherort HowTo..." }, | 1385 | { "Storage HowTo...","Speicherort HowTo..." }, |
1386 | { "Timetracking HowTo...","Timetracking HowTo..." }, | 1386 | { "Timetracking HowTo...","Timetracking HowTo..." }, |
1387 | { "Juni","Juni" }, | 1387 | { "Juni","Juni" }, |
1388 | { "Juli","Juli" }, | 1388 | { "Juli","Juli" }, |
1389 | { "ToDo:","ToDo:" }, | 1389 | { "ToDo:","ToDo:" }, |
1390 | { "Set Calendar","Setze Kalender" }, | 1390 | { "Set Calendar","Setze Kalender" }, |
1391 | { "Todo: %1","Todo: %1" }, | 1391 | { "Todo: %1","Todo: %1" }, |
1392 | { ": (Prio ",": (Prio " }, | 1392 | { ": (Prio ",": (Prio " }, |
1393 | { "Todos","Todos" }, | 1393 | { "Todos","Todos" }, |
1394 | { "Todo Viewer","Todo Anzeige" }, | 1394 | { "Todo Viewer","Todo Anzeige" }, |
1395 | { "Todo ","Todo " }, | 1395 | { "Todo ","Todo " }, |
1396 | { " Calendar \n Resource "," Kalender \n Resource " }, | 1396 | { " Calendar \n Resource "," Kalender \n Resource " }, |
1397 | { " Color "," Farbe " }, | 1397 | { " Color "," Farbe " }, |
1398 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, | 1398 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, |
1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, | 1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, |
1400 | { "Add new Calendar","Füge Kalender hinzu" }, | 1400 | { "Add new Calendar","Füge Kalender hinzu" }, |
1401 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, | 1401 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, |
1402 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, | 1402 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, |
1403 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, | 1403 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, |
1404 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, | 1404 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, |
1405 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, | 1405 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, |
1406 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, | 1406 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, |
1407 | { "Global application font for all apps:","Globale Schriftart:" }, | 1407 | { "Global application font for all apps:","Globale Schriftart:" }, |
1408 | { "Application Font","Applikationsschriftart" }, | 1408 | { "Application Font","Applikationsschriftart" }, |
1409 | { "Kx/Pi","Kx/Pi" }, | 1409 | { "Kx/Pi","Kx/Pi" }, |
1410 | { "Backup","Backup" }, | 1410 | { "Backup","Backup" }, |
1411 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, | 1411 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, |
1412 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, | 1412 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, |
1413 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, | 1413 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, |
1414 | { "Choose Color","Wähle Farbe" }, | 1414 | { "Choose Color","Wähle Farbe" }, |
1415 | { " OK "," OK " }, | 1415 | { " OK "," OK " }, |
1416 | { " Cancel "," Abbrechen " }, | 1416 | { " Cancel "," Abbrechen " }, |
1417 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, | 1417 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, |
1418 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, | 1418 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, |
1419 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, | 1419 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, |
1420 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, | 1420 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, |
1421 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, | 1421 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, |
1422 | { "%1\nis running!","%1\nist am Laufen!" }, | 1422 | { "%1\nis running!","%1\nist am Laufen!" }, |
1423 | { "Additional Comment:","Zusätzlicher Kommentar:" }, | 1423 | { "Additional Comment:","Zusätzlicher Kommentar:" }, |
1424 | { "Stop and save","Stopp und Speichern" }, | 1424 | { "Stop and save","Stopp und Speichern" }, |
1425 | { "Continue running","Weiter laufen lassen" }, | 1425 | { "Continue running","Weiter laufen lassen" }, |
1426 | { "Stop - do not save","Stopp - nicht Speichern" }, | 1426 | { "Stop - do not save","Stopp - nicht Speichern" }, |
1427 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, | 1427 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, |
1428 | { "Time mismatch!","Zeiten stimmen nicht!" }, | 1428 | { "Time mismatch!","Zeiten stimmen nicht!" }, |
1429 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, | 1429 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, |
1430 | { "Yes, stop todo","Ja, stoppe Todo" }, | 1430 | { "Yes, stop todo","Ja, stoppe Todo" }, |
1431 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, | 1431 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, |
1432 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, | 1432 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, |
1433 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, | 1433 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, |
1434 | { "Spouse","Ehegatte" }, | 1434 | { "Spouse","Ehegatte" }, |
1435 | { "Notes","Notizen" }, | 1435 | { "Notes","Notizen" }, |
1436 | { "Messanger","Messanger" }, | 1436 | { "Messanger","Messanger" }, |
1437 | { "Assistant","Assistent" }, | 1437 | { "Assistant","Assistent" }, |
1438 | { "Manager","Manager" }, | 1438 | { "Manager","Manager" }, |
1439 | { "Secrecy","Sichtbar" }, | 1439 | { "Secrecy","Sichtbar" }, |
1440 | { "male","männlich" }, | 1440 | { "male","männlich" }, |
1441 | { "female","weiblich" }, | 1441 | { "female","weiblich" }, |
1442 | { "Hide!","Verbergen!" }, | 1442 | { "Hide!","Verbergen!" }, |
1443 | { "Show!","Anzeigen!" }, | 1443 | { "Show!","Anzeigen!" }, |
1444 | { "Details","Details" }, | 1444 | { "Details","Details" }, |
1445 | { "Profession","Beruf" }, | 1445 | { "Profession","Beruf" }, |
1446 | { "Children","Kinder" }, | 1446 | { "Children","Kinder" }, |
1447 | { "Department","Abteilung" }, | 1447 | { "Department","Abteilung" }, |
1448 | { "Backup cancelled","Backup abgebrochen" }, | 1448 | { "Backup cancelled","Backup abgebrochen" }, |
1449 | { "Backup globally disabled","Backup global abgeschaltet" }, | 1449 | { "Backup globally disabled","Backup global abgeschaltet" }, |
1450 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1450 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1451 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1451 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1452 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, | 1452 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, |
1453 | { "Birthdays","Geburtstage" }, | 1453 | { "Birthdays","Geburtstage" }, |
1454 | { "KO/Pi import information!","KO/Pi Import Information!" }, | 1454 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1455 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, | 1455 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, |
1456 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, | 1456 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, |
1457 | { "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!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, | 1457 | { "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!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, |
1458 | { "Reload","Neu laden" }, | 1458 | { "Reload","Neu laden" }, |
1459 | { "Timezone settings","Zeitzoneneinstellung" }, | 1459 | { "Timezone settings","Zeitzoneneinstellung" }, |
1460 | { "Title: ","Titel: " }, | 1460 | { "Title: ","Titel: " }, |
1461 | { "Journal from: ","Journal vom: " }, | 1461 | { "Journal from: ","Journal vom: " }, |
1462 | { "Journal: %1 from ","Journal: %1 vom " }, | 1462 | { "Journal: %1 from ","Journal: %1 vom " }, |
1463 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, | 1463 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, |
1464 | { "Selected Item","Ausgewähltes Item" }, | 1464 | { "Selected Item","Ausgewähltes Item" }, |
1465 | { "Select Date...","Wähle Datum..." }, | 1465 | { "Select Date...","Wähle Datum..." }, |
1466 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, | 1466 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, |
1467 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, | 1467 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, |
1468 | { "Edit category list...","Ändere Kategorieliste..." }, | 1468 | { "Edit category list...","Ändere Kategorieliste..." }, |
1469 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, | 1469 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, |
1470 | { "Filepath: ","Dateipfad: " }, | 1470 | { "Filepath: ","Dateipfad: " }, |
1471 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, | 1471 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, |
1472 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, | 1472 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, |
1473 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, | 1473 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, |
1474 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, | 1474 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, |
1475 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, | 1475 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, |
1476 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, | 1476 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, |
1477 | { "Alarm Options","Alarm Einstellungen" }, | 1477 | { "Alarm Options","Alarm Einstellungen" }, |
1478 | { "Delete selected...","Lösche Ausgewählte..." }, | 1478 | { "Delete selected...","Lösche Ausgewählte..." }, |
1479 | { "None","Nichts" }, | 1479 | { "None","Nichts" }, |
1480 | { "Selection","Auswahl" }, | 1480 | { "Selection","Auswahl" }, |
1481 | { "Set categories","Setze Kategorien" }, | 1481 | { "Set categories","Setze Kategorien" }, |
1482 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, | 1482 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, |
1483 | { "Reset","Neu setzen" }, | 1483 | { "Reset","Neu setzen" }, |
1484 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, | 1484 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, |
1485 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, | 1485 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, |
1486 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, | 1486 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, |
1487 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, | 1487 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, |
1488 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, | 1488 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, |
1489 | { "Edit","Edit" }, | 1489 | { "Edit","Edit" }, |
1490 | { "Last Modified","Zuletzt geändert" }, | 1490 | { "Last Modified","Zuletzt geändert" }, |
1491 | { "Journal viewer","Journal Anzeige" }, | 1491 | { "Journal viewer","Journal Anzeige" }, |
1492 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, | 1492 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, |
1493 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, | 1493 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, |
1494 | { "Hide Completed","Verstecke erledigte Todos" }, | 1494 | { "Hide Completed","Verstecke erledigte Todos" }, |
1495 | { "Show not Running","Zeige nicht Laufende" }, | 1495 | { "Show not Running","Zeige nicht Laufende" }, |
1496 | { "Click to add new Todo","Klick für neues Todo!" }, | 1496 | { "Click to add new Todo","Klick für neues Todo!" }, |
1497 | { "Show next conflict for","Zeige nächsten Konflikt für" }, | ||
1498 | { "All events","Alle Termine" }, | ||
1499 | { "Allday events","Ganztagestermine" }, | ||
1500 | { "Events with time","Termine mit Zeit" }, | ||
1501 | { "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" }, | ||
1502 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, | ||
1503 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, | ||
1504 | { "","" }, | ||
1505 | { "","" }, | ||
1506 | { "","" }, | ||
1507 | { "","" }, | ||
1508 | { "","" }, | ||
1509 | { "","" }, | ||
1510 | { "","" }, | ||
1497 | { "","" }, | 1511 | { "","" }, |
1498 | { "","" }, | 1512 | { "","" }, |
1499 | { "","" }, | 1513 | { "","" }, |
1500 | { "","" }, | 1514 | { "","" }, |
1501 | { "","" }, | 1515 | { "","" }, |
1502 | { "","" }, | 1516 | { "","" }, |
1503 | { "","" }, | 1517 | { "","" }, |
1504 | 1518 | ||
1505 | 1519 | ||
1506 | 1520 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index bc1c0c7..9a114d0 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -401,512 +401,578 @@ void CalendarView::init() | |||
401 | "CalendarView::DateNavigator" ); | 401 | "CalendarView::DateNavigator" ); |
402 | 402 | ||
403 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 403 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
404 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 404 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
405 | mTodoList->setNavigator( mNavigator ); | 405 | mTodoList->setNavigator( mNavigator ); |
406 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 406 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
407 | 407 | ||
408 | #ifdef KORG_NORESOURCEVIEW | 408 | #ifdef KORG_NORESOURCEVIEW |
409 | mResourceView = 0; | 409 | mResourceView = 0; |
410 | #else | 410 | #else |
411 | if ( mResourceManager ) { | 411 | if ( mResourceManager ) { |
412 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 412 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
413 | mResourceView->updateView(); | 413 | mResourceView->updateView(); |
414 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 414 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
415 | SLOT( updateView() ) ); | 415 | SLOT( updateView() ) ); |
416 | } else { | 416 | } else { |
417 | mResourceView = 0; | 417 | mResourceView = 0; |
418 | } | 418 | } |
419 | #endif | 419 | #endif |
420 | QWidget *rightBox = new QWidget( mPanner ); | 420 | QWidget *rightBox = new QWidget( mPanner ); |
421 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 421 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
422 | 422 | ||
423 | mRightFrame = new QWidgetStack( rightBox ); | 423 | mRightFrame = new QWidgetStack( rightBox ); |
424 | rightLayout->addWidget( mRightFrame, 1 ); | 424 | rightLayout->addWidget( mRightFrame, 1 ); |
425 | 425 | ||
426 | mLeftFrame = mLeftSplitter; | 426 | mLeftFrame = mLeftSplitter; |
427 | #else | 427 | #else |
428 | //QWidget *mainBox = new QWidget( this ); | 428 | //QWidget *mainBox = new QWidget( this ); |
429 | //QWidget *leftFrame = new QWidget( mainBox ); | 429 | //QWidget *leftFrame = new QWidget( mainBox ); |
430 | //QBoxLayout * mainBoxLayout; | 430 | //QBoxLayout * mainBoxLayout; |
431 | if ( KOPrefs::instance()->mVerticalScreen ) { | 431 | if ( KOPrefs::instance()->mVerticalScreen ) { |
432 | //mainBoxLayout = new QVBoxLayout(mainBox); | 432 | //mainBoxLayout = new QVBoxLayout(mainBox); |
433 | //leftFrameLayout = new QHBoxLayout(leftFrame ); | 433 | //leftFrameLayout = new QHBoxLayout(leftFrame ); |
434 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); | 434 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); |
435 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 435 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
436 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; | 436 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; |
437 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 437 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
438 | } else { | 438 | } else { |
439 | //mainBoxLayout = new QHBoxLayout(mainBox); | 439 | //mainBoxLayout = new QHBoxLayout(mainBox); |
440 | //leftFrameLayout = new QVBoxLayout(leftFrame ); | 440 | //leftFrameLayout = new QVBoxLayout(leftFrame ); |
441 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 441 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
442 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); | 442 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); |
443 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); | 443 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); |
444 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 444 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
445 | } | 445 | } |
446 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 446 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
447 | //QBoxLayout * leftFrameLayout; | 447 | //QBoxLayout * leftFrameLayout; |
448 | topLayout->addWidget( mMainFrame ); | 448 | topLayout->addWidget( mMainFrame ); |
449 | #ifdef DESKTOP_VERSION | 449 | #ifdef DESKTOP_VERSION |
450 | mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); | 450 | mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); |
451 | topLayout->addWidget( mDateScrollBar ); | 451 | topLayout->addWidget( mDateScrollBar ); |
452 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); | 452 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); |
453 | if ( QApplication::desktop()->width() < 800 ) | 453 | if ( QApplication::desktop()->width() < 800 ) |
454 | mDateScrollBar->hide(); | 454 | mDateScrollBar->hide(); |
455 | #endif | 455 | #endif |
456 | //mainBoxLayout->addWidget (mLeftFrame); | 456 | //mainBoxLayout->addWidget (mLeftFrame); |
457 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, | 457 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, |
458 | "CalendarView::DateNavigator" ); | 458 | "CalendarView::DateNavigator" ); |
459 | #if 0 | 459 | #if 0 |
460 | // FIXME | 460 | // FIXME |
461 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 461 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
462 | "CalendarView::DateNavigator", QDate::currentDate()); | 462 | "CalendarView::DateNavigator", QDate::currentDate()); |
463 | #endif | 463 | #endif |
464 | // mDateNavigator->blockSignals( true ); | 464 | // mDateNavigator->blockSignals( true ); |
465 | //leftFrameLayout->addWidget( mDateNavigator ); | 465 | //leftFrameLayout->addWidget( mDateNavigator ); |
466 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 466 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
467 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 467 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
468 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); | 468 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); |
469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); | 471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); |
472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | 477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); |
478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
479 | 479 | ||
480 | mTodoList->setNavigator( mNavigator ); | 480 | mTodoList->setNavigator( mNavigator ); |
481 | #if 0 | 481 | #if 0 |
482 | if ( QApplication::desktop()->width() < 480 ) { | 482 | if ( QApplication::desktop()->width() < 480 ) { |
483 | leftFrameLayout->addWidget(mFilterView); | 483 | leftFrameLayout->addWidget(mFilterView); |
484 | leftFrameLayout->addWidget(mTodoList, 2 ); | 484 | leftFrameLayout->addWidget(mTodoList, 2 ); |
485 | 485 | ||
486 | } else { | 486 | } else { |
487 | leftFrameLayout->addWidget(mTodoList,2 ); | 487 | leftFrameLayout->addWidget(mTodoList,2 ); |
488 | leftFrameLayout->addWidget(mFilterView ); | 488 | leftFrameLayout->addWidget(mFilterView ); |
489 | } | 489 | } |
490 | #endif | 490 | #endif |
491 | mFilterView->hide(); | 491 | mFilterView->hide(); |
492 | mCalEditView->hide(); | 492 | mCalEditView->hide(); |
493 | QWidget *rightBox = new QWidget( mMainFrame ); | 493 | QWidget *rightBox = new QWidget( mMainFrame ); |
494 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 494 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
495 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 495 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
496 | mRightFrame = new QWidgetStack( rightBox ); | 496 | mRightFrame = new QWidgetStack( rightBox ); |
497 | rightLayout->addWidget( mRightFrame, 10 ); | 497 | rightLayout->addWidget( mRightFrame, 10 ); |
498 | 498 | ||
499 | //mLeftFrame = (QWidget *)leftFrame; | 499 | //mLeftFrame = (QWidget *)leftFrame; |
500 | if ( KOPrefs::instance()->mVerticalScreen ) { | 500 | if ( KOPrefs::instance()->mVerticalScreen ) { |
501 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 501 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
502 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 502 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
503 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 503 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
504 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 504 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
505 | } else { | 505 | } else { |
506 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 506 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
507 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 507 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
508 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 508 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
509 | } | 509 | } |
510 | if ( !KOPrefs::instance()->mShowDateNavigator) | 510 | if ( !KOPrefs::instance()->mShowDateNavigator) |
511 | mDateNavigator->hide(); | 511 | mDateNavigator->hide(); |
512 | //qDebug("Calendarview Size %d %d ", width(), height()); | 512 | //qDebug("Calendarview Size %d %d ", width(), height()); |
513 | #endif | 513 | #endif |
514 | 514 | ||
515 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 515 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
516 | SLOT( showDates( const KCal::DateList & ) ) ); | 516 | SLOT( showDates( const KCal::DateList & ) ) ); |
517 | 517 | ||
518 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 518 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
519 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 519 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
520 | 520 | ||
521 | 521 | ||
522 | 522 | ||
523 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), | 523 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), |
524 | mViewManager, SLOT( showMonth( const QDate & ) ) ); | 524 | mViewManager, SLOT( showMonth( const QDate & ) ) ); |
525 | 525 | ||
526 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 526 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
527 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 527 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
528 | 528 | ||
529 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 529 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
530 | mNavigator, SLOT( selectPreviousYear() ) ); | 530 | mNavigator, SLOT( selectPreviousYear() ) ); |
531 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 531 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
532 | mNavigator, SLOT( selectNextYear() ) ); | 532 | mNavigator, SLOT( selectNextYear() ) ); |
533 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 533 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
534 | mNavigator, SLOT( selectPreviousMonth() ) ); | 534 | mNavigator, SLOT( selectPreviousMonth() ) ); |
535 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 535 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
536 | mNavigator, SLOT( selectNextMonth() ) ); | 536 | mNavigator, SLOT( selectNextMonth() ) ); |
537 | 537 | ||
538 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 538 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
539 | mNavigator, SLOT( selectPrevious() ) ); | 539 | mNavigator, SLOT( selectPrevious() ) ); |
540 | connect( mDateNavigator, SIGNAL( goNext() ), | 540 | connect( mDateNavigator, SIGNAL( goNext() ), |
541 | mNavigator, SLOT( selectNext() ) ); | 541 | mNavigator, SLOT( selectNext() ) ); |
542 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 542 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
543 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 543 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
544 | 544 | ||
545 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 545 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
546 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 546 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
547 | #if 0 | 547 | #if 0 |
548 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 548 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
549 | SLOT( incidenceAdded( Incidence *) ) ); | 549 | SLOT( incidenceAdded( Incidence *) ) ); |
550 | #endif | 550 | #endif |
551 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 551 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
552 | 552 | ||
553 | connect( this, SIGNAL( configChanged() ), | 553 | connect( this, SIGNAL( configChanged() ), |
554 | mDateNavigator, SLOT( updateConfig() ) ); | 554 | mDateNavigator, SLOT( updateConfig() ) ); |
555 | 555 | ||
556 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 556 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
557 | SLOT( newTodo() ) ); | 557 | SLOT( newTodo() ) ); |
558 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 558 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
559 | SLOT( newSubTodo( Todo * ) ) ); | 559 | SLOT( newSubTodo( Todo * ) ) ); |
560 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 560 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
561 | SLOT( editTodo( Todo * ) ) ); | 561 | SLOT( editTodo( Todo * ) ) ); |
562 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 562 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
563 | SLOT( showTodo( Todo *) ) ); | 563 | SLOT( showTodo( Todo *) ) ); |
564 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 564 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
565 | SLOT( deleteTodo( Todo *) ) ); | 565 | SLOT( deleteTodo( Todo *) ) ); |
566 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 566 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
567 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 567 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
568 | SLOT( purgeCompleted() ) ); | 568 | SLOT( purgeCompleted() ) ); |
569 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 569 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
570 | SIGNAL( todoModified( Todo *, int ) ) ); | 570 | SIGNAL( todoModified( Todo *, int ) ) ); |
571 | 571 | ||
572 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), | 572 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), |
573 | this, SLOT ( cloneIncidence( Incidence * ) ) ); | 573 | this, SLOT ( cloneIncidence( Incidence * ) ) ); |
574 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), | 574 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), |
575 | this, SLOT (cancelIncidence( Incidence * ) ) ); | 575 | this, SLOT (cancelIncidence( Incidence * ) ) ); |
576 | 576 | ||
577 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), | 577 | connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), |
578 | this, SLOT ( moveIncidence( Incidence * ) ) ); | 578 | this, SLOT ( moveIncidence( Incidence * ) ) ); |
579 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), | 579 | connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), |
580 | this, SLOT ( beamIncidence( Incidence * ) ) ); | 580 | this, SLOT ( beamIncidence( Incidence * ) ) ); |
581 | 581 | ||
582 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), | 582 | connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), |
583 | this, SLOT ( todo_unsub( Todo * ) ) ); | 583 | this, SLOT ( todo_unsub( Todo * ) ) ); |
584 | 584 | ||
585 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 585 | connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
586 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); | 586 | this, SLOT ( todo_resub( Todo *,Todo * ) ) ); |
587 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, | 587 | connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, |
588 | SLOT( updateTodo( Todo *, int ) ) ); | 588 | SLOT( updateTodo( Todo *, int ) ) ); |
589 | connect( this, SIGNAL( todoModified( Todo *, int )), this, | 589 | connect( this, SIGNAL( todoModified( Todo *, int )), this, |
590 | SLOT( changeTodoDisplay( Todo *, int ) ) ); | 590 | SLOT( changeTodoDisplay( Todo *, int ) ) ); |
591 | 591 | ||
592 | 592 | ||
593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); | 593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); |
594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); | 594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); |
595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); | 595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); |
596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); | 596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); |
597 | 597 | ||
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), | 602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), |
603 | SLOT(checkClipboard())); | 603 | SLOT(checkClipboard())); |
604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
605 | SLOT( processTodoListSelection( Incidence * ) ) ); | 605 | SLOT( processTodoListSelection( Incidence * ) ) ); |
606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
607 | 607 | ||
608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
609 | 609 | ||
610 | mDateFrame = new QVBox(0,0,WType_Popup); | 610 | mDateFrame = new QVBox(0,0,WType_Popup); |
611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
613 | mDateFrame->setLineWidth(3); | 613 | mDateFrame->setLineWidth(3); |
614 | mDateFrame->hide(); | 614 | mDateFrame->hide(); |
615 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 615 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
617 | 617 | ||
618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
619 | 619 | ||
620 | mEventEditor = mDialogManager->getEventEditor(); | 620 | mEventEditor = mDialogManager->getEventEditor(); |
621 | mTodoEditor = mDialogManager->getTodoEditor(); | 621 | mTodoEditor = mDialogManager->getTodoEditor(); |
622 | 622 | ||
623 | mFlagEditDescription = false; | 623 | mFlagEditDescription = false; |
624 | 624 | ||
625 | mSuspendTimer = new QTimer( this ); | 625 | mSuspendTimer = new QTimer( this ); |
626 | mAlarmTimer = new QTimer( this ); | 626 | mAlarmTimer = new QTimer( this ); |
627 | mRecheckAlarmTimer = new QTimer( this ); | 627 | mRecheckAlarmTimer = new QTimer( this ); |
628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
631 | mAlarmDialog = new AlarmDialog( this ); | 631 | mAlarmDialog = new AlarmDialog( this ); |
632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
633 | mAlarmDialog->setServerNotification( false ); | 633 | mAlarmDialog->setServerNotification( false ); |
634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
635 | 635 | ||
636 | 636 | ||
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | //US listen for arriving address resultsets | 638 | //US listen for arriving address resultsets |
639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
641 | #endif | 641 | #endif |
642 | mDateNavigator->setCalendar( mCalendar ); | 642 | mDateNavigator->setCalendar( mCalendar ); |
643 | } | 643 | } |
644 | 644 | ||
645 | 645 | ||
646 | CalendarView::~CalendarView() | 646 | CalendarView::~CalendarView() |
647 | { | 647 | { |
648 | // kdDebug() << "~CalendarView()" << endl; | 648 | // kdDebug() << "~CalendarView()" << endl; |
649 | //qDebug("CalendarView::~CalendarView() "); | 649 | //qDebug("CalendarView::~CalendarView() "); |
650 | delete mDialogManager; | 650 | delete mDialogManager; |
651 | delete mViewManager; | 651 | delete mViewManager; |
652 | delete mStorage; | 652 | delete mStorage; |
653 | delete mDateFrame ; | 653 | delete mDateFrame ; |
654 | delete mEventViewerDialog; | 654 | delete mEventViewerDialog; |
655 | //kdDebug() << "~CalendarView() done" << endl; | 655 | //kdDebug() << "~CalendarView() done" << endl; |
656 | } | 656 | } |
657 | void CalendarView::nextConflict( bool all, bool allday ) | ||
658 | { | ||
659 | QDate start = mNavigator->selectedDates().first().addDays(1); | ||
660 | QDate end = start.addDays( 365*2); | ||
661 | while ( start < end ) { | ||
662 | QPtrList<Event> eventList = calendar()->events( start ); | ||
663 | Event * ev = eventList.first(); | ||
664 | QPtrList<Event> test = eventList; | ||
665 | while ( ev ) { | ||
666 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); | ||
667 | Event * t_ev = test.first(); | ||
668 | QDateTime es = ev->dtStart(); | ||
669 | QDateTime ee = ev->dtEnd(); | ||
670 | if ( ev->doesFloat() ) | ||
671 | ee = ee.addDays( 1 ); | ||
672 | if ( ! all ) { | ||
673 | if ( ev->doesFloat() != allday ) | ||
674 | t_ev = 0; | ||
675 | } | ||
676 | while ( t_ev ) { | ||
677 | bool skip = false; | ||
678 | if ( ! all ) { | ||
679 | if ( t_ev->doesFloat() != allday ) | ||
680 | skip = true; | ||
681 | } | ||
682 | if ( !skip && ev != t_ev ) { | ||
683 | QDateTime ets = t_ev->dtStart(); | ||
684 | QDateTime ete = t_ev->dtEnd(); | ||
685 | if ( t_ev->doesFloat() ) | ||
686 | ete = ete.addDays( 1 ); | ||
687 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); | ||
688 | if ( es < ete && ets < ee ) { | ||
689 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | ||
690 | mViewManager->showDayView(); | ||
691 | mNavigator->slotDaySelect( start ); | ||
692 | int hour = es.time().hour(); | ||
693 | if ( ets > es ) | ||
694 | hour = ets.time().hour(); | ||
695 | mViewManager->agendaView()->setStartHour( hour ); | ||
696 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); | ||
697 | return; | ||
698 | } | ||
699 | } | ||
700 | t_ev = test.next(); | ||
701 | } | ||
702 | ev = eventList.next(); | ||
703 | } | ||
704 | start = start.addDays( 1 ); | ||
705 | } | ||
706 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | ||
707 | qDebug("No conflict found "); | ||
708 | } | ||
709 | |||
710 | void CalendarView::conflictAll() | ||
711 | { | ||
712 | nextConflict ( true, true ); | ||
713 | } | ||
714 | void CalendarView::conflictAllday() | ||
715 | { | ||
716 | nextConflict ( false, true ); | ||
717 | } | ||
718 | void CalendarView::conflictNotAll() | ||
719 | { | ||
720 | nextConflict ( false, false ); | ||
721 | } | ||
722 | |||
657 | void CalendarView::setCalReadOnly( int id, bool readO ) | 723 | void CalendarView::setCalReadOnly( int id, bool readO ) |
658 | { | 724 | { |
659 | if ( readO ) { | 725 | if ( readO ) { |
660 | emit save(); | 726 | emit save(); |
661 | } | 727 | } |
662 | mCalendar->setReadOnly( id, readO ); | 728 | mCalendar->setReadOnly( id, readO ); |
663 | } | 729 | } |
664 | void CalendarView::setScrollBarStep(int val ) | 730 | void CalendarView::setScrollBarStep(int val ) |
665 | { | 731 | { |
666 | #ifdef DESKTOP_VERSION | 732 | #ifdef DESKTOP_VERSION |
667 | mDateScrollBar->setLineStep ( val ); | 733 | mDateScrollBar->setLineStep ( val ); |
668 | #endif | 734 | #endif |
669 | } | 735 | } |
670 | void CalendarView::scrollBarValue(int val ) | 736 | void CalendarView::scrollBarValue(int val ) |
671 | { | 737 | { |
672 | #ifdef DESKTOP_VERSION | 738 | #ifdef DESKTOP_VERSION |
673 | if ( QApplication::desktop()->width() < 800 ) return; | 739 | if ( QApplication::desktop()->width() < 800 ) return; |
674 | static bool block = false; | 740 | static bool block = false; |
675 | if ( block ) return; | 741 | if ( block ) return; |
676 | block = true; | 742 | block = true; |
677 | int count = mNavigator->selectedDates().count(); | 743 | int count = mNavigator->selectedDates().count(); |
678 | int day = mNavigator->selectedDates().first().dayOfYear(); | 744 | int day = mNavigator->selectedDates().first().dayOfYear(); |
679 | int stepdays = val; | 745 | int stepdays = val; |
680 | if ( mDateScrollBar->lineStep () <= count ) { | 746 | if ( mDateScrollBar->lineStep () <= count ) { |
681 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 747 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
682 | //qDebug("VAL %d ",val ); | 748 | //qDebug("VAL %d ",val ); |
683 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 749 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
684 | stepdays = day+stepdays; | 750 | stepdays = day+stepdays; |
685 | if ( stepdays < 0 ) stepdays = 0; | 751 | if ( stepdays < 0 ) stepdays = 0; |
686 | } | 752 | } |
687 | if ( stepdays == day ) { | 753 | if ( stepdays == day ) { |
688 | block = false; | 754 | block = false; |
689 | return; | 755 | return; |
690 | } | 756 | } |
691 | int year = mNavigator->selectedDates().first().year(); | 757 | int year = mNavigator->selectedDates().first().year(); |
692 | QDate d ( year,1,1 ); | 758 | QDate d ( year,1,1 ); |
693 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); | 759 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); |
694 | block = false; | 760 | block = false; |
695 | #endif | 761 | #endif |
696 | 762 | ||
697 | } | 763 | } |
698 | void CalendarView::updateView(const QDate &start, const QDate &end) | 764 | void CalendarView::updateView(const QDate &start, const QDate &end) |
699 | { | 765 | { |
700 | #ifdef DESKTOP_VERSION | 766 | #ifdef DESKTOP_VERSION |
701 | if ( ! mDateScrollBar->draggingSlider () ) { | 767 | if ( ! mDateScrollBar->draggingSlider () ) { |
702 | int dof = start.dayOfYear(); | 768 | int dof = start.dayOfYear(); |
703 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); | 769 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); |
704 | if ( dof != mDateScrollBar->value() ) { | 770 | if ( dof != mDateScrollBar->value() ) { |
705 | mDateScrollBar->blockSignals( true ); | 771 | mDateScrollBar->blockSignals( true ); |
706 | mDateScrollBar->setValue( start.dayOfYear()); | 772 | mDateScrollBar->setValue( start.dayOfYear()); |
707 | mDateScrollBar->blockSignals( false ); | 773 | mDateScrollBar->blockSignals( false ); |
708 | } | 774 | } |
709 | } | 775 | } |
710 | #endif | 776 | #endif |
711 | mTodoList->updateView(); | 777 | mTodoList->updateView(); |
712 | mViewManager->updateView(start, end); | 778 | mViewManager->updateView(start, end); |
713 | //mDateNavigator->updateView(); | 779 | //mDateNavigator->updateView(); |
714 | } | 780 | } |
715 | 781 | ||
716 | 782 | ||
717 | 783 | ||
718 | void CalendarView::checkFiles() | 784 | void CalendarView::checkFiles() |
719 | { | 785 | { |
720 | QString message; | 786 | QString message; |
721 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 787 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
722 | KopiCalendarFile * cal = calendars.first(); | 788 | KopiCalendarFile * cal = calendars.first(); |
723 | while ( cal ) { | 789 | while ( cal ) { |
724 | if ( cal->mErrorOnLoad ) { | 790 | if ( cal->mErrorOnLoad ) { |
725 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; | 791 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; |
726 | } | 792 | } |
727 | cal = calendars.next(); | 793 | cal = calendars.next(); |
728 | } | 794 | } |
729 | if ( !message.isEmpty() ) { | 795 | if ( !message.isEmpty() ) { |
730 | 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); | 796 | 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); |
731 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); | 797 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); |
732 | } | 798 | } |
733 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); | 799 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); |
734 | } | 800 | } |
735 | void CalendarView::checkAlarms() | 801 | void CalendarView::checkAlarms() |
736 | { | 802 | { |
737 | 803 | ||
738 | 804 | ||
739 | KConfig *config = KOGlobals::config(); | 805 | KConfig *config = KOGlobals::config(); |
740 | config->setGroup( "AppRun" ); | 806 | config->setGroup( "AppRun" ); |
741 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 807 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
742 | int daysto = dt.daysTo( QDate::currentDate() ); | 808 | int daysto = dt.daysTo( QDate::currentDate() ); |
743 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); | 809 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); |
744 | dt = dt.addDays( days ); | 810 | dt = dt.addDays( days ); |
745 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 811 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
746 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; | 812 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; |
747 | //qDebug("KO: Reading program stop %d ", secs); | 813 | //qDebug("KO: Reading program stop %d ", secs); |
748 | //secs -= ( 3600 * 24*3 ); // debug only | 814 | //secs -= ( 3600 * 24*3 ); // debug only |
749 | QDateTime latest = dt.addSecs ( secs ); | 815 | QDateTime latest = dt.addSecs ( secs ); |
750 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | 816 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); |
751 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); | 817 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); |
752 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | 818 | QPtrList<Incidence> el = mCalendar->rawIncidences(); |
753 | QPtrList<Incidence> al; | 819 | QPtrList<Incidence> al; |
754 | Incidence* inL = el.first(); | 820 | Incidence* inL = el.first(); |
755 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); | 821 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); |
756 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); | 822 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); |
757 | while ( inL ) { | 823 | while ( inL ) { |
758 | bool ok = false; | 824 | bool ok = false; |
759 | int offset = 0; | 825 | int offset = 0; |
760 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | 826 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; |
761 | if ( ok ) { | 827 | if ( ok ) { |
762 | //qDebug("OK %s",next.toString().latin1()); | 828 | //qDebug("OK %s",next.toString().latin1()); |
763 | if ( next < cur ) { | 829 | if ( next < cur ) { |
764 | al.append( inL ); | 830 | al.append( inL ); |
765 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 831 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
766 | } | 832 | } |
767 | } | 833 | } |
768 | inL = el.next(); | 834 | inL = el.next(); |
769 | } | 835 | } |
770 | if ( al.count() ) { | 836 | if ( al.count() ) { |
771 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); | 837 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); |
772 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); | 838 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); |
773 | QVBoxLayout* lay = new QVBoxLayout( dia ); | 839 | QVBoxLayout* lay = new QVBoxLayout( dia ); |
774 | lay->setSpacing( 0 ); | 840 | lay->setSpacing( 0 ); |
775 | lay->setMargin( 0 ); | 841 | lay->setMargin( 0 ); |
776 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); | 842 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); |
777 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | 843 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); |
778 | lay->addWidget( matb ); | 844 | lay->addWidget( matb ); |
779 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { | 845 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { |
780 | int wid = 210; | 846 | int wid = 210; |
781 | int x = QApplication::desktop()->width() - wid - 7; | 847 | int x = QApplication::desktop()->width() - wid - 7; |
782 | int y = QApplication::desktop()->height() - wid - 70; | 848 | int y = QApplication::desktop()->height() - wid - 70; |
783 | dia->setGeometry ( x,y,wid,wid); | 849 | dia->setGeometry ( x,y,wid,wid); |
784 | } else { | 850 | } else { |
785 | int si = 220; | 851 | int si = 220; |
786 | if ( QApplication::desktop()->width() > 470 ) | 852 | if ( QApplication::desktop()->width() > 470 ) |
787 | si = 400; | 853 | si = 400; |
788 | dia->resize(si,si/2); | 854 | dia->resize(si,si/2); |
789 | } | 855 | } |
790 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); | 856 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); |
791 | dia->show(); | 857 | dia->show(); |
792 | 858 | ||
793 | } | 859 | } |
794 | } | 860 | } |
795 | void CalendarView::showDay( QDate d ) | 861 | void CalendarView::showDay( QDate d ) |
796 | { | 862 | { |
797 | dateNavigator()->blockSignals( true ); | 863 | dateNavigator()->blockSignals( true ); |
798 | dateNavigator()->selectDate( d ); | 864 | dateNavigator()->selectDate( d ); |
799 | dateNavigator()->blockSignals( false ); | 865 | dateNavigator()->blockSignals( false ); |
800 | mViewManager->showDayView(); | 866 | mViewManager->showDayView(); |
801 | //dateNavigator()->selectDate( d ); | 867 | //dateNavigator()->selectDate( d ); |
802 | } | 868 | } |
803 | void CalendarView::timerAlarm() | 869 | void CalendarView::timerAlarm() |
804 | { | 870 | { |
805 | //qDebug("CalendarView::timerAlarm() "); | 871 | //qDebug("CalendarView::timerAlarm() "); |
806 | computeAlarm(mAlarmNotification ); | 872 | computeAlarm(mAlarmNotification ); |
807 | } | 873 | } |
808 | 874 | ||
809 | void CalendarView::suspendAlarm() | 875 | void CalendarView::suspendAlarm() |
810 | { | 876 | { |
811 | //qDebug(" CalendarView::suspendAlarm() "); | 877 | //qDebug(" CalendarView::suspendAlarm() "); |
812 | computeAlarm(mSuspendAlarmNotification ); | 878 | computeAlarm(mSuspendAlarmNotification ); |
813 | 879 | ||
814 | } | 880 | } |
815 | 881 | ||
816 | void CalendarView::startAlarm( QString mess , QString filename) | 882 | void CalendarView::startAlarm( QString mess , QString filename) |
817 | { | 883 | { |
818 | 884 | ||
819 | topLevelWidget()->showNormal(); | 885 | topLevelWidget()->showNormal(); |
820 | topLevelWidget()->setActiveWindow(); | 886 | topLevelWidget()->setActiveWindow(); |
821 | topLevelWidget()->raise(); | 887 | topLevelWidget()->raise(); |
822 | 888 | ||
823 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 889 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
824 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); | 890 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); |
825 | 891 | ||
826 | } | 892 | } |
827 | 893 | ||
828 | void CalendarView::checkNextTimerAlarm() | 894 | void CalendarView::checkNextTimerAlarm() |
829 | { | 895 | { |
830 | mCalendar->checkAlarmForIncidence( 0, true ); | 896 | mCalendar->checkAlarmForIncidence( 0, true ); |
831 | } | 897 | } |
832 | 898 | ||
833 | void CalendarView::computeAlarm( QString msg ) | 899 | void CalendarView::computeAlarm( QString msg ) |
834 | { | 900 | { |
835 | 901 | ||
836 | QString mess = msg; | 902 | QString mess = msg; |
837 | QString mAlarmMessage = mess.mid( 9 ); | 903 | QString mAlarmMessage = mess.mid( 9 ); |
838 | QString filename = MainWindow::resourcePath(); | 904 | QString filename = MainWindow::resourcePath(); |
839 | filename += "koalarm.wav"; | 905 | filename += "koalarm.wav"; |
840 | QString tempfilename; | 906 | QString tempfilename; |
841 | if ( mess.left( 13 ) == "suspend_alarm") { | 907 | if ( mess.left( 13 ) == "suspend_alarm") { |
842 | bool error = false; | 908 | bool error = false; |
843 | int len = mess.mid( 13 ).find("+++"); | 909 | int len = mess.mid( 13 ).find("+++"); |
844 | if ( len < 2 ) | 910 | if ( len < 2 ) |
845 | error = true; | 911 | error = true; |
846 | else { | 912 | else { |
847 | tempfilename = mess.mid( 13, len ); | 913 | tempfilename = mess.mid( 13, len ); |
848 | if ( !QFile::exists( tempfilename ) ) | 914 | if ( !QFile::exists( tempfilename ) ) |
849 | error = true; | 915 | error = true; |
850 | } | 916 | } |
851 | if ( ! error ) { | 917 | if ( ! error ) { |
852 | filename = tempfilename; | 918 | filename = tempfilename; |
853 | } | 919 | } |
854 | mAlarmMessage = mess.mid( 13+len+3 ); | 920 | mAlarmMessage = mess.mid( 13+len+3 ); |
855 | //qDebug("suspend file %s ",tempfilename.latin1() ); | 921 | //qDebug("suspend file %s ",tempfilename.latin1() ); |
856 | startAlarm( mAlarmMessage, filename); | 922 | startAlarm( mAlarmMessage, filename); |
857 | return; | 923 | return; |
858 | } | 924 | } |
859 | if ( mess.left( 11 ) == "timer_alarm") { | 925 | if ( mess.left( 11 ) == "timer_alarm") { |
860 | //mTimerTime = 0; | 926 | //mTimerTime = 0; |
861 | startAlarm( mess.mid( 11 ), filename ); | 927 | startAlarm( mess.mid( 11 ), filename ); |
862 | return; | 928 | return; |
863 | } | 929 | } |
864 | if ( mess.left( 10 ) == "proc_alarm") { | 930 | if ( mess.left( 10 ) == "proc_alarm") { |
865 | bool error = false; | 931 | bool error = false; |
866 | int len = mess.mid( 10 ).find("+++"); | 932 | int len = mess.mid( 10 ).find("+++"); |
867 | if ( len < 2 ) | 933 | if ( len < 2 ) |
868 | error = true; | 934 | error = true; |
869 | else { | 935 | else { |
870 | tempfilename = mess.mid( 10, len ); | 936 | tempfilename = mess.mid( 10, len ); |
871 | if ( !QFile::exists( tempfilename ) ) | 937 | if ( !QFile::exists( tempfilename ) ) |
872 | error = true; | 938 | error = true; |
873 | } | 939 | } |
874 | if ( error ) { | 940 | if ( error ) { |
875 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 941 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
876 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 942 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
877 | } else { | 943 | } else { |
878 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 944 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
879 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 945 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
880 | #ifndef _WIN32_ | 946 | #ifndef _WIN32_ |
881 | if ( vfork () == 0 ) { | 947 | if ( vfork () == 0 ) { |
882 | execl ( tempfilename.latin1(), 0 ); | 948 | execl ( tempfilename.latin1(), 0 ); |
883 | return; | 949 | return; |
884 | } | 950 | } |
885 | #else | 951 | #else |
886 | QProcess* p = new QProcess(); | 952 | QProcess* p = new QProcess(); |
887 | p->addArgument( tempfilename.latin1() ); | 953 | p->addArgument( tempfilename.latin1() ); |
888 | p->start(); | 954 | p->start(); |
889 | return; | 955 | return; |
890 | #endif | 956 | #endif |
891 | 957 | ||
892 | return; | 958 | return; |
893 | } | 959 | } |
894 | 960 | ||
895 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 961 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
896 | } | 962 | } |
897 | if ( mess.left( 11 ) == "audio_alarm") { | 963 | if ( mess.left( 11 ) == "audio_alarm") { |
898 | bool error = false; | 964 | bool error = false; |
899 | int len = mess.mid( 11 ).find("+++"); | 965 | int len = mess.mid( 11 ).find("+++"); |
900 | if ( len < 2 ) | 966 | if ( len < 2 ) |
901 | error = true; | 967 | error = true; |
902 | else { | 968 | else { |
903 | tempfilename = mess.mid( 11, len ); | 969 | tempfilename = mess.mid( 11, len ); |
904 | if ( !QFile::exists( tempfilename ) ) | 970 | if ( !QFile::exists( tempfilename ) ) |
905 | error = true; | 971 | error = true; |
906 | } | 972 | } |
907 | if ( ! error ) { | 973 | if ( ! error ) { |
908 | filename = tempfilename; | 974 | filename = tempfilename; |
909 | } | 975 | } |
910 | mAlarmMessage = mess.mid( 11+len+3+9 ); | 976 | mAlarmMessage = mess.mid( 11+len+3+9 ); |
911 | //qDebug("audio file command %s ",tempfilename.latin1() ); | 977 | //qDebug("audio file command %s ",tempfilename.latin1() ); |
912 | } | 978 | } |
@@ -2909,972 +2975,972 @@ void CalendarView::manageCategories() | |||
2909 | int dw = QApplication::desktop()->width(); | 2975 | int dw = QApplication::desktop()->width(); |
2910 | int dh = QApplication::desktop()->height(); | 2976 | int dh = QApplication::desktop()->height(); |
2911 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2977 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2912 | if ( !cp->exec() ) { | 2978 | if ( !cp->exec() ) { |
2913 | delete cp; | 2979 | delete cp; |
2914 | return; | 2980 | return; |
2915 | } | 2981 | } |
2916 | int count = 0; | 2982 | int count = 0; |
2917 | if ( cp->addCat() ) { | 2983 | if ( cp->addCat() ) { |
2918 | count = addCategories(); | 2984 | count = addCategories(); |
2919 | if ( count ) { | 2985 | if ( count ) { |
2920 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2986 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2921 | writeSettings(); | 2987 | writeSettings(); |
2922 | } else | 2988 | } else |
2923 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | 2989 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); |
2924 | } else { | 2990 | } else { |
2925 | removeCategories(); | 2991 | removeCategories(); |
2926 | updateView(); | 2992 | updateView(); |
2927 | } | 2993 | } |
2928 | delete cp; | 2994 | delete cp; |
2929 | } | 2995 | } |
2930 | 2996 | ||
2931 | void CalendarView::beamIncidence(Incidence * Inc) | 2997 | void CalendarView::beamIncidence(Incidence * Inc) |
2932 | { | 2998 | { |
2933 | QPtrList<Incidence> delSel ; | 2999 | QPtrList<Incidence> delSel ; |
2934 | delSel.append(Inc); | 3000 | delSel.append(Inc); |
2935 | beamIncidenceList( delSel ); | 3001 | beamIncidenceList( delSel ); |
2936 | } | 3002 | } |
2937 | void CalendarView::beamCalendar() | 3003 | void CalendarView::beamCalendar() |
2938 | { | 3004 | { |
2939 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 3005 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2940 | //qDebug("beamCalendar() "); | 3006 | //qDebug("beamCalendar() "); |
2941 | beamIncidenceList( delSel ); | 3007 | beamIncidenceList( delSel ); |
2942 | } | 3008 | } |
2943 | void CalendarView::beamFilteredCalendar() | 3009 | void CalendarView::beamFilteredCalendar() |
2944 | { | 3010 | { |
2945 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 3011 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2946 | //qDebug("beamFilteredCalendar() "); | 3012 | //qDebug("beamFilteredCalendar() "); |
2947 | beamIncidenceList( delSel ); | 3013 | beamIncidenceList( delSel ); |
2948 | } | 3014 | } |
2949 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 3015 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2950 | { | 3016 | { |
2951 | 3017 | ||
2952 | KOBeamPrefs beamDialog; | 3018 | KOBeamPrefs beamDialog; |
2953 | if ( beamDialog.exec () == QDialog::Rejected ) | 3019 | if ( beamDialog.exec () == QDialog::Rejected ) |
2954 | return; | 3020 | return; |
2955 | #ifdef DESKTOP_VERSION | 3021 | #ifdef DESKTOP_VERSION |
2956 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 3022 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2957 | #else | 3023 | #else |
2958 | QString fn = "/tmp/kopibeamfile"; | 3024 | QString fn = "/tmp/kopibeamfile"; |
2959 | #endif | 3025 | #endif |
2960 | QString mes; | 3026 | QString mes; |
2961 | bool createbup = true; | 3027 | bool createbup = true; |
2962 | if ( createbup ) { | 3028 | if ( createbup ) { |
2963 | QString description = "\n"; | 3029 | QString description = "\n"; |
2964 | CalendarLocal* cal = new CalendarLocal(); | 3030 | CalendarLocal* cal = new CalendarLocal(); |
2965 | if ( beamDialog.beamLocal() ) | 3031 | if ( beamDialog.beamLocal() ) |
2966 | cal->setLocalTime(); | 3032 | cal->setLocalTime(); |
2967 | else | 3033 | else |
2968 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 3034 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2969 | Incidence *incidence = delSel.first(); | 3035 | Incidence *incidence = delSel.first(); |
2970 | bool addText = false; | 3036 | bool addText = false; |
2971 | if ( delSel.count() < 10 ) | 3037 | if ( delSel.count() < 10 ) |
2972 | addText = true; | 3038 | addText = true; |
2973 | else { | 3039 | else { |
2974 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 3040 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2975 | } | 3041 | } |
2976 | while ( incidence ) { | 3042 | while ( incidence ) { |
2977 | Incidence *in = incidence->clone(); | 3043 | Incidence *in = incidence->clone(); |
2978 | if ( ! in->summary().isEmpty() ) { | 3044 | if ( ! in->summary().isEmpty() ) { |
2979 | in->setDescription(""); | 3045 | in->setDescription(""); |
2980 | } else { | 3046 | } else { |
2981 | in->setSummary( in->description().left(20)); | 3047 | in->setSummary( in->description().left(20)); |
2982 | in->setDescription(""); | 3048 | in->setDescription(""); |
2983 | } | 3049 | } |
2984 | if ( addText ) | 3050 | if ( addText ) |
2985 | description += in->summary() + "\n"; | 3051 | description += in->summary() + "\n"; |
2986 | cal->addIncidence( in ); | 3052 | cal->addIncidence( in ); |
2987 | incidence = delSel.next(); | 3053 | incidence = delSel.next(); |
2988 | } | 3054 | } |
2989 | if ( beamDialog.beamVcal() ) { | 3055 | if ( beamDialog.beamVcal() ) { |
2990 | fn += ".vcs"; | 3056 | fn += ".vcs"; |
2991 | FileStorage storage( cal, fn, new VCalFormat ); | 3057 | FileStorage storage( cal, fn, new VCalFormat ); |
2992 | storage.save(); | 3058 | storage.save(); |
2993 | } else { | 3059 | } else { |
2994 | fn += ".ics"; | 3060 | fn += ".ics"; |
2995 | FileStorage storage( cal, fn, new ICalFormat( ) ); | 3061 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2996 | storage.save(); | 3062 | storage.save(); |
2997 | } | 3063 | } |
2998 | delete cal; | 3064 | delete cal; |
2999 | mes = i18n("KO/Pi: Ready for beaming"); | 3065 | mes = i18n("KO/Pi: Ready for beaming"); |
3000 | topLevelWidget()->setCaption(mes); | 3066 | topLevelWidget()->setCaption(mes); |
3001 | KApplication::convert2latin1( fn ); | 3067 | KApplication::convert2latin1( fn ); |
3002 | #ifndef DESKTOP_VERSION | 3068 | #ifndef DESKTOP_VERSION |
3003 | Ir *ir = new Ir( this ); | 3069 | Ir *ir = new Ir( this ); |
3004 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 3070 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
3005 | ir->send( fn, description, "text/x-vCalendar" ); | 3071 | ir->send( fn, description, "text/x-vCalendar" ); |
3006 | #endif | 3072 | #endif |
3007 | } | 3073 | } |
3008 | } | 3074 | } |
3009 | 3075 | ||
3010 | #ifndef DESKTOP_VERSION | 3076 | #ifndef DESKTOP_VERSION |
3011 | void CalendarView::beamDone( Ir *ir ) | 3077 | void CalendarView::beamDone( Ir *ir ) |
3012 | { | 3078 | { |
3013 | delete ir; | 3079 | delete ir; |
3014 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 3080 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
3015 | topLevelWidget()->raise(); | 3081 | topLevelWidget()->raise(); |
3016 | } | 3082 | } |
3017 | #else | 3083 | #else |
3018 | void CalendarView::beamDone( Ir *){;} | 3084 | void CalendarView::beamDone( Ir *){;} |
3019 | #endif | 3085 | #endif |
3020 | void CalendarView::moveIncidence(Incidence * inc ) | 3086 | void CalendarView::moveIncidence(Incidence * inc ) |
3021 | { | 3087 | { |
3022 | if ( !inc ) return; | 3088 | if ( !inc ) return; |
3023 | showDatePickerPopup(); | 3089 | showDatePickerPopup(); |
3024 | mDatePickerMode = 2; | 3090 | mDatePickerMode = 2; |
3025 | mMoveIncidence = inc ; | 3091 | mMoveIncidence = inc ; |
3026 | QDate da; | 3092 | QDate da; |
3027 | if ( mMoveIncidence->typeID() == todoID ) { | 3093 | if ( mMoveIncidence->typeID() == todoID ) { |
3028 | Todo * to = (Todo *) mMoveIncidence; | 3094 | Todo * to = (Todo *) mMoveIncidence; |
3029 | if ( to->hasDueDate() ) | 3095 | if ( to->hasDueDate() ) |
3030 | da = to->dtDue().date(); | 3096 | da = to->dtDue().date(); |
3031 | else | 3097 | else |
3032 | da = QDate::currentDate(); | 3098 | da = QDate::currentDate(); |
3033 | } else { | 3099 | } else { |
3034 | da = mMoveIncidence->dtStart().date(); | 3100 | da = mMoveIncidence->dtStart().date(); |
3035 | } | 3101 | } |
3036 | //PENDING set date for recurring incidence to date of recurrence | 3102 | //PENDING set date for recurring incidence to date of recurrence |
3037 | //mMoveIncidenceOldDate; | 3103 | //mMoveIncidenceOldDate; |
3038 | mDatePicker->setDate( da ); | 3104 | mDatePicker->setDate( da ); |
3039 | } | 3105 | } |
3040 | void CalendarView::showDatePickerPopup() | 3106 | void CalendarView::showDatePickerPopup() |
3041 | { | 3107 | { |
3042 | if ( mDateFrame->isVisible() ) | 3108 | if ( mDateFrame->isVisible() ) |
3043 | mDateFrame->hide(); | 3109 | mDateFrame->hide(); |
3044 | else { | 3110 | else { |
3045 | int offX = 0, offY = 0; | 3111 | int offX = 0, offY = 0; |
3046 | #ifdef DESKTOP_VERSION | 3112 | #ifdef DESKTOP_VERSION |
3047 | int w =mDatePicker->sizeHint().width() ; | 3113 | int w =mDatePicker->sizeHint().width() ; |
3048 | int h = mDatePicker->sizeHint().height() ; | 3114 | int h = mDatePicker->sizeHint().height() ; |
3049 | int dw = topLevelWidget()->width(); | 3115 | int dw = topLevelWidget()->width(); |
3050 | int dh = topLevelWidget()->height(); | 3116 | int dh = topLevelWidget()->height(); |
3051 | offX = topLevelWidget()->x(); | 3117 | offX = topLevelWidget()->x(); |
3052 | offY = topLevelWidget()->y(); | 3118 | offY = topLevelWidget()->y(); |
3053 | #else | 3119 | #else |
3054 | int w =mDatePicker->sizeHint().width() ; | 3120 | int w =mDatePicker->sizeHint().width() ; |
3055 | int h = mDatePicker->sizeHint().height() ; | 3121 | int h = mDatePicker->sizeHint().height() ; |
3056 | int dw = QApplication::desktop()->width(); | 3122 | int dw = QApplication::desktop()->width(); |
3057 | int dh = QApplication::desktop()->height(); | 3123 | int dh = QApplication::desktop()->height(); |
3058 | #endif | 3124 | #endif |
3059 | mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); | 3125 | mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); |
3060 | mDateFrame->show(); | 3126 | mDateFrame->show(); |
3061 | } | 3127 | } |
3062 | } | 3128 | } |
3063 | void CalendarView::showDatePicker( ) | 3129 | void CalendarView::showDatePicker( ) |
3064 | { | 3130 | { |
3065 | showDatePickerPopup(); | 3131 | showDatePickerPopup(); |
3066 | mDatePickerMode = 1; | 3132 | mDatePickerMode = 1; |
3067 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 3133 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
3068 | } | 3134 | } |
3069 | 3135 | ||
3070 | void CalendarView::showEventEditor() | 3136 | void CalendarView::showEventEditor() |
3071 | { | 3137 | { |
3072 | #ifdef DESKTOP_VERSION | 3138 | #ifdef DESKTOP_VERSION |
3073 | int x,y,w,h; | 3139 | int x,y,w,h; |
3074 | x = mEventEditor->geometry().x(); | 3140 | x = mEventEditor->geometry().x(); |
3075 | y = mEventEditor->geometry().y(); | 3141 | y = mEventEditor->geometry().y(); |
3076 | w = mEventEditor->width(); | 3142 | w = mEventEditor->width(); |
3077 | h = mEventEditor->height(); | 3143 | h = mEventEditor->height(); |
3078 | mEventEditor->show(); | 3144 | mEventEditor->show(); |
3079 | mEventEditor->setGeometry(x,y,w,h); | 3145 | mEventEditor->setGeometry(x,y,w,h); |
3080 | #else | 3146 | #else |
3081 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 3147 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
3082 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 3148 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
3083 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 3149 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
3084 | qApp->processEvents(); | 3150 | qApp->processEvents(); |
3085 | delete mEventEditor; | 3151 | delete mEventEditor; |
3086 | mEventEditor = mDialogManager->getEventEditor(); | 3152 | mEventEditor = mDialogManager->getEventEditor(); |
3087 | topLevelWidget()->setCaption( i18n("") ); | 3153 | topLevelWidget()->setCaption( i18n("") ); |
3088 | } | 3154 | } |
3089 | mEventEditor->showMaximized(); | 3155 | mEventEditor->showMaximized(); |
3090 | #endif | 3156 | #endif |
3091 | } | 3157 | } |
3092 | void CalendarView::showTodoEditor() | 3158 | void CalendarView::showTodoEditor() |
3093 | { | 3159 | { |
3094 | #ifdef DESKTOP_VERSION | 3160 | #ifdef DESKTOP_VERSION |
3095 | int x,y,w,h; | 3161 | int x,y,w,h; |
3096 | x = mTodoEditor->geometry().x(); | 3162 | x = mTodoEditor->geometry().x(); |
3097 | y = mTodoEditor->geometry().y(); | 3163 | y = mTodoEditor->geometry().y(); |
3098 | w = mTodoEditor->width(); | 3164 | w = mTodoEditor->width(); |
3099 | h = mTodoEditor->height(); | 3165 | h = mTodoEditor->height(); |
3100 | mTodoEditor->show(); | 3166 | mTodoEditor->show(); |
3101 | mTodoEditor->setGeometry(x,y,w,h); | 3167 | mTodoEditor->setGeometry(x,y,w,h); |
3102 | #else | 3168 | #else |
3103 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 3169 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
3104 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 3170 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
3105 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 3171 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
3106 | qApp->processEvents(); | 3172 | qApp->processEvents(); |
3107 | delete mTodoEditor; | 3173 | delete mTodoEditor; |
3108 | mTodoEditor = mDialogManager->getTodoEditor(); | 3174 | mTodoEditor = mDialogManager->getTodoEditor(); |
3109 | topLevelWidget()->setCaption( i18n("") ); | 3175 | topLevelWidget()->setCaption( i18n("") ); |
3110 | } | 3176 | } |
3111 | mTodoEditor->showMaximized(); | 3177 | mTodoEditor->showMaximized(); |
3112 | #endif | 3178 | #endif |
3113 | } | 3179 | } |
3114 | 3180 | ||
3115 | void CalendarView::cloneIncidence() | 3181 | void CalendarView::cloneIncidence() |
3116 | { | 3182 | { |
3117 | Incidence *incidence = currentSelection(); | 3183 | Incidence *incidence = currentSelection(); |
3118 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3184 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3119 | if ( incidence ) { | 3185 | if ( incidence ) { |
3120 | cloneIncidence(incidence); | 3186 | cloneIncidence(incidence); |
3121 | } | 3187 | } |
3122 | } | 3188 | } |
3123 | void CalendarView::moveIncidence() | 3189 | void CalendarView::moveIncidence() |
3124 | { | 3190 | { |
3125 | Incidence *incidence = currentSelection(); | 3191 | Incidence *incidence = currentSelection(); |
3126 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3192 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3127 | if ( incidence ) { | 3193 | if ( incidence ) { |
3128 | moveIncidence(incidence); | 3194 | moveIncidence(incidence); |
3129 | } | 3195 | } |
3130 | } | 3196 | } |
3131 | void CalendarView::beamIncidence() | 3197 | void CalendarView::beamIncidence() |
3132 | { | 3198 | { |
3133 | Incidence *incidence = currentSelection(); | 3199 | Incidence *incidence = currentSelection(); |
3134 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3200 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3135 | if ( incidence ) { | 3201 | if ( incidence ) { |
3136 | beamIncidence(incidence); | 3202 | beamIncidence(incidence); |
3137 | } | 3203 | } |
3138 | } | 3204 | } |
3139 | void CalendarView::toggleCancelIncidence() | 3205 | void CalendarView::toggleCancelIncidence() |
3140 | { | 3206 | { |
3141 | Incidence *incidence = currentSelection(); | 3207 | Incidence *incidence = currentSelection(); |
3142 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3208 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3143 | if ( incidence ) { | 3209 | if ( incidence ) { |
3144 | cancelIncidence(incidence); | 3210 | cancelIncidence(incidence); |
3145 | } | 3211 | } |
3146 | } | 3212 | } |
3147 | 3213 | ||
3148 | 3214 | ||
3149 | void CalendarView::cancelIncidence(Incidence * inc ) | 3215 | void CalendarView::cancelIncidence(Incidence * inc ) |
3150 | { | 3216 | { |
3151 | inc->setCancelled( ! inc->cancelled() ); | 3217 | inc->setCancelled( ! inc->cancelled() ); |
3152 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 3218 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
3153 | updateView(); | 3219 | updateView(); |
3154 | } | 3220 | } |
3155 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 3221 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
3156 | { | 3222 | { |
3157 | Incidence * newInc = orgInc->clone(); | 3223 | Incidence * newInc = orgInc->clone(); |
3158 | newInc->recreate(); | 3224 | newInc->recreate(); |
3159 | 3225 | ||
3160 | if ( newInc->typeID() == todoID ) { | 3226 | if ( newInc->typeID() == todoID ) { |
3161 | Todo* t = (Todo*) newInc; | 3227 | Todo* t = (Todo*) newInc; |
3162 | bool cloneSub = false; | 3228 | bool cloneSub = false; |
3163 | if ( orgInc->relations().count() ) { | 3229 | if ( orgInc->relations().count() ) { |
3164 | int result = KMessageBox::warningYesNoCancel(this, | 3230 | int result = KMessageBox::warningYesNoCancel(this, |
3165 | i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), | 3231 | i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ), |
3166 | i18n("Todo has subtodos"), | 3232 | i18n("Todo has subtodos"), |
3167 | i18n("Yes"), | 3233 | i18n("Yes"), |
3168 | i18n("No")); | 3234 | i18n("No")); |
3169 | 3235 | ||
3170 | if ( result == KMessageBox::Cancel ) { | 3236 | if ( result == KMessageBox::Cancel ) { |
3171 | delete t; | 3237 | delete t; |
3172 | return; | 3238 | return; |
3173 | } | 3239 | } |
3174 | if (result == KMessageBox::Yes) cloneSub = true; | 3240 | if (result == KMessageBox::Yes) cloneSub = true; |
3175 | } | 3241 | } |
3176 | showTodoEditor(); | 3242 | showTodoEditor(); |
3177 | mTodoEditor->editTodo( t ); | 3243 | mTodoEditor->editTodo( t ); |
3178 | if ( mTodoEditor->exec() ) { | 3244 | if ( mTodoEditor->exec() ) { |
3179 | if ( cloneSub ) { | 3245 | if ( cloneSub ) { |
3180 | orgInc->cloneRelations( t ); | 3246 | orgInc->cloneRelations( t ); |
3181 | mCalendar->addIncidenceBranch( t ); | 3247 | mCalendar->addIncidenceBranch( t ); |
3182 | updateView(); | 3248 | updateView(); |
3183 | 3249 | ||
3184 | } else { | 3250 | } else { |
3185 | mCalendar->addTodo( t ); | 3251 | mCalendar->addTodo( t ); |
3186 | updateView(); | 3252 | updateView(); |
3187 | } | 3253 | } |
3188 | } else { | 3254 | } else { |
3189 | delete t; | 3255 | delete t; |
3190 | } | 3256 | } |
3191 | } | 3257 | } |
3192 | else if ( newInc->typeID() == eventID ) { | 3258 | else if ( newInc->typeID() == eventID ) { |
3193 | Event* e = (Event*) newInc; | 3259 | Event* e = (Event*) newInc; |
3194 | showEventEditor(); | 3260 | showEventEditor(); |
3195 | mEventEditor->editEvent( e ); | 3261 | mEventEditor->editEvent( e ); |
3196 | if ( mEventEditor->exec() ) { | 3262 | if ( mEventEditor->exec() ) { |
3197 | mCalendar->addEvent( e ); | 3263 | mCalendar->addEvent( e ); |
3198 | updateView(); | 3264 | updateView(); |
3199 | } else { | 3265 | } else { |
3200 | delete e; | 3266 | delete e; |
3201 | } | 3267 | } |
3202 | } if ( newInc->typeID() == journalID ) { | 3268 | } if ( newInc->typeID() == journalID ) { |
3203 | mCalendar->addJournal( (Journal*) newInc ); | 3269 | mCalendar->addJournal( (Journal*) newInc ); |
3204 | editJournal( (Journal*) newInc ); | 3270 | editJournal( (Journal*) newInc ); |
3205 | } | 3271 | } |
3206 | setActiveWindow(); | 3272 | setActiveWindow(); |
3207 | } | 3273 | } |
3208 | 3274 | ||
3209 | void CalendarView::newEvent() | 3275 | void CalendarView::newEvent() |
3210 | { | 3276 | { |
3211 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 3277 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
3212 | KOAgendaView *aView = mViewManager->agendaView(); | 3278 | KOAgendaView *aView = mViewManager->agendaView(); |
3213 | if (aView) { | 3279 | if (aView) { |
3214 | if (aView->selectionStart().isValid()) { | 3280 | if (aView->selectionStart().isValid()) { |
3215 | if (aView->selectedIsAllDay()) { | 3281 | if (aView->selectedIsAllDay()) { |
3216 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 3282 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
3217 | } else { | 3283 | } else { |
3218 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 3284 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
3219 | } | 3285 | } |
3220 | return; | 3286 | return; |
3221 | } | 3287 | } |
3222 | } | 3288 | } |
3223 | 3289 | ||
3224 | QDate date = mNavigator->selectedDates().first(); | 3290 | QDate date = mNavigator->selectedDates().first(); |
3225 | QDateTime current = QDateTime::currentDateTime(); | 3291 | QDateTime current = QDateTime::currentDateTime(); |
3226 | if ( date <= current.date() ) { | 3292 | if ( date <= current.date() ) { |
3227 | int hour = current.time().hour() +1; | 3293 | int hour = current.time().hour() +1; |
3228 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 3294 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
3229 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 3295 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
3230 | } else | 3296 | } else |
3231 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 3297 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
3232 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 3298 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
3233 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 3299 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
3234 | } | 3300 | } |
3235 | 3301 | ||
3236 | void CalendarView::newEvent(QDateTime fh) | 3302 | void CalendarView::newEvent(QDateTime fh) |
3237 | { | 3303 | { |
3238 | newEvent(fh, | 3304 | newEvent(fh, |
3239 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 3305 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
3240 | } | 3306 | } |
3241 | 3307 | ||
3242 | void CalendarView::newEvent(QDate dt) | 3308 | void CalendarView::newEvent(QDate dt) |
3243 | { | 3309 | { |
3244 | newEvent(QDateTime(dt, QTime(0,0,0)), | 3310 | newEvent(QDateTime(dt, QTime(0,0,0)), |
3245 | QDateTime(dt, QTime(0,0,0)), true); | 3311 | QDateTime(dt, QTime(0,0,0)), true); |
3246 | } | 3312 | } |
3247 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | 3313 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) |
3248 | { | 3314 | { |
3249 | newEvent(fromHint, toHint, false); | 3315 | newEvent(fromHint, toHint, false); |
3250 | } | 3316 | } |
3251 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 3317 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
3252 | { | 3318 | { |
3253 | 3319 | ||
3254 | showEventEditor(); | 3320 | showEventEditor(); |
3255 | mEventEditor->newEvent(fromHint,toHint,allDay); | 3321 | mEventEditor->newEvent(fromHint,toHint,allDay); |
3256 | if ( mFilterView->filtersEnabled() ) { | 3322 | if ( mFilterView->filtersEnabled() ) { |
3257 | CalFilter *filter = mFilterView->selectedFilter(); | 3323 | CalFilter *filter = mFilterView->selectedFilter(); |
3258 | if (filter && filter->showCategories()) { | 3324 | if (filter && filter->showCategories()) { |
3259 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 3325 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
3260 | } | 3326 | } |
3261 | if ( filter ) | 3327 | if ( filter ) |
3262 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 3328 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
3263 | } | 3329 | } |
3264 | mEventEditor->exec(); | 3330 | mEventEditor->exec(); |
3265 | setActiveWindow(); | 3331 | setActiveWindow(); |
3266 | } | 3332 | } |
3267 | void CalendarView::todoAdded(Todo * t) | 3333 | void CalendarView::todoAdded(Todo * t) |
3268 | { | 3334 | { |
3269 | 3335 | ||
3270 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); | 3336 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); |
3271 | updateTodoViews(); | 3337 | updateTodoViews(); |
3272 | } | 3338 | } |
3273 | void CalendarView::todoChanged(Todo * t) | 3339 | void CalendarView::todoChanged(Todo * t) |
3274 | { | 3340 | { |
3275 | emit todoModified( t, 4 ); | 3341 | emit todoModified( t, 4 ); |
3276 | // updateTodoViews(); | 3342 | // updateTodoViews(); |
3277 | } | 3343 | } |
3278 | void CalendarView::todoToBeDeleted(Todo *) | 3344 | void CalendarView::todoToBeDeleted(Todo *) |
3279 | { | 3345 | { |
3280 | //qDebug("todoToBeDeleted(Todo *) "); | 3346 | //qDebug("todoToBeDeleted(Todo *) "); |
3281 | updateTodoViews(); | 3347 | updateTodoViews(); |
3282 | } | 3348 | } |
3283 | void CalendarView::todoDeleted() | 3349 | void CalendarView::todoDeleted() |
3284 | { | 3350 | { |
3285 | //qDebug(" todoDeleted()"); | 3351 | //qDebug(" todoDeleted()"); |
3286 | updateTodoViews(); | 3352 | updateTodoViews(); |
3287 | } | 3353 | } |
3288 | 3354 | ||
3289 | 3355 | ||
3290 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) | 3356 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) |
3291 | { | 3357 | { |
3292 | showTodoEditor(); | 3358 | showTodoEditor(); |
3293 | mTodoEditor->newTodo(dt,0,allday); | 3359 | mTodoEditor->newTodo(dt,0,allday); |
3294 | if ( mFilterView->filtersEnabled() ) { | 3360 | if ( mFilterView->filtersEnabled() ) { |
3295 | CalFilter *filter = mFilterView->selectedFilter(); | 3361 | CalFilter *filter = mFilterView->selectedFilter(); |
3296 | if (filter && filter->showCategories()) { | 3362 | if (filter && filter->showCategories()) { |
3297 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 3363 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
3298 | } | 3364 | } |
3299 | if ( filter ) | 3365 | if ( filter ) |
3300 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 3366 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
3301 | } | 3367 | } |
3302 | mTodoEditor->exec(); | 3368 | mTodoEditor->exec(); |
3303 | setActiveWindow(); | 3369 | setActiveWindow(); |
3304 | } | 3370 | } |
3305 | 3371 | ||
3306 | void CalendarView::newTodo() | 3372 | void CalendarView::newTodo() |
3307 | { | 3373 | { |
3308 | newTodoDateTime( QDateTime(),true ); | 3374 | newTodoDateTime( QDateTime(),true ); |
3309 | } | 3375 | } |
3310 | 3376 | ||
3311 | void CalendarView::newSubTodo() | 3377 | void CalendarView::newSubTodo() |
3312 | { | 3378 | { |
3313 | Todo *todo = selectedTodo(); | 3379 | Todo *todo = selectedTodo(); |
3314 | if ( todo ) newSubTodo( todo ); | 3380 | if ( todo ) newSubTodo( todo ); |
3315 | } | 3381 | } |
3316 | 3382 | ||
3317 | void CalendarView::newSubTodo(Todo *parentEvent) | 3383 | void CalendarView::newSubTodo(Todo *parentEvent) |
3318 | { | 3384 | { |
3319 | 3385 | ||
3320 | showTodoEditor(); | 3386 | showTodoEditor(); |
3321 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); | 3387 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); |
3322 | mTodoEditor->exec(); | 3388 | mTodoEditor->exec(); |
3323 | setActiveWindow(); | 3389 | setActiveWindow(); |
3324 | } | 3390 | } |
3325 | 3391 | ||
3326 | void CalendarView::newFloatingEvent() | 3392 | void CalendarView::newFloatingEvent() |
3327 | { | 3393 | { |
3328 | DateList tmpList = mNavigator->selectedDates(); | 3394 | DateList tmpList = mNavigator->selectedDates(); |
3329 | QDate date = tmpList.first(); | 3395 | QDate date = tmpList.first(); |
3330 | 3396 | ||
3331 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), | 3397 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), |
3332 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); | 3398 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); |
3333 | } | 3399 | } |
3334 | 3400 | ||
3335 | 3401 | ||
3336 | void CalendarView::editEvent( Event *event ) | 3402 | void CalendarView::editEvent( Event *event ) |
3337 | { | 3403 | { |
3338 | 3404 | ||
3339 | if ( !event ) return; | 3405 | if ( !event ) return; |
3340 | if ( event->isReadOnly() ) { | 3406 | if ( event->isReadOnly() ) { |
3341 | showEvent( event ); | 3407 | showEvent( event ); |
3342 | return; | 3408 | return; |
3343 | } | 3409 | } |
3344 | showEventEditor(); | 3410 | showEventEditor(); |
3345 | mEventEditor->editEvent( event , mFlagEditDescription); | 3411 | mEventEditor->editEvent( event , mFlagEditDescription); |
3346 | mEventEditor->exec(); | 3412 | mEventEditor->exec(); |
3347 | setActiveWindow(); | 3413 | setActiveWindow(); |
3348 | 3414 | ||
3349 | } | 3415 | } |
3350 | void CalendarView::editJournal( Journal *jour ) | 3416 | void CalendarView::editJournal( Journal *jour ) |
3351 | { | 3417 | { |
3352 | if ( !jour ) return; | 3418 | if ( !jour ) return; |
3353 | mDialogManager->hideSearchDialog(); | 3419 | mDialogManager->hideSearchDialog(); |
3354 | mViewManager->showJournalView(); | 3420 | mViewManager->showJournalView(); |
3355 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 3421 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
3356 | } | 3422 | } |
3357 | void CalendarView::editTodo( Todo *todo ) | 3423 | void CalendarView::editTodo( Todo *todo ) |
3358 | { | 3424 | { |
3359 | if ( !todo ) return; | 3425 | if ( !todo ) return; |
3360 | 3426 | ||
3361 | if ( todo->isReadOnly() ) { | 3427 | if ( todo->isReadOnly() ) { |
3362 | showTodo( todo ); | 3428 | showTodo( todo ); |
3363 | return; | 3429 | return; |
3364 | } | 3430 | } |
3365 | showTodoEditor(); | 3431 | showTodoEditor(); |
3366 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 3432 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
3367 | mTodoEditor->exec(); | 3433 | mTodoEditor->exec(); |
3368 | setActiveWindow(); | 3434 | setActiveWindow(); |
3369 | 3435 | ||
3370 | } | 3436 | } |
3371 | 3437 | ||
3372 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 3438 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
3373 | { | 3439 | { |
3374 | if ( !mEventViewerDialog ) { | 3440 | if ( !mEventViewerDialog ) { |
3375 | mEventViewerDialog = new KOEventViewerDialog(0); | 3441 | mEventViewerDialog = new KOEventViewerDialog(0); |
3376 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 3442 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
3377 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 3443 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
3378 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 3444 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
3379 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 3445 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
3380 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 3446 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
3381 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 3447 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
3382 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), | 3448 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), |
3383 | this, SLOT( slotViewerClosed() ) ); | 3449 | this, SLOT( slotViewerClosed() ) ); |
3384 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), | 3450 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), |
3385 | this, SLOT( todoChanged(Todo *) ) ); | 3451 | this, SLOT( todoChanged(Todo *) ) ); |
3386 | connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | 3452 | connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); |
3387 | mEventViewerDialog->resize( 640, 480 ); | 3453 | mEventViewerDialog->resize( 640, 480 ); |
3388 | 3454 | ||
3389 | } | 3455 | } |
3390 | return mEventViewerDialog; | 3456 | return mEventViewerDialog; |
3391 | } | 3457 | } |
3392 | void CalendarView::showEvent(Event *event) | 3458 | void CalendarView::showEvent(Event *event) |
3393 | { | 3459 | { |
3394 | getEventViewerDialog()->setEvent(event); | 3460 | getEventViewerDialog()->setEvent(event); |
3395 | getEventViewerDialog()->showMe(); | 3461 | getEventViewerDialog()->showMe(); |
3396 | } | 3462 | } |
3397 | 3463 | ||
3398 | void CalendarView::showTodo(Todo *event) | 3464 | void CalendarView::showTodo(Todo *event) |
3399 | { | 3465 | { |
3400 | getEventViewerDialog()->setTodo(event); | 3466 | getEventViewerDialog()->setTodo(event); |
3401 | getEventViewerDialog()->showMe(); | 3467 | getEventViewerDialog()->showMe(); |
3402 | } | 3468 | } |
3403 | void CalendarView::showJournal( Journal *jour ) | 3469 | void CalendarView::showJournal( Journal *jour ) |
3404 | { | 3470 | { |
3405 | getEventViewerDialog()->setJournal(jour); | 3471 | getEventViewerDialog()->setJournal(jour); |
3406 | getEventViewerDialog()->showMe(); | 3472 | getEventViewerDialog()->showMe(); |
3407 | 3473 | ||
3408 | } | 3474 | } |
3409 | // void CalendarView::todoModified (Todo *event, int changed) | 3475 | // void CalendarView::todoModified (Todo *event, int changed) |
3410 | // { | 3476 | // { |
3411 | // // if (mDialogList.find (event) != mDialogList.end ()) { | 3477 | // // if (mDialogList.find (event) != mDialogList.end ()) { |
3412 | // // kdDebug() << "Todo modified and open" << endl; | 3478 | // // kdDebug() << "Todo modified and open" << endl; |
3413 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; | 3479 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; |
3414 | // // temp->modified (changed); | 3480 | // // temp->modified (changed); |
3415 | 3481 | ||
3416 | // // } | 3482 | // // } |
3417 | 3483 | ||
3418 | // mViewManager->updateView(); | 3484 | // mViewManager->updateView(); |
3419 | // } | 3485 | // } |
3420 | 3486 | ||
3421 | void CalendarView::appointment_show() | 3487 | void CalendarView::appointment_show() |
3422 | { | 3488 | { |
3423 | Event *anEvent = 0; | 3489 | Event *anEvent = 0; |
3424 | 3490 | ||
3425 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 3491 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
3426 | 3492 | ||
3427 | if (mViewManager->currentView()->isEventView()) { | 3493 | if (mViewManager->currentView()->isEventView()) { |
3428 | if ( incidence && incidence->typeID() == eventID ) { | 3494 | if ( incidence && incidence->typeID() == eventID ) { |
3429 | anEvent = static_cast<Event *>(incidence); | 3495 | anEvent = static_cast<Event *>(incidence); |
3430 | } | 3496 | } |
3431 | } | 3497 | } |
3432 | 3498 | ||
3433 | if (!anEvent) { | 3499 | if (!anEvent) { |
3434 | KNotifyClient::beep(); | 3500 | KNotifyClient::beep(); |
3435 | return; | 3501 | return; |
3436 | } | 3502 | } |
3437 | 3503 | ||
3438 | showEvent(anEvent); | 3504 | showEvent(anEvent); |
3439 | } | 3505 | } |
3440 | 3506 | ||
3441 | void CalendarView::appointment_edit() | 3507 | void CalendarView::appointment_edit() |
3442 | { | 3508 | { |
3443 | Event *anEvent = 0; | 3509 | Event *anEvent = 0; |
3444 | 3510 | ||
3445 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 3511 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
3446 | 3512 | ||
3447 | if (mViewManager->currentView()->isEventView()) { | 3513 | if (mViewManager->currentView()->isEventView()) { |
3448 | if ( incidence && incidence->typeID() == eventID ) { | 3514 | if ( incidence && incidence->typeID() == eventID ) { |
3449 | anEvent = static_cast<Event *>(incidence); | 3515 | anEvent = static_cast<Event *>(incidence); |
3450 | } | 3516 | } |
3451 | } | 3517 | } |
3452 | 3518 | ||
3453 | if (!anEvent) { | 3519 | if (!anEvent) { |
3454 | KNotifyClient::beep(); | 3520 | KNotifyClient::beep(); |
3455 | return; | 3521 | return; |
3456 | } | 3522 | } |
3457 | 3523 | ||
3458 | editEvent(anEvent); | 3524 | editEvent(anEvent); |
3459 | } | 3525 | } |
3460 | 3526 | ||
3461 | void CalendarView::appointment_delete() | 3527 | void CalendarView::appointment_delete() |
3462 | { | 3528 | { |
3463 | Event *anEvent = 0; | 3529 | Event *anEvent = 0; |
3464 | 3530 | ||
3465 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 3531 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
3466 | 3532 | ||
3467 | if (mViewManager->currentView()->isEventView()) { | 3533 | if (mViewManager->currentView()->isEventView()) { |
3468 | if ( incidence && incidence->typeID() == eventID ) { | 3534 | if ( incidence && incidence->typeID() == eventID ) { |
3469 | anEvent = static_cast<Event *>(incidence); | 3535 | anEvent = static_cast<Event *>(incidence); |
3470 | } | 3536 | } |
3471 | } | 3537 | } |
3472 | 3538 | ||
3473 | if (!anEvent) { | 3539 | if (!anEvent) { |
3474 | KNotifyClient::beep(); | 3540 | KNotifyClient::beep(); |
3475 | return; | 3541 | return; |
3476 | } | 3542 | } |
3477 | 3543 | ||
3478 | deleteEvent(anEvent); | 3544 | deleteEvent(anEvent); |
3479 | } | 3545 | } |
3480 | 3546 | ||
3481 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) | 3547 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) |
3482 | { | 3548 | { |
3483 | if (!sub) return; | 3549 | if (!sub) return; |
3484 | if ( sub->relatedTo() == parent ) | 3550 | if ( sub->relatedTo() == parent ) |
3485 | return; | 3551 | return; |
3486 | sub->setRelatedTo(parent); | 3552 | sub->setRelatedTo(parent); |
3487 | sub->updated(); | 3553 | sub->updated(); |
3488 | setModified(true); | 3554 | setModified(true); |
3489 | updateView(); | 3555 | updateView(); |
3490 | } | 3556 | } |
3491 | void CalendarView::todo_unsub(Todo *anTodo ) | 3557 | void CalendarView::todo_unsub(Todo *anTodo ) |
3492 | { | 3558 | { |
3493 | todo_resub( 0, anTodo ); | 3559 | todo_resub( 0, anTodo ); |
3494 | } | 3560 | } |
3495 | 3561 | ||
3496 | void CalendarView::deleteTodo(Todo *todo) | 3562 | void CalendarView::deleteTodo(Todo *todo) |
3497 | { | 3563 | { |
3498 | if (!todo) { | 3564 | if (!todo) { |
3499 | KNotifyClient::beep(); | 3565 | KNotifyClient::beep(); |
3500 | return; | 3566 | return; |
3501 | } | 3567 | } |
3502 | if (KOPrefs::instance()->mConfirm) { | 3568 | if (KOPrefs::instance()->mConfirm) { |
3503 | QString text = todo->summary().left(20); | 3569 | QString text = KGlobal::formatMessage ( todo->summary(),0 ); |
3504 | if (!todo->relations().isEmpty()) { | 3570 | if (!todo->relations().isEmpty()) { |
3505 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); | 3571 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); |
3506 | 3572 | ||
3507 | } | 3573 | } |
3508 | switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { | 3574 | switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { |
3509 | case KMessageBox::Continue: // OK | 3575 | case KMessageBox::Continue: // OK |
3510 | bool deleteT = false; | 3576 | bool deleteT = false; |
3511 | if (!todo->relations().isEmpty()) { | 3577 | if (!todo->relations().isEmpty()) { |
3512 | deleteT = removeCompletedSubTodos( todo ); | 3578 | deleteT = removeCompletedSubTodos( todo ); |
3513 | } | 3579 | } |
3514 | // deleteT == true: todo already deleted in removeCompletedSubTodos | 3580 | // deleteT == true: todo already deleted in removeCompletedSubTodos |
3515 | if ( !deleteT ) { | 3581 | if ( !deleteT ) { |
3516 | checkExternalId( todo ); | 3582 | checkExternalId( todo ); |
3517 | calendar()->deleteTodo(todo); | 3583 | calendar()->deleteTodo(todo); |
3518 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3584 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3519 | updateView(); | 3585 | updateView(); |
3520 | } | 3586 | } |
3521 | break; | 3587 | break; |
3522 | } // switch | 3588 | } // switch |
3523 | } else { | 3589 | } else { |
3524 | checkExternalId( todo ); | 3590 | checkExternalId( todo ); |
3525 | mCalendar->deleteTodo(todo); | 3591 | mCalendar->deleteTodo(todo); |
3526 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3592 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3527 | updateView(); | 3593 | updateView(); |
3528 | } | 3594 | } |
3529 | 3595 | ||
3530 | emit updateSearchDialog(); | 3596 | emit updateSearchDialog(); |
3531 | } | 3597 | } |
3532 | void CalendarView::deleteJournal(Journal *jour) | 3598 | void CalendarView::deleteJournal(Journal *jour) |
3533 | { | 3599 | { |
3534 | if (!jour) { | 3600 | if (!jour) { |
3535 | KNotifyClient::beep(); | 3601 | KNotifyClient::beep(); |
3536 | return; | 3602 | return; |
3537 | } | 3603 | } |
3538 | if (KOPrefs::instance()->mConfirm) { | 3604 | if (KOPrefs::instance()->mConfirm) { |
3539 | 3605 | ||
3540 | QString des; | 3606 | QString des; |
3541 | if ( !jour->summary().isEmpty() ) { | 3607 | if ( !jour->summary().isEmpty() ) { |
3542 | des = jour->summary(); | 3608 | des = jour->summary(); |
3543 | } else { | 3609 | } else { |
3544 | des = jour->description().left(30); | 3610 | des = jour->description().left(30); |
3545 | des = des.simplifyWhiteSpace (); | 3611 | des = des.simplifyWhiteSpace (); |
3546 | des.replace (QRegExp ("\\n"),"" ); | 3612 | des.replace (QRegExp ("\\n"),"" ); |
3547 | des.replace (QRegExp ("\\r"),"" ); | 3613 | des.replace (QRegExp ("\\r"),"" ); |
3548 | } | 3614 | } |
3549 | switch (msgItemDelete( i18n("Journal:") +"\n"+des.left(20))) { | 3615 | switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) { |
3550 | case KMessageBox::Continue: // OK | 3616 | case KMessageBox::Continue: // OK |
3551 | calendar()->deleteJournal(jour); | 3617 | calendar()->deleteJournal(jour); |
3552 | updateView(); | 3618 | updateView(); |
3553 | break; | 3619 | break; |
3554 | } // switch | 3620 | } // switch |
3555 | } else { | 3621 | } else { |
3556 | calendar()->deleteJournal(jour);; | 3622 | calendar()->deleteJournal(jour);; |
3557 | updateView(); | 3623 | updateView(); |
3558 | } | 3624 | } |
3559 | emit updateSearchDialog(); | 3625 | emit updateSearchDialog(); |
3560 | } | 3626 | } |
3561 | 3627 | ||
3562 | void CalendarView::deleteEvent(Event *anEvent) | 3628 | void CalendarView::deleteEvent(Event *anEvent) |
3563 | { | 3629 | { |
3564 | if (!anEvent) { | 3630 | if (!anEvent) { |
3565 | KNotifyClient::beep(); | 3631 | KNotifyClient::beep(); |
3566 | return; | 3632 | return; |
3567 | } | 3633 | } |
3568 | 3634 | ||
3569 | if (anEvent->recurrence()->doesRecur()) { | 3635 | if (anEvent->recurrence()->doesRecur()) { |
3570 | QDate itemDate = mViewManager->currentSelectionDate(); | 3636 | QDate itemDate = mViewManager->currentSelectionDate(); |
3571 | int km; | 3637 | int km; |
3572 | if (!itemDate.isValid()) { | 3638 | if (!itemDate.isValid()) { |
3573 | //kdDebug() << "Date Not Valid" << endl; | 3639 | //kdDebug() << "Date Not Valid" << endl; |
3574 | if (KOPrefs::instance()->mConfirm) { | 3640 | if (KOPrefs::instance()->mConfirm) { |
3575 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3641 | km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3576 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 3642 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
3577 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 3643 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
3578 | if ( km == KMessageBox::Continue ) | 3644 | if ( km == KMessageBox::Continue ) |
3579 | km = KMessageBox::No; // No = all below | 3645 | km = KMessageBox::No; // No = all below |
3580 | } else | 3646 | } else |
3581 | km = KMessageBox::No; | 3647 | km = KMessageBox::No; |
3582 | } else { | 3648 | } else { |
3583 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + | 3649 | km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3584 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 3650 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
3585 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 3651 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
3586 | i18n("KO/Pi Confirmation"),i18n("Current"), | 3652 | i18n("KO/Pi Confirmation"),i18n("Current"), |
3587 | i18n("All")); | 3653 | i18n("All")); |
3588 | } | 3654 | } |
3589 | switch(km) { | 3655 | switch(km) { |
3590 | 3656 | ||
3591 | case KMessageBox::No: // Continue // all | 3657 | case KMessageBox::No: // Continue // all |
3592 | //qDebug("KMessageBox::No "); | 3658 | //qDebug("KMessageBox::No "); |
3593 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3659 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3594 | schedule(Scheduler::Cancel,anEvent); | 3660 | schedule(Scheduler::Cancel,anEvent); |
3595 | 3661 | ||
3596 | checkExternalId( anEvent); | 3662 | checkExternalId( anEvent); |
3597 | mCalendar->deleteEvent(anEvent); | 3663 | mCalendar->deleteEvent(anEvent); |
3598 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); | 3664 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); |
3599 | break; | 3665 | break; |
3600 | 3666 | ||
3601 | // Disabled because it does not work | 3667 | // Disabled because it does not work |
3602 | //#if 0 | 3668 | //#if 0 |
3603 | case KMessageBox::Yes: // just this one | 3669 | case KMessageBox::Yes: // just this one |
3604 | //QDate qd = mNavigator->selectedDates().first(); | 3670 | //QDate qd = mNavigator->selectedDates().first(); |
3605 | //if (!qd.isValid()) { | 3671 | //if (!qd.isValid()) { |
3606 | // kdDebug() << "no date selected, or invalid date" << endl; | 3672 | // kdDebug() << "no date selected, or invalid date" << endl; |
3607 | // KNotifyClient::beep(); | 3673 | // KNotifyClient::beep(); |
3608 | // return; | 3674 | // return; |
3609 | //} | 3675 | //} |
3610 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); | 3676 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); |
3611 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { | 3677 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { |
3612 | anEvent->addExDate(itemDate); | 3678 | anEvent->addExDate(itemDate); |
3613 | int duration = anEvent->recurrence()->duration(); | 3679 | int duration = anEvent->recurrence()->duration(); |
3614 | if ( duration > 0 ) { | 3680 | if ( duration > 0 ) { |
3615 | anEvent->recurrence()->setDuration( duration - 1 ); | 3681 | anEvent->recurrence()->setDuration( duration - 1 ); |
3616 | } | 3682 | } |
3617 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); | 3683 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); |
3618 | } | 3684 | } |
3619 | break; | 3685 | break; |
3620 | //#endif | 3686 | //#endif |
3621 | } // switch | 3687 | } // switch |
3622 | } else { | 3688 | } else { |
3623 | if (KOPrefs::instance()->mConfirm) { | 3689 | if (KOPrefs::instance()->mConfirm) { |
3624 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3690 | switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3625 | i18n("\nAre you sure you want\nto delete this event?"), | 3691 | i18n("\nAre you sure you want\nto delete this event?"), |
3626 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { | 3692 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { |
3627 | case KMessageBox::Continue: // OK | 3693 | case KMessageBox::Continue: // OK |
3628 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3694 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3629 | schedule(Scheduler::Cancel,anEvent); | 3695 | schedule(Scheduler::Cancel,anEvent); |
3630 | checkExternalId( anEvent); | 3696 | checkExternalId( anEvent); |
3631 | mCalendar->deleteEvent(anEvent); | 3697 | mCalendar->deleteEvent(anEvent); |
3632 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3698 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3633 | break; | 3699 | break; |
3634 | } // switch | 3700 | } // switch |
3635 | } else { | 3701 | } else { |
3636 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3702 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3637 | schedule(Scheduler::Cancel,anEvent); | 3703 | schedule(Scheduler::Cancel,anEvent); |
3638 | checkExternalId( anEvent); | 3704 | checkExternalId( anEvent); |
3639 | mCalendar->deleteEvent(anEvent); | 3705 | mCalendar->deleteEvent(anEvent); |
3640 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3706 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3641 | } | 3707 | } |
3642 | } // if-else | 3708 | } // if-else |
3643 | emit updateSearchDialog(); | 3709 | emit updateSearchDialog(); |
3644 | } | 3710 | } |
3645 | 3711 | ||
3646 | bool CalendarView::deleteEvent(const QString &uid) | 3712 | bool CalendarView::deleteEvent(const QString &uid) |
3647 | { | 3713 | { |
3648 | Event *ev = mCalendar->event(uid); | 3714 | Event *ev = mCalendar->event(uid); |
3649 | if (ev) { | 3715 | if (ev) { |
3650 | deleteEvent(ev); | 3716 | deleteEvent(ev); |
3651 | return true; | 3717 | return true; |
3652 | } else { | 3718 | } else { |
3653 | return false; | 3719 | return false; |
3654 | } | 3720 | } |
3655 | } | 3721 | } |
3656 | 3722 | ||
3657 | /*****************************************************************************/ | 3723 | /*****************************************************************************/ |
3658 | 3724 | ||
3659 | void CalendarView::action_mail() | 3725 | void CalendarView::action_mail() |
3660 | { | 3726 | { |
3661 | #ifndef KORG_NOMAIL | 3727 | #ifndef KORG_NOMAIL |
3662 | KOMailClient mailClient; | 3728 | KOMailClient mailClient; |
3663 | 3729 | ||
3664 | Incidence *incidence = currentSelection(); | 3730 | Incidence *incidence = currentSelection(); |
3665 | 3731 | ||
3666 | if (!incidence) { | 3732 | if (!incidence) { |
3667 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3733 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3668 | return; | 3734 | return; |
3669 | } | 3735 | } |
3670 | if(incidence->attendeeCount() == 0 ) { | 3736 | if(incidence->attendeeCount() == 0 ) { |
3671 | KMessageBox::sorry(this, | 3737 | KMessageBox::sorry(this, |
3672 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3738 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3673 | return; | 3739 | return; |
3674 | } | 3740 | } |
3675 | 3741 | ||
3676 | CalendarLocal cal_tmp; | 3742 | CalendarLocal cal_tmp; |
3677 | Event *event = 0; | 3743 | Event *event = 0; |
3678 | Event *ev = 0; | 3744 | Event *ev = 0; |
3679 | if ( incidence && incidence->typeID() == eventID ) { | 3745 | if ( incidence && incidence->typeID() == eventID ) { |
3680 | event = static_cast<Event *>(incidence); | 3746 | event = static_cast<Event *>(incidence); |
3681 | ev = new Event(*event); | 3747 | ev = new Event(*event); |
3682 | cal_tmp.addEvent(ev); | 3748 | cal_tmp.addEvent(ev); |
3683 | } | 3749 | } |
3684 | ICalFormat mForm(); | 3750 | ICalFormat mForm(); |
3685 | QString attachment = mForm.toString( &cal_tmp ); | 3751 | QString attachment = mForm.toString( &cal_tmp ); |
3686 | if (ev) delete(ev); | 3752 | if (ev) delete(ev); |
3687 | 3753 | ||
3688 | mailClient.mailAttendees(currentSelection(), attachment); | 3754 | mailClient.mailAttendees(currentSelection(), attachment); |
3689 | 3755 | ||
3690 | #endif | 3756 | #endif |
3691 | 3757 | ||
3692 | #if 0 | 3758 | #if 0 |
3693 | Event *anEvent = 0; | 3759 | Event *anEvent = 0; |
3694 | if (mViewManager->currentView()->isEventView()) { | 3760 | if (mViewManager->currentView()->isEventView()) { |
3695 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); | 3761 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); |
3696 | } | 3762 | } |
3697 | 3763 | ||
3698 | if (!anEvent) { | 3764 | if (!anEvent) { |
3699 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3765 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3700 | return; | 3766 | return; |
3701 | } | 3767 | } |
3702 | if(anEvent->attendeeCount() == 0 ) { | 3768 | if(anEvent->attendeeCount() == 0 ) { |
3703 | KMessageBox::sorry(this, | 3769 | KMessageBox::sorry(this, |
3704 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3770 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3705 | return; | 3771 | return; |
3706 | } | 3772 | } |
3707 | 3773 | ||
3708 | mailobject.emailEvent(anEvent); | 3774 | mailobject.emailEvent(anEvent); |
3709 | #endif | 3775 | #endif |
3710 | } | 3776 | } |
3711 | 3777 | ||
3712 | 3778 | ||
3713 | void CalendarView::schedule_publish(Incidence *incidence) | 3779 | void CalendarView::schedule_publish(Incidence *incidence) |
3714 | { | 3780 | { |
3715 | Event *event = 0; | 3781 | Event *event = 0; |
3716 | Todo *todo = 0; | 3782 | Todo *todo = 0; |
3717 | 3783 | ||
3718 | if (incidence == 0) { | 3784 | if (incidence == 0) { |
3719 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3785 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3720 | if (incidence == 0) { | 3786 | if (incidence == 0) { |
3721 | incidence = mTodoList->selectedIncidences().first(); | 3787 | incidence = mTodoList->selectedIncidences().first(); |
3722 | } | 3788 | } |
3723 | } | 3789 | } |
3724 | if ( incidence && incidence->typeID() == eventID ) { | 3790 | if ( incidence && incidence->typeID() == eventID ) { |
3725 | event = static_cast<Event *>(incidence); | 3791 | event = static_cast<Event *>(incidence); |
3726 | } else { | 3792 | } else { |
3727 | if ( incidence && incidence->typeID() == todoID ) { | 3793 | if ( incidence && incidence->typeID() == todoID ) { |
3728 | todo = static_cast<Todo *>(incidence); | 3794 | todo = static_cast<Todo *>(incidence); |
3729 | } | 3795 | } |
3730 | } | 3796 | } |
3731 | 3797 | ||
3732 | if (!event && !todo) { | 3798 | if (!event && !todo) { |
3733 | KMessageBox::sorry(this,i18n("No event selected.")); | 3799 | KMessageBox::sorry(this,i18n("No event selected.")); |
3734 | return; | 3800 | return; |
3735 | } | 3801 | } |
3736 | 3802 | ||
3737 | PublishDialog *publishdlg = new PublishDialog(); | 3803 | PublishDialog *publishdlg = new PublishDialog(); |
3738 | if (incidence->attendeeCount()>0) { | 3804 | if (incidence->attendeeCount()>0) { |
3739 | QPtrList<Attendee> attendees = incidence->attendees(); | 3805 | QPtrList<Attendee> attendees = incidence->attendees(); |
3740 | attendees.first(); | 3806 | attendees.first(); |
3741 | while ( attendees.current()!=0 ) { | 3807 | while ( attendees.current()!=0 ) { |
3742 | publishdlg->addAttendee(attendees.current()); | 3808 | publishdlg->addAttendee(attendees.current()); |
3743 | attendees.next(); | 3809 | attendees.next(); |
3744 | } | 3810 | } |
3745 | } | 3811 | } |
3746 | bool send = true; | 3812 | bool send = true; |
3747 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { | 3813 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { |
3748 | if ( publishdlg->exec() != QDialog::Accepted ) | 3814 | if ( publishdlg->exec() != QDialog::Accepted ) |
3749 | send = false; | 3815 | send = false; |
3750 | } | 3816 | } |
3751 | if ( send ) { | 3817 | if ( send ) { |
3752 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3818 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3753 | if ( event ) { | 3819 | if ( event ) { |
3754 | Event *ev = new Event(*event); | 3820 | Event *ev = new Event(*event); |
3755 | ev->registerObserver(0); | 3821 | ev->registerObserver(0); |
3756 | ev->clearAttendees(); | 3822 | ev->clearAttendees(); |
3757 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3823 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3758 | delete(ev); | 3824 | delete(ev); |
3759 | } | 3825 | } |
3760 | } else { | 3826 | } else { |
3761 | if ( todo ) { | 3827 | if ( todo ) { |
3762 | Todo *ev = new Todo(*todo); | 3828 | Todo *ev = new Todo(*todo); |
3763 | ev->registerObserver(0); | 3829 | ev->registerObserver(0); |
3764 | ev->clearAttendees(); | 3830 | ev->clearAttendees(); |
3765 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3831 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3766 | delete(ev); | 3832 | delete(ev); |
3767 | } | 3833 | } |
3768 | } | 3834 | } |
3769 | } | 3835 | } |
3770 | } | 3836 | } |
3771 | delete publishdlg; | 3837 | delete publishdlg; |
3772 | } | 3838 | } |
3773 | 3839 | ||
3774 | void CalendarView::schedule_request(Incidence *incidence) | 3840 | void CalendarView::schedule_request(Incidence *incidence) |
3775 | { | 3841 | { |
3776 | schedule(Scheduler::Request,incidence); | 3842 | schedule(Scheduler::Request,incidence); |
3777 | } | 3843 | } |
3778 | 3844 | ||
3779 | void CalendarView::schedule_refresh(Incidence *incidence) | 3845 | void CalendarView::schedule_refresh(Incidence *incidence) |
3780 | { | 3846 | { |
3781 | schedule(Scheduler::Refresh,incidence); | 3847 | schedule(Scheduler::Refresh,incidence); |
3782 | } | 3848 | } |
3783 | 3849 | ||
3784 | void CalendarView::schedule_cancel(Incidence *incidence) | 3850 | void CalendarView::schedule_cancel(Incidence *incidence) |
3785 | { | 3851 | { |
3786 | schedule(Scheduler::Cancel,incidence); | 3852 | schedule(Scheduler::Cancel,incidence); |
3787 | } | 3853 | } |
3788 | 3854 | ||
3789 | void CalendarView::schedule_add(Incidence *incidence) | 3855 | void CalendarView::schedule_add(Incidence *incidence) |
3790 | { | 3856 | { |
3791 | schedule(Scheduler::Add,incidence); | 3857 | schedule(Scheduler::Add,incidence); |
3792 | } | 3858 | } |
3793 | 3859 | ||
3794 | void CalendarView::schedule_reply(Incidence *incidence) | 3860 | void CalendarView::schedule_reply(Incidence *incidence) |
3795 | { | 3861 | { |
3796 | schedule(Scheduler::Reply,incidence); | 3862 | schedule(Scheduler::Reply,incidence); |
3797 | } | 3863 | } |
3798 | 3864 | ||
3799 | void CalendarView::schedule_counter(Incidence *incidence) | 3865 | void CalendarView::schedule_counter(Incidence *incidence) |
3800 | { | 3866 | { |
3801 | schedule(Scheduler::Counter,incidence); | 3867 | schedule(Scheduler::Counter,incidence); |
3802 | } | 3868 | } |
3803 | 3869 | ||
3804 | void CalendarView::schedule_declinecounter(Incidence *incidence) | 3870 | void CalendarView::schedule_declinecounter(Incidence *incidence) |
3805 | { | 3871 | { |
3806 | schedule(Scheduler::Declinecounter,incidence); | 3872 | schedule(Scheduler::Declinecounter,incidence); |
3807 | } | 3873 | } |
3808 | 3874 | ||
3809 | void CalendarView::schedule_publish_freebusy(int daysToPublish) | 3875 | void CalendarView::schedule_publish_freebusy(int daysToPublish) |
3810 | { | 3876 | { |
3811 | QDateTime start = QDateTime::currentDateTime(); | 3877 | QDateTime start = QDateTime::currentDateTime(); |
3812 | QDateTime end = start.addDays(daysToPublish); | 3878 | QDateTime end = start.addDays(daysToPublish); |
3813 | 3879 | ||
3814 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); | 3880 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); |
3815 | freebusy->setOrganizer(KOPrefs::instance()->email()); | 3881 | freebusy->setOrganizer(KOPrefs::instance()->email()); |
3816 | 3882 | ||
3817 | 3883 | ||
3818 | PublishDialog *publishdlg = new PublishDialog(); | 3884 | PublishDialog *publishdlg = new PublishDialog(); |
3819 | if ( publishdlg->exec() == QDialog::Accepted ) { | 3885 | if ( publishdlg->exec() == QDialog::Accepted ) { |
3820 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3886 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3821 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { | 3887 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { |
3822 | delete(freebusy); | 3888 | delete(freebusy); |
3823 | } | 3889 | } |
3824 | } | 3890 | } |
3825 | delete publishdlg; | 3891 | delete publishdlg; |
3826 | } | 3892 | } |
3827 | 3893 | ||
3828 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) | 3894 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) |
3829 | { | 3895 | { |
3830 | Event *event = 0; | 3896 | Event *event = 0; |
3831 | Todo *todo = 0; | 3897 | Todo *todo = 0; |
3832 | 3898 | ||
3833 | if (incidence == 0) { | 3899 | if (incidence == 0) { |
3834 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3900 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3835 | if (incidence == 0) { | 3901 | if (incidence == 0) { |
3836 | incidence = mTodoList->selectedIncidences().first(); | 3902 | incidence = mTodoList->selectedIncidences().first(); |
3837 | } | 3903 | } |
3838 | } | 3904 | } |
3839 | if ( incidence && incidence->typeID() == eventID ) { | 3905 | if ( incidence && incidence->typeID() == eventID ) { |
3840 | event = static_cast<Event *>(incidence); | 3906 | event = static_cast<Event *>(incidence); |
3841 | } | 3907 | } |
3842 | if ( incidence && incidence->typeID() == todoID ) { | 3908 | if ( incidence && incidence->typeID() == todoID ) { |
3843 | todo = static_cast<Todo *>(incidence); | 3909 | todo = static_cast<Todo *>(incidence); |
3844 | } | 3910 | } |
3845 | 3911 | ||
3846 | if (!event && !todo) { | 3912 | if (!event && !todo) { |
3847 | KMessageBox::sorry(this,i18n("No event selected.")); | 3913 | KMessageBox::sorry(this,i18n("No event selected.")); |
3848 | return; | 3914 | return; |
3849 | } | 3915 | } |
3850 | 3916 | ||
3851 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { | 3917 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { |
3852 | KMessageBox::sorry(this,i18n("The event has no attendees.")); | 3918 | KMessageBox::sorry(this,i18n("The event has no attendees.")); |
3853 | return; | 3919 | return; |
3854 | } | 3920 | } |
3855 | 3921 | ||
3856 | Event *ev = 0; | 3922 | Event *ev = 0; |
3857 | if (event) ev = new Event(*event); | 3923 | if (event) ev = new Event(*event); |
3858 | Todo *to = 0; | 3924 | Todo *to = 0; |
3859 | if (todo) to = new Todo(*todo); | 3925 | if (todo) to = new Todo(*todo); |
3860 | 3926 | ||
3861 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { | 3927 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { |
3862 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 3928 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
3863 | if (!me) { | 3929 | if (!me) { |
3864 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); | 3930 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); |
3865 | return; | 3931 | return; |
3866 | } | 3932 | } |
3867 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { | 3933 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { |
3868 | StatusDialog *statdlg = new StatusDialog(this); | 3934 | StatusDialog *statdlg = new StatusDialog(this); |
3869 | if (!statdlg->exec()==QDialog::Accepted) return; | 3935 | if (!statdlg->exec()==QDialog::Accepted) return; |
3870 | me->setStatus( statdlg->status() ); | 3936 | me->setStatus( statdlg->status() ); |
3871 | delete(statdlg); | 3937 | delete(statdlg); |
3872 | } | 3938 | } |
3873 | Attendee *menew = new Attendee(*me); | 3939 | Attendee *menew = new Attendee(*me); |
3874 | if (ev) { | 3940 | if (ev) { |
3875 | ev->clearAttendees(); | 3941 | ev->clearAttendees(); |
3876 | ev->addAttendee(menew,false); | 3942 | ev->addAttendee(menew,false); |
3877 | } else { | 3943 | } else { |
3878 | if (to) { | 3944 | if (to) { |
3879 | todo->clearAttendees(); | 3945 | todo->clearAttendees(); |
3880 | todo->addAttendee(menew,false); | 3946 | todo->addAttendee(menew,false); |
@@ -4327,335 +4393,335 @@ void CalendarView::addView(KOrg::BaseView *view) | |||
4327 | } | 4393 | } |
4328 | 4394 | ||
4329 | void CalendarView::showView(KOrg::BaseView *view) | 4395 | void CalendarView::showView(KOrg::BaseView *view) |
4330 | { | 4396 | { |
4331 | mViewManager->showView(view, mLeftFrame->isVisible()); | 4397 | mViewManager->showView(view, mLeftFrame->isVisible()); |
4332 | } | 4398 | } |
4333 | 4399 | ||
4334 | Incidence *CalendarView::currentSelection() | 4400 | Incidence *CalendarView::currentSelection() |
4335 | { | 4401 | { |
4336 | return mViewManager->currentSelection(); | 4402 | return mViewManager->currentSelection(); |
4337 | } | 4403 | } |
4338 | void CalendarView::toggleAllDaySize() | 4404 | void CalendarView::toggleAllDaySize() |
4339 | { | 4405 | { |
4340 | /* | 4406 | /* |
4341 | if ( KOPrefs::instance()->mAllDaySize > 47 ) | 4407 | if ( KOPrefs::instance()->mAllDaySize > 47 ) |
4342 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; | 4408 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; |
4343 | else | 4409 | else |
4344 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; | 4410 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; |
4345 | */ | 4411 | */ |
4346 | viewManager()->agendaView()->toggleAllDay(); | 4412 | viewManager()->agendaView()->toggleAllDay(); |
4347 | } | 4413 | } |
4348 | void CalendarView::toggleExpand() | 4414 | void CalendarView::toggleExpand() |
4349 | { | 4415 | { |
4350 | // if ( mLeftFrame->isHidden() ) { | 4416 | // if ( mLeftFrame->isHidden() ) { |
4351 | // mLeftFrame->show(); | 4417 | // mLeftFrame->show(); |
4352 | // emit calendarViewExpanded( false ); | 4418 | // emit calendarViewExpanded( false ); |
4353 | // } else { | 4419 | // } else { |
4354 | // mLeftFrame->hide(); | 4420 | // mLeftFrame->hide(); |
4355 | // emit calendarViewExpanded( true ); | 4421 | // emit calendarViewExpanded( true ); |
4356 | // } | 4422 | // } |
4357 | //qDebug(" CalendarView::toggleExpand()"); | 4423 | //qDebug(" CalendarView::toggleExpand()"); |
4358 | globalFlagBlockAgenda = 1; | 4424 | globalFlagBlockAgenda = 1; |
4359 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); | 4425 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); |
4360 | globalFlagBlockAgenda = 5; | 4426 | globalFlagBlockAgenda = 5; |
4361 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); | 4427 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); |
4362 | //mViewManager->showView( 0, true ); | 4428 | //mViewManager->showView( 0, true ); |
4363 | } | 4429 | } |
4364 | 4430 | ||
4365 | void CalendarView::calendarModified( bool modified, Calendar * ) | 4431 | void CalendarView::calendarModified( bool modified, Calendar * ) |
4366 | { | 4432 | { |
4367 | setModified( modified ); | 4433 | setModified( modified ); |
4368 | } | 4434 | } |
4369 | 4435 | ||
4370 | Todo *CalendarView::selectedTodo() | 4436 | Todo *CalendarView::selectedTodo() |
4371 | { | 4437 | { |
4372 | Incidence *incidence = currentSelection(); | 4438 | Incidence *incidence = currentSelection(); |
4373 | if ( incidence && incidence->typeID() == todoID ) { | 4439 | if ( incidence && incidence->typeID() == todoID ) { |
4374 | return static_cast<Todo *>( incidence ); | 4440 | return static_cast<Todo *>( incidence ); |
4375 | } | 4441 | } |
4376 | 4442 | ||
4377 | incidence = mTodoList->selectedIncidences().first(); | 4443 | incidence = mTodoList->selectedIncidences().first(); |
4378 | if ( incidence && incidence->typeID() == todoID ) { | 4444 | if ( incidence && incidence->typeID() == todoID ) { |
4379 | return static_cast<Todo *>( incidence ); | 4445 | return static_cast<Todo *>( incidence ); |
4380 | } | 4446 | } |
4381 | 4447 | ||
4382 | return 0; | 4448 | return 0; |
4383 | } | 4449 | } |
4384 | 4450 | ||
4385 | void CalendarView::showIncidence() | 4451 | void CalendarView::showIncidence() |
4386 | { | 4452 | { |
4387 | mViewerCallerIsSearchDialog = false; | 4453 | mViewerCallerIsSearchDialog = false; |
4388 | Incidence *incidence = currentSelection(); | 4454 | Incidence *incidence = currentSelection(); |
4389 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4455 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
4390 | if ( incidence ) { | 4456 | if ( incidence ) { |
4391 | ShowIncidenceVisitor v; | 4457 | ShowIncidenceVisitor v; |
4392 | v.act( incidence, this ); | 4458 | v.act( incidence, this ); |
4393 | } | 4459 | } |
4394 | } | 4460 | } |
4395 | void CalendarView::editIncidenceDescription() | 4461 | void CalendarView::editIncidenceDescription() |
4396 | { | 4462 | { |
4397 | mFlagEditDescription = true; | 4463 | mFlagEditDescription = true; |
4398 | editIncidence(); | 4464 | editIncidence(); |
4399 | mFlagEditDescription = false; | 4465 | mFlagEditDescription = false; |
4400 | } | 4466 | } |
4401 | void CalendarView::editIncidence() | 4467 | void CalendarView::editIncidence() |
4402 | { | 4468 | { |
4403 | // qDebug("editIncidence() "); | 4469 | // qDebug("editIncidence() "); |
4404 | Incidence *incidence = currentSelection(); | 4470 | Incidence *incidence = currentSelection(); |
4405 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4471 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
4406 | if ( incidence ) { | 4472 | if ( incidence ) { |
4407 | EditIncidenceVisitor v; | 4473 | EditIncidenceVisitor v; |
4408 | v.act( incidence, this ); | 4474 | v.act( incidence, this ); |
4409 | } | 4475 | } |
4410 | } | 4476 | } |
4411 | 4477 | ||
4412 | void CalendarView::deleteIncidence() | 4478 | void CalendarView::deleteIncidence() |
4413 | { | 4479 | { |
4414 | Incidence *incidence = currentSelection(); | 4480 | Incidence *incidence = currentSelection(); |
4415 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4481 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
4416 | if ( incidence ) { | 4482 | if ( incidence ) { |
4417 | deleteIncidence(incidence); | 4483 | deleteIncidence(incidence); |
4418 | } | 4484 | } |
4419 | } | 4485 | } |
4420 | void CalendarView::showIncidence(QString uid) | 4486 | void CalendarView::showIncidence(QString uid) |
4421 | { | 4487 | { |
4422 | Incidence *inc = mCalendar->incidence( uid ); | 4488 | Incidence *inc = mCalendar->incidence( uid ); |
4423 | if ( inc ) | 4489 | if ( inc ) |
4424 | showIncidence( inc ); | 4490 | showIncidence( inc ); |
4425 | } | 4491 | } |
4426 | void CalendarView::showIncidence(Incidence *incidence) | 4492 | void CalendarView::showIncidence(Incidence *incidence) |
4427 | { | 4493 | { |
4428 | mViewerCallerIsSearchDialog = false; | 4494 | mViewerCallerIsSearchDialog = false; |
4429 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); | 4495 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); |
4430 | if ( sender() && mDialogManager->getSearchDialog() ) { | 4496 | if ( sender() && mDialogManager->getSearchDialog() ) { |
4431 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { | 4497 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { |
4432 | mViewerCallerIsSearchDialog = true; | 4498 | mViewerCallerIsSearchDialog = true; |
4433 | } | 4499 | } |
4434 | } | 4500 | } |
4435 | if ( incidence ) { | 4501 | if ( incidence ) { |
4436 | ShowIncidenceVisitor v; | 4502 | ShowIncidenceVisitor v; |
4437 | v.act( incidence, this ); | 4503 | v.act( incidence, this ); |
4438 | } | 4504 | } |
4439 | } | 4505 | } |
4440 | 4506 | ||
4441 | void CalendarView::editIncidence(Incidence *incidence) | 4507 | void CalendarView::editIncidence(Incidence *incidence) |
4442 | { | 4508 | { |
4443 | if ( incidence ) { | 4509 | if ( incidence ) { |
4444 | 4510 | ||
4445 | EditIncidenceVisitor v; | 4511 | EditIncidenceVisitor v; |
4446 | v.act( incidence, this ); | 4512 | v.act( incidence, this ); |
4447 | 4513 | ||
4448 | } | 4514 | } |
4449 | } | 4515 | } |
4450 | 4516 | ||
4451 | void CalendarView::deleteIncidence(Incidence *incidence) | 4517 | void CalendarView::deleteIncidence(Incidence *incidence) |
4452 | { | 4518 | { |
4453 | //qDebug(" CalendarView::deleteIncidence "); | 4519 | //qDebug(" CalendarView::deleteIncidence "); |
4454 | if ( incidence == 0 ) { | 4520 | if ( incidence == 0 ) { |
4455 | updateView(); | 4521 | updateView(); |
4456 | emit updateSearchDialog(); | 4522 | emit updateSearchDialog(); |
4457 | return; | 4523 | return; |
4458 | } | 4524 | } |
4459 | if ( incidence ) { | 4525 | if ( incidence ) { |
4460 | DeleteIncidenceVisitor v; | 4526 | DeleteIncidenceVisitor v; |
4461 | v.act( incidence, this ); | 4527 | v.act( incidence, this ); |
4462 | } | 4528 | } |
4463 | } | 4529 | } |
4464 | 4530 | ||
4465 | 4531 | ||
4466 | void CalendarView::lookForOutgoingMessages() | 4532 | void CalendarView::lookForOutgoingMessages() |
4467 | { | 4533 | { |
4468 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); | 4534 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); |
4469 | ogd->loadMessages(); | 4535 | ogd->loadMessages(); |
4470 | } | 4536 | } |
4471 | 4537 | ||
4472 | void CalendarView::lookForIncomingMessages() | 4538 | void CalendarView::lookForIncomingMessages() |
4473 | { | 4539 | { |
4474 | IncomingDialog *icd = mDialogManager->incomingDialog(); | 4540 | IncomingDialog *icd = mDialogManager->incomingDialog(); |
4475 | icd->retrieve(); | 4541 | icd->retrieve(); |
4476 | } | 4542 | } |
4477 | 4543 | ||
4478 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 4544 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
4479 | { | 4545 | { |
4480 | bool deleteTodo = true; | 4546 | bool deleteTodo = true; |
4481 | QPtrList<Incidence> subTodos; | 4547 | QPtrList<Incidence> subTodos; |
4482 | Incidence *aTodo; | 4548 | Incidence *aTodo; |
4483 | subTodos = t->relations(); | 4549 | subTodos = t->relations(); |
4484 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 4550 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
4485 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 4551 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
4486 | deleteTodo = false; | 4552 | deleteTodo = false; |
4487 | } | 4553 | } |
4488 | if ( deleteTodo ) { | 4554 | if ( deleteTodo ) { |
4489 | if ( t->isCompleted() && !t->doesRecur()) { | 4555 | if ( t->isCompleted() && !t->doesRecur()) { |
4490 | checkExternalId( t ); | 4556 | checkExternalId( t ); |
4491 | mCalendar->deleteTodo( t ); | 4557 | mCalendar->deleteTodo( t ); |
4492 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 4558 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
4493 | } | 4559 | } |
4494 | else | 4560 | else |
4495 | deleteTodo = false; | 4561 | deleteTodo = false; |
4496 | } | 4562 | } |
4497 | return deleteTodo; | 4563 | return deleteTodo; |
4498 | 4564 | ||
4499 | } | 4565 | } |
4500 | void CalendarView::purgeCompleted() | 4566 | void CalendarView::purgeCompleted() |
4501 | { | 4567 | { |
4502 | int result = KMessageBox::warningContinueCancel(this, | 4568 | int result = KMessageBox::warningContinueCancel(this, |
4503 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); | 4569 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); |
4504 | 4570 | ||
4505 | if (result == KMessageBox::Continue) { | 4571 | if (result == KMessageBox::Continue) { |
4506 | 4572 | ||
4507 | QPtrList<Todo> todoCal; | 4573 | QPtrList<Todo> todoCal; |
4508 | QPtrList<Todo> rootTodos; | 4574 | QPtrList<Todo> rootTodos; |
4509 | //QPtrList<Incidence> rel; | 4575 | //QPtrList<Incidence> rel; |
4510 | Todo *aTodo; | 4576 | Todo *aTodo; |
4511 | todoCal = calendar()->todos(); | 4577 | todoCal = calendar()->todos(); |
4512 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 4578 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
4513 | if ( !aTodo->relatedTo() ) | 4579 | if ( !aTodo->relatedTo() ) |
4514 | rootTodos.append( aTodo ); | 4580 | rootTodos.append( aTodo ); |
4515 | } | 4581 | } |
4516 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 4582 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
4517 | removeCompletedSubTodos( aTodo ); | 4583 | removeCompletedSubTodos( aTodo ); |
4518 | } | 4584 | } |
4519 | 4585 | ||
4520 | updateView(); | 4586 | updateView(); |
4521 | } | 4587 | } |
4522 | } | 4588 | } |
4523 | 4589 | ||
4524 | void CalendarView::slotCalendarChanged() | 4590 | void CalendarView::slotCalendarChanged() |
4525 | { | 4591 | { |
4526 | ; | 4592 | ; |
4527 | } | 4593 | } |
4528 | 4594 | ||
4529 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 4595 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
4530 | { | 4596 | { |
4531 | //qDebug(" alendarView::keyPressEvent "); | 4597 | //qDebug(" alendarView::keyPressEvent "); |
4532 | e->ignore(); | 4598 | e->ignore(); |
4533 | } | 4599 | } |
4534 | 4600 | ||
4535 | 4601 | ||
4536 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4602 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4537 | { | 4603 | { |
4538 | 4604 | ||
4539 | if ( manager != mSyncManager) | 4605 | if ( manager != mSyncManager) |
4540 | qDebug("KO: Internal error-1. SyncManager mismatch "); | 4606 | qDebug("KO: Internal error-1. SyncManager mismatch "); |
4541 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4607 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4542 | qDebug("KO: SyncKDE request detected!"); | 4608 | qDebug("KO: SyncKDE request detected!"); |
4543 | } | 4609 | } |
4544 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4610 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4545 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4611 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4546 | return syncCalendar( filename, mode ); | 4612 | return syncCalendar( filename, mode ); |
4547 | } | 4613 | } |
4548 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4614 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4549 | { | 4615 | { |
4550 | //mSyncManager = manager; | 4616 | //mSyncManager = manager; |
4551 | if ( manager != mSyncManager) | 4617 | if ( manager != mSyncManager) |
4552 | qDebug("KO: Internal error-2. SyncManager mismatch "); | 4618 | qDebug("KO: Internal error-2. SyncManager mismatch "); |
4553 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4619 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4554 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4620 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4555 | if ( resource == "sharp" ) | 4621 | if ( resource == "sharp" ) |
4556 | syncExternal( 0 ); | 4622 | syncExternal( 0 ); |
4557 | if ( resource == "phone" ) | 4623 | if ( resource == "phone" ) |
4558 | syncExternal( 1 ); | 4624 | syncExternal( 1 ); |
4559 | // pending setmodified | 4625 | // pending setmodified |
4560 | return true; | 4626 | return true; |
4561 | } | 4627 | } |
4562 | void CalendarView::setSyncManager(KSyncManager* manager) | 4628 | void CalendarView::setSyncManager(KSyncManager* manager) |
4563 | { | 4629 | { |
4564 | mSyncManager = manager; | 4630 | mSyncManager = manager; |
4565 | } | 4631 | } |
4566 | 4632 | ||
4567 | void CalendarView::removeSyncInfo( QString syncProfile) | 4633 | void CalendarView::removeSyncInfo( QString syncProfile) |
4568 | { | 4634 | { |
4569 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4635 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4570 | mCalendar->removeSyncInfo( syncProfile ); | 4636 | mCalendar->removeSyncInfo( syncProfile ); |
4571 | 4637 | ||
4572 | } | 4638 | } |
4573 | 4639 | ||
4574 | void CalendarView::undo_delete() | 4640 | void CalendarView::undo_delete() |
4575 | { | 4641 | { |
4576 | //qDebug("undo_delete() "); | 4642 | //qDebug("undo_delete() "); |
4577 | Incidence* undo = mCalendar->undoIncidence(); | 4643 | Incidence* undo = mCalendar->undoIncidence(); |
4578 | if ( !undo ) { | 4644 | if ( !undo ) { |
4579 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4645 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4580 | i18n("KO/Pi")); | 4646 | i18n("KO/Pi")); |
4581 | return; | 4647 | return; |
4582 | } | 4648 | } |
4583 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | 4649 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + |
4584 | i18n("\nAre you sure you want\nto restore this?"), | 4650 | i18n("\nAre you sure you want\nto restore this?"), |
4585 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 4651 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
4586 | mCalendar->undoDeleteIncidence(); | 4652 | mCalendar->undoDeleteIncidence(); |
4587 | updateView(); | 4653 | updateView(); |
4588 | } | 4654 | } |
4589 | } | 4655 | } |
4590 | 4656 | ||
4591 | void CalendarView::slotViewerClosed() | 4657 | void CalendarView::slotViewerClosed() |
4592 | { | 4658 | { |
4593 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 4659 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
4594 | } | 4660 | } |
4595 | 4661 | ||
4596 | void CalendarView::resetFocus() | 4662 | void CalendarView::resetFocus() |
4597 | { | 4663 | { |
4598 | if ( mViewerCallerIsSearchDialog ) { | 4664 | if ( mViewerCallerIsSearchDialog ) { |
4599 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 4665 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
4600 | mDialogManager->getSearchDialog()->raise(); | 4666 | mDialogManager->getSearchDialog()->raise(); |
4601 | mDialogManager->getSearchDialog()->setActiveWindow(); | 4667 | mDialogManager->getSearchDialog()->setActiveWindow(); |
4602 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 4668 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
4603 | } else | 4669 | } else |
4604 | mViewerCallerIsSearchDialog = false; | 4670 | mViewerCallerIsSearchDialog = false; |
4605 | } | 4671 | } |
4606 | if ( !mViewerCallerIsSearchDialog ) { | 4672 | if ( !mViewerCallerIsSearchDialog ) { |
4607 | //mViewManager->currentView()->setFocus(); | 4673 | //mViewManager->currentView()->setFocus(); |
4608 | //qDebug("sssssssssssssssset focus "); | 4674 | //qDebug("sssssssssssssssset focus "); |
4609 | topLevelWidget()->raise(); | 4675 | topLevelWidget()->raise(); |
4610 | setActiveWindow(); | 4676 | setActiveWindow(); |
4611 | //setFocus(); | 4677 | //setFocus(); |
4612 | } | 4678 | } |
4613 | mViewerCallerIsSearchDialog = false; | 4679 | mViewerCallerIsSearchDialog = false; |
4614 | } | 4680 | } |
4615 | 4681 | ||
4616 | void CalendarView::showNextAlarms() | 4682 | void CalendarView::showNextAlarms() |
4617 | { | 4683 | { |
4618 | QString message; | 4684 | QString message; |
4619 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 4685 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
4620 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 4686 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { |
4621 | QString sum = mCalendar->nextSummary(); | 4687 | QString sum = mCalendar->nextSummary(); |
4622 | QDateTime nextA = mNextAlarmDateTime; | 4688 | QDateTime nextA = mNextAlarmDateTime; |
4623 | QDateTime cur = QDateTime::currentDateTime(); | 4689 | QDateTime cur = QDateTime::currentDateTime(); |
4624 | int secs = cur.secsTo( nextA ); | 4690 | int secs = cur.secsTo( nextA ); |
4625 | int min = secs /60; | 4691 | int min = secs /60; |
4626 | int hours = min /60; | 4692 | int hours = min /60; |
4627 | min = min % 60; | 4693 | min = min % 60; |
4628 | int days = hours /24; | 4694 | int days = hours /24; |
4629 | hours = hours % 24; | 4695 | hours = hours % 24; |
4630 | 4696 | ||
4631 | //message = i18n("The next alarm is in:\n"); | 4697 | //message = i18n("The next alarm is in:\n"); |
4632 | if ( days > 1 ) | 4698 | if ( days > 1 ) |
4633 | message += i18n("%1 days\n").arg( days ); | 4699 | message += i18n("%1 days\n").arg( days ); |
4634 | else if ( days == 1 ) | 4700 | else if ( days == 1 ) |
4635 | message += i18n("1 day\n"); | 4701 | message += i18n("1 day\n"); |
4636 | if ( hours > 1 ) | 4702 | if ( hours > 1 ) |
4637 | message += i18n("%1 hours\n").arg( hours ); | 4703 | message += i18n("%1 hours\n").arg( hours ); |
4638 | else if ( hours == 1 ) | 4704 | else if ( hours == 1 ) |
4639 | message += i18n("1 hour\n"); | 4705 | message += i18n("1 hour\n"); |
4640 | if ( min > 1 ) | 4706 | if ( min > 1 ) |
4641 | message += i18n("%1 minutes\n").arg( min ); | 4707 | message += i18n("%1 minutes\n").arg( min ); |
4642 | else if ( min == 1 ) | 4708 | else if ( min == 1 ) |
4643 | message += i18n("1 minute\n"); | 4709 | message += i18n("1 minute\n"); |
4644 | if ( message.isEmpty() ) | 4710 | if ( message.isEmpty() ) |
4645 | message = i18n("The next alarm is in\nless than one minute!"); | 4711 | message = i18n("The next alarm is in\nless than one minute!"); |
4646 | else | 4712 | else |
4647 | message = i18n("The next alarm is in:\n") + message; | 4713 | message = i18n("The next alarm is in:\n") + message; |
4648 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | 4714 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; |
4649 | } else { | 4715 | } else { |
4650 | message = i18n("There is no next alarm."); | 4716 | message = i18n("There is no next alarm."); |
4651 | 4717 | ||
4652 | } | 4718 | } |
4653 | #ifdef DESKTOP_VERSION | 4719 | #ifdef DESKTOP_VERSION |
4654 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 4720 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
4655 | message += i18n("\nThe internal alarm notification is disabled!\n"); | 4721 | message += i18n("\nThe internal alarm notification is disabled!\n"); |
4656 | message += i18n("Enable it in the settings menu, TAB alarm."); | 4722 | message += i18n("Enable it in the settings menu, TAB alarm."); |
4657 | } | 4723 | } |
4658 | 4724 | ||
4659 | #endif | 4725 | #endif |
4660 | KMessageBox::information( this, message); | 4726 | KMessageBox::information( this, message); |
4661 | } | 4727 | } |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index a5f230a..51eb1d4 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -1,458 +1,462 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000, 2001 | 3 | Copyright (c) 2000, 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef CALENDARVIEW_H | 24 | #ifndef CALENDARVIEW_H |
25 | #define CALENDARVIEW_H | 25 | #define CALENDARVIEW_H |
26 | 26 | ||
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #include <qptrlist.h> | 30 | #include <qptrlist.h> |
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #include <qscrollbar.h> | 33 | #include <qscrollbar.h> |
34 | #ifndef DESKTOP_VERSION | 34 | #ifndef DESKTOP_VERSION |
35 | #include <qtopia/ir.h> | 35 | #include <qtopia/ir.h> |
36 | #else | 36 | #else |
37 | #define Ir char | 37 | #define Ir char |
38 | #endif | 38 | #endif |
39 | #include <libkcal/calendar.h> | 39 | #include <libkcal/calendar.h> |
40 | #include <libkcal/scheduler.h> | 40 | #include <libkcal/scheduler.h> |
41 | #include <libkcal/calendarresources.h> | 41 | #include <libkcal/calendarresources.h> |
42 | #include <libkcal/resourcecalendar.h> | 42 | #include <libkcal/resourcecalendar.h> |
43 | #include <KDGanttMinimizeSplitter.h> | 43 | #include <KDGanttMinimizeSplitter.h> |
44 | 44 | ||
45 | #include <korganizer/calendarviewbase.h> | 45 | #include <korganizer/calendarviewbase.h> |
46 | 46 | ||
47 | #include <ksyncmanager.h> | 47 | #include <ksyncmanager.h> |
48 | //#include <koprefs.h> | 48 | //#include <koprefs.h> |
49 | 49 | ||
50 | class QWidgetStack; | 50 | class QWidgetStack; |
51 | class QSplitter; | 51 | class QSplitter; |
52 | class KopiCalendarFile; | 52 | class KopiCalendarFile; |
53 | class CalPrinter; | 53 | class CalPrinter; |
54 | class KOFilterView; | 54 | class KOFilterView; |
55 | class KOCalEditView; | 55 | class KOCalEditView; |
56 | class KOViewManager; | 56 | class KOViewManager; |
57 | class KODialogManager; | 57 | class KODialogManager; |
58 | class KOTodoView; | 58 | class KOTodoView; |
59 | class KDateNavigator; | 59 | class KDateNavigator; |
60 | class DateNavigatorContainer; | 60 | class DateNavigatorContainer; |
61 | class DateNavigator; | 61 | class DateNavigator; |
62 | class KOIncidenceEditor; | 62 | class KOIncidenceEditor; |
63 | class KDatePicker; | 63 | class KDatePicker; |
64 | class ResourceView; | 64 | class ResourceView; |
65 | class KOEventEditor; | 65 | class KOEventEditor; |
66 | class KOTodoEditor ; | 66 | class KOTodoEditor ; |
67 | class KOEventViewerDialog; | 67 | class KOEventViewerDialog; |
68 | class KOBeamPrefs; | 68 | class KOBeamPrefs; |
69 | class KSyncProfile; | 69 | class KSyncProfile; |
70 | class AlarmDialog; | 70 | class AlarmDialog; |
71 | class KCal::Attendee; | 71 | class KCal::Attendee; |
72 | 72 | ||
73 | namespace KCal { class FileStorage; } | 73 | namespace KCal { class FileStorage; } |
74 | 74 | ||
75 | using namespace KCal; | 75 | using namespace KCal; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | This is the main calendar widget. It provides the different vies on t he | 78 | This is the main calendar widget. It provides the different vies on t he |
79 | calendar data as well as the date navigator. It also handles synchronisation | 79 | calendar data as well as the date navigator. It also handles synchronisation |
80 | of the different views and controls the different dialogs like preferences, | 80 | of the different views and controls the different dialogs like preferences, |
81 | event editor, search dialog etc. | 81 | event editor, search dialog etc. |
82 | 82 | ||
83 | @short main calendar view widget | 83 | @short main calendar view widget |
84 | @author Cornelius Schumacher | 84 | @author Cornelius Schumacher |
85 | */ | 85 | */ |
86 | 86 | ||
87 | #include <qtextbrowser.h> | 87 | #include <qtextbrowser.h> |
88 | #include <qtextcodec.h> | 88 | #include <qtextcodec.h> |
89 | 89 | ||
90 | class MissedAlarmTextBrowser : public QTextBrowser { | 90 | class MissedAlarmTextBrowser : public QTextBrowser { |
91 | Q_OBJECT | 91 | Q_OBJECT |
92 | public: | 92 | public: |
93 | MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); | 93 | MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); |
94 | ~MissedAlarmTextBrowser(); | 94 | ~MissedAlarmTextBrowser(); |
95 | void setSource(const QString & n); | 95 | void setSource(const QString & n); |
96 | 96 | ||
97 | private: | 97 | private: |
98 | Incidence * getNextInc(QDateTime start ); | 98 | Incidence * getNextInc(QDateTime start ); |
99 | QPtrList<Incidence> mAlarms; | 99 | QPtrList<Incidence> mAlarms; |
100 | signals: | 100 | signals: |
101 | void showIncidence( QString uid); | 101 | void showIncidence( QString uid); |
102 | }; | 102 | }; |
103 | 103 | ||
104 | 104 | ||
105 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 105 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
106 | { | 106 | { |
107 | Q_OBJECT | 107 | Q_OBJECT |
108 | public: | 108 | public: |
109 | /** | 109 | /** |
110 | Constructs a new calendar view widget. | 110 | Constructs a new calendar view widget. |
111 | 111 | ||
112 | @param calendar calendar document | 112 | @param calendar calendar document |
113 | @param parent parent window | 113 | @param parent parent window |
114 | @param name Qt internal widget object name | 114 | @param name Qt internal widget object name |
115 | */ | 115 | */ |
116 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 116 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
117 | const char *name = 0 ); | 117 | const char *name = 0 ); |
118 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 118 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
119 | const char *name = 0 ); | 119 | const char *name = 0 ); |
120 | virtual ~CalendarView(); | 120 | virtual ~CalendarView(); |
121 | 121 | ||
122 | Calendar *calendar() { return mCalendar; } | 122 | Calendar *calendar() { return mCalendar; } |
123 | 123 | ||
124 | KOViewManager *viewManager(); | 124 | KOViewManager *viewManager(); |
125 | KODialogManager *dialogManager(); | 125 | KODialogManager *dialogManager(); |
126 | 126 | ||
127 | QDate startDate(); | 127 | QDate startDate(); |
128 | QDate endDate(); | 128 | QDate endDate(); |
129 | 129 | ||
130 | QWidgetStack *viewStack(); | 130 | QWidgetStack *viewStack(); |
131 | QWidget *leftFrame(); | 131 | QWidget *leftFrame(); |
132 | 132 | ||
133 | DateNavigator *dateNavigator(); | 133 | DateNavigator *dateNavigator(); |
134 | KDateNavigator *dateNavigatorWidget(); | 134 | KDateNavigator *dateNavigatorWidget(); |
135 | 135 | ||
136 | void addView(KOrg::BaseView *); | 136 | void addView(KOrg::BaseView *); |
137 | void showView(KOrg::BaseView *); | 137 | void showView(KOrg::BaseView *); |
138 | KOEventViewerDialog* getEventViewerDialog(); | 138 | KOEventViewerDialog* getEventViewerDialog(); |
139 | Incidence *currentSelection(); | 139 | Incidence *currentSelection(); |
140 | void checkSuspendAlarm(); | 140 | void checkSuspendAlarm(); |
141 | 141 | ||
142 | signals: | 142 | signals: |
143 | void save (); | 143 | void save (); |
144 | void saveStopTimer (); | 144 | void saveStopTimer (); |
145 | void tempDisableBR(bool); | 145 | void tempDisableBR(bool); |
146 | /** This todo has been modified */ | 146 | /** This todo has been modified */ |
147 | void todoModified(Todo *, int); | 147 | void todoModified(Todo *, int); |
148 | 148 | ||
149 | /** when change is made to options dialog, the topwidget will catch this | 149 | /** when change is made to options dialog, the topwidget will catch this |
150 | * and emit this signal which notifies all widgets which have registered | 150 | * and emit this signal which notifies all widgets which have registered |
151 | * for notification to update their settings. */ | 151 | * for notification to update their settings. */ |
152 | void configChanged(); | 152 | void configChanged(); |
153 | /** emitted when the topwidget is closing down, so that any attached | 153 | /** emitted when the topwidget is closing down, so that any attached |
154 | child windows can also close. */ | 154 | child windows can also close. */ |
155 | void closingDown(); | 155 | void closingDown(); |
156 | /** emitted right before we die */ | 156 | /** emitted right before we die */ |
157 | void closed(QWidget *); | 157 | void closed(QWidget *); |
158 | 158 | ||
159 | /** Emitted when state of modified flag changes */ | 159 | /** Emitted when state of modified flag changes */ |
160 | void modifiedChanged(bool); | 160 | void modifiedChanged(bool); |
161 | void signalmodified(); | 161 | void signalmodified(); |
162 | 162 | ||
163 | /** Emitted when state of read-only flag changes */ | 163 | /** Emitted when state of read-only flag changes */ |
164 | void readOnlyChanged(bool); | 164 | void readOnlyChanged(bool); |
165 | 165 | ||
166 | /** Emitted when the unit of navigation changes */ | 166 | /** Emitted when the unit of navigation changes */ |
167 | void changeNavStringPrev(const QString &); | 167 | void changeNavStringPrev(const QString &); |
168 | void changeNavStringNext(const QString &); | 168 | void changeNavStringNext(const QString &); |
169 | 169 | ||
170 | /** Emitted when state of events selection has changed and user is organizer*/ | 170 | /** Emitted when state of events selection has changed and user is organizer*/ |
171 | void organizerEventsSelected(bool); | 171 | void organizerEventsSelected(bool); |
172 | /** Emitted when state of events selection has changed and user is attendee*/ | 172 | /** Emitted when state of events selection has changed and user is attendee*/ |
173 | void groupEventsSelected(bool); | 173 | void groupEventsSelected(bool); |
174 | /** | 174 | /** |
175 | Emitted when an incidence gets selected. If the selection is cleared the | 175 | Emitted when an incidence gets selected. If the selection is cleared the |
176 | signal is emitted with 0 as argument. | 176 | signal is emitted with 0 as argument. |
177 | */ | 177 | */ |
178 | void incidenceSelected( Incidence * ); | 178 | void incidenceSelected( Incidence * ); |
179 | /** Emitted, when a todoitem is selected or deselected. */ | 179 | /** Emitted, when a todoitem is selected or deselected. */ |
180 | void todoSelected( bool ); | 180 | void todoSelected( bool ); |
181 | 181 | ||
182 | /** | 182 | /** |
183 | Emitted, when clipboard content changes. Parameter indicates if paste | 183 | Emitted, when clipboard content changes. Parameter indicates if paste |
184 | is possible or not. | 184 | is possible or not. |
185 | */ | 185 | */ |
186 | void pasteEnabled(bool); | 186 | void pasteEnabled(bool); |
187 | 187 | ||
188 | /** Emitted, when the number of incoming messages has changed. */ | 188 | /** Emitted, when the number of incoming messages has changed. */ |
189 | void numIncomingChanged(int); | 189 | void numIncomingChanged(int); |
190 | 190 | ||
191 | /** Emitted, when the number of outgoing messages has changed. */ | 191 | /** Emitted, when the number of outgoing messages has changed. */ |
192 | void numOutgoingChanged(int); | 192 | void numOutgoingChanged(int); |
193 | 193 | ||
194 | /** Send status message, which can e.g. be displayed in the status bar. */ | 194 | /** Send status message, which can e.g. be displayed in the status bar. */ |
195 | void statusMessage(const QString &); | 195 | void statusMessage(const QString &); |
196 | 196 | ||
197 | void calendarViewExpanded( bool ); | 197 | void calendarViewExpanded( bool ); |
198 | void updateSearchDialog(); | 198 | void updateSearchDialog(); |
199 | void filtersUpdated(); | 199 | void filtersUpdated(); |
200 | 200 | ||
201 | 201 | ||
202 | public slots: | 202 | public slots: |
203 | void nextConflict( bool all, bool allday ); | ||
204 | void conflictAll(); | ||
205 | void conflictAllday(); | ||
206 | void conflictNotAll(); | ||
203 | void setCalReadOnly( int id, bool readO ); | 207 | void setCalReadOnly( int id, bool readO ); |
204 | void checkAlarms(); | 208 | void checkAlarms(); |
205 | void checkFiles(); | 209 | void checkFiles(); |
206 | void slotprintSelInc(); | 210 | void slotprintSelInc(); |
207 | void showNextAlarms(); | 211 | void showNextAlarms(); |
208 | void showOpenError(); | 212 | void showOpenError(); |
209 | void watchSavedFile(); | 213 | void watchSavedFile(); |
210 | void recheckTimerAlarm(); | 214 | void recheckTimerAlarm(); |
211 | void checkNextTimerAlarm(); | 215 | void checkNextTimerAlarm(); |
212 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 216 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
213 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 217 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
214 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 218 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
215 | 219 | ||
216 | /** options dialog made a changed to the configuration. we catch this | 220 | /** options dialog made a changed to the configuration. we catch this |
217 | * and notify all widgets which need to update their configuration. */ | 221 | * and notify all widgets which need to update their configuration. */ |
218 | void updateConfig(); | 222 | void updateConfig(); |
219 | 223 | ||
220 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 224 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
221 | const QStringList& anniversaryList, const QStringList& realNameList, | 225 | const QStringList& anniversaryList, const QStringList& realNameList, |
222 | const QStringList& emailList, const QStringList& assembledNameList, | 226 | const QStringList& emailList, const QStringList& assembledNameList, |
223 | const QStringList& uidList); | 227 | const QStringList& uidList); |
224 | 228 | ||
225 | /** | 229 | /** |
226 | Load calendar from file \a filename. If \a merge is true, load | 230 | Load calendar from file \a filename. If \a merge is true, load |
227 | calendar into existing one, if it is false, clear calendar, before | 231 | calendar into existing one, if it is false, clear calendar, before |
228 | loading. Return true, if calendar could be successfully loaded. | 232 | loading. Return true, if calendar could be successfully loaded. |
229 | */ | 233 | */ |
230 | bool openCalendar(QString filename, bool merge=false); | 234 | bool openCalendar(QString filename, bool merge=false); |
231 | bool loadCalendars(); | 235 | bool loadCalendars(); |
232 | bool saveCalendars(); | 236 | bool saveCalendars(); |
233 | bool restoreCalendarSettings(); | 237 | bool restoreCalendarSettings(); |
234 | bool addCalendar( KopiCalendarFile * ); | 238 | bool addCalendar( KopiCalendarFile * ); |
235 | void addCalendarId( int id ); | 239 | void addCalendarId( int id ); |
236 | bool syncCalendar(QString filename,int mode = 0 ); | 240 | bool syncCalendar(QString filename,int mode = 0 ); |
237 | 241 | ||
238 | /** | 242 | /** |
239 | Save calendar data to file. Return true if calendar could be | 243 | Save calendar data to file. Return true if calendar could be |
240 | successfully saved. | 244 | successfully saved. |
241 | */ | 245 | */ |
242 | bool saveCalendar(QString filename); | 246 | bool saveCalendar(QString filename); |
243 | 247 | ||
244 | /** | 248 | /** |
245 | Close calendar. Clear calendar data and reset views to display an empty | 249 | Close calendar. Clear calendar data and reset views to display an empty |
246 | calendar. | 250 | calendar. |
247 | */ | 251 | */ |
248 | void closeCalendar(); | 252 | void closeCalendar(); |
249 | 253 | ||
250 | /** Archive old events of calendar */ | 254 | /** Archive old events of calendar */ |
251 | void archiveCalendar(); | 255 | void archiveCalendar(); |
252 | 256 | ||
253 | void showIncidence(); | 257 | void showIncidence(); |
254 | void editIncidence(); | 258 | void editIncidence(); |
255 | void editIncidenceDescription(); | 259 | void editIncidenceDescription(); |
256 | void deleteIncidence(); | 260 | void deleteIncidence(); |
257 | void cloneIncidence(); | 261 | void cloneIncidence(); |
258 | void moveIncidence(); | 262 | void moveIncidence(); |
259 | void beamIncidence(); | 263 | void beamIncidence(); |
260 | void toggleCancelIncidence(); | 264 | void toggleCancelIncidence(); |
261 | 265 | ||
262 | /** create an editeventwin with supplied date/time, and if bool is true, | 266 | /** create an editeventwin with supplied date/time, and if bool is true, |
263 | * make the event take all day. */ | 267 | * make the event take all day. */ |
264 | void newEvent(QDateTime, QDateTime, bool allDay ); | 268 | void newEvent(QDateTime, QDateTime, bool allDay ); |
265 | void newEvent(QDateTime, QDateTime); | 269 | void newEvent(QDateTime, QDateTime); |
266 | void newEvent(QDateTime fh); | 270 | void newEvent(QDateTime fh); |
267 | void newEvent(QDate dt); | 271 | void newEvent(QDate dt); |
268 | /** create new event without having a date hint. Takes current date as | 272 | /** create new event without having a date hint. Takes current date as |
269 | default hint. */ | 273 | default hint. */ |
270 | void newEvent(); | 274 | void newEvent(); |
271 | void newFloatingEvent(); | 275 | void newFloatingEvent(); |
272 | 276 | ||
273 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 277 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
274 | void showIncidence(Incidence *); | 278 | void showIncidence(Incidence *); |
275 | void showIncidence(QString uid); | 279 | void showIncidence(QString uid); |
276 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 280 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
277 | void editIncidence(Incidence *); | 281 | void editIncidence(Incidence *); |
278 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 282 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
279 | void deleteIncidence(Incidence *); | 283 | void deleteIncidence(Incidence *); |
280 | void cloneIncidence(Incidence *); | 284 | void cloneIncidence(Incidence *); |
281 | void cancelIncidence(Incidence *); | 285 | void cancelIncidence(Incidence *); |
282 | /** Create an editor for the supplied event. */ | 286 | /** Create an editor for the supplied event. */ |
283 | void editEvent(Event *); | 287 | void editEvent(Event *); |
284 | /** Delete the supplied event. */ | 288 | /** Delete the supplied event. */ |
285 | void deleteEvent(Event *); | 289 | void deleteEvent(Event *); |
286 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 290 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
287 | found. */ | 291 | found. */ |
288 | bool deleteEvent(const QString &uid); | 292 | bool deleteEvent(const QString &uid); |
289 | /** Create a read-only viewer dialog for the supplied event. */ | 293 | /** Create a read-only viewer dialog for the supplied event. */ |
290 | void showEvent(Event *); | 294 | void showEvent(Event *); |
291 | 295 | ||
292 | void editJournal(Journal *); | 296 | void editJournal(Journal *); |
293 | void showJournal(Journal *); | 297 | void showJournal(Journal *); |
294 | void deleteJournal(Journal *); | 298 | void deleteJournal(Journal *); |
295 | /** Create an editor dialog for a todo */ | 299 | /** Create an editor dialog for a todo */ |
296 | void editTodo(Todo *); | 300 | void editTodo(Todo *); |
297 | /** Create a read-only viewer dialog for the supplied todo */ | 301 | /** Create a read-only viewer dialog for the supplied todo */ |
298 | void showTodo(Todo *); | 302 | void showTodo(Todo *); |
299 | /** create new todo */ | 303 | /** create new todo */ |
300 | void newTodo(); | 304 | void newTodo(); |
301 | void newTodoDateTime(QDateTime, bool allday); | 305 | void newTodoDateTime(QDateTime, bool allday); |
302 | /** create new todo with a parent todo */ | 306 | /** create new todo with a parent todo */ |
303 | void newSubTodo(); | 307 | void newSubTodo(); |
304 | /** create new todo with a parent todo */ | 308 | /** create new todo with a parent todo */ |
305 | void newSubTodo(Todo *); | 309 | void newSubTodo(Todo *); |
306 | /** Delete todo */ | 310 | /** Delete todo */ |
307 | void deleteTodo(Todo *); | 311 | void deleteTodo(Todo *); |
308 | 312 | ||
309 | 313 | ||
310 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is | 314 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is |
311 | * emitted as result. */ | 315 | * emitted as result. */ |
312 | void checkClipboard(); | 316 | void checkClipboard(); |
313 | 317 | ||
314 | /** using the KConfig associated with the kapp variable, read in the | 318 | /** using the KConfig associated with the kapp variable, read in the |
315 | * settings from the config file. | 319 | * settings from the config file. |
316 | */ | 320 | */ |
317 | void readSettings(); | 321 | void readSettings(); |
318 | 322 | ||
319 | /** write current state to config file. */ | 323 | /** write current state to config file. */ |
320 | void writeSettings(); | 324 | void writeSettings(); |
321 | 325 | ||
322 | /** read settings for calendar filters */ | 326 | /** read settings for calendar filters */ |
323 | void readFilterSettings(KConfig *config); | 327 | void readFilterSettings(KConfig *config); |
324 | 328 | ||
325 | /** write settings for calendar filters */ | 329 | /** write settings for calendar filters */ |
326 | void writeFilterSettings(KConfig *config); | 330 | void writeFilterSettings(KConfig *config); |
327 | 331 | ||
328 | /** passes on the message that an event has changed to the currently | 332 | /** passes on the message that an event has changed to the currently |
329 | * activated view so that it can make appropriate display changes. */ | 333 | * activated view so that it can make appropriate display changes. */ |
330 | void changeEventDisplay(Event *, int); | 334 | void changeEventDisplay(Event *, int); |
331 | void changeIncidenceDisplay(Incidence *, int); | 335 | void changeIncidenceDisplay(Incidence *, int); |
332 | void changeTodoDisplay(Todo *, int); | 336 | void changeTodoDisplay(Todo *, int); |
333 | 337 | ||
334 | void eventAdded(Event *); | 338 | void eventAdded(Event *); |
335 | void eventChanged(Event *); | 339 | void eventChanged(Event *); |
336 | void eventToBeDeleted(Event *); | 340 | void eventToBeDeleted(Event *); |
337 | void eventDeleted(); | 341 | void eventDeleted(); |
338 | 342 | ||
339 | void todoAdded(Todo *); | 343 | void todoAdded(Todo *); |
340 | void todoChanged(Todo *); | 344 | void todoChanged(Todo *); |
341 | void todoToBeDeleted(Todo *); | 345 | void todoToBeDeleted(Todo *); |
342 | void todoDeleted(); | 346 | void todoDeleted(); |
343 | 347 | ||
344 | void updateView(const QDate &start, const QDate &end); | 348 | void updateView(const QDate &start, const QDate &end); |
345 | void updateView(); | 349 | void updateView(); |
346 | void clearAllViews(); | 350 | void clearAllViews(); |
347 | 351 | ||
348 | /** Full update of visible todo views */ | 352 | /** Full update of visible todo views */ |
349 | void updateTodoViews(); | 353 | void updateTodoViews(); |
350 | 354 | ||
351 | void updateUnmanagedViews(); | 355 | void updateUnmanagedViews(); |
352 | 356 | ||
353 | /** cut the current appointment to the clipboard */ | 357 | /** cut the current appointment to the clipboard */ |
354 | void edit_cut(); | 358 | void edit_cut(); |
355 | 359 | ||
356 | /** copy the current appointment(s) to the clipboard */ | 360 | /** copy the current appointment(s) to the clipboard */ |
357 | void edit_copy(); | 361 | void edit_copy(); |
358 | 362 | ||
359 | /** paste the current vobject(s) in the clipboard buffer into calendar */ | 363 | /** paste the current vobject(s) in the clipboard buffer into calendar */ |
360 | void edit_paste(); | 364 | void edit_paste(); |
361 | 365 | ||
362 | /** edit viewing and configuration options. */ | 366 | /** edit viewing and configuration options. */ |
363 | void edit_options(); | 367 | void edit_options(); |
364 | void edit_global_options(); | 368 | void edit_global_options(); |
365 | /** | 369 | /** |
366 | Functions for printing, previewing a print, and setting up printing | 370 | Functions for printing, previewing a print, and setting up printing |
367 | parameters. | 371 | parameters. |
368 | */ | 372 | */ |
369 | void print(); | 373 | void print(); |
370 | void printSetup(); | 374 | void printSetup(); |
371 | void printPreview(); | 375 | void printPreview(); |
372 | 376 | ||
373 | /** Export as iCalendar file */ | 377 | /** Export as iCalendar file */ |
374 | void exportICalendar(); | 378 | void exportICalendar(); |
375 | 379 | ||
376 | /** Export as vCalendar file */ | 380 | /** Export as vCalendar file */ |
377 | bool exportVCalendar( QString fn); | 381 | bool exportVCalendar( QString fn); |
378 | 382 | ||
379 | /** pop up a dialog to show an existing appointment. */ | 383 | /** pop up a dialog to show an existing appointment. */ |
380 | void appointment_show(); | 384 | void appointment_show(); |
381 | /** | 385 | /** |
382 | * pop up an Appointment Dialog to edit an existing appointment.Get | 386 | * pop up an Appointment Dialog to edit an existing appointment.Get |
383 | * information on the appointment from the list of unique IDs that is | 387 | * information on the appointment from the list of unique IDs that is |
384 | * currently in the View, called currIds. | 388 | * currently in the View, called currIds. |
385 | */ | 389 | */ |
386 | void appointment_edit(); | 390 | void appointment_edit(); |
387 | /** | 391 | /** |
388 | * pop up dialog confirming deletion of currently selected event in the | 392 | * pop up dialog confirming deletion of currently selected event in the |
389 | * View. | 393 | * View. |
390 | */ | 394 | */ |
391 | void appointment_delete(); | 395 | void appointment_delete(); |
392 | 396 | ||
393 | /** mails the currently selected event to a particular user as a vCalendar | 397 | /** mails the currently selected event to a particular user as a vCalendar |
394 | attachment. */ | 398 | attachment. */ |
395 | void action_mail(); | 399 | void action_mail(); |
396 | 400 | ||
397 | /* frees a subtodo from it's relation */ | 401 | /* frees a subtodo from it's relation */ |
398 | void todo_unsub( Todo * ); | 402 | void todo_unsub( Todo * ); |
399 | void todo_resub( Todo * parent, Todo * sub ); | 403 | void todo_resub( Todo * parent, Todo * sub ); |
400 | 404 | ||
401 | /** Take ownership of selected event. */ | 405 | /** Take ownership of selected event. */ |
402 | void takeOverEvent(); | 406 | void takeOverEvent(); |
403 | 407 | ||
404 | /** Take ownership of all events in calendar. */ | 408 | /** Take ownership of all events in calendar. */ |
405 | void takeOverCalendar(); | 409 | void takeOverCalendar(); |
406 | 410 | ||
407 | /** query whether or not the calendar is "dirty". */ | 411 | /** query whether or not the calendar is "dirty". */ |
408 | bool isModified(); | 412 | bool isModified(); |
409 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ | 413 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ |
410 | void setModified(bool modified=true); | 414 | void setModified(bool modified=true); |
411 | 415 | ||
412 | /** query if the calendar is read-only. */ | 416 | /** query if the calendar is read-only. */ |
413 | bool isReadOnly(); | 417 | bool isReadOnly(); |
414 | /** set state of calendar to read-only */ | 418 | /** set state of calendar to read-only */ |
415 | void setReadOnly(bool readOnly=true); | 419 | void setReadOnly(bool readOnly=true); |
416 | 420 | ||
417 | void eventUpdated(Incidence *); | 421 | void eventUpdated(Incidence *); |
418 | 422 | ||
419 | /* iTIP scheduling actions */ | 423 | /* iTIP scheduling actions */ |
420 | void schedule_publish(Incidence *incidence = 0); | 424 | void schedule_publish(Incidence *incidence = 0); |
421 | void schedule_request(Incidence *incidence = 0); | 425 | void schedule_request(Incidence *incidence = 0); |
422 | void schedule_refresh(Incidence *incidence = 0); | 426 | void schedule_refresh(Incidence *incidence = 0); |
423 | void schedule_cancel(Incidence *incidence = 0); | 427 | void schedule_cancel(Incidence *incidence = 0); |
424 | void schedule_add(Incidence *incidence = 0); | 428 | void schedule_add(Incidence *incidence = 0); |
425 | void schedule_reply(Incidence *incidence = 0); | 429 | void schedule_reply(Incidence *incidence = 0); |
426 | void schedule_counter(Incidence *incidence = 0); | 430 | void schedule_counter(Incidence *incidence = 0); |
427 | void schedule_declinecounter(Incidence *incidence = 0); | 431 | void schedule_declinecounter(Incidence *incidence = 0); |
428 | void schedule_publish_freebusy(int daysToPublish = 30); | 432 | void schedule_publish_freebusy(int daysToPublish = 30); |
429 | 433 | ||
430 | void openAddressbook(); | 434 | void openAddressbook(); |
431 | 435 | ||
432 | void editFilters(); | 436 | void editFilters(); |
433 | void toggleFilerEnabled(); | 437 | void toggleFilerEnabled(); |
434 | QPtrList<CalFilter> filters(); | 438 | QPtrList<CalFilter> filters(); |
435 | void toggleFilter(); | 439 | void toggleFilter(); |
436 | void showFilter(bool visible); | 440 | void showFilter(bool visible); |
437 | void updateFilter(); | 441 | void updateFilter(); |
438 | void filterEdited(); | 442 | void filterEdited(); |
439 | void selectFilter( int ); | 443 | void selectFilter( int ); |
440 | KOFilterView *filterView(); | 444 | KOFilterView *filterView(); |
441 | 445 | ||
442 | void showIntro(); | 446 | void showIntro(); |
443 | 447 | ||
444 | /** Move the curdatepient view date to today */ | 448 | /** Move the curdatepient view date to today */ |
445 | void goToday(); | 449 | void goToday(); |
446 | 450 | ||
447 | /** Move to the next date(s) in the current view */ | 451 | /** Move to the next date(s) in the current view */ |
448 | void goNext(); | 452 | void goNext(); |
449 | 453 | ||
450 | /** Move to the previous date(s) in the current view */ | 454 | /** Move to the previous date(s) in the current view */ |
451 | void goPrevious(); | 455 | void goPrevious(); |
452 | /** Move to the next date(s) in the current view */ | 456 | /** Move to the next date(s) in the current view */ |
453 | void goNextMonth(); | 457 | void goNextMonth(); |
454 | 458 | ||
455 | /** Move to the previous date(s) in the current view */ | 459 | /** Move to the previous date(s) in the current view */ |
456 | void goPreviousMonth(); | 460 | void goPreviousMonth(); |
457 | 461 | ||
458 | void toggleExpand(); | 462 | void toggleExpand(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9c2ac82..bfae1b5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -406,854 +406,872 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
406 | updateFilterToolbar(); | 406 | updateFilterToolbar(); |
407 | updateWeek( mView->startDate() ); | 407 | updateWeek( mView->startDate() ); |
408 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 408 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
409 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 409 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
410 | mBRdisabled = false; | 410 | mBRdisabled = false; |
411 | //toggleBeamReceive(); | 411 | //toggleBeamReceive(); |
412 | 412 | ||
413 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 413 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); |
414 | } | 414 | } |
415 | MainWindow::~MainWindow() | 415 | MainWindow::~MainWindow() |
416 | { | 416 | { |
417 | //qDebug("MainWindow::~MainWindow() "); | 417 | //qDebug("MainWindow::~MainWindow() "); |
418 | //save toolbar location | 418 | //save toolbar location |
419 | delete mCalendar; | 419 | delete mCalendar; |
420 | delete mSyncManager; | 420 | delete mSyncManager; |
421 | #ifndef DESKTOP_VERSION | 421 | #ifndef DESKTOP_VERSION |
422 | if ( infrared ) | 422 | if ( infrared ) |
423 | delete infrared; | 423 | delete infrared; |
424 | #endif | 424 | #endif |
425 | 425 | ||
426 | 426 | ||
427 | } | 427 | } |
428 | 428 | ||
429 | void MainWindow::disableBR(bool b) | 429 | void MainWindow::disableBR(bool b) |
430 | { | 430 | { |
431 | #ifndef DESKTOP_VERSION | 431 | #ifndef DESKTOP_VERSION |
432 | if ( b ) { | 432 | if ( b ) { |
433 | if ( infrared ) { | 433 | if ( infrared ) { |
434 | toggleBeamReceive(); | 434 | toggleBeamReceive(); |
435 | mBRdisabled = true; | 435 | mBRdisabled = true; |
436 | } | 436 | } |
437 | mBRdisabled = true; | 437 | mBRdisabled = true; |
438 | } else { | 438 | } else { |
439 | if ( mBRdisabled ) { | 439 | if ( mBRdisabled ) { |
440 | mBRdisabled = false; | 440 | mBRdisabled = false; |
441 | //makes no sense,because other cal ap is probably running | 441 | //makes no sense,because other cal ap is probably running |
442 | // toggleBeamReceive(); | 442 | // toggleBeamReceive(); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | #endif | 445 | #endif |
446 | 446 | ||
447 | } | 447 | } |
448 | bool MainWindow::beamReceiveEnabled() | 448 | bool MainWindow::beamReceiveEnabled() |
449 | { | 449 | { |
450 | #ifndef DESKTOP_VERSION | 450 | #ifndef DESKTOP_VERSION |
451 | return ( infrared != 0 ); | 451 | return ( infrared != 0 ); |
452 | #endif | 452 | #endif |
453 | return false; | 453 | return false; |
454 | } | 454 | } |
455 | 455 | ||
456 | void MainWindow::toggleBeamReceive() | 456 | void MainWindow::toggleBeamReceive() |
457 | { | 457 | { |
458 | if ( mBRdisabled ) | 458 | if ( mBRdisabled ) |
459 | return; | 459 | return; |
460 | #ifndef DESKTOP_VERSION | 460 | #ifndef DESKTOP_VERSION |
461 | if ( infrared ) { | 461 | if ( infrared ) { |
462 | qDebug("KO: Disable BeamReceive "); | 462 | qDebug("KO: Disable BeamReceive "); |
463 | delete infrared; | 463 | delete infrared; |
464 | infrared = 0; | 464 | infrared = 0; |
465 | brAction->setOn(false); | 465 | brAction->setOn(false); |
466 | return; | 466 | return; |
467 | } | 467 | } |
468 | qDebug("KO: Enable BeamReceive "); | 468 | qDebug("KO: Enable BeamReceive "); |
469 | brAction->setOn(true); | 469 | brAction->setOn(true); |
470 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 470 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
471 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 471 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
472 | #endif | 472 | #endif |
473 | } | 473 | } |
474 | void MainWindow::showMaximized () | 474 | void MainWindow::showMaximized () |
475 | { | 475 | { |
476 | #ifndef DESKTOP_VERSION | 476 | #ifndef DESKTOP_VERSION |
477 | if ( ! globalFlagBlockStartup ) | 477 | if ( ! globalFlagBlockStartup ) |
478 | if ( mClosed ) | 478 | if ( mClosed ) |
479 | mView->goToday(); | 479 | mView->goToday(); |
480 | #endif | 480 | #endif |
481 | QWidget::showMaximized () ; | 481 | QWidget::showMaximized () ; |
482 | mClosed = false; | 482 | mClosed = false; |
483 | } | 483 | } |
484 | void MainWindow::closeEvent( QCloseEvent* ce ) | 484 | void MainWindow::closeEvent( QCloseEvent* ce ) |
485 | { | 485 | { |
486 | 486 | ||
487 | 487 | ||
488 | 488 | ||
489 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 489 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
490 | saveOnClose(); | 490 | saveOnClose(); |
491 | mClosed = true; | 491 | mClosed = true; |
492 | ce->accept(); | 492 | ce->accept(); |
493 | return; | 493 | return; |
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | switch( QMessageBox::information( this, "KO/Pi", | 497 | switch( QMessageBox::information( this, "KO/Pi", |
498 | i18n("Do you really want\nto close KO/Pi?"), | 498 | i18n("Do you really want\nto close KO/Pi?"), |
499 | i18n("Close"), i18n("No"), | 499 | i18n("Close"), i18n("No"), |
500 | 0, 0 ) ) { | 500 | 0, 0 ) ) { |
501 | case 0: | 501 | case 0: |
502 | saveOnClose(); | 502 | saveOnClose(); |
503 | mClosed = true; | 503 | mClosed = true; |
504 | ce->accept(); | 504 | ce->accept(); |
505 | break; | 505 | break; |
506 | case 1: | 506 | case 1: |
507 | ce->ignore(); | 507 | ce->ignore(); |
508 | break; | 508 | break; |
509 | case 2: | 509 | case 2: |
510 | 510 | ||
511 | default: | 511 | default: |
512 | break; | 512 | break; |
513 | } | 513 | } |
514 | 514 | ||
515 | 515 | ||
516 | } | 516 | } |
517 | 517 | ||
518 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 518 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
519 | { | 519 | { |
520 | QDataStream stream( data, IO_ReadOnly ); | 520 | QDataStream stream( data, IO_ReadOnly ); |
521 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 521 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
522 | //QString datamess; | 522 | //QString datamess; |
523 | //qDebug("message "); | 523 | //qDebug("message "); |
524 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 524 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
525 | 525 | ||
526 | if ( cmsg == "setDocument(QString)" ) { | 526 | if ( cmsg == "setDocument(QString)" ) { |
527 | QDataStream stream( data, IO_ReadOnly ); | 527 | QDataStream stream( data, IO_ReadOnly ); |
528 | QString fileName; | 528 | QString fileName; |
529 | stream >> fileName; | 529 | stream >> fileName; |
530 | //qDebug("filename %s ", fileName.latin1()); | 530 | //qDebug("filename %s ", fileName.latin1()); |
531 | showMaximized(); | 531 | showMaximized(); |
532 | raise(); | 532 | raise(); |
533 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 533 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
534 | mSyncManager->slotSyncMenu( 1002 ); | 534 | mSyncManager->slotSyncMenu( 1002 ); |
535 | return; | 535 | return; |
536 | } | 536 | } |
537 | 537 | ||
538 | if ( cmsg == "-writeFile" ) { | 538 | if ( cmsg == "-writeFile" ) { |
539 | // I made from the "-writeFile" an "-writeAlarm" | 539 | // I made from the "-writeFile" an "-writeAlarm" |
540 | mView->viewManager()->showWhatsNextView(); | 540 | mView->viewManager()->showWhatsNextView(); |
541 | mCalendar->checkAlarmForIncidence( 0, true); | 541 | mCalendar->checkAlarmForIncidence( 0, true); |
542 | showMaximized(); | 542 | showMaximized(); |
543 | raise(); | 543 | raise(); |
544 | return; | 544 | return; |
545 | 545 | ||
546 | } | 546 | } |
547 | if ( cmsg == "-writeFileSilent" ) { | 547 | if ( cmsg == "-writeFileSilent" ) { |
548 | // I made from the "-writeFile" an "-writeAlarm" | 548 | // I made from the "-writeFile" an "-writeAlarm" |
549 | // mView->viewManager()->showWhatsNextView(); | 549 | // mView->viewManager()->showWhatsNextView(); |
550 | mCalendar->checkAlarmForIncidence( 0, true); | 550 | mCalendar->checkAlarmForIncidence( 0, true); |
551 | //showMaximized(); | 551 | //showMaximized(); |
552 | //raise(); | 552 | //raise(); |
553 | hide(); | 553 | hide(); |
554 | return; | 554 | return; |
555 | } | 555 | } |
556 | if ( cmsg == "-newCountdown" ) { | 556 | if ( cmsg == "-newCountdown" ) { |
557 | qDebug("newCountdown "); | 557 | qDebug("newCountdown "); |
558 | 558 | ||
559 | } | 559 | } |
560 | QString msg ; | 560 | QString msg ; |
561 | QString allmsg = cmsg; | 561 | QString allmsg = cmsg; |
562 | while ( allmsg.length() > 0 ) { | 562 | while ( allmsg.length() > 0 ) { |
563 | int nextC = allmsg.find( "-", 1 ); | 563 | int nextC = allmsg.find( "-", 1 ); |
564 | if ( nextC == -1 ) { | 564 | if ( nextC == -1 ) { |
565 | msg = allmsg; | 565 | msg = allmsg; |
566 | allmsg = ""; | 566 | allmsg = ""; |
567 | } else{ | 567 | } else{ |
568 | msg = allmsg.left( nextC ); | 568 | msg = allmsg.left( nextC ); |
569 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 569 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
570 | } | 570 | } |
571 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 571 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
572 | if ( msg == "-newEvent" ) { | 572 | if ( msg == "-newEvent" ) { |
573 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); | 573 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
574 | } | 574 | } |
575 | if ( msg == "-newTodo" ) { | 575 | if ( msg == "-newTodo" ) { |
576 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); | 576 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
577 | } | 577 | } |
578 | if ( msg == "-showWN" ) { | 578 | if ( msg == "-showWN" ) { |
579 | mView->viewManager()->showWhatsNextView(); | 579 | mView->viewManager()->showWhatsNextView(); |
580 | } | 580 | } |
581 | if ( msg == "-showTodo" ) { | 581 | if ( msg == "-showTodo" ) { |
582 | mView->viewManager()->showTodoView(); | 582 | mView->viewManager()->showTodoView(); |
583 | } | 583 | } |
584 | if ( msg == "-showList" ) { | 584 | if ( msg == "-showList" ) { |
585 | mView->viewManager()->showListView(); | 585 | mView->viewManager()->showListView(); |
586 | } | 586 | } |
587 | else if ( msg == "-showDay" ) { | 587 | else if ( msg == "-showDay" ) { |
588 | mView->viewManager()->showDayView(); | 588 | mView->viewManager()->showDayView(); |
589 | } | 589 | } |
590 | else if ( msg == "-showWWeek" ) { | 590 | else if ( msg == "-showWWeek" ) { |
591 | mView->viewManager()->showWorkWeekView(); | 591 | mView->viewManager()->showWorkWeekView(); |
592 | } | 592 | } |
593 | else if ( msg == "-ringSync" ) { | 593 | else if ( msg == "-ringSync" ) { |
594 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 594 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
595 | } | 595 | } |
596 | else if ( msg == "-showWeek" ) { | 596 | else if ( msg == "-showWeek" ) { |
597 | mView->viewManager()->showWeekView(); | 597 | mView->viewManager()->showWeekView(); |
598 | } | 598 | } |
599 | else if ( msg == "-showTodo" ) { | 599 | else if ( msg == "-showTodo" ) { |
600 | mView->viewManager()->showTodoView(); | 600 | mView->viewManager()->showTodoView(); |
601 | } | 601 | } |
602 | else if ( msg == "-showJournal" ) { | 602 | else if ( msg == "-showJournal" ) { |
603 | mView->dateNavigator()->selectDates( 1 ); | 603 | mView->dateNavigator()->selectDates( 1 ); |
604 | mView->dateNavigator()->selectToday(); | 604 | mView->dateNavigator()->selectToday(); |
605 | mView->viewManager()->showJournalView(); | 605 | mView->viewManager()->showJournalView(); |
606 | } | 606 | } |
607 | else if ( msg == "-showKO" ) { | 607 | else if ( msg == "-showKO" ) { |
608 | mView->viewManager()->showNextXView(); | 608 | mView->viewManager()->showNextXView(); |
609 | } | 609 | } |
610 | else if ( msg == "-showWNext" ) { | 610 | else if ( msg == "-showWNext" ) { |
611 | mView->viewManager()->showWhatsNextView(); | 611 | mView->viewManager()->showWhatsNextView(); |
612 | } | 612 | } |
613 | else if ( msg == "nextView()" ) { | 613 | else if ( msg == "nextView()" ) { |
614 | mView->viewManager()->showNextView(); | 614 | mView->viewManager()->showNextView(); |
615 | } | 615 | } |
616 | else if ( msg == "-showNextXView" ) { | 616 | else if ( msg == "-showNextXView" ) { |
617 | mView->viewManager()->showNextXView(); | 617 | mView->viewManager()->showNextXView(); |
618 | } | 618 | } |
619 | 619 | ||
620 | 620 | ||
621 | } | 621 | } |
622 | 622 | ||
623 | showMaximized(); | 623 | showMaximized(); |
624 | raise(); | 624 | raise(); |
625 | } | 625 | } |
626 | void MainWindow::startMultiSync() | 626 | void MainWindow::startMultiSync() |
627 | { | 627 | { |
628 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 628 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
629 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 629 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
630 | question, | 630 | question, |
631 | i18n("Yes"), i18n("No"), | 631 | i18n("Yes"), i18n("No"), |
632 | 0, 0 ) != 0 ) { | 632 | 0, 0 ) != 0 ) { |
633 | setCaption(i18n("Aborted! Nothing synced!")); | 633 | setCaption(i18n("Aborted! Nothing synced!")); |
634 | return; | 634 | return; |
635 | } | 635 | } |
636 | mSyncManager->multiSync( false ); | 636 | mSyncManager->multiSync( false ); |
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | QPixmap MainWindow::loadPixmap( QString name ) | 641 | QPixmap MainWindow::loadPixmap( QString name ) |
642 | { | 642 | { |
643 | return SmallIcon( name ); | 643 | return SmallIcon( name ); |
644 | 644 | ||
645 | } | 645 | } |
646 | void MainWindow::setUsesBigPixmaps ( bool b ) | 646 | void MainWindow::setUsesBigPixmaps ( bool b ) |
647 | { | 647 | { |
648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
649 | if ( b ) | 649 | if ( b ) |
650 | qDebug("KO: BigPixmaps are not supported "); | 650 | qDebug("KO: BigPixmaps are not supported "); |
651 | } | 651 | } |
652 | void MainWindow::initActions() | 652 | void MainWindow::initActions() |
653 | { | 653 | { |
654 | //KOPrefs::instance()->mShowFullMenu | 654 | //KOPrefs::instance()->mShowFullMenu |
655 | iconToolBar->clear(); | 655 | iconToolBar->clear(); |
656 | KOPrefs *p = KOPrefs::instance(); | 656 | KOPrefs *p = KOPrefs::instance(); |
657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
658 | 658 | ||
659 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 659 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
660 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 660 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
661 | mCurrentItemMenu = new QPopupMenu ( this ); | 661 | mCurrentItemMenu = new QPopupMenu ( this ); |
662 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | ||
662 | QPopupMenu *importMenu = new QPopupMenu( this ); | 663 | QPopupMenu *importMenu = new QPopupMenu( this ); |
663 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 664 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
664 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 665 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
665 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 666 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
666 | selectFilterMenu = new QPopupMenu( this ); | 667 | selectFilterMenu = new QPopupMenu( this ); |
667 | selectFilterMenu->setCheckable( true ); | 668 | selectFilterMenu->setCheckable( true ); |
668 | syncMenu = new QPopupMenu( this ); | 669 | syncMenu = new QPopupMenu( this ); |
669 | configureAgendaMenu = new QPopupMenu( this ); | 670 | configureAgendaMenu = new QPopupMenu( this ); |
670 | configureToolBarMenu = new QPopupMenu( this ); | 671 | configureToolBarMenu = new QPopupMenu( this ); |
671 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 672 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
672 | QIconSet icon; | 673 | QIconSet icon; |
673 | int pixWid = 22, pixHei = 22; | 674 | int pixWid = 22, pixHei = 22; |
674 | QString pathString = ""; | 675 | QString pathString = ""; |
675 | if ( !p->mToolBarMiniIcons ) { | 676 | if ( !p->mToolBarMiniIcons ) { |
676 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 677 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
677 | pathString += "icons16/"; | 678 | pathString += "icons16/"; |
678 | pixWid = 18; pixHei = 16; | 679 | pixWid = 18; pixHei = 16; |
679 | } | 680 | } |
680 | } else { | 681 | } else { |
681 | pathString += "iconsmini/"; | 682 | pathString += "iconsmini/"; |
682 | pixWid = 18; pixHei = 16; | 683 | pixWid = 18; pixHei = 16; |
683 | } | 684 | } |
684 | if ( KOPrefs::instance()->mShowFullMenu ) { | 685 | if ( KOPrefs::instance()->mShowFullMenu ) { |
685 | QMenuBar *menuBar1; | 686 | QMenuBar *menuBar1; |
686 | menuBar1 = menuBar(); | 687 | menuBar1 = menuBar(); |
687 | menuBar1->insertItem( i18n("File"), importMenu ); | 688 | menuBar1->insertItem( i18n("File"), importMenu ); |
688 | menuBar1->insertItem( i18n("View"), viewMenu ); | 689 | menuBar1->insertItem( i18n("View"), viewMenu ); |
689 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); | 690 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); |
690 | menuBar1->insertItem( i18n("Action"), actionMenu ); | 691 | menuBar1->insertItem( i18n("Action"), actionMenu ); |
691 | #ifdef DESKTOP_VERSION | 692 | #ifdef DESKTOP_VERSION |
692 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 693 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
693 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 694 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
694 | #else | 695 | #else |
695 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 696 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
696 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 697 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
697 | #endif | 698 | #endif |
698 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 699 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
699 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 700 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
700 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 701 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
701 | } else { | 702 | } else { |
702 | QPEMenuBar *menuBar1; | 703 | QPEMenuBar *menuBar1; |
703 | menuBar1 = new QPEMenuBar( iconToolBar ); | 704 | menuBar1 = new QPEMenuBar( iconToolBar ); |
704 | QPopupMenu *menuBar = new QPopupMenu( this ); | 705 | QPopupMenu *menuBar = new QPopupMenu( this ); |
705 | icon = loadPixmap( pathString + "z_menu" ); | 706 | icon = loadPixmap( pathString + "z_menu" ); |
706 | menuBar1->insertItem( icon.pixmap(), menuBar); | 707 | menuBar1->insertItem( icon.pixmap(), menuBar); |
707 | //menuBar1->insertItem( i18n("ME"), menuBar); | 708 | //menuBar1->insertItem( i18n("ME"), menuBar); |
708 | menuBar->insertItem( i18n("File"), importMenu ); | 709 | menuBar->insertItem( i18n("File"), importMenu ); |
709 | menuBar->insertItem( i18n("View"), viewMenu ); | 710 | menuBar->insertItem( i18n("View"), viewMenu ); |
710 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); | 711 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
711 | menuBar->insertItem( i18n("Action"), actionMenu ); | 712 | menuBar->insertItem( i18n("Action"), actionMenu ); |
712 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 713 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
713 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 714 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
714 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 715 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
715 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 716 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
716 | menuBar->insertItem( i18n("Help"), helpMenu ); | 717 | menuBar->insertItem( i18n("Help"), helpMenu ); |
717 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 718 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
718 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 719 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
719 | } | 720 | } |
720 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 721 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
721 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 722 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
722 | 723 | ||
723 | 724 | ||
724 | mWeekBgColor = iconToolBar->backgroundColor(); | 725 | mWeekBgColor = iconToolBar->backgroundColor(); |
725 | mWeekPixmap.resize( pixWid , pixHei ); | 726 | mWeekPixmap.resize( pixWid , pixHei ); |
726 | mWeekPixmap.fill( mWeekBgColor ); | 727 | mWeekPixmap.fill( mWeekBgColor ); |
727 | icon = mWeekPixmap; | 728 | icon = mWeekPixmap; |
728 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 729 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
729 | if ( p-> mShowIconWeekNum ) | 730 | if ( p-> mShowIconWeekNum ) |
730 | mWeekAction->addTo( iconToolBar ); | 731 | mWeekAction->addTo( iconToolBar ); |
731 | mWeekFont = font(); | 732 | mWeekFont = font(); |
732 | 733 | ||
733 | int fontPoint = mWeekFont.pointSize(); | 734 | int fontPoint = mWeekFont.pointSize(); |
734 | QFontMetrics f( mWeekFont ); | 735 | QFontMetrics f( mWeekFont ); |
735 | int fontWid = f.width( "30" ); | 736 | int fontWid = f.width( "30" ); |
736 | while ( fontWid > pixWid ) { | 737 | while ( fontWid > pixWid ) { |
737 | --fontPoint; | 738 | --fontPoint; |
738 | mWeekFont.setPointSize( fontPoint ); | 739 | mWeekFont.setPointSize( fontPoint ); |
739 | QFontMetrics f( mWeekFont ); | 740 | QFontMetrics f( mWeekFont ); |
740 | fontWid = f.width( "30" ); | 741 | fontWid = f.width( "30" ); |
741 | //qDebug("dec-- "); | 742 | //qDebug("dec-- "); |
742 | } | 743 | } |
743 | 744 | ||
744 | connect( mWeekAction, SIGNAL( activated() ), | 745 | connect( mWeekAction, SIGNAL( activated() ), |
745 | this, SLOT( weekAction() ) ); | 746 | this, SLOT( weekAction() ) ); |
746 | 747 | ||
747 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 748 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
748 | if ( p->mShowIconFilterview ) { | 749 | if ( p->mShowIconFilterview ) { |
749 | icon = loadPixmap( pathString + "filter" ); | 750 | icon = loadPixmap( pathString + "filter" ); |
750 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 751 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
751 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 752 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
752 | this, SLOT( fillFilterMenuTB() ) ); | 753 | this, SLOT( fillFilterMenuTB() ) ); |
753 | actionFilterMenuTB->addTo( iconToolBar ); | 754 | actionFilterMenuTB->addTo( iconToolBar ); |
754 | selectFilterMenuTB = new QPopupMenu( this ); | 755 | selectFilterMenuTB = new QPopupMenu( this ); |
755 | selectFilterMenuTB->setCheckable( true ); | 756 | selectFilterMenuTB->setCheckable( true ); |
756 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 757 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
757 | } | 758 | } |
758 | 759 | ||
759 | //#endif | 760 | //#endif |
760 | // ****************** | 761 | // ****************** |
761 | QAction *action; | 762 | QAction *action; |
762 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 763 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
763 | configureToolBarMenu->setCheckable( true ); | 764 | configureToolBarMenu->setCheckable( true ); |
764 | 765 | ||
765 | 766 | ||
766 | configureAgendaMenu->setCheckable( true ); | 767 | configureAgendaMenu->setCheckable( true ); |
767 | int iii ; | 768 | int iii ; |
768 | for ( iii = 1;iii<= 10 ;++iii ){ | 769 | for ( iii = 1;iii<= 10 ;++iii ){ |
769 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 770 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
770 | } | 771 | } |
771 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 772 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
772 | 773 | ||
773 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 774 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
774 | this, SLOT( showConfigureAgenda( ) ) ); | 775 | this, SLOT( showConfigureAgenda( ) ) ); |
775 | icon = loadPixmap( pathString + "today" ); | 776 | icon = loadPixmap( pathString + "today" ); |
776 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 777 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
777 | today_action->addTo( actionMenu ); | 778 | today_action->addTo( actionMenu ); |
778 | connect( today_action, SIGNAL( activated() ), | 779 | connect( today_action, SIGNAL( activated() ), |
779 | mView, SLOT( goToday() ) ); | 780 | mView, SLOT( goToday() ) ); |
780 | 781 | ||
781 | icon = loadPixmap( pathString + "picker" ); | 782 | icon = loadPixmap( pathString + "picker" ); |
782 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 783 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
783 | dPickerAction->addTo( actionMenu ); | 784 | dPickerAction->addTo( actionMenu ); |
784 | connect( dPickerAction, SIGNAL( activated() ), | 785 | connect( dPickerAction, SIGNAL( activated() ), |
785 | mView, SLOT( showDatePicker() ) ); | 786 | mView, SLOT( showDatePicker() ) ); |
786 | 787 | ||
787 | icon = loadPixmap( pathString + "search" ); | 788 | icon = loadPixmap( pathString + "search" ); |
788 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 789 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
789 | search_action->addTo( actionMenu ); | 790 | search_action->addTo( actionMenu ); |
790 | connect( search_action, SIGNAL( activated() ), | 791 | connect( search_action, SIGNAL( activated() ), |
791 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 792 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
793 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | ||
792 | 794 | ||
795 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | ||
796 | action->addTo( nextConflictMenu ); | ||
797 | connect( action, SIGNAL( activated() ), | ||
798 | mView, SLOT( conflictAll() ) ); | ||
799 | |||
800 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | ||
801 | action->addTo( nextConflictMenu ); | ||
802 | connect( action, SIGNAL( activated() ), | ||
803 | mView, SLOT( conflictAllday() ) ); | ||
804 | |||
805 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | ||
806 | action->addTo( nextConflictMenu ); | ||
807 | connect( action, SIGNAL( activated() ), | ||
808 | mView, SLOT( conflictNotAll() ) ); | ||
809 | |||
793 | actionMenu->insertSeparator(); | 810 | actionMenu->insertSeparator(); |
794 | 811 | ||
812 | icon = loadPixmap( pathString + "newevent" ); | ||
813 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | ||
814 | ne_action->addTo( mCurrentItemMenu ); | ||
815 | connect( ne_action, SIGNAL( activated() ), | ||
816 | mView, SLOT( newEvent() ) ); | ||
817 | icon = loadPixmap( pathString + "newtodo" ); | ||
818 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | ||
819 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | ||
820 | nt_action->addTo( mCurrentItemMenu ); | ||
821 | connect( nt_action, SIGNAL( activated() ), | ||
822 | mView, SLOT( newTodo() ) ); | ||
823 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | ||
824 | this ); | ||
825 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | ||
826 | connect( mNewSubTodoAction, SIGNAL( activated() ), | ||
827 | mView, SLOT( newSubTodo() ) ); | ||
795 | 828 | ||
796 | |||
797 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | ||
798 | action->addTo( mCurrentItemMenu ); | ||
799 | connect( action, SIGNAL( activated() ), | ||
800 | mView, SLOT( undo_delete() ) ); | ||
801 | mCurrentItemMenu->insertSeparator(); | 829 | mCurrentItemMenu->insertSeparator(); |
802 | icon = loadPixmap( pathString + "newevent" ); | 830 | icon = loadPixmap( pathString + "newevent" ); |
803 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 831 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
804 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 832 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
805 | configureToolBarMenu->insertSeparator(); | 833 | configureToolBarMenu->insertSeparator(); |
806 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 834 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
807 | configureToolBarMenu->insertSeparator(); | 835 | configureToolBarMenu->insertSeparator(); |
808 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 836 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
809 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 837 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
810 | 838 | ||
811 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 839 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
812 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 840 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
813 | mShowAction->addTo( mCurrentItemMenu ); | 841 | mShowAction->addTo( mCurrentItemMenu ); |
814 | connect( mShowAction, SIGNAL( activated() ), | 842 | connect( mShowAction, SIGNAL( activated() ), |
815 | mView, SLOT( showIncidence() ) ); | 843 | mView, SLOT( showIncidence() ) ); |
816 | 844 | ||
817 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 845 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
818 | mEditAction->addTo( mCurrentItemMenu ); | 846 | mEditAction->addTo( mCurrentItemMenu ); |
819 | connect( mEditAction, SIGNAL( activated() ), | 847 | connect( mEditAction, SIGNAL( activated() ), |
820 | mView, SLOT( editIncidence() ) ); | 848 | mView, SLOT( editIncidence() ) ); |
821 | 849 | ||
822 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 850 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
823 | mDeleteAction->addTo( mCurrentItemMenu ); | 851 | mDeleteAction->addTo( mCurrentItemMenu ); |
824 | connect( mDeleteAction, SIGNAL( activated() ), | 852 | connect( mDeleteAction, SIGNAL( activated() ), |
825 | mView, SLOT( deleteIncidence() ) ); | 853 | mView, SLOT( deleteIncidence() ) ); |
826 | 854 | ||
827 | 855 | ||
828 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 856 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
829 | mCloneAction->addTo( mCurrentItemMenu ); | 857 | mCloneAction->addTo( mCurrentItemMenu ); |
830 | connect( mCloneAction, SIGNAL( activated() ), | 858 | connect( mCloneAction, SIGNAL( activated() ), |
831 | mView, SLOT( cloneIncidence() ) ); | 859 | mView, SLOT( cloneIncidence() ) ); |
832 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 860 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
833 | mMoveAction->addTo( mCurrentItemMenu ); | 861 | mMoveAction->addTo( mCurrentItemMenu ); |
834 | connect( mMoveAction, SIGNAL( activated() ), | 862 | connect( mMoveAction, SIGNAL( activated() ), |
835 | mView, SLOT( moveIncidence() ) ); | 863 | mView, SLOT( moveIncidence() ) ); |
836 | #ifndef DESKTOP_VERSION | 864 | #ifndef DESKTOP_VERSION |
837 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 865 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
838 | mBeamAction->addTo(mCurrentItemMenu ); | 866 | mBeamAction->addTo(mCurrentItemMenu ); |
839 | connect( mBeamAction, SIGNAL( activated() ), | 867 | connect( mBeamAction, SIGNAL( activated() ), |
840 | mView, SLOT( beamIncidence() ) ); | 868 | mView, SLOT( beamIncidence() ) ); |
841 | #endif | 869 | #endif |
842 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 870 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
843 | mCancelAction->addTo( mCurrentItemMenu ); | 871 | mCancelAction->addTo( mCurrentItemMenu ); |
844 | connect( mCancelAction, SIGNAL( activated() ), | 872 | connect( mCancelAction, SIGNAL( activated() ), |
845 | mView, SLOT( toggleCancelIncidence() ) ); | 873 | mView, SLOT( toggleCancelIncidence() ) ); |
846 | 874 | ||
847 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 875 | |
848 | ne_action->addTo( actionMenu ); | 876 | mCurrentItemMenu->insertSeparator(); |
849 | connect( ne_action, SIGNAL( activated() ), | 877 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
850 | mView, SLOT( newEvent() ) ); | 878 | action->addTo( mCurrentItemMenu ); |
851 | icon = loadPixmap( pathString + "newtodo" ); | 879 | connect( action, SIGNAL( activated() ), |
852 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 880 | mView, SLOT( undo_delete() ) ); |
853 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | ||
854 | nt_action->addTo( actionMenu ); | ||
855 | connect( nt_action, SIGNAL( activated() ), | ||
856 | mView, SLOT( newTodo() ) ); | ||
857 | |||
858 | |||
859 | 881 | ||
860 | // *********************** | 882 | // *********************** |
861 | if ( KOPrefs::instance()->mVerticalScreen ) { | 883 | if ( KOPrefs::instance()->mVerticalScreen ) { |
862 | icon = SmallIcon( "1updownarrow" ); | 884 | icon = SmallIcon( "1updownarrow" ); |
863 | } else { | 885 | } else { |
864 | icon = SmallIcon("1leftrightarrow" ); | 886 | icon = SmallIcon("1leftrightarrow" ); |
865 | } | 887 | } |
866 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
867 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 889 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
868 | FSaction->addTo( viewMenu ); | 890 | FSaction->addTo( viewMenu ); |
869 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 891 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
870 | 892 | ||
871 | 893 | ||
872 | icon = loadPixmap( pathString + "filter" ); | 894 | icon = loadPixmap( pathString + "filter" ); |
873 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 895 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
874 | icon = loadPixmap( pathString + "configure" ); | 896 | icon = loadPixmap( pathString + "configure" ); |
875 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 897 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
876 | action->addTo( viewMenu ); | 898 | action->addTo( viewMenu ); |
877 | connect( action, SIGNAL( activated() ), | 899 | connect( action, SIGNAL( activated() ), |
878 | mView, SLOT( toggleFilter() ) ); | 900 | mView, SLOT( toggleFilter() ) ); |
879 | mToggleFilter = action; | 901 | mToggleFilter = action; |
880 | icon = loadPixmap( pathString + "navi" ); | 902 | icon = loadPixmap( pathString + "navi" ); |
881 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 903 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
882 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 904 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
883 | action->addTo( viewMenu ); | 905 | action->addTo( viewMenu ); |
884 | connect( action, SIGNAL( activated() ), | 906 | connect( action, SIGNAL( activated() ), |
885 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 907 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
886 | mToggleNav = action ; | 908 | mToggleNav = action ; |
887 | icon = loadPixmap( pathString + "allday" ); | 909 | icon = loadPixmap( pathString + "allday" ); |
888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 910 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
889 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 911 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
890 | action->addTo( viewMenu ); | 912 | action->addTo( viewMenu ); |
891 | connect( action, SIGNAL( activated() ), | 913 | connect( action, SIGNAL( activated() ), |
892 | mView, SLOT( toggleAllDaySize() ) ); | 914 | mView, SLOT( toggleAllDaySize() ) ); |
893 | mToggleAllday = action; | 915 | mToggleAllday = action; |
894 | 916 | ||
895 | 917 | ||
896 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 918 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
897 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 919 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
898 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 920 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
899 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 921 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
900 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 922 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
901 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 923 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
902 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 924 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
903 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 925 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
904 | 926 | ||
905 | 927 | ||
906 | dPickerAction->addTo( iconToolBar ); | 928 | dPickerAction->addTo( iconToolBar ); |
907 | viewMenu->insertSeparator(); | 929 | viewMenu->insertSeparator(); |
908 | 930 | ||
909 | if ( p-> mShowIconToggleFull ) | 931 | if ( p-> mShowIconToggleFull ) |
910 | FSaction->addTo( iconToolBar ); | 932 | FSaction->addTo( iconToolBar ); |
911 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 933 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
912 | 934 | ||
913 | //******************** | 935 | //******************** |
914 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 936 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
915 | 937 | ||
916 | 938 | ||
917 | icon = loadPixmap( pathString + "whatsnext" ); | 939 | icon = loadPixmap( pathString + "whatsnext" ); |
918 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 940 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
919 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 941 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
920 | whatsnext_action->addTo( viewMenu ); | 942 | whatsnext_action->addTo( viewMenu ); |
921 | connect( whatsnext_action, SIGNAL( activated() ), | 943 | connect( whatsnext_action, SIGNAL( activated() ), |
922 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 944 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
923 | 945 | ||
924 | icon = loadPixmap( pathString + "xdays" ); | 946 | icon = loadPixmap( pathString + "xdays" ); |
925 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 947 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
926 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 948 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
927 | xdays_action->addTo( viewMenu ); | 949 | xdays_action->addTo( viewMenu ); |
928 | connect( xdays_action, SIGNAL( activated() ), | 950 | connect( xdays_action, SIGNAL( activated() ), |
929 | mView->viewManager(), SLOT( showNextXView() ) ); | 951 | mView->viewManager(), SLOT( showNextXView() ) ); |
930 | 952 | ||
931 | 953 | ||
932 | icon = loadPixmap( pathString + "journal" ); | 954 | icon = loadPixmap( pathString + "journal" ); |
933 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 955 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
934 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 956 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
935 | viewjournal_action->addTo( viewMenu ); | 957 | viewjournal_action->addTo( viewMenu ); |
936 | connect( viewjournal_action, SIGNAL( activated() ), | 958 | connect( viewjournal_action, SIGNAL( activated() ), |
937 | mView->viewManager(), SLOT( showJournalView() ) ); | 959 | mView->viewManager(), SLOT( showJournalView() ) ); |
938 | 960 | ||
939 | 961 | ||
940 | icon = loadPixmap( pathString + "day" ); | 962 | icon = loadPixmap( pathString + "day" ); |
941 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 963 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
942 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 964 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
943 | day1_action->addTo( viewMenu ); | 965 | day1_action->addTo( viewMenu ); |
944 | // action->addTo( toolBar ); | 966 | // action->addTo( toolBar ); |
945 | connect( day1_action, SIGNAL( activated() ), | 967 | connect( day1_action, SIGNAL( activated() ), |
946 | mView->viewManager(), SLOT( showDayView() ) ); | 968 | mView->viewManager(), SLOT( showDayView() ) ); |
947 | 969 | ||
948 | icon = loadPixmap( pathString + "workweek" ); | 970 | icon = loadPixmap( pathString + "workweek" ); |
949 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 971 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
950 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 972 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
951 | day5_action->addTo( viewMenu ); | 973 | day5_action->addTo( viewMenu ); |
952 | connect( day5_action, SIGNAL( activated() ), | 974 | connect( day5_action, SIGNAL( activated() ), |
953 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 975 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
954 | 976 | ||
955 | icon = loadPixmap( pathString + "week" ); | 977 | icon = loadPixmap( pathString + "week" ); |
956 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 978 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
957 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 979 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
958 | day7_action->addTo( viewMenu ); | 980 | day7_action->addTo( viewMenu ); |
959 | connect( day7_action, SIGNAL( activated() ), | 981 | connect( day7_action, SIGNAL( activated() ), |
960 | mView->viewManager(), SLOT( showWeekView() ) ); | 982 | mView->viewManager(), SLOT( showWeekView() ) ); |
961 | 983 | ||
962 | icon = loadPixmap( pathString + "workweek2" ); | 984 | icon = loadPixmap( pathString + "workweek2" ); |
963 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 985 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
964 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 986 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
965 | day6_action->addTo( viewMenu ); | 987 | day6_action->addTo( viewMenu ); |
966 | connect( day6_action, SIGNAL( activated() ), | 988 | connect( day6_action, SIGNAL( activated() ), |
967 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 989 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
968 | 990 | ||
969 | icon = loadPixmap( pathString + "month" ); | 991 | icon = loadPixmap( pathString + "month" ); |
970 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 992 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
971 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 993 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
972 | month_action->addTo( viewMenu ); | 994 | month_action->addTo( viewMenu ); |
973 | connect( month_action, SIGNAL( activated() ), | 995 | connect( month_action, SIGNAL( activated() ), |
974 | mView->viewManager(), SLOT( showMonthView() ) ); | 996 | mView->viewManager(), SLOT( showMonthView() ) ); |
975 | 997 | ||
976 | icon = loadPixmap( pathString + "list" ); | 998 | icon = loadPixmap( pathString + "list" ); |
977 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 999 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
978 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1000 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
979 | showlist_action->addTo( viewMenu ); | 1001 | showlist_action->addTo( viewMenu ); |
980 | connect( showlist_action, SIGNAL( activated() ), | 1002 | connect( showlist_action, SIGNAL( activated() ), |
981 | mView->viewManager(), SLOT( showListView() ) ); | 1003 | mView->viewManager(), SLOT( showListView() ) ); |
982 | 1004 | ||
983 | icon = loadPixmap( pathString + "todo" ); | 1005 | icon = loadPixmap( pathString + "todo" ); |
984 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1006 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
985 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1007 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
986 | todoview_action->addTo( viewMenu ); | 1008 | todoview_action->addTo( viewMenu ); |
987 | connect( todoview_action, SIGNAL( activated() ), | 1009 | connect( todoview_action, SIGNAL( activated() ), |
988 | mView->viewManager(), SLOT( showTodoView() ) ); | 1010 | mView->viewManager(), SLOT( showTodoView() ) ); |
989 | 1011 | ||
990 | 1012 | ||
991 | 1013 | ||
992 | #if 0 | 1014 | #if 0 |
993 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1015 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
994 | action->addTo( viewMenu ); | 1016 | action->addTo( viewMenu ); |
995 | connect( action, SIGNAL( activated() ), | 1017 | connect( action, SIGNAL( activated() ), |
996 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1018 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
997 | #endif | 1019 | #endif |
998 | 1020 | ||
999 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 1021 | |
1000 | this ); | ||
1001 | mNewSubTodoAction->addTo( actionMenu ); | ||
1002 | connect( mNewSubTodoAction, SIGNAL( activated() ), | ||
1003 | mView, SLOT( newSubTodo() ) ); | ||
1004 | 1022 | ||
1005 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1023 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
1006 | this ); | 1024 | this ); |
1007 | action->addTo( actionMenu ); | 1025 | action->addTo( actionMenu ); |
1008 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1026 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1009 | 1027 | ||
1010 | 1028 | ||
1011 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1029 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1012 | 1030 | ||
1013 | 1031 | ||
1014 | 1032 | ||
1015 | actionMenu->insertSeparator(); | 1033 | actionMenu->insertSeparator(); |
1016 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1034 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, |
1017 | this ); | 1035 | this ); |
1018 | action->addTo( actionMenu ); | 1036 | action->addTo( actionMenu ); |
1019 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1037 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1020 | 1038 | ||
1021 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1039 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1022 | this ); | 1040 | this ); |
1023 | action->addTo( actionMenu ); | 1041 | action->addTo( actionMenu ); |
1024 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1042 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1025 | 1043 | ||
1026 | 1044 | ||
1027 | actionMenu->insertSeparator(); | 1045 | actionMenu->insertSeparator(); |
1028 | icon = loadPixmap( pathString + "configure" ); | 1046 | icon = loadPixmap( pathString + "configure" ); |
1029 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1047 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1030 | action->addTo( actionMenu ); | 1048 | action->addTo( actionMenu ); |
1031 | connect( action, SIGNAL( activated() ), | 1049 | connect( action, SIGNAL( activated() ), |
1032 | mView, SLOT( edit_options() ) ); | 1050 | mView, SLOT( edit_options() ) ); |
1033 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1051 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1034 | action->addTo( actionMenu ); | 1052 | action->addTo( actionMenu ); |
1035 | connect( action, SIGNAL( activated() ), | 1053 | connect( action, SIGNAL( activated() ), |
1036 | this, SLOT( calHint() ) ); | 1054 | this, SLOT( calHint() ) ); |
1037 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1055 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1038 | action->addTo( actionMenu ); | 1056 | action->addTo( actionMenu ); |
1039 | connect( action, SIGNAL( activated() ), | 1057 | connect( action, SIGNAL( activated() ), |
1040 | mView, SLOT( edit_global_options() ) ); | 1058 | mView, SLOT( edit_global_options() ) ); |
1041 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1059 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1042 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1060 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1043 | 1061 | ||
1044 | } | 1062 | } |
1045 | // actionMenu->insertSeparator(); | 1063 | // actionMenu->insertSeparator(); |
1046 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1064 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1047 | this ); | 1065 | this ); |
1048 | action->addTo( importMenu_X ); | 1066 | action->addTo( importMenu_X ); |
1049 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1067 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1050 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1068 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
1051 | this ); | 1069 | this ); |
1052 | action->addTo( importMenu_X ); | 1070 | action->addTo( importMenu_X ); |
1053 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1071 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1054 | importMenu_X->insertSeparator(); | 1072 | importMenu_X->insertSeparator(); |
1055 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1073 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1056 | this ); | 1074 | this ); |
1057 | action->addTo( importMenu_X ); | 1075 | action->addTo( importMenu_X ); |
1058 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1076 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1059 | //#ifndef DESKTOP_VERSION | 1077 | //#ifndef DESKTOP_VERSION |
1060 | importMenu_X->insertSeparator(); | 1078 | importMenu_X->insertSeparator(); |
1061 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1079 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1062 | this ); | 1080 | this ); |
1063 | action->addTo( importMenu_X ); | 1081 | action->addTo( importMenu_X ); |
1064 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1082 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1065 | //#else | 1083 | //#else |
1066 | #ifdef _OL_IMPORT_ | 1084 | #ifdef _OL_IMPORT_ |
1067 | importMenu_X->insertSeparator(); | 1085 | importMenu_X->insertSeparator(); |
1068 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 1086 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
1069 | this ); | 1087 | this ); |
1070 | action->addTo( importMenu_X ); | 1088 | action->addTo( importMenu_X ); |
1071 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 1089 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
1072 | #endif | 1090 | #endif |
1073 | //#endif | 1091 | //#endif |
1074 | 1092 | ||
1075 | //importMenu->insertSeparator(); | 1093 | //importMenu->insertSeparator(); |
1076 | #if 0 | 1094 | #if 0 |
1077 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 1095 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
1078 | this ); | 1096 | this ); |
1079 | action->addTo( importMenu ); | 1097 | action->addTo( importMenu ); |
1080 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 1098 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
1081 | #endif | 1099 | #endif |
1082 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, | 1100 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, |
1083 | this ); | 1101 | this ); |
1084 | action->addTo( importMenu ); | 1102 | action->addTo( importMenu ); |
1085 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 1103 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
1086 | importMenu->insertSeparator(); | 1104 | importMenu->insertSeparator(); |
1087 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 1105 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
1088 | //importMenu->insertSeparator(); | 1106 | //importMenu->insertSeparator(); |
1089 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1107 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
1090 | this ); | 1108 | this ); |
1091 | action->addTo( exportMenu_X ); | 1109 | action->addTo( exportMenu_X ); |
1092 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 1110 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
1093 | 1111 | ||
1094 | 1112 | ||
1095 | //LR | 1113 | //LR |
1096 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 1114 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
1097 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1115 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1098 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1116 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1099 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 1117 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
1100 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 1118 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
1101 | 1119 | ||
1102 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 1120 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
1103 | #ifndef DESKTOP_VERSION | 1121 | #ifndef DESKTOP_VERSION |
1104 | //importMenu->insertSeparator(); | 1122 | //importMenu->insertSeparator(); |
1105 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 1123 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
1106 | this ); | 1124 | this ); |
1107 | brAction->addTo( beamMenu_X ); | 1125 | brAction->addTo( beamMenu_X ); |
1108 | brAction->setToggleAction (true ) ; | 1126 | brAction->setToggleAction (true ) ; |
1109 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1127 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
1110 | 1128 | ||
1111 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1129 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
1112 | this ); | 1130 | this ); |
1113 | action->addTo( beamMenu_X ); | 1131 | action->addTo( beamMenu_X ); |
1114 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1132 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
1115 | 1133 | ||
1116 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1134 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
1117 | this ); | 1135 | this ); |
1118 | action->addTo( beamMenu_X ); | 1136 | action->addTo( beamMenu_X ); |
1119 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1137 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1120 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1138 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1121 | #else | 1139 | #else |
1122 | //importMenu->insertSeparator(); | 1140 | //importMenu->insertSeparator(); |
1123 | icon = loadPixmap( pathString + "print" ); | 1141 | icon = loadPixmap( pathString + "print" ); |
1124 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1142 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1125 | action->addTo( beamMenu_X ); | 1143 | action->addTo( beamMenu_X ); |
1126 | connect( action, SIGNAL( activated() ), | 1144 | connect( action, SIGNAL( activated() ), |
1127 | this, SLOT( printCal() ) ); | 1145 | this, SLOT( printCal() ) ); |
1128 | 1146 | ||
1129 | icon = loadPixmap( pathString + "print" ); | 1147 | icon = loadPixmap( pathString + "print" ); |
1130 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1148 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1131 | action->addTo( beamMenu_X ); | 1149 | action->addTo( beamMenu_X ); |
1132 | connect( action, SIGNAL( activated() ), | 1150 | connect( action, SIGNAL( activated() ), |
1133 | this, SLOT( printSel() ) ); | 1151 | this, SLOT( printSel() ) ); |
1134 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1152 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1135 | action->addTo( beamMenu_X ); | 1153 | action->addTo( beamMenu_X ); |
1136 | connect( action, SIGNAL( activated() ), | 1154 | connect( action, SIGNAL( activated() ), |
1137 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1155 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1138 | 1156 | ||
1139 | 1157 | ||
1140 | icon = loadPixmap( pathString + "print" ); | 1158 | icon = loadPixmap( pathString + "print" ); |
1141 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); | 1159 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); |
1142 | action->addTo( beamMenu_X ); | 1160 | action->addTo( beamMenu_X ); |
1143 | connect( action, SIGNAL( activated() ), | 1161 | connect( action, SIGNAL( activated() ), |
1144 | this, SLOT( printListView() ) ); | 1162 | this, SLOT( printListView() ) ); |
1145 | 1163 | ||
1146 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1164 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1147 | action->addTo( beamMenu_X ); | 1165 | action->addTo( beamMenu_X ); |
1148 | connect( action, SIGNAL( activated() ), | 1166 | connect( action, SIGNAL( activated() ), |
1149 | mView, SLOT( slotprintSelInc() ) ); | 1167 | mView, SLOT( slotprintSelInc() ) ); |
1150 | 1168 | ||
1151 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1169 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1152 | #endif | 1170 | #endif |
1153 | 1171 | ||
1154 | importMenu->insertSeparator(); | 1172 | importMenu->insertSeparator(); |
1155 | action = new QAction( "beam all", i18n("Save"), 0, | 1173 | action = new QAction( "beam all", i18n("Save"), 0, |
1156 | this ); | 1174 | this ); |
1157 | action->addTo( importMenu ); | 1175 | action->addTo( importMenu ); |
1158 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1176 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1159 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1177 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1160 | this ); | 1178 | this ); |
1161 | action->addTo( importMenu ); | 1179 | action->addTo( importMenu ); |
1162 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1180 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1163 | 1181 | ||
1164 | //menuBar->insertItem( "Configure",configureMenu ); | 1182 | //menuBar->insertItem( "Configure",configureMenu ); |
1165 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1183 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1166 | icon = loadPixmap( "korganizer/korganizer" ); | 1184 | icon = loadPixmap( "korganizer/korganizer" ); |
1167 | 1185 | ||
1168 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1186 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1169 | action->addTo( helpMenu ); | 1187 | action->addTo( helpMenu ); |
1170 | connect( action, SIGNAL( activated() ), | 1188 | connect( action, SIGNAL( activated() ), |
1171 | SLOT( whatsNew() ) ); | 1189 | SLOT( whatsNew() ) ); |
1172 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1190 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1173 | action->addTo( helpMenu ); | 1191 | action->addTo( helpMenu ); |
1174 | connect( action, SIGNAL( activated() ), | 1192 | connect( action, SIGNAL( activated() ), |
1175 | SLOT( features() ) ); | 1193 | SLOT( features() ) ); |
1176 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1194 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1177 | action->addTo( helpMenu ); | 1195 | action->addTo( helpMenu ); |
1178 | connect( action, SIGNAL( activated() ), | 1196 | connect( action, SIGNAL( activated() ), |
1179 | SLOT( keyBindings() ) ); | 1197 | SLOT( keyBindings() ) ); |
1180 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1198 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1181 | action->addTo( helpMenu ); | 1199 | action->addTo( helpMenu ); |
1182 | connect( action, SIGNAL( activated() ), | 1200 | connect( action, SIGNAL( activated() ), |
1183 | SLOT( storagehowto() ) ); | 1201 | SLOT( storagehowto() ) ); |
1184 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1202 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1185 | action->addTo( helpMenu ); | 1203 | action->addTo( helpMenu ); |
1186 | connect( action, SIGNAL( activated() ), | 1204 | connect( action, SIGNAL( activated() ), |
1187 | SLOT( timetrackinghowto() ) ); | 1205 | SLOT( timetrackinghowto() ) ); |
1188 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1206 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1189 | action->addTo( helpMenu ); | 1207 | action->addTo( helpMenu ); |
1190 | connect( action, SIGNAL( activated() ), | 1208 | connect( action, SIGNAL( activated() ), |
1191 | SLOT( synchowto() ) ); | 1209 | SLOT( synchowto() ) ); |
1192 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1210 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1193 | action->addTo( helpMenu ); | 1211 | action->addTo( helpMenu ); |
1194 | connect( action, SIGNAL( activated() ), | 1212 | connect( action, SIGNAL( activated() ), |
1195 | SLOT( kdesynchowto() ) ); | 1213 | SLOT( kdesynchowto() ) ); |
1196 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1214 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1197 | action->addTo( helpMenu ); | 1215 | action->addTo( helpMenu ); |
1198 | connect( action, SIGNAL( activated() ), | 1216 | connect( action, SIGNAL( activated() ), |
1199 | SLOT( multisynchowto() ) ); | 1217 | SLOT( multisynchowto() ) ); |
1200 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1218 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1201 | action->addTo( helpMenu ); | 1219 | action->addTo( helpMenu ); |
1202 | connect( action, SIGNAL( activated() ), | 1220 | connect( action, SIGNAL( activated() ), |
1203 | SLOT( aboutAutoSaving() ) ); | 1221 | SLOT( aboutAutoSaving() ) ); |
1204 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1222 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
1205 | action->addTo( helpMenu ); | 1223 | action->addTo( helpMenu ); |
1206 | connect( action, SIGNAL( activated() ), | 1224 | connect( action, SIGNAL( activated() ), |
1207 | SLOT( aboutKnownBugs() ) ); | 1225 | SLOT( aboutKnownBugs() ) ); |
1208 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1226 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
1209 | action->addTo( helpMenu ); | 1227 | action->addTo( helpMenu ); |
1210 | connect( action, SIGNAL( activated() ), | 1228 | connect( action, SIGNAL( activated() ), |
1211 | SLOT( usertrans() ) ); | 1229 | SLOT( usertrans() ) ); |
1212 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1230 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1213 | action->addTo( helpMenu ); | 1231 | action->addTo( helpMenu ); |
1214 | connect( action, SIGNAL( activated() ), | 1232 | connect( action, SIGNAL( activated() ), |
1215 | SLOT( faq() ) ); | 1233 | SLOT( faq() ) ); |
1216 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1234 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1217 | action->addTo( helpMenu ); | 1235 | action->addTo( helpMenu ); |
1218 | connect( action, SIGNAL( activated() ), | 1236 | connect( action, SIGNAL( activated() ), |
1219 | SLOT( licence() ) ); | 1237 | SLOT( licence() ) ); |
1220 | action = new QAction( "about", i18n("About..."), 0, this ); | 1238 | action = new QAction( "about", i18n("About..."), 0, this ); |
1221 | action->addTo( helpMenu ); | 1239 | action->addTo( helpMenu ); |
1222 | connect( action, SIGNAL( activated() ), | 1240 | connect( action, SIGNAL( activated() ), |
1223 | SLOT( about() ) ); | 1241 | SLOT( about() ) ); |
1224 | //menuBar->insertSeparator(); | 1242 | //menuBar->insertSeparator(); |
1225 | 1243 | ||
1226 | // ****************************************************** | 1244 | // ****************************************************** |
1227 | // menubar icons | 1245 | // menubar icons |
1228 | 1246 | ||
1229 | 1247 | ||
1230 | 1248 | ||
1231 | //menuBar->insertItem( iconToolBar ); | 1249 | //menuBar->insertItem( iconToolBar ); |
1232 | //xdays_action | 1250 | //xdays_action |
1233 | if (p-> mShowIconNewEvent) | 1251 | if (p-> mShowIconNewEvent) |
1234 | ne_action->addTo( iconToolBar ); | 1252 | ne_action->addTo( iconToolBar ); |
1235 | if (p->mShowIconNewTodo ) | 1253 | if (p->mShowIconNewTodo ) |
1236 | nt_action->addTo( iconToolBar ); | 1254 | nt_action->addTo( iconToolBar ); |
1237 | if (p-> mShowIconSearch) | 1255 | if (p-> mShowIconSearch) |
1238 | search_action->addTo( iconToolBar ); | 1256 | search_action->addTo( iconToolBar ); |
1239 | if (p-> mShowIconWhatsThis) | 1257 | if (p-> mShowIconWhatsThis) |
1240 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1258 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1241 | if (p-> mShowIconNext) | 1259 | if (p-> mShowIconNext) |
1242 | whatsnext_action->addTo( viewToolBar ); | 1260 | whatsnext_action->addTo( viewToolBar ); |
1243 | if (p-> mShowIconNextDays) | 1261 | if (p-> mShowIconNextDays) |
1244 | xdays_action->addTo( viewToolBar ); | 1262 | xdays_action->addTo( viewToolBar ); |
1245 | if (p-> mShowIconJournal) | 1263 | if (p-> mShowIconJournal) |
1246 | viewjournal_action->addTo( viewToolBar ); | 1264 | viewjournal_action->addTo( viewToolBar ); |
1247 | if (p-> mShowIconDay1) | 1265 | if (p-> mShowIconDay1) |
1248 | day1_action->addTo( viewToolBar ); | 1266 | day1_action->addTo( viewToolBar ); |
1249 | if (p-> mShowIconDay5) | 1267 | if (p-> mShowIconDay5) |
1250 | day5_action->addTo( viewToolBar ); | 1268 | day5_action->addTo( viewToolBar ); |
1251 | if (p-> mShowIconDay7) | 1269 | if (p-> mShowIconDay7) |
1252 | day7_action->addTo( viewToolBar ); | 1270 | day7_action->addTo( viewToolBar ); |
1253 | if (p-> mShowIconDay6) | 1271 | if (p-> mShowIconDay6) |
1254 | day6_action->addTo( viewToolBar ); | 1272 | day6_action->addTo( viewToolBar ); |
1255 | if (p-> mShowIconMonth) | 1273 | if (p-> mShowIconMonth) |
1256 | month_action->addTo( viewToolBar ); | 1274 | month_action->addTo( viewToolBar ); |
1257 | if (p-> mShowIconList) | 1275 | if (p-> mShowIconList) |
1258 | showlist_action->addTo( viewToolBar ); | 1276 | showlist_action->addTo( viewToolBar ); |
1259 | if (p-> mShowIconTodoview) | 1277 | if (p-> mShowIconTodoview) |
@@ -1312,512 +1330,513 @@ void MainWindow::initActions() | |||
1312 | if (p-> mShowIconSearch) | 1330 | if (p-> mShowIconSearch) |
1313 | configureToolBarMenu->setItemChecked( 120, true ); | 1331 | configureToolBarMenu->setItemChecked( 120, true ); |
1314 | if (p-> mShowIconList) | 1332 | if (p-> mShowIconList) |
1315 | configureToolBarMenu->setItemChecked( 30, true ); | 1333 | configureToolBarMenu->setItemChecked( 30, true ); |
1316 | if (p-> mShowIconDay1) | 1334 | if (p-> mShowIconDay1) |
1317 | configureToolBarMenu->setItemChecked( 40, true ); | 1335 | configureToolBarMenu->setItemChecked( 40, true ); |
1318 | if (p-> mShowIconDay5) | 1336 | if (p-> mShowIconDay5) |
1319 | configureToolBarMenu->setItemChecked( 50, true ); | 1337 | configureToolBarMenu->setItemChecked( 50, true ); |
1320 | if (p-> mShowIconDay6) | 1338 | if (p-> mShowIconDay6) |
1321 | configureToolBarMenu->setItemChecked( 75, true ); | 1339 | configureToolBarMenu->setItemChecked( 75, true ); |
1322 | if (p-> mShowIconDay7) | 1340 | if (p-> mShowIconDay7) |
1323 | configureToolBarMenu->setItemChecked( 60, true ); | 1341 | configureToolBarMenu->setItemChecked( 60, true ); |
1324 | if (p-> mShowIconMonth) | 1342 | if (p-> mShowIconMonth) |
1325 | configureToolBarMenu->setItemChecked( 70, true ); | 1343 | configureToolBarMenu->setItemChecked( 70, true ); |
1326 | if (p-> mShowIconTodoview) | 1344 | if (p-> mShowIconTodoview) |
1327 | configureToolBarMenu->setItemChecked( 80, true ); | 1345 | configureToolBarMenu->setItemChecked( 80, true ); |
1328 | if (p-> mShowIconBackFast) | 1346 | if (p-> mShowIconBackFast) |
1329 | configureToolBarMenu->setItemChecked( 200, true ); | 1347 | configureToolBarMenu->setItemChecked( 200, true ); |
1330 | if (p-> mShowIconBack) | 1348 | if (p-> mShowIconBack) |
1331 | configureToolBarMenu->setItemChecked( 210, true ); | 1349 | configureToolBarMenu->setItemChecked( 210, true ); |
1332 | if (p-> mShowIconToday) | 1350 | if (p-> mShowIconToday) |
1333 | configureToolBarMenu->setItemChecked( 130, true ); | 1351 | configureToolBarMenu->setItemChecked( 130, true ); |
1334 | if (p-> mShowIconForward) | 1352 | if (p-> mShowIconForward) |
1335 | configureToolBarMenu->setItemChecked( 220, true ); | 1353 | configureToolBarMenu->setItemChecked( 220, true ); |
1336 | if (p-> mShowIconForwardFast) | 1354 | if (p-> mShowIconForwardFast) |
1337 | configureToolBarMenu->setItemChecked( 230, true ); | 1355 | configureToolBarMenu->setItemChecked( 230, true ); |
1338 | if (p-> mShowIconNextDays) | 1356 | if (p-> mShowIconNextDays) |
1339 | configureToolBarMenu->setItemChecked( 100, true ); | 1357 | configureToolBarMenu->setItemChecked( 100, true ); |
1340 | if (p-> mShowIconNext) | 1358 | if (p-> mShowIconNext) |
1341 | configureToolBarMenu->setItemChecked( 110, true ); | 1359 | configureToolBarMenu->setItemChecked( 110, true ); |
1342 | if (p-> mShowIconJournal) | 1360 | if (p-> mShowIconJournal) |
1343 | configureToolBarMenu->setItemChecked( 90, true ); | 1361 | configureToolBarMenu->setItemChecked( 90, true ); |
1344 | if (p-> mShowIconWhatsThis) | 1362 | if (p-> mShowIconWhatsThis) |
1345 | configureToolBarMenu->setItemChecked( 300, true ); | 1363 | configureToolBarMenu->setItemChecked( 300, true ); |
1346 | if (p-> mShowIconWeekNum) | 1364 | if (p-> mShowIconWeekNum) |
1347 | configureToolBarMenu->setItemChecked( 400, true ); | 1365 | configureToolBarMenu->setItemChecked( 400, true ); |
1348 | if (!p-> mShowIconStretch) { | 1366 | if (!p-> mShowIconStretch) { |
1349 | QLabel* dummy = new QLabel( iconToolBar ); | 1367 | QLabel* dummy = new QLabel( iconToolBar ); |
1350 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1368 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1351 | dummy->setMinimumWidth( 0 ); | 1369 | dummy->setMinimumWidth( 0 ); |
1352 | iconToolBar->setStretchableWidget ( dummy ) ; | 1370 | iconToolBar->setStretchableWidget ( dummy ) ; |
1353 | } | 1371 | } |
1354 | else { | 1372 | else { |
1355 | iconToolBar->setHorizontalStretchable (true ); | 1373 | iconToolBar->setHorizontalStretchable (true ); |
1356 | viewToolBar->setHorizontalStretchable (true ); | 1374 | viewToolBar->setHorizontalStretchable (true ); |
1357 | navigatorToolBar->setHorizontalStretchable (true ); | 1375 | navigatorToolBar->setHorizontalStretchable (true ); |
1358 | iconToolBar->setVerticalStretchable (true ); | 1376 | iconToolBar->setVerticalStretchable (true ); |
1359 | viewToolBar->setVerticalStretchable (true ); | 1377 | viewToolBar->setVerticalStretchable (true ); |
1360 | navigatorToolBar->setVerticalStretchable (true ); | 1378 | navigatorToolBar->setVerticalStretchable (true ); |
1361 | configureToolBarMenu->setItemChecked( 5, true ); | 1379 | configureToolBarMenu->setItemChecked( 5, true ); |
1362 | } | 1380 | } |
1363 | if (p-> mShowIconFilter) | 1381 | if (p-> mShowIconFilter) |
1364 | configureToolBarMenu->setItemChecked( 7, true ); | 1382 | configureToolBarMenu->setItemChecked( 7, true ); |
1365 | if (p-> mShowIconOnetoolbar) | 1383 | if (p-> mShowIconOnetoolbar) |
1366 | configureToolBarMenu->setItemChecked( 6, true ); | 1384 | configureToolBarMenu->setItemChecked( 6, true ); |
1367 | 1385 | ||
1368 | 1386 | ||
1369 | if ( filterMenubar ) { | 1387 | if ( filterMenubar ) { |
1370 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); | 1388 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); |
1371 | connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) ); | 1389 | connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) ); |
1372 | } | 1390 | } |
1373 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1391 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1374 | configureAgenda( p->mHourSize ); | 1392 | configureAgenda( p->mHourSize ); |
1375 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1393 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1376 | } | 1394 | } |
1377 | void MainWindow::calHint() | 1395 | void MainWindow::calHint() |
1378 | { | 1396 | { |
1379 | QString message = i18n("You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>."); | 1397 | QString message = i18n("You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>."); |
1380 | 1398 | ||
1381 | KMessageBox::information( this, message); | 1399 | KMessageBox::information( this, message); |
1382 | } | 1400 | } |
1383 | void MainWindow::exportToPhone( int mode ) | 1401 | void MainWindow::exportToPhone( int mode ) |
1384 | { | 1402 | { |
1385 | 1403 | ||
1386 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1404 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1387 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1405 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1388 | KOex2phonePrefs ex2phone; | 1406 | KOex2phonePrefs ex2phone; |
1389 | 1407 | ||
1390 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1408 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1391 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1409 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1392 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1410 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1393 | if ( mode == 1 ) | 1411 | if ( mode == 1 ) |
1394 | ex2phone.setCaption(i18n("Export complete calendar")); | 1412 | ex2phone.setCaption(i18n("Export complete calendar")); |
1395 | if ( mode == 2 ) | 1413 | if ( mode == 2 ) |
1396 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1414 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1397 | 1415 | ||
1398 | if ( !ex2phone.exec() ) { | 1416 | if ( !ex2phone.exec() ) { |
1399 | return; | 1417 | return; |
1400 | } | 1418 | } |
1401 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1419 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1402 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1420 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1403 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1421 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1404 | 1422 | ||
1405 | int inFuture = 0; | 1423 | int inFuture = 0; |
1406 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1424 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1407 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1425 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1408 | QPtrList<Incidence> delSel; | 1426 | QPtrList<Incidence> delSel; |
1409 | if ( mode == 1 ) | 1427 | if ( mode == 1 ) |
1410 | delSel = mCalendar->rawIncidences(); | 1428 | delSel = mCalendar->rawIncidences(); |
1411 | if ( mode == 2 ) | 1429 | if ( mode == 2 ) |
1412 | delSel = mCalendar->incidences(); | 1430 | delSel = mCalendar->incidences(); |
1413 | CalendarLocal* cal = new CalendarLocal(); | 1431 | CalendarLocal* cal = new CalendarLocal(); |
1414 | cal->setLocalTime(); | 1432 | cal->setLocalTime(); |
1415 | Incidence *incidence = delSel.first(); | 1433 | Incidence *incidence = delSel.first(); |
1416 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1434 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1417 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1435 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1418 | while ( incidence ) { | 1436 | while ( incidence ) { |
1419 | if ( incidence->typeID() != journalID ) { | 1437 | if ( incidence->typeID() != journalID ) { |
1420 | bool add = true; | 1438 | bool add = true; |
1421 | if ( inFuture ) { | 1439 | if ( inFuture ) { |
1422 | QDateTime dt; | 1440 | QDateTime dt; |
1423 | if ( incidence->typeID() == todoID ) { | 1441 | if ( incidence->typeID() == todoID ) { |
1424 | Todo * t = (Todo*)incidence; | 1442 | Todo * t = (Todo*)incidence; |
1425 | if ( t->hasDueDate() ) | 1443 | if ( t->hasDueDate() ) |
1426 | dt = t->dtDue(); | 1444 | dt = t->dtDue(); |
1427 | else | 1445 | else |
1428 | dt = cur.addSecs( 62 ); | 1446 | dt = cur.addSecs( 62 ); |
1429 | } | 1447 | } |
1430 | else { | 1448 | else { |
1431 | bool ok; | 1449 | bool ok; |
1432 | dt = incidence->getNextOccurence( cur, &ok ); | 1450 | dt = incidence->getNextOccurence( cur, &ok ); |
1433 | if ( !ok ) | 1451 | if ( !ok ) |
1434 | dt = cur.addSecs( -62 ); | 1452 | dt = cur.addSecs( -62 ); |
1435 | } | 1453 | } |
1436 | if ( dt < cur || dt > end ) { | 1454 | if ( dt < cur || dt > end ) { |
1437 | add = false; | 1455 | add = false; |
1438 | } | 1456 | } |
1439 | } | 1457 | } |
1440 | if ( add ) { | 1458 | if ( add ) { |
1441 | Incidence *in = incidence->clone(); | 1459 | Incidence *in = incidence->clone(); |
1442 | cal->addIncidence( in ); | 1460 | cal->addIncidence( in ); |
1443 | } | 1461 | } |
1444 | } | 1462 | } |
1445 | incidence = delSel.next(); | 1463 | incidence = delSel.next(); |
1446 | } | 1464 | } |
1447 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1465 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1448 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1466 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1449 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1467 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1450 | 1468 | ||
1451 | setCaption( i18n("Writing to phone...")); | 1469 | setCaption( i18n("Writing to phone...")); |
1452 | if ( PhoneFormat::writeToPhone( cal ) ) | 1470 | if ( PhoneFormat::writeToPhone( cal ) ) |
1453 | setCaption( i18n("Export to phone successful!")); | 1471 | setCaption( i18n("Export to phone successful!")); |
1454 | else | 1472 | else |
1455 | setCaption( i18n("Error exporting to phone!")); | 1473 | setCaption( i18n("Error exporting to phone!")); |
1456 | delete cal; | 1474 | delete cal; |
1457 | } | 1475 | } |
1458 | 1476 | ||
1459 | 1477 | ||
1460 | void MainWindow::setDefaultPreferences() | 1478 | void MainWindow::setDefaultPreferences() |
1461 | { | 1479 | { |
1462 | KOPrefs *p = KOPrefs::instance(); | 1480 | KOPrefs *p = KOPrefs::instance(); |
1463 | 1481 | ||
1464 | p->mCompactDialogs = true; | 1482 | p->mCompactDialogs = true; |
1465 | p->mConfirm = true; | 1483 | p->mConfirm = true; |
1466 | // p->mEnableQuickTodo = false; | 1484 | // p->mEnableQuickTodo = false; |
1467 | 1485 | ||
1468 | } | 1486 | } |
1469 | 1487 | ||
1470 | QString MainWindow::resourcePath() | 1488 | QString MainWindow::resourcePath() |
1471 | { | 1489 | { |
1472 | return KGlobal::iconLoader()->iconPath(); | 1490 | return KGlobal::iconLoader()->iconPath(); |
1473 | } | 1491 | } |
1474 | 1492 | ||
1475 | void MainWindow::displayText( QString text ,QString cap ) | 1493 | void MainWindow::displayText( QString text ,QString cap ) |
1476 | { | 1494 | { |
1477 | QDialog dia( this, "name", true ); ; | 1495 | QDialog dia( this, "name", true ); ; |
1478 | dia.setCaption( cap ); | 1496 | dia.setCaption( cap ); |
1479 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1497 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1480 | lay->setSpacing( 3 ); | 1498 | lay->setSpacing( 3 ); |
1481 | lay->setMargin( 3 ); | 1499 | lay->setMargin( 3 ); |
1482 | QTextBrowser tb ( &dia ); | 1500 | QTextBrowser tb ( &dia ); |
1483 | lay->addWidget( &tb ); | 1501 | lay->addWidget( &tb ); |
1484 | tb.setText( text ); | 1502 | tb.setText( text ); |
1485 | #ifdef DESKTOP_VERSION | 1503 | #ifdef DESKTOP_VERSION |
1486 | dia.resize( 640, 480); | 1504 | dia.resize( 640, 480); |
1487 | #else | 1505 | #else |
1488 | dia.showMaximized(); | 1506 | dia.showMaximized(); |
1489 | #endif | 1507 | #endif |
1490 | dia.exec(); | 1508 | dia.exec(); |
1491 | } | 1509 | } |
1492 | 1510 | ||
1493 | void MainWindow::features() | 1511 | void MainWindow::features() |
1494 | { | 1512 | { |
1495 | 1513 | ||
1496 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1514 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1497 | } | 1515 | } |
1498 | 1516 | ||
1499 | void MainWindow::usertrans() | 1517 | void MainWindow::usertrans() |
1500 | { | 1518 | { |
1501 | 1519 | ||
1502 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1520 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1503 | } | 1521 | } |
1504 | 1522 | ||
1505 | void MainWindow::storagehowto() | 1523 | void MainWindow::storagehowto() |
1506 | { | 1524 | { |
1507 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1525 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1508 | } | 1526 | } |
1509 | void MainWindow::timetrackinghowto() | 1527 | void MainWindow::timetrackinghowto() |
1510 | { | 1528 | { |
1511 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1529 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1512 | } | 1530 | } |
1513 | void MainWindow::kdesynchowto() | 1531 | void MainWindow::kdesynchowto() |
1514 | { | 1532 | { |
1515 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1533 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1516 | } | 1534 | } |
1517 | void MainWindow::multisynchowto() | 1535 | void MainWindow::multisynchowto() |
1518 | { | 1536 | { |
1519 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1537 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1520 | } | 1538 | } |
1521 | void MainWindow::synchowto() | 1539 | void MainWindow::synchowto() |
1522 | { | 1540 | { |
1523 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1541 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1524 | } | 1542 | } |
1525 | void MainWindow::faq() | 1543 | void MainWindow::faq() |
1526 | { | 1544 | { |
1527 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1545 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1528 | 1546 | ||
1529 | } | 1547 | } |
1530 | void MainWindow::whatsNew() | 1548 | void MainWindow::whatsNew() |
1531 | { | 1549 | { |
1532 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1550 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1533 | 1551 | ||
1534 | } | 1552 | } |
1535 | void MainWindow::licence() | 1553 | void MainWindow::licence() |
1536 | { | 1554 | { |
1537 | KApplication::showLicence(); | 1555 | KApplication::showLicence(); |
1538 | 1556 | ||
1539 | } | 1557 | } |
1540 | void MainWindow::about() | 1558 | void MainWindow::about() |
1541 | { | 1559 | { |
1542 | QString version; | 1560 | QString version; |
1543 | #include <../version> | 1561 | #include <../version> |
1544 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1562 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1545 | i18n("KOrganizer/Platform-independent\n") + | 1563 | i18n("KOrganizer/Platform-independent\n") + |
1546 | "(KO/Pi) " + version + " - " + | 1564 | "(KO/Pi) " + version + " - " + |
1547 | 1565 | ||
1548 | #ifdef DESKTOP_VERSION | 1566 | #ifdef DESKTOP_VERSION |
1549 | i18n("Desktop Edition\n") + | 1567 | i18n("Desktop Edition\n") + |
1550 | #else | 1568 | #else |
1551 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1569 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1552 | #endif | 1570 | #endif |
1553 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1571 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1554 | } | 1572 | } |
1555 | void MainWindow::keyBindings() | 1573 | void MainWindow::keyBindings() |
1556 | { | 1574 | { |
1557 | QString cap = i18n("KO/Pi Keys + Colors"); | 1575 | QString cap = i18n("KO/Pi Keys + Colors"); |
1558 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1576 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1559 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1577 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1560 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1578 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1561 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1579 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1562 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1580 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1563 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1581 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1564 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ | 1582 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ |
1565 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1583 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1566 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1584 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1567 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1585 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1586 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ | ||
1568 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1587 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1569 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1588 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1570 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1589 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1571 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1590 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1572 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1591 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1573 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1592 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1574 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ | 1593 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ |
1575 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1594 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1576 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1595 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1577 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1596 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1578 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1597 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1579 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1598 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1580 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1599 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1581 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1600 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1582 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1601 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1583 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1602 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1584 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1603 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1585 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1604 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1586 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1605 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1587 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1606 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1588 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1607 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1589 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1608 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1590 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1609 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1591 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1610 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1592 | i18n("<p><h3>In list view:</h3></p>\n") + | 1611 | i18n("<p><h3>In list view:</h3></p>\n") + |
1593 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1612 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1594 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1613 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1595 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1614 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1596 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1615 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1597 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1616 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1598 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1617 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1599 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1618 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1600 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1619 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1601 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1620 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1602 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1621 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1603 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1622 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1604 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1623 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1605 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1624 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1606 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1625 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1607 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1626 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1608 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1627 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1609 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1628 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1610 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1629 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1611 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1630 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1612 | displayText( text, cap); | 1631 | displayText( text, cap); |
1613 | } | 1632 | } |
1614 | void MainWindow::aboutAutoSaving() | 1633 | void MainWindow::aboutAutoSaving() |
1615 | { | 1634 | { |
1616 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1635 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1617 | 1636 | ||
1618 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1637 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1619 | 1638 | ||
1620 | } | 1639 | } |
1621 | void MainWindow::aboutKnownBugs() | 1640 | void MainWindow::aboutKnownBugs() |
1622 | { | 1641 | { |
1623 | QMessageBox* msg; | 1642 | QMessageBox* msg; |
1624 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1643 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1625 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1644 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1626 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1645 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1627 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1646 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1628 | i18n("\nor report them in the bugtracker on\n") + | 1647 | i18n("\nor report them in the bugtracker on\n") + |
1629 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1648 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1630 | QMessageBox::NoIcon, | 1649 | QMessageBox::NoIcon, |
1631 | QMessageBox::Ok, | 1650 | QMessageBox::Ok, |
1632 | QMessageBox::NoButton, | 1651 | QMessageBox::NoButton, |
1633 | QMessageBox::NoButton); | 1652 | QMessageBox::NoButton); |
1634 | msg->exec(); | 1653 | msg->exec(); |
1635 | delete msg; | 1654 | delete msg; |
1636 | 1655 | ||
1637 | } | 1656 | } |
1638 | 1657 | ||
1639 | QString MainWindow::defaultFileName() | 1658 | QString MainWindow::defaultFileName() |
1640 | { | 1659 | { |
1641 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1660 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1642 | } | 1661 | } |
1643 | QString MainWindow::syncFileName() | 1662 | QString MainWindow::syncFileName() |
1644 | { | 1663 | { |
1645 | #ifdef DESKTOP_VERSION | 1664 | #ifdef DESKTOP_VERSION |
1646 | return locateLocal( "tmp", "synccalendar.ics" ); | 1665 | return locateLocal( "tmp", "synccalendar.ics" ); |
1647 | #else | 1666 | #else |
1648 | return QString( "/tmp/synccalendar.ics" ); | 1667 | return QString( "/tmp/synccalendar.ics" ); |
1649 | #endif | 1668 | #endif |
1650 | } | 1669 | } |
1651 | #include "koglobals.h" | 1670 | #include "koglobals.h" |
1652 | #include <kcalendarsystem.h> | 1671 | #include <kcalendarsystem.h> |
1653 | void MainWindow::updateWeek(QDate seda) | 1672 | void MainWindow::updateWeek(QDate seda) |
1654 | { | 1673 | { |
1655 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1674 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1656 | mWeekPixmap.fill( mWeekBgColor ); | 1675 | mWeekPixmap.fill( mWeekBgColor ); |
1657 | QPainter p ( &mWeekPixmap ); | 1676 | QPainter p ( &mWeekPixmap ); |
1658 | p.setFont( mWeekFont ); | 1677 | p.setFont( mWeekFont ); |
1659 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1678 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1660 | p.end(); | 1679 | p.end(); |
1661 | QIconSet icon3 ( mWeekPixmap ); | 1680 | QIconSet icon3 ( mWeekPixmap ); |
1662 | mWeekAction->setIconSet ( icon3 ); | 1681 | mWeekAction->setIconSet ( icon3 ); |
1663 | 1682 | ||
1664 | } | 1683 | } |
1665 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1684 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1666 | { | 1685 | { |
1667 | updateWeek( selectedDates.first() ); | 1686 | updateWeek( selectedDates.first() ); |
1668 | } | 1687 | } |
1669 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1688 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1670 | { | 1689 | { |
1671 | if ( !incidence ) { | 1690 | if ( !incidence ) { |
1672 | mShowAction->setMenuText( i18n("Show") ); | 1691 | mShowAction->setMenuText( i18n("Show") ); |
1673 | enableIncidenceActions( false ); | 1692 | enableIncidenceActions( false ); |
1674 | mNewSubTodoAction->setEnabled( false ); | 1693 | mNewSubTodoAction->setEnabled( false ); |
1675 | setCaptionToDates(); | 1694 | setCaptionToDates(); |
1676 | return; | 1695 | return; |
1677 | } | 1696 | } |
1678 | QString startString = ""; | 1697 | QString startString = ""; |
1679 | if ( incidence->typeID() != todoID ) { | 1698 | if ( incidence->typeID() != todoID ) { |
1680 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1699 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1681 | if ( incidence->doesFloat() ) { | 1700 | if ( incidence->doesFloat() ) { |
1682 | startString += ": "+incidence->dtStartDateStr( true ); | 1701 | startString += ": "+incidence->dtStartDateStr( true ); |
1683 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1702 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1684 | } else { | 1703 | } else { |
1685 | startString = ": "+incidence->dtStartStr(true); | 1704 | startString = ": "+incidence->dtStartStr(true); |
1686 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1705 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1687 | } | 1706 | } |
1688 | } else { | 1707 | } else { |
1689 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1708 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1690 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1709 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1691 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1710 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1692 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1711 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1693 | bool ok; | 1712 | bool ok; |
1694 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1713 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1695 | if ( ok ) { | 1714 | if ( ok ) { |
1696 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1715 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1697 | startString += i18n(" (%1 y.)"). arg( years ); | 1716 | startString += i18n(" (%1 y.)"). arg( years ); |
1698 | } | 1717 | } |
1699 | } | 1718 | } |
1700 | else | 1719 | else |
1701 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1720 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1702 | } | 1721 | } |
1703 | } | 1722 | } |
1704 | else { | 1723 | else { |
1705 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) | 1724 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) |
1706 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); | 1725 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); |
1707 | else | 1726 | else |
1708 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1727 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1709 | } | 1728 | } |
1710 | if ( !incidence->location().isEmpty() ) | 1729 | if ( !incidence->location().isEmpty() ) |
1711 | startString += " (" +incidence->location()+")"; | 1730 | startString += " (" +incidence->location()+")"; |
1712 | setCaption( incidence->summary()+startString); | 1731 | setCaption( incidence->summary()+startString); |
1713 | enableIncidenceActions( true ); | 1732 | enableIncidenceActions( true ); |
1714 | if ( incidence->typeID() == eventID ) { | 1733 | if ( incidence->typeID() == eventID ) { |
1715 | mShowAction->setMenuText( i18n("Show Event") ); | 1734 | mShowAction->setMenuText( i18n("Show Event") ); |
1716 | mNewSubTodoAction->setEnabled( false ); | 1735 | mNewSubTodoAction->setEnabled( false ); |
1717 | } else if ( incidence->typeID() == todoID ) { | 1736 | } else if ( incidence->typeID() == todoID ) { |
1718 | mShowAction->setMenuText( i18n("Show Todo") ); | 1737 | mShowAction->setMenuText( i18n("Show Todo") ); |
1719 | mNewSubTodoAction->setEnabled( true ); | 1738 | mNewSubTodoAction->setEnabled( true ); |
1720 | } else { | 1739 | } else { |
1721 | mShowAction->setMenuText( i18n("Show") ); | 1740 | mShowAction->setMenuText( i18n("Show") ); |
1722 | mNewSubTodoAction->setEnabled( false ); | 1741 | mNewSubTodoAction->setEnabled( false ); |
1723 | } | 1742 | } |
1724 | } | 1743 | } |
1725 | 1744 | ||
1726 | void MainWindow::enableIncidenceActions( bool enabled ) | 1745 | void MainWindow::enableIncidenceActions( bool enabled ) |
1727 | { | 1746 | { |
1728 | mShowAction->setEnabled( enabled ); | 1747 | mShowAction->setEnabled( enabled ); |
1729 | mEditAction->setEnabled( enabled ); | 1748 | mEditAction->setEnabled( enabled ); |
1730 | mDeleteAction->setEnabled( enabled ); | 1749 | mDeleteAction->setEnabled( enabled ); |
1731 | 1750 | ||
1732 | mCloneAction->setEnabled( enabled ); | 1751 | mCloneAction->setEnabled( enabled ); |
1733 | mMoveAction->setEnabled( enabled ); | 1752 | mMoveAction->setEnabled( enabled ); |
1734 | #ifndef DESKTOP_VERSION | 1753 | #ifndef DESKTOP_VERSION |
1735 | mBeamAction->setEnabled( enabled ); | 1754 | mBeamAction->setEnabled( enabled ); |
1736 | #endif | 1755 | #endif |
1737 | mCancelAction->setEnabled( enabled ); | 1756 | mCancelAction->setEnabled( enabled ); |
1738 | } | 1757 | } |
1739 | 1758 | ||
1740 | void MainWindow::importOL() | 1759 | void MainWindow::importOL() |
1741 | { | 1760 | { |
1742 | #ifdef _OL_IMPORT_ | 1761 | #ifdef _OL_IMPORT_ |
1743 | mView->clearAllViews(); | 1762 | mView->clearAllViews(); |
1744 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1763 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1745 | id->exec(); | 1764 | id->exec(); |
1746 | delete id; | 1765 | delete id; |
1747 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1766 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1748 | mView->updateView(); | 1767 | mView->updateView(); |
1749 | #endif | 1768 | #endif |
1750 | } | 1769 | } |
1751 | void MainWindow::importBday() | 1770 | void MainWindow::importBday() |
1752 | { | 1771 | { |
1753 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), | 1772 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1754 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1773 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1755 | i18n("Import!"), i18n("Cancel"), 0, | 1774 | i18n("Import!"), i18n("Cancel"), 0, |
1756 | 0, 1 ); | 1775 | 0, 1 ); |
1757 | if ( result == 0 ) { | 1776 | if ( result == 0 ) { |
1758 | mView->importBday(); | 1777 | mView->importBday(); |
1759 | 1778 | ||
1760 | } | 1779 | } |
1761 | 1780 | ||
1762 | 1781 | ||
1763 | } | 1782 | } |
1764 | void MainWindow::importQtopia() | 1783 | void MainWindow::importQtopia() |
1765 | { | 1784 | { |
1766 | //#ifndef DESKTOP_VERSION | 1785 | //#ifndef DESKTOP_VERSION |
1767 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1786 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1768 | #ifdef DESKTOP_VERSION | 1787 | #ifdef DESKTOP_VERSION |
1769 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1788 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1770 | #endif | 1789 | #endif |
1771 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1790 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1772 | i18n("Import!"), i18n("Cancel"), 0, | 1791 | i18n("Import!"), i18n("Cancel"), 0, |
1773 | 0, 1 ); | 1792 | 0, 1 ); |
1774 | if ( result == 0 ) { | 1793 | if ( result == 0 ) { |
1775 | #ifndef DESKTOP_VERSION | 1794 | #ifndef DESKTOP_VERSION |
1776 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1795 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1777 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1796 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1778 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1797 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1779 | #else | 1798 | #else |
1780 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1799 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1781 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1800 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1782 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1801 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1783 | #endif | 1802 | #endif |
1784 | mView->importQtopia( categories, datebook, todolist ); | 1803 | mView->importQtopia( categories, datebook, todolist ); |
1785 | } | 1804 | } |
1786 | mView->calendar()->reInitAlarmSettings(); | 1805 | mView->calendar()->reInitAlarmSettings(); |
1787 | #if 0 | 1806 | #if 0 |
1788 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1807 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1789 | i18n("Not supported \non desktop!\n"), | 1808 | i18n("Not supported \non desktop!\n"), |
1790 | i18n("Ok"), i18n("Cancel"), 0, | 1809 | i18n("Ok"), i18n("Cancel"), 0, |
1791 | 0, 1 ); | 1810 | 0, 1 ); |
1792 | 1811 | ||
1793 | #endif | 1812 | #endif |
1794 | } | 1813 | } |
1795 | 1814 | ||
1796 | void MainWindow::saveOnClose() | 1815 | void MainWindow::saveOnClose() |
1797 | { | 1816 | { |
1798 | KOPrefs *p = KOPrefs::instance(); | 1817 | KOPrefs *p = KOPrefs::instance(); |
1799 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1818 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1800 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1819 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1801 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1820 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1802 | if ( filterToolBar ) { | 1821 | if ( filterToolBar ) { |
1803 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1822 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1804 | } | 1823 | } |
1805 | #ifdef DESKTOP_VERSION | 1824 | #ifdef DESKTOP_VERSION |
1806 | 1825 | ||
1807 | QPoint myP; | 1826 | QPoint myP; |
1808 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1827 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1809 | if ( p->mToolBarHor ) | 1828 | if ( p->mToolBarHor ) |
1810 | p->mToolBarUp = myP.y() > height()/2; | 1829 | p->mToolBarUp = myP.y() > height()/2; |
1811 | else | 1830 | else |
1812 | p->mToolBarUp = myP.x() > width()/2; | 1831 | p->mToolBarUp = myP.x() > width()/2; |
1813 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1832 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1814 | if ( p->mToolBarHorV ) | 1833 | if ( p->mToolBarHorV ) |
1815 | p->mToolBarUpV = myP.y() > height()/2; | 1834 | p->mToolBarUpV = myP.y() > height()/2; |
1816 | else | 1835 | else |
1817 | p->mToolBarUpV = myP.x() > width()/2 ; | 1836 | p->mToolBarUpV = myP.x() > width()/2 ; |
1818 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1837 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1819 | if ( p->mToolBarHorN ) | 1838 | if ( p->mToolBarHorN ) |
1820 | p->mToolBarUpN = myP.y() > height()/2; | 1839 | p->mToolBarUpN = myP.y() > height()/2; |
1821 | else | 1840 | else |
1822 | p->mToolBarUpN = myP.x() > width()/2 ; | 1841 | p->mToolBarUpN = myP.x() > width()/2 ; |
1823 | if ( filterToolBar ) { | 1842 | if ( filterToolBar ) { |
@@ -1846,512 +1865,520 @@ void MainWindow::saveOnClose() | |||
1846 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1865 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1847 | else | 1866 | else |
1848 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1867 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1849 | } | 1868 | } |
1850 | #endif | 1869 | #endif |
1851 | save(); | 1870 | save(); |
1852 | mView->writeSettings(); | 1871 | mView->writeSettings(); |
1853 | mView->checkSuspendAlarm(); | 1872 | mView->checkSuspendAlarm(); |
1854 | } | 1873 | } |
1855 | void MainWindow::slotModifiedChanged( bool ) | 1874 | void MainWindow::slotModifiedChanged( bool ) |
1856 | { | 1875 | { |
1857 | if ( mBlockAtStartup ) | 1876 | if ( mBlockAtStartup ) |
1858 | return; | 1877 | return; |
1859 | 1878 | ||
1860 | int msec; | 1879 | int msec; |
1861 | // we store the changes after 1 minute, | 1880 | // we store the changes after 1 minute, |
1862 | // and for safety reasons after 10 minutes again | 1881 | // and for safety reasons after 10 minutes again |
1863 | if ( !mSyncManager->blockSave() ) | 1882 | if ( !mSyncManager->blockSave() ) |
1864 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1883 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1865 | else | 1884 | else |
1866 | msec = 1000 * 600; | 1885 | msec = 1000 * 600; |
1867 | mSaveTimer.start( msec, true ); // 1 minute | 1886 | mSaveTimer.start( msec, true ); // 1 minute |
1868 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1887 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1869 | mCalendarModifiedFlag = true; | 1888 | mCalendarModifiedFlag = true; |
1870 | } | 1889 | } |
1871 | void MainWindow::saveStopTimer() | 1890 | void MainWindow::saveStopTimer() |
1872 | { | 1891 | { |
1873 | mSaveTimer.stop(); | 1892 | mSaveTimer.stop(); |
1874 | } | 1893 | } |
1875 | void MainWindow::backupAllFiles() | 1894 | void MainWindow::backupAllFiles() |
1876 | { | 1895 | { |
1877 | QDate reference ( 2000,1,1); | 1896 | QDate reference ( 2000,1,1); |
1878 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1897 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1879 | setCaption(i18n("Creating backup ... please wait ..." )); | 1898 | setCaption(i18n("Creating backup ... please wait ..." )); |
1880 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); | 1899 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); |
1881 | // we need the file path, the backup dir and the number of bups as param | 1900 | // we need the file path, the backup dir and the number of bups as param |
1882 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 1901 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
1883 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 1902 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
1884 | bupDir = KGlobalSettings::backupDataDir(); | 1903 | bupDir = KGlobalSettings::backupDataDir(); |
1885 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1904 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1886 | if ( retval == 0 ) { | 1905 | if ( retval == 0 ) { |
1887 | setCaption(i18n("Backup cancelled" )); | 1906 | setCaption(i18n("Backup cancelled" )); |
1888 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 1907 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
1889 | // retval == 0 : backup skipped for today, try again tomorrow | 1908 | // retval == 0 : backup skipped for today, try again tomorrow |
1890 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 1909 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
1891 | } else if ( retval == 1 ){ | 1910 | } else if ( retval == 1 ){ |
1892 | qDebug("KO: Backup created."); | 1911 | qDebug("KO: Backup created."); |
1893 | // backup ok | 1912 | // backup ok |
1894 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 1913 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
1895 | KopiCalendarFile * cal = calendars.first(); | 1914 | KopiCalendarFile * cal = calendars.first(); |
1896 | cal = calendars.next(); | 1915 | cal = calendars.next(); |
1897 | while ( cal ) { | 1916 | while ( cal ) { |
1898 | if ( !cal->mErrorOnLoad ) { | 1917 | if ( !cal->mErrorOnLoad ) { |
1899 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1918 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1900 | } | 1919 | } |
1901 | cal = calendars.next(); | 1920 | cal = calendars.next(); |
1902 | } | 1921 | } |
1903 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1922 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1904 | setCaption(i18n("Backup succesfully finished" )); | 1923 | setCaption(i18n("Backup succesfully finished" )); |
1905 | } else if ( retval == 2 ){ | 1924 | } else if ( retval == 2 ){ |
1906 | setCaption(i18n("Backup globally disabled" )); | 1925 | setCaption(i18n("Backup globally disabled" )); |
1907 | qDebug("KO: Backup globally cancelled."); | 1926 | qDebug("KO: Backup globally cancelled."); |
1908 | // backup globally cancelled | 1927 | // backup globally cancelled |
1909 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1928 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1910 | } | 1929 | } |
1911 | // retval == 3: do nothing, try again later | 1930 | // retval == 3: do nothing, try again later |
1912 | } | 1931 | } |
1913 | void MainWindow::save() | 1932 | void MainWindow::save() |
1914 | { | 1933 | { |
1915 | 1934 | ||
1916 | if ( mView->viewManager()->journalView() ) | 1935 | if ( mView->viewManager()->journalView() ) |
1917 | mView->viewManager()->journalView()->checkModified(); | 1936 | mView->viewManager()->journalView()->checkModified(); |
1918 | if ( !mCalendarModifiedFlag ) { | 1937 | if ( !mCalendarModifiedFlag ) { |
1919 | qDebug("KO: Calendar not modified. Nothing saved."); | 1938 | qDebug("KO: Calendar not modified. Nothing saved."); |
1920 | return; | 1939 | return; |
1921 | } | 1940 | } |
1922 | if ( mSyncManager->blockSave() ) | 1941 | if ( mSyncManager->blockSave() ) |
1923 | return; | 1942 | return; |
1924 | mSyncManager->setBlockSave(true); | 1943 | mSyncManager->setBlockSave(true); |
1925 | if ( mView->checkAllFileVersions() ) { | 1944 | if ( mView->checkAllFileVersions() ) { |
1926 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ | 1945 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ |
1927 | QDate reference ( 2000,1,1); | 1946 | QDate reference ( 2000,1,1); |
1928 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1947 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1929 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 1948 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
1930 | backupAllFiles(); | 1949 | backupAllFiles(); |
1931 | } | 1950 | } |
1932 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 1951 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
1933 | } | 1952 | } |
1934 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1953 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1935 | if ( !isMinimized () ) | 1954 | if ( !isMinimized () ) |
1936 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1955 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1937 | qDebug("KO: Start saving data to file!"); | 1956 | qDebug("KO: Start saving data to file!"); |
1938 | mView->saveCalendars(); | 1957 | mView->saveCalendars(); |
1939 | mCalendarModifiedFlag = false; | 1958 | mCalendarModifiedFlag = false; |
1940 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1959 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1941 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1960 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1942 | QString savemes; | 1961 | QString savemes; |
1943 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1962 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1944 | if ( !isMinimized () ) | 1963 | if ( !isMinimized () ) |
1945 | setCaption(savemes); | 1964 | setCaption(savemes); |
1946 | else | 1965 | else |
1947 | qDebug(savemes); | 1966 | qDebug(savemes); |
1948 | } else | 1967 | } else |
1949 | setCaption(i18n("Saving cancelled!")); | 1968 | setCaption(i18n("Saving cancelled!")); |
1950 | mSyncManager->setBlockSave( false ); | 1969 | mSyncManager->setBlockSave( false ); |
1951 | } | 1970 | } |
1952 | 1971 | ||
1953 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1972 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1954 | { | 1973 | { |
1955 | if ( !e->isAutoRepeat() ) { | 1974 | if ( !e->isAutoRepeat() ) { |
1956 | mFlagKeyPressed = false; | 1975 | mFlagKeyPressed = false; |
1957 | } | 1976 | } |
1958 | } | 1977 | } |
1959 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1978 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1960 | { | 1979 | { |
1961 | qApp->processEvents(); | 1980 | qApp->processEvents(); |
1962 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1981 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1963 | e->ignore(); | 1982 | e->ignore(); |
1964 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1983 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1965 | return; | 1984 | return; |
1966 | } | 1985 | } |
1967 | if (! e->isAutoRepeat() ) | 1986 | if (! e->isAutoRepeat() ) |
1968 | mFlagKeyPressed = true; | 1987 | mFlagKeyPressed = true; |
1969 | KOPrefs *p = KOPrefs::instance(); | 1988 | KOPrefs *p = KOPrefs::instance(); |
1970 | bool showSelectedDates = false; | 1989 | bool showSelectedDates = false; |
1971 | int size; | 1990 | int size; |
1972 | int pro = 0; | 1991 | int pro = 0; |
1973 | //qDebug("MainWindow::keyPressEvent "); | 1992 | //qDebug("MainWindow::keyPressEvent "); |
1974 | switch ( e->key() ) { | 1993 | switch ( e->key() ) { |
1975 | case Qt::Key_Right: | 1994 | case Qt::Key_Right: |
1976 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1995 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1977 | mView->goNextMonth(); | 1996 | mView->goNextMonth(); |
1978 | else | 1997 | else |
1979 | mView->goNext(); | 1998 | mView->goNext(); |
1980 | showSelectedDates = true; | 1999 | showSelectedDates = true; |
1981 | break; | 2000 | break; |
1982 | case Qt::Key_Left: | 2001 | case Qt::Key_Left: |
1983 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2002 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1984 | mView->goPreviousMonth(); | 2003 | mView->goPreviousMonth(); |
1985 | else | 2004 | else |
1986 | mView->goPrevious(); | 2005 | mView->goPrevious(); |
1987 | showSelectedDates = true; | 2006 | showSelectedDates = true; |
1988 | break; | 2007 | break; |
1989 | case Qt::Key_Down: | 2008 | case Qt::Key_Down: |
1990 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 2009 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1991 | break; | 2010 | break; |
1992 | case Qt::Key_Up: | 2011 | case Qt::Key_Up: |
1993 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 2012 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1994 | break; | 2013 | break; |
1995 | case Qt::Key_K: | 2014 | case Qt::Key_K: |
1996 | mView->viewManager()->showMonthViewWeek(); | 2015 | mView->viewManager()->showMonthViewWeek(); |
1997 | break; | 2016 | break; |
1998 | case Qt::Key_I: | 2017 | case Qt::Key_I: |
1999 | mView->showIncidence(); | 2018 | mView->showIncidence(); |
2000 | break; | 2019 | break; |
2001 | case Qt::Key_Delete: | 2020 | case Qt::Key_Delete: |
2002 | case Qt::Key_Backspace: | 2021 | case Qt::Key_Backspace: |
2003 | mView->deleteIncidence(); | 2022 | mView->deleteIncidence(); |
2004 | break; | 2023 | break; |
2005 | case Qt::Key_D: | 2024 | case Qt::Key_D: |
2006 | mView->viewManager()->showDayView(); | 2025 | mView->viewManager()->showDayView(); |
2007 | showSelectedDates = true; | 2026 | showSelectedDates = true; |
2008 | break; | 2027 | break; |
2009 | case Qt::Key_O: | 2028 | case Qt::Key_O: |
2010 | mView->toggleFilerEnabled( ); | 2029 | mView->toggleFilerEnabled( ); |
2011 | break; | 2030 | break; |
2012 | case Qt::Key_0: | 2031 | case Qt::Key_0: |
2013 | case Qt::Key_1: | 2032 | case Qt::Key_1: |
2014 | case Qt::Key_2: | 2033 | case Qt::Key_2: |
2015 | case Qt::Key_3: | 2034 | case Qt::Key_3: |
2016 | case Qt::Key_4: | 2035 | case Qt::Key_4: |
2017 | case Qt::Key_5: | 2036 | case Qt::Key_5: |
2018 | case Qt::Key_6: | 2037 | case Qt::Key_6: |
2019 | case Qt::Key_7: | 2038 | case Qt::Key_7: |
2020 | case Qt::Key_8: | 2039 | case Qt::Key_8: |
2021 | case Qt::Key_9: | 2040 | case Qt::Key_9: |
2022 | pro = e->key()-48; | 2041 | pro = e->key()-48; |
2023 | if ( pro == 0 ) | 2042 | if ( pro == 0 ) |
2024 | pro = 10; | 2043 | pro = 10; |
2025 | if ( e->state() == Qt::ControlButton) | 2044 | if ( e->state() == Qt::ControlButton) |
2026 | pro += 10; | 2045 | pro += 10; |
2027 | break; | 2046 | break; |
2028 | case Qt::Key_M: | 2047 | case Qt::Key_M: |
2029 | mView->viewManager()->showMonthView(); | 2048 | mView->viewManager()->showMonthView(); |
2030 | showSelectedDates = true; | 2049 | showSelectedDates = true; |
2031 | break; | 2050 | break; |
2032 | case Qt::Key_Insert: | 2051 | case Qt::Key_Insert: |
2033 | mView->newEvent(); | 2052 | mView->newEvent(); |
2034 | break; | 2053 | break; |
2035 | case Qt::Key_S : | 2054 | case Qt::Key_S : |
2036 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 2055 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
2037 | mView->newSubTodo(); | 2056 | mView->newSubTodo(); |
2038 | else | 2057 | else |
2039 | mView->dialogManager()->showSearchDialog(); | 2058 | mView->dialogManager()->showSearchDialog(); |
2040 | break; | 2059 | break; |
2041 | case Qt::Key_Y : | 2060 | case Qt::Key_Y : |
2042 | case Qt::Key_Z : | 2061 | case Qt::Key_Z : |
2043 | mView->viewManager()->showWorkWeekView(); | 2062 | mView->viewManager()->showWorkWeekView(); |
2044 | showSelectedDates = true; | 2063 | showSelectedDates = true; |
2045 | break; | 2064 | break; |
2046 | case Qt::Key_U : | 2065 | case Qt::Key_U : |
2047 | mView->viewManager()->showWeekView(); | 2066 | mView->viewManager()->showWeekView(); |
2048 | showSelectedDates = true; | 2067 | showSelectedDates = true; |
2049 | break; | 2068 | break; |
2050 | case Qt::Key_H : | 2069 | case Qt::Key_H : |
2051 | keyBindings(); | 2070 | keyBindings(); |
2052 | break; | 2071 | break; |
2053 | case Qt::Key_W: | 2072 | case Qt::Key_W: |
2054 | mView->viewManager()->showWhatsNextView(); | 2073 | mView->viewManager()->showWhatsNextView(); |
2055 | break; | 2074 | break; |
2056 | case Qt::Key_L: | 2075 | case Qt::Key_L: |
2057 | mView->viewManager()->showListView(); | 2076 | mView->viewManager()->showListView(); |
2058 | break; | 2077 | break; |
2059 | case Qt::Key_N: | 2078 | case Qt::Key_N: |
2060 | mView->viewManager()->showNextView(); | 2079 | mView->viewManager()->showNextView(); |
2061 | break; | 2080 | break; |
2062 | case Qt::Key_V: | 2081 | case Qt::Key_V: |
2063 | mView->viewManager()->showTodoView(); | 2082 | mView->viewManager()->showTodoView(); |
2064 | break; | 2083 | break; |
2065 | case Qt::Key_C: | 2084 | case Qt::Key_C: |
2066 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 2085 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
2067 | break; | 2086 | break; |
2068 | case Qt::Key_P: | 2087 | case Qt::Key_P: |
2069 | mView->showDatePicker( ); | 2088 | mView->showDatePicker( ); |
2070 | break; | 2089 | break; |
2071 | case Qt::Key_F: | 2090 | case Qt::Key_F: |
2072 | mView->editFilters(); | 2091 | mView->editFilters(); |
2073 | break; | 2092 | break; |
2074 | case Qt::Key_R: | 2093 | case Qt::Key_R: |
2075 | mView->toggleFilter(); | 2094 | mView->toggleFilter(); |
2076 | break; | 2095 | break; |
2077 | case Qt::Key_X: | 2096 | case Qt::Key_X: |
2078 | if ( e->state() == Qt::ControlButton ) | 2097 | if ( e->state() == Qt::ControlButton ) |
2079 | mView->toggleDateNavigatorWidget(); | 2098 | mView->toggleDateNavigatorWidget(); |
2080 | else { | 2099 | else { |
2081 | mView->viewManager()->showNextXView(); | 2100 | mView->viewManager()->showNextXView(); |
2082 | showSelectedDates = true; | 2101 | showSelectedDates = true; |
2083 | } | 2102 | } |
2084 | break; | 2103 | break; |
2085 | case Qt::Key_Space: | 2104 | case Qt::Key_Space: |
2086 | mView->toggleExpand(); | 2105 | mView->toggleExpand(); |
2087 | break; | 2106 | break; |
2088 | case Qt::Key_A: | 2107 | case Qt::Key_A: |
2089 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | 2108 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
2090 | mView->showNextAlarms(); | 2109 | mView->showNextAlarms(); |
2091 | else | 2110 | else |
2092 | mView->toggleAllDaySize(); | 2111 | mView->toggleAllDaySize(); |
2093 | break; | 2112 | break; |
2094 | case Qt::Key_T: | 2113 | case Qt::Key_T: |
2095 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2114 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2096 | mView->newTodo(); | 2115 | mView->newTodo(); |
2097 | else { | 2116 | else { |
2098 | mView->goToday(); | 2117 | mView->goToday(); |
2099 | showSelectedDates = true; | 2118 | showSelectedDates = true; |
2100 | } | 2119 | } |
2101 | break; | 2120 | break; |
2121 | case Qt::Key_Q: | ||
2122 | if ( e->state() == Qt::ControlButton ) | ||
2123 | mView->conflictNotAll(); | ||
2124 | else if ( e->state() == Qt::ShiftButton ) | ||
2125 | mView->conflictAllday(); | ||
2126 | else | ||
2127 | mView->conflictAll(); | ||
2128 | break; | ||
2102 | case Qt::Key_J: | 2129 | case Qt::Key_J: |
2103 | mView->viewManager()->showJournalView(); | 2130 | mView->viewManager()->showJournalView(); |
2104 | break; | 2131 | break; |
2105 | case Qt::Key_B: | 2132 | case Qt::Key_B: |
2106 | mView->editIncidenceDescription();; | 2133 | mView->editIncidenceDescription();; |
2107 | break; | 2134 | break; |
2108 | // case Qt::Key_Return: | 2135 | // case Qt::Key_Return: |
2109 | case Qt::Key_E: | 2136 | case Qt::Key_E: |
2110 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2137 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2111 | mView->newEvent(); | 2138 | mView->newEvent(); |
2112 | else | 2139 | else |
2113 | mView->editIncidence(); | 2140 | mView->editIncidence(); |
2114 | break; | 2141 | break; |
2115 | case Qt::Key_Plus: | 2142 | case Qt::Key_Plus: |
2116 | size = p->mHourSize +2; | 2143 | size = p->mHourSize +2; |
2117 | if ( size <= 22 ) | 2144 | if ( size <= 22 ) |
2118 | configureAgenda( size ); | 2145 | configureAgenda( size ); |
2119 | break; | 2146 | break; |
2120 | case Qt::Key_Minus: | 2147 | case Qt::Key_Minus: |
2121 | size = p->mHourSize - 2; | 2148 | size = p->mHourSize - 2; |
2122 | if ( size >= 4 ) | 2149 | if ( size >= 4 ) |
2123 | configureAgenda( size ); | 2150 | configureAgenda( size ); |
2124 | break; | 2151 | break; |
2125 | 2152 | ||
2126 | 2153 | ||
2127 | default: | 2154 | default: |
2128 | e->ignore(); | 2155 | e->ignore(); |
2129 | } | 2156 | } |
2130 | if ( pro > 0 ) { | 2157 | if ( pro > 0 ) { |
2131 | selectFilter( pro+1 ); | 2158 | selectFilter( pro+1 ); |
2132 | } | 2159 | } |
2133 | if ( showSelectedDates ) { | 2160 | if ( showSelectedDates ) { |
2134 | ;// setCaptionToDates(); | 2161 | ;// setCaptionToDates(); |
2135 | } | 2162 | } |
2136 | 2163 | ||
2137 | } | 2164 | } |
2138 | void MainWindow::fillFilterMenuTB() | 2165 | void MainWindow::fillFilterMenuTB() |
2139 | { | 2166 | { |
2140 | selectFilterMenuTB->clear(); | 2167 | selectFilterMenuTB->clear(); |
2141 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); | 2168 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); |
2142 | selectFilterMenuTB->insertSeparator(); | 2169 | selectFilterMenuTB->insertSeparator(); |
2143 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); | 2170 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); |
2144 | 2171 | ||
2145 | selectFilterMenuTB->insertSeparator(); | 2172 | selectFilterMenuTB->insertSeparator(); |
2146 | QPtrList<CalFilter> fili = mView->filters(); | 2173 | QPtrList<CalFilter> fili = mView->filters(); |
2147 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2174 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2148 | CalFilter *filter = fili.first(); | 2175 | CalFilter *filter = fili.first(); |
2149 | int iii = 2; | 2176 | int iii = 2; |
2150 | bool checkitem = mView->filterView()->filtersEnabled(); | 2177 | bool checkitem = mView->filterView()->filtersEnabled(); |
2151 | while(filter) { | 2178 | while(filter) { |
2152 | selectFilterMenuTB->insertItem( filter->name(), iii ); | 2179 | selectFilterMenuTB->insertItem( filter->name(), iii ); |
2153 | if ( filter == curfilter) | 2180 | if ( filter == curfilter) |
2154 | selectFilterMenuTB->setItemChecked( iii, checkitem ); | 2181 | selectFilterMenuTB->setItemChecked( iii, checkitem ); |
2155 | filter = fili.next(); | 2182 | filter = fili.next(); |
2156 | ++iii; | 2183 | ++iii; |
2157 | } | 2184 | } |
2158 | if ( !checkitem ) | 2185 | if ( !checkitem ) |
2159 | selectFilterMenuTB->setItemChecked( 1, true ); | 2186 | selectFilterMenuTB->setItemChecked( 1, true ); |
2160 | 2187 | ||
2161 | int x = 0; | 2188 | int x = 0; |
2162 | int y = iconToolBar->height(); | 2189 | int y = iconToolBar->height(); |
2163 | int dX = 0; | 2190 | int dX = 0; |
2164 | int dY = 0; | 2191 | int dY = 0; |
2165 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2192 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2166 | if ( iconToolBar->y() > height()/2 ) { | 2193 | if ( iconToolBar->y() > height()/2 ) { |
2167 | dY = selectFilterMenuTB->sizeHint().height()+8; | 2194 | dY = selectFilterMenuTB->sizeHint().height()+8; |
2168 | y = 0; | 2195 | y = 0; |
2169 | } | 2196 | } |
2170 | } else { | 2197 | } else { |
2171 | if ( iconToolBar->x() > width()/2 ) { // right side | 2198 | if ( iconToolBar->x() > width()/2 ) { // right side |
2172 | x=0; | 2199 | x=0; |
2173 | dX= selectFilterMenuTB->sizeHint().width()+8; | 2200 | dX= selectFilterMenuTB->sizeHint().width()+8; |
2174 | y = 0; | 2201 | y = 0; |
2175 | } else { | 2202 | } else { |
2176 | x= iconToolBar->width(); | 2203 | x= iconToolBar->width(); |
2177 | y = 0; | 2204 | y = 0; |
2178 | } | 2205 | } |
2179 | } | 2206 | } |
2180 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2207 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2181 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); | 2208 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); |
2182 | } | 2209 | } |
2183 | void MainWindow::fillFilterMenu() | 2210 | void MainWindow::fillFilterMenu() |
2184 | { | 2211 | { |
2185 | selectFilterMenu->clear(); | 2212 | selectFilterMenu->clear(); |
2186 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 2213 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
2187 | selectFilterMenu->insertSeparator(); | 2214 | selectFilterMenu->insertSeparator(); |
2188 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); | 2215 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); |
2189 | 2216 | ||
2190 | selectFilterMenu->insertSeparator(); | 2217 | selectFilterMenu->insertSeparator(); |
2191 | QPtrList<CalFilter> fili = mView->filters(); | 2218 | QPtrList<CalFilter> fili = mView->filters(); |
2192 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2219 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2193 | CalFilter *filter = fili.first(); | 2220 | CalFilter *filter = fili.first(); |
2194 | int iii = 2; | 2221 | int iii = 2; |
2195 | bool checkitem = mView->filterView()->filtersEnabled(); | 2222 | bool checkitem = mView->filterView()->filtersEnabled(); |
2196 | while(filter) { | 2223 | while(filter) { |
2197 | selectFilterMenu->insertItem( filter->name(), iii ); | 2224 | selectFilterMenu->insertItem( filter->name(), iii ); |
2198 | if ( filter == curfilter) | 2225 | if ( filter == curfilter) |
2199 | selectFilterMenu->setItemChecked( iii, checkitem ); | 2226 | selectFilterMenu->setItemChecked( iii, checkitem ); |
2200 | filter = fili.next(); | 2227 | filter = fili.next(); |
2201 | ++iii; | 2228 | ++iii; |
2202 | } | 2229 | } |
2203 | if ( !checkitem ) | 2230 | if ( !checkitem ) |
2204 | selectFilterMenu->setItemChecked( 1, true ); | 2231 | selectFilterMenu->setItemChecked( 1, true ); |
2205 | } | 2232 | } |
2206 | void MainWindow::fillFilterMenuPopup() | 2233 | void MainWindow::fillFilterMenuPopup() |
2207 | { | 2234 | { |
2208 | filterPopupMenu->clear(); | 2235 | filterPopupMenu->clear(); |
2209 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); | 2236 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); |
2210 | 2237 | ||
2211 | filterPopupMenu->insertSeparator(); | 2238 | filterPopupMenu->insertSeparator(); |
2212 | QPtrList<CalFilter> fili = mView->filters(); | 2239 | QPtrList<CalFilter> fili = mView->filters(); |
2213 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2240 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2214 | CalFilter *filter = fili.first(); | 2241 | CalFilter *filter = fili.first(); |
2215 | int iii = 1; | 2242 | int iii = 1; |
2216 | bool checkitem = mView->filterView()->filtersEnabled(); | 2243 | bool checkitem = mView->filterView()->filtersEnabled(); |
2217 | while(filter) { | 2244 | while(filter) { |
2218 | filterPopupMenu->insertItem( filter->name(), iii ); | 2245 | filterPopupMenu->insertItem( filter->name(), iii ); |
2219 | if ( filter == curfilter) | 2246 | if ( filter == curfilter) |
2220 | filterPopupMenu->setItemChecked( iii, checkitem ); | 2247 | filterPopupMenu->setItemChecked( iii, checkitem ); |
2221 | filter = fili.next(); | 2248 | filter = fili.next(); |
2222 | ++iii; | 2249 | ++iii; |
2223 | } | 2250 | } |
2224 | if ( !checkitem ) | 2251 | if ( !checkitem ) |
2225 | filterPopupMenu->setItemChecked( 0, true ); | 2252 | filterPopupMenu->setItemChecked( 0, true ); |
2226 | } | 2253 | } |
2227 | void MainWindow::selectFilter( int fil ) | 2254 | void MainWindow::selectFilter( int fil ) |
2228 | { | 2255 | { |
2229 | 2256 | ||
2230 | if ( fil == 0 ) { | 2257 | if ( fil == 0 ) { |
2231 | mView->editFilters( ); | 2258 | mView->editFilters( ); |
2232 | } else if ( fil == 1 ){ | 2259 | } else if ( fil == 1 ){ |
2233 | if ( mView->filterView()->filtersEnabled() ) | 2260 | if ( mView->filterView()->filtersEnabled() ) |
2234 | mView->toggleFilerEnabled( ); | 2261 | mView->toggleFilerEnabled( ); |
2235 | } else { | 2262 | } else { |
2236 | if ( !mView->filterView()->filtersEnabled() ) { | 2263 | if ( !mView->filterView()->filtersEnabled() ) { |
2237 | mView->filterView()->blockSignals( true ); | 2264 | mView->filterView()->blockSignals( true ); |
2238 | mView->toggleFilerEnabled( ); | 2265 | mView->toggleFilerEnabled( ); |
2239 | mView->filterView()->blockSignals( false ); | 2266 | mView->filterView()->blockSignals( false ); |
2240 | } | 2267 | } |
2241 | mView->selectFilter( fil-2 ); | 2268 | mView->selectFilter( fil-2 ); |
2242 | } | 2269 | } |
2243 | } | 2270 | } |
2244 | void MainWindow::updateFilterToolbar() | 2271 | void MainWindow::updateFilterToolbar() |
2245 | { | 2272 | { |
2246 | if ( filterMenubar ) { | 2273 | if ( filterMenubar ) { |
2247 | if ( !mView->filterView()->filtersEnabled() ) { | 2274 | if ( !mView->filterView()->filtersEnabled() ) { |
2248 | filterMenubar->changeItem( 0, i18n("No Filter") ); | 2275 | filterMenubar->changeItem( 0, i18n("No Filter") ); |
2249 | } else { | 2276 | } else { |
2250 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2277 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2251 | if ( curfilter ) { | 2278 | if ( curfilter ) { |
2252 | filterMenubar->changeItem( 0, curfilter->name() ); | 2279 | filterMenubar->changeItem( 0, curfilter->name() ); |
2253 | } | 2280 | } |
2254 | } | 2281 | } |
2255 | } | 2282 | } |
2256 | } | 2283 | } |
2257 | void MainWindow::selectFilterPopup( int fil ) | 2284 | void MainWindow::selectFilterPopup( int fil ) |
2258 | { | 2285 | { |
2259 | selectFilter( fil + 1 ); | 2286 | selectFilter( fil + 1 ); |
2260 | 2287 | ||
2261 | } | 2288 | } |
2262 | void MainWindow::configureToolBar( int item ) | 2289 | void MainWindow::configureToolBar( int item ) |
2263 | { | 2290 | { |
2264 | 2291 | ||
2265 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2292 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2266 | KOPrefs *p = KOPrefs::instance(); | 2293 | KOPrefs *p = KOPrefs::instance(); |
2267 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2294 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2268 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2295 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2269 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2296 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2270 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2297 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2271 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2298 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2272 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2299 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2273 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2300 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2274 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2301 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2275 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2302 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2276 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2303 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2277 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2304 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2278 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2305 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2279 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2306 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2280 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2307 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2281 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2308 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2282 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2309 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2283 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2310 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2284 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2311 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
2285 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 2312 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
2286 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 2313 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
2287 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2314 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
2288 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2315 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
2289 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2316 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
2290 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2317 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
2291 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2318 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
2292 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2319 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
2293 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2320 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
2294 | // initActions(); | 2321 | // initActions(); |
2295 | setCaption ( i18n("Toolbar changes needs a restart!") ); | 2322 | setCaption ( i18n("Toolbar changes needs a restart!") ); |
2296 | } | 2323 | } |
2297 | void MainWindow::setCaption ( const QString & c ) | 2324 | void MainWindow::setCaption ( const QString & c ) |
2298 | { | 2325 | { |
2299 | QString cap = c; | 2326 | QString cap = c; |
2300 | cap.replace( QRegExp("\n"), " " ); | 2327 | cap.replace( QRegExp("\n"), " " ); |
2301 | cap = cap.stripWhiteSpace(); | 2328 | cap = cap.stripWhiteSpace(); |
2302 | if ( cap.isEmpty() ) | 2329 | if ( cap.isEmpty() ) |
2303 | cap = "KO/Pi"; | 2330 | cap = "KO/Pi"; |
2304 | QWidget::setCaption( cap ); | 2331 | QWidget::setCaption( cap ); |
2305 | } | 2332 | } |
2306 | void MainWindow::setCaptionToDates() | 2333 | void MainWindow::setCaptionToDates() |
2307 | { | 2334 | { |
2308 | QString selDates; | 2335 | QString selDates; |
2309 | QDate date = mView->startDate(); | 2336 | QDate date = mView->startDate(); |
2310 | if ( ! date.isValid() ) { | 2337 | if ( ! date.isValid() ) { |
2311 | setCaption(""); | 2338 | setCaption(""); |
2312 | return; | 2339 | return; |
2313 | } | 2340 | } |
2314 | selDates = KGlobal::locale()->formatDate( date, true); | 2341 | selDates = KGlobal::locale()->formatDate( date, true); |
2315 | if (mView->startDate() < mView->endDate() ) | 2342 | if (mView->startDate() < mView->endDate() ) |
2316 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 2343 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
2317 | else { | 2344 | else { |
2318 | QString addString; | 2345 | QString addString; |
2319 | if ( date == QDateTime::currentDateTime().date() ) | 2346 | if ( date == QDateTime::currentDateTime().date() ) |
2320 | addString = i18n("Today"); | 2347 | addString = i18n("Today"); |
2321 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 2348 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
2322 | addString = i18n("Tomorrow"); | 2349 | addString = i18n("Tomorrow"); |
2323 | if ( !addString.isEmpty() ) | 2350 | if ( !addString.isEmpty() ) |
2324 | selDates = addString+", "+selDates ; | 2351 | selDates = addString+", "+selDates ; |
2325 | } | 2352 | } |
2326 | setCaption( i18n("Dates: ") + selDates ); | 2353 | setCaption( i18n("Dates: ") + selDates ); |
2327 | 2354 | ||
2328 | } | 2355 | } |
2329 | void MainWindow::showConfigureAgenda( ) | 2356 | void MainWindow::showConfigureAgenda( ) |
2330 | { | 2357 | { |
2331 | int iii; | 2358 | int iii; |
2332 | for ( iii = 1;iii<= 10 ;++iii ){ | 2359 | for ( iii = 1;iii<= 10 ;++iii ){ |
2333 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2360 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2334 | } | 2361 | } |
2335 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2362 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2336 | } | 2363 | } |
2337 | void MainWindow::configureAgenda( int item ) | 2364 | void MainWindow::configureAgenda( int item ) |
2338 | { | 2365 | { |
2339 | if ( KOPrefs::instance()->mHourSize == item ) | 2366 | if ( KOPrefs::instance()->mHourSize == item ) |
2340 | return; | 2367 | return; |
2341 | KOPrefs::instance()->mHourSize=item; | 2368 | KOPrefs::instance()->mHourSize=item; |
2342 | mView->viewManager()->agendaView()->updateConfig(); | 2369 | mView->viewManager()->agendaView()->updateConfig(); |
2343 | } | 2370 | } |
2344 | 2371 | ||
2345 | void MainWindow::saveCalendar() | 2372 | void MainWindow::saveCalendar() |
2346 | { | 2373 | { |
2347 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2374 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2348 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2375 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2349 | bupDir = KGlobalSettings::backupDataDir(); | 2376 | bupDir = KGlobalSettings::backupDataDir(); |
2350 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2377 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2351 | QString bupHint; | 2378 | QString bupHint; |
2352 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2379 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2353 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2380 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2354 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2381 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2355 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | 2382 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; |
2356 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 2383 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
2357 | save(); | 2384 | save(); |