summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt1
-rw-r--r--korganizer/koeventviewer.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 2032420..06d630a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,281 +1,282 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.17 ************ 3********** VERSION 2.1.17 ************
4 4
5KO/Pi: 5KO/Pi:
6Added option to display times in What's Next View on two lines. 6Added option to display times in What's Next View on two lines.
7(Useful for display on the Zaurus with 240x320 screen)
7Removed "Allday" for allday events of one day duration in What's Next View. 8Removed "Allday" for allday events of one day duration in What's Next View.
8Added date range for allday events of more than one day duration in What's Next View. 9Added date range for allday events of more than one day duration in What's Next View.
9 10
10********** VERSION 2.1.16 ************ 11********** VERSION 2.1.16 ************
11 12
12Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. 13Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus.
13Added columns for datetime in todo view: Last modified, created and last modified subtodo 14Added columns for datetime in todo view: Last modified, created and last modified subtodo
14Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. 15Fixed a bug in agenda view displaying recurring multiday events which are longer than two days.
15Made conflict detection up to 4 times faster. 16Made conflict detection up to 4 times faster.
16 17
17********** VERSION 2.1.15 ************ 18********** VERSION 2.1.15 ************
18 19
19Fixed two layout problems on the Z: 20Fixed two layout problems on the Z:
20Made the with of the newly added buttons on the Quick-Todo smaller. 21Made the with of the newly added buttons on the Quick-Todo smaller.
21Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. 22Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible.
22 23
23 24
24********** VERSION 2.1.14 ************ 25********** VERSION 2.1.14 ************
25 26
26Added 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. 27Added 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.
27Added a button to add a subtodo quickly. 28Added a button to add a subtodo quickly.
28 29
29Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). 30Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ).
30Added an option to change the layout of the list week to column mode. 31Added an option to change the layout of the list week to column mode.
31 32
32Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. 33Fixed some usability problems in pi-sync mode by adding some progress information about file transfer.
33 34
34Fixed pi-sync problems with the new multi calendar feature. 35Fixed pi-sync problems with the new multi calendar feature.
35Now pi-sync behaviour should be: 36Now pi-sync behaviour should be:
361) Local sends file request ( as usual ) 371) Local sends file request ( as usual )
372) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. 382) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars.
383) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). 393) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ).
39 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. 40 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar.
404) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. 414) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote.
41 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. 42 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar.
42 43
43Summary: 44Summary:
44No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner. 45No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner.
45If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour. 46If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour.
46Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars. 47Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars.
47 48
48********** VERSION 2.1.13 ************ 49********** VERSION 2.1.13 ************
49 50
50Fixed a problem in KA/Pi search. 51Fixed a problem in KA/Pi search.
51Fixed some minor problems in KO/Pi. 52Fixed some minor problems in KO/Pi.
52Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. 53Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
53 54
54Fixed memory usage problems in KA/Pi: 55Fixed memory usage problems in KA/Pi:
55When loading data KA/Pi did load the file data twice. 56When loading data KA/Pi did load the file data twice.
56Example: 57Example:
57 A 600k file did consume 1200k memory during loading process. 58 A 600k file did consume 1200k memory during loading process.
58 This is fixed, it does now consume only 600k during loading process. 59 This is fixed, it does now consume only 600k during loading process.
59When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. 60When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
60This is fixed. 61This is fixed.
61Example: 62Example:
62 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. 63 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
63 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. 64 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.
64 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. 65 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
65Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. 66Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
66The saving of data may be a bit slower now. 67The saving of data may be a bit slower now.
67 68
68Fixed memory usage problems in KO/Pi: 69Fixed memory usage problems in KO/Pi:
69When KO/Pi did save the data to file, it did not release the used buffers after saving. 70When KO/Pi did save the data to file, it did not release the used buffers after saving.
70The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. 71The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
71This is fixed. 72This is fixed.
72Example: 73Example:
73 When saving a 400k file KO/Pi do now use 400k less memory now. 74 When saving a 400k file KO/Pi do now use 400k less memory now.
74 75
75Optimized memory usage in KO/Pi Agenda view: 76Optimized memory usage in KO/Pi Agenda view:
76KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. 77KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view.
77These buffers were not made smaller (i.e. downsized) because of performance reasons. 78These buffers were not made smaller (i.e. downsized) because of performance reasons.
78The handling of these buffers are now much smarter: 79The handling of these buffers are now much smarter:
79Two (of six) buffers are removed completely. 80Two (of six) buffers are removed completely.
80The remaing four buffers are now downsized after not using the agenda view for 45 seconds. 81The remaing four buffers are now downsized after not using the agenda view for 45 seconds.
81Such 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. 82Such 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.
82 83
83Worst case example ( for a maximum size agenda content): 84Worst case example ( for a maximum size agenda content):
84 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. 85 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.
85 86
86When 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. 87When 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.
87 88
88Summary: 89Summary:
89Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. 90Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus.
90 91
91********** VERSION 2.1.12 ************ 92********** VERSION 2.1.12 ************
92 93
93KO/Pi: 94KO/Pi:
94Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. 95Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus.
95Fixed a problem with the month view when file was saved but KO/Pi was not the active window. 96Fixed a problem with the month view when file was saved but KO/Pi was not the active window.
96Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). 97Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only).
97Fixed some other small problems. 98Fixed some other small problems.
98 99
99********** VERSION 2.1.11 ************ 100********** VERSION 2.1.11 ************
100 101
101KO/Pi: 102KO/Pi:
102Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. 103Because we can have many calendars now in KO/Pi we can have more than one journal entry per day.
103Added features to handle (and add ) more than one journal entry per day. 104Added features to handle (and add ) more than one journal entry per day.
104Added option for a journal title. 105Added option for a journal title.
105 106
106Added info about the calendar, the item belongs to, to the event/todo/journal viewer. 107Added info about the calendar, the item belongs to, to the event/todo/journal viewer.
107Fixed a problem of the alarm of completed recurring todos. 108Fixed a problem of the alarm of completed recurring todos.
108Added to the event/todo editor to set quickly the category of an item. 109Added to the event/todo editor to set quickly the category of an item.
109 110
110 111
111Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. 112Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet.
112 113
113Added KA/Pi multi sync to the multi sync called from the alarm applet. 114Added KA/Pi multi sync to the multi sync called from the alarm applet.
114 115
115********** VERSION 2.1.10 ************ 116********** VERSION 2.1.10 ************
116 117
117KO/Pi: 118KO/Pi:
118Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. 119Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file.
119When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. 120When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted.
120Fixed a bug in searching for a small timerange, i.e. one day. 121Fixed a bug in searching for a small timerange, i.e. one day.
121 122
122KA/Pi: 123KA/Pi:
123Fixed two problems in csv export. 124Fixed two problems in csv export.
124Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. 125Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi.
125 126
126********** VERSION 2.1.9 ************ 127********** VERSION 2.1.9 ************
127 128
128KO/Pi: 129KO/Pi:
129Fixed some problems of the new search options in the search dialog. 130Fixed some problems of the new search options in the search dialog.
130Fixed some problems in the new resource config options. 131Fixed some problems in the new resource config options.
131Changed 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. 132Changed 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.
132Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: 133Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown:
133Now 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. 134Now 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.
134 135
135Fixed a problem in recurrence range in syncing with DTM. 136Fixed a problem in recurrence range in syncing with DTM.
136 137
137KA/Pi: 138KA/Pi:
138Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) 139Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...)
139 140
140PwM/Pi: 141PwM/Pi:
141Added "sec" to the timeout config settings to make it clear the timeout values are seconds. 142Added "sec" to the timeout config settings to make it clear the timeout values are seconds.
142 143
143********** VERSION 2.1.8 ************ 144********** VERSION 2.1.8 ************
144 145
145KO/Pi: 146KO/Pi:
146Added info about the completion state of a todo in the ListView/Searchdialog. 147Added info about the completion state of a todo in the ListView/Searchdialog.
147If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 148If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
148Fixed some updating problems when changing the filter. 149Fixed some updating problems when changing the filter.
149 150
150KA/Pi: 151KA/Pi:
151In the addressee selection dialog now the formatted name is shown, if not empty. 152In the addressee selection dialog now the formatted name is shown, if not empty.
152Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. 153Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
153Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. 154Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
154 155
155Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 156Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
156Fixed the sorting for size in the file selector on the Z. 157Fixed the sorting for size in the file selector on the Z.
157 158
158Changed the color selection dialog on the Zaurus to a more user friendly version. 159Changed the color selection dialog on the Zaurus to a more user friendly version.
159 160
160********** VERSION 2.1.7 ************ 161********** VERSION 2.1.7 ************
161 162
162KO/Pi: 163KO/Pi:
163Fixed several problems in the new Resource handling. 164Fixed several problems in the new Resource handling.
164Added more options to the search dialog. 165Added more options to the search dialog.
165Fixed a problem in the Month view. 166Fixed a problem in the Month view.
166Added more options to the dialog when setting a todo to stopped. 167Added more options to the dialog when setting a todo to stopped.
167 168
168Fixed two small problems in KO/Pi Alarm applet. 169Fixed two small problems in KO/Pi Alarm applet.
169 170
170********** VERSION 2.1.6 ************ 171********** VERSION 2.1.6 ************
171 172
172This release is for testing only. 173This release is for testing only.
173 174
174KO/Pi: 175KO/Pi:
175Added to the list view (the list view is used in search dialog as well) the possibility to print it. 176Added to the list view (the list view is used in search dialog as well) the possibility to print it.
176Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 177Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
177Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 178Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
178Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 179Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
179Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 180Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
180Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 181Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
181 182
182Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 183Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
183In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 184In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
184Now on every sync the set of calendars is synced which are enabled in the resource view. 185Now on every sync the set of calendars is synced which are enabled in the resource view.
185 186
186A calendar is enabled in the resource view if the "eye" column is checked. 187A calendar is enabled in the resource view if the "eye" column is checked.
187You can set a calendar to be the default for new items( "+" column ). 188You can set a calendar to be the default for new items( "+" column ).
188You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 189You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
189To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 190To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
190 191
191 192
192********** VERSION 2.1.5 ************ 193********** VERSION 2.1.5 ************
193 194
194This is the new stable version. 195This is the new stable version.
195Bugfix: 196Bugfix:
196Fixed a problem with agenda popup on the desktop in KO/Pi. 197Fixed a problem with agenda popup on the desktop in KO/Pi.
197Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 198Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
198Added config option to not display completed todos in agenda view. 199Added config option to not display completed todos in agenda view.
199Addressee view is now using the formatted name, if defined. 200Addressee view is now using the formatted name, if defined.
200That makes it possible to display "lastname, firstname" in that view now. 201That makes it possible to display "lastname, firstname" in that view now.
201To set the formatted name for all contacts, please use menu: 202To set the formatted name for all contacts, please use menu:
202Edit->Change->Set formatted name. 203Edit->Change->Set formatted name.
203Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 204Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
204 205
205********** VERSION 2.1.4 ************ 206********** VERSION 2.1.4 ************
206 207
207Fixed two more bugs in the KA/Pi CSV import dialog: 208Fixed two more bugs in the KA/Pi CSV import dialog:
208Made it possible to read multi-line fields and import it to the "Note" field. 209Made it possible to read multi-line fields and import it to the "Note" field.
209Fixed a problem in mapping custom fields, whatever a custem field is... 210Fixed a problem in mapping custom fields, whatever a custem field is...
210 211
211********** VERSION 2.1.3 ************ 212********** VERSION 2.1.3 ************
212 213
213Changed the menu structure of the alarm applet: 214Changed the menu structure of the alarm applet:
214Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 215Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
215 216
216Fixed several problems in the KA/Pi CSV import dialog: 217Fixed several problems in the KA/Pi CSV import dialog:
217Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 218Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
218 219
219 220
220********** VERSION 2.1.2 ************ 221********** VERSION 2.1.2 ************
221 222
222Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 223Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
223 224
224Fixed a problem when importing data from Outlook with mutiple categories set. 225Fixed a problem when importing data from Outlook with mutiple categories set.
225 226
226Changed display of days in datenavigator: 227Changed display of days in datenavigator:
227Birthdays are now blue, not dark green. 228Birthdays are now blue, not dark green.
228When todo view is shown, no birtdays are shown and days with due todos are shown blue. 229When todo view is shown, no birtdays are shown and days with due todos are shown blue.
229When journal view is shown, only holidays are shown and days with journals are blue. 230When journal view is shown, only holidays are shown and days with journals are blue.
230 231
231Added Backup options to global config: 232Added Backup options to global config:
232You 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 ). 233You 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 ).
233It 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. 234It 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.
234The 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. 235The 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.
235 236
236********** VERSION 2.1.1 ************ 237********** VERSION 2.1.1 ************
237 238
238Stable release 2.1.1! 239Stable release 2.1.1!
239 240
240KO/Pi: 241KO/Pi:
241Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 242Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
242 243
243********** VERSION 2.1.0 ************ 244********** VERSION 2.1.0 ************
244 245
245Stable release 2.1.0! 246Stable release 2.1.0!
246 247
247Summary of changes/fixes compared to version 2.0.6: 248Summary of changes/fixes compared to version 2.0.6:
248 249
249Many bugs of version 2.0.6 fixed. 250Many bugs of version 2.0.6 fixed.
250Most of them were small bugs, but some of them were important. 251Most of them were small bugs, but some of them were important.
251It is recommended to use version 2.1.0 and not version 2.0.6. 252It is recommended to use version 2.1.0 and not version 2.0.6.
252 253
253Important changes: 254Important changes:
254 255
255Added recurring todos to KO/Pi. 256Added recurring todos to KO/Pi.
256 257
257Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 258Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
258 259
259Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 260Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
260 261
261Datenavigator can now display many months. Very useful on the desktop. 262Datenavigator can now display many months. Very useful on the desktop.
262 263
263KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 264KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
264 265
265Made alarm sound working on Linux desktop. 266Made alarm sound working on Linux desktop.
266 267
267Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 268Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
268 269
269Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 270Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
270 271
271Many other usebility enhancements. 272Many other usebility enhancements.
272Special thanks to Ben for his suggestions! 273Special thanks to Ben for his suggestions!
273 274
274You can find the complete changelog 275You can find the complete changelog
275from version 1.7.7 to 2.1.0 276from version 1.7.7 to 2.1.0
276in the source package or on 277in the source package or on
277 278
278http://www.pi-sync.net/html/changelog.html 279http://www.pi-sync.net/html/changelog.html
279 280
280 281
281 282
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 2d0bfff..a690ab1 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -1,831 +1,831 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qcstring.h> 20#include <qcstring.h>
21#include <qwhatsthis.h> 21#include <qwhatsthis.h>
22#include <qdialog.h> 22#include <qdialog.h>
23#include <qapplication.h> 23#include <qapplication.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kapplication.h> 28#include <kapplication.h>
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30#include <libkcal/todo.h> 30#include <libkcal/todo.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33#include <krun.h> 33#include <krun.h>
34#include <kglobal.h> 34#include <kglobal.h>
35#include <kprocess.h> 35#include <kprocess.h>
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38#include <kabc/stdaddressbook.h> 38#include <kabc/stdaddressbook.h>
39 39
40#ifndef KORG_NODCOP 40#ifndef KORG_NODCOP
41#include <dcopclient.h> 41#include <dcopclient.h>
42#include "korganizer.h" 42#include "korganizer.h"
43#include "koprefs.h" 43#include "koprefs.h"
44#include "actionmanager.h" 44#include "actionmanager.h"
45#endif 45#endif
46 46
47#include "koeventviewer.h" 47#include "koeventviewer.h"
48//#ifndef KORG_NOKABC 48//#ifndef KORG_NOKABC
49//#include <kabc/stdaddressbook.h> 49//#include <kabc/stdaddressbook.h>
50//#define size count 50//#define size count
51//#endif 51//#endif
52 52
53#ifdef DESKTOP_VERSION 53#ifdef DESKTOP_VERSION
54#include <kabc/addresseedialog.h> 54#include <kabc/addresseedialog.h>
55#include <kabc/addresseeview.h> 55#include <kabc/addresseeview.h>
56#include <qprinter.h> 56#include <qprinter.h>
57#include <qpainter.h> 57#include <qpainter.h>
58#include <qpaintdevicemetrics.h> 58#include <qpaintdevicemetrics.h>
59#else //DESKTOP_VERSION 59#else //DESKTOP_VERSION
60#include <externalapphandler.h> 60#include <externalapphandler.h>
61#include <qtopia/qcopenvelope_qws.h> 61#include <qtopia/qcopenvelope_qws.h>
62#endif //DESKTOP_VERSION 62#endif //DESKTOP_VERSION
63 63
64KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 64KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
65 : QTextBrowser(parent,name) 65 : QTextBrowser(parent,name)
66{ 66{
67 mSyncMode = false; 67 mSyncMode = false;
68 mColorMode = 0; 68 mColorMode = 0;
69} 69}
70 70
71KOEventViewer::~KOEventViewer() 71KOEventViewer::~KOEventViewer()
72{ 72{
73} 73}
74 74
75void KOEventViewer::printMe() 75void KOEventViewer::printMe()
76{ 76{
77#ifdef DESKTOP_VERSION 77#ifdef DESKTOP_VERSION
78 78
79 KOPrintPrefs pp ( this ); 79 KOPrintPrefs pp ( this );
80 if (!pp.exec() ) 80 if (!pp.exec() )
81 return; 81 return;
82 int scaleval = pp.printMode() ; 82 int scaleval = pp.printMode() ;
83 83
84 QPrinter printer; 84 QPrinter printer;
85 if (!printer.setup() ) 85 if (!printer.setup() )
86 return; 86 return;
87 QPainter p; 87 QPainter p;
88 p.begin ( &printer ); 88 p.begin ( &printer );
89 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 89 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
90 float dx, dy; 90 float dx, dy;
91 int wid = (m.width() * 9)/10; 91 int wid = (m.width() * 9)/10;
92 dx = (float) wid/(float)contentsWidth (); 92 dx = (float) wid/(float)contentsWidth ();
93 dy = (float)(m.height()) / (float)contentsHeight (); 93 dy = (float)(m.height()) / (float)contentsHeight ();
94 float scale; 94 float scale;
95 // scale to fit the width or height of the paper 95 // scale to fit the width or height of the paper
96 if ( dx < dy ) 96 if ( dx < dy )
97 scale = dx; 97 scale = dx;
98 else 98 else
99 scale = dy; 99 scale = dy;
100 100
101 p.translate( m.width()/10,0 ); 101 p.translate( m.width()/10,0 );
102 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { 102 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
103 p.scale( scale, scale ); 103 p.scale( scale, scale );
104 } 104 }
105 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 105 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
106 p.end(); 106 p.end();
107#endif 107#endif
108 108
109} 109}
110void KOEventViewer::setSource(const QString& n) 110void KOEventViewer::setSource(const QString& n)
111{ 111{
112 112
113 if ( n.left(8) == "todo_uid" ) { 113 if ( n.left(8) == "todo_uid" ) {
114 int midstr = 9; 114 int midstr = 9;
115#ifdef DESKTOP_VERSION 115#ifdef DESKTOP_VERSION
116 midstr = 11; 116 midstr = 11;
117#endif 117#endif
118 qDebug("-%s- ", n.mid(midstr).latin1()); 118 //qDebug("-%s- ", n.mid(midstr).latin1());
119 emit showIncidence( n.mid(midstr) ); 119 emit showIncidence( n.mid(midstr) );
120 return; 120 return;
121 } 121 }
122 122
123 if ( n.left(3) == "uid" ) 123 if ( n.left(3) == "uid" )
124#ifdef DESKTOP_VERSION 124#ifdef DESKTOP_VERSION
125 { 125 {
126 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 126 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
127 KABC::AddressBook::Iterator it; 127 KABC::AddressBook::Iterator it;
128 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 128 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
129 // LR I do not understand, why the uid string is different on zaurus and desktop 129 // LR I do not understand, why the uid string is different on zaurus and desktop
130 QString uid = "uid://"+(*it).uid(); 130 QString uid = "uid://"+(*it).uid();
131 131
132 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); 132 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
133 if (n == uid ) { 133 if (n == uid ) {
134 //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); 134 //qDebug("found %s ",(*it).mobileHomePhone().latin1() );
135 QDialog dia( this,"dia123", true ); 135 QDialog dia( this,"dia123", true );
136 dia.setCaption( i18n("Details of attendee") ); 136 dia.setCaption( i18n("Details of attendee") );
137 QVBoxLayout lay ( &dia ); 137 QVBoxLayout lay ( &dia );
138 KABC::AddresseeView av ( &dia ); 138 KABC::AddresseeView av ( &dia );
139 av.setAddressee( (*it) ); 139 av.setAddressee( (*it) );
140 lay.addWidget( &av ); 140 lay.addWidget( &av );
141 if ( QApplication::desktop()->width() < 480 ) 141 if ( QApplication::desktop()->width() < 480 )
142 dia.resize( 220, 240); 142 dia.resize( 220, 240);
143 else { 143 else {
144 dia.resize( 400,400); 144 dia.resize( 400,400);
145 } 145 }
146 dia.exec(); 146 dia.exec();
147 break; 147 break;
148 } 148 }
149 } 149 }
150 return; 150 return;
151 } 151 }
152#else 152#else
153 { 153 {
154 if ( "uid:organizer" == n ) { 154 if ( "uid:organizer" == n ) {
155 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); 155 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
156 return; 156 return;
157 } 157 }
158 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 158 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
159 if (attendees.count()) { 159 if (attendees.count()) {
160 Attendee *a; 160 Attendee *a;
161 for(a=attendees.first();a;a=attendees.next()) { 161 for(a=attendees.first();a;a=attendees.next()) {
162 if ( "uid:"+a->uid() == n ) { 162 if ( "uid:"+a->uid() == n ) {
163 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); 163 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
164 return; 164 return;
165 } 165 }
166 } 166 }
167 } 167 }
168 return; 168 return;
169 } 169 }
170 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 170 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
171 // the result should now arrive through method insertAttendees 171 // the result should now arrive through method insertAttendees
172 //QString uid = "uid:"+(*it).uid(); 172 //QString uid = "uid:"+(*it).uid();
173#endif 173#endif
174 if ( n.left(6) == "mailto" ) { 174 if ( n.left(6) == "mailto" ) {
175 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); 175 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
176#ifndef DESKTOP_VERSION 176#ifndef DESKTOP_VERSION
177 if ( n.mid(7,3) == "ALL" ) { 177 if ( n.mid(7,3) == "ALL" ) {
178 mailToAttendees( true ); 178 mailToAttendees( true );
179 } else if ( n.mid(7,4) == "RSVP" ) { 179 } else if ( n.mid(7,4) == "RSVP" ) {
180 mailToAttendees( false ); 180 mailToAttendees( false );
181 } else { 181 } else {
182 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); 182 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
183 e << n.mid(7); 183 e << n.mid(7);
184 } 184 }
185#endif 185#endif
186 186
187 } 187 }
188 188
189 189
190#ifndef KORG_NODCOP 190#ifndef KORG_NODCOP
191 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 191 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
192 QString tmpStr; 192 QString tmpStr;
193 if (n.startsWith("mailto:")) { 193 if (n.startsWith("mailto:")) {
194 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 194 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
195 //emit showIncidence(n); 195 //emit showIncidence(n);
196 return; 196 return;
197 } else if (n.startsWith("uid:")) { 197 } else if (n.startsWith("uid:")) {
198 DCOPClient *client = KApplication::kApplication()->dcopClient(); 198 DCOPClient *client = KApplication::kApplication()->dcopClient();
199 const QByteArray noParamData; 199 const QByteArray noParamData;
200 const QByteArray paramData; 200 const QByteArray paramData;
201 QByteArray replyData; 201 QByteArray replyData;
202 QCString replyTypeStr; 202 QCString replyTypeStr;
203#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 203#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
204 bool foundAbbrowser = PING_ABBROWSER; 204 bool foundAbbrowser = PING_ABBROWSER;
205 205
206 if (foundAbbrowser) { 206 if (foundAbbrowser) {
207 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 207 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
208 //client->send("kaddressbook","KAddressBookIface", 208 //client->send("kaddressbook","KAddressBookIface",
209 QDataStream arg(paramData, IO_WriteOnly); 209 QDataStream arg(paramData, IO_WriteOnly);
210 arg << n.mid(6); 210 arg << n.mid(6);
211 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); 211 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
212 return; 212 return;
213 } else { 213 } else {
214 /* 214 /*
215 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. 215 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
216 We start it without its main interface 216 We start it without its main interface
217 */ 217 */
218 KIconLoader* iconLoader = new KIconLoader(); 218 KIconLoader* iconLoader = new KIconLoader();
219 QString iconPath = iconLoader->iconPath("go",KIcon::Small); 219 QString iconPath = iconLoader->iconPath("go",KIcon::Small);
220 ActionManager::setStartedKAddressBook(true); 220 ActionManager::setStartedKAddressBook(true);
221 tmpStr = "kaddressbook --editor-only --uid "; 221 tmpStr = "kaddressbook --editor-only --uid ";
222 tmpStr += KProcess::quote(n.mid(6)); 222 tmpStr += KProcess::quote(n.mid(6));
223 KRun::runCommand(tmpStr,"KAddressBook",iconPath); 223 KRun::runCommand(tmpStr,"KAddressBook",iconPath);
224 return; 224 return;
225 } 225 }
226 } else { 226 } else {
227 //QTextBrowser::setSource(n); 227 //QTextBrowser::setSource(n);
228 } 228 }
229#endif 229#endif
230} 230}
231void KOEventViewer::mailToAttendees( bool all ) 231void KOEventViewer::mailToAttendees( bool all )
232{ 232{
233 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 233 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
234 if (attendees.count() == 0) return; 234 if (attendees.count() == 0) return;
235 QStringList nameList; 235 QStringList nameList;
236 QStringList emailList; 236 QStringList emailList;
237 QStringList uidList; 237 QStringList uidList;
238 Attendee* a; 238 Attendee* a;
239 for(a=attendees.first();a;a=attendees.next()) { 239 for(a=attendees.first();a;a=attendees.next()) {
240 if ( !all && !a->RSVP() ) continue; 240 if ( !all && !a->RSVP() ) continue;
241 if (!a->email().isEmpty()) { 241 if (!a->email().isEmpty()) {
242 nameList.append (a->name() ); 242 nameList.append (a->name() );
243 emailList.append (a->email() ); 243 emailList.append (a->email() );
244 uidList.append (a->uid() ); 244 uidList.append (a->uid() );
245 } 245 }
246 } 246 }
247 QString uid = "ComposeMailUIpick2"+mMailSubject; 247 QString uid = "ComposeMailUIpick2"+mMailSubject;
248#ifndef DESKTOP_VERSION 248#ifndef DESKTOP_VERSION
249 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 249 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
250#endif 250#endif
251 251
252} 252}
253void KOEventViewer::addTag(const QString & tag,const QString & text) 253void KOEventViewer::addTag(const QString & tag,const QString & text)
254{ 254{
255 int number=text.contains("\n"); 255 int number=text.contains("\n");
256 QString str = "<" + tag + ">"; 256 QString str = "<" + tag + ">";
257 QString tmpText=text; 257 QString tmpText=text;
258 QString tmpStr=str; 258 QString tmpStr=str;
259 if(number !=-1) 259 if(number !=-1)
260 { 260 {
261 if (number > 0) { 261 if (number > 0) {
262 int pos=0; 262 int pos=0;
263 QString tmp; 263 QString tmp;
264 for(int i=0;i<=number;i++) { 264 for(int i=0;i<=number;i++) {
265 pos=tmpText.find("\n"); 265 pos=tmpText.find("\n");
266 tmp=tmpText.left(pos); 266 tmp=tmpText.left(pos);
267 tmpText=tmpText.right(tmpText.length()-pos-1); 267 tmpText=tmpText.right(tmpText.length()-pos-1);
268 tmpStr+=tmp+"<br>"; 268 tmpStr+=tmp+"<br>";
269 } 269 }
270 } 270 }
271 else tmpStr += tmpText; 271 else tmpStr += tmpText;
272 tmpStr+="</" + tag + ">"; 272 tmpStr+="</" + tag + ">";
273 mText.append(tmpStr); 273 mText.append(tmpStr);
274 } 274 }
275 else 275 else
276 { 276 {
277 str += text + "</" + tag + ">"; 277 str += text + "</" + tag + ">";
278 mText.append(str); 278 mText.append(str);
279 } 279 }
280} 280}
281 281
282void KOEventViewer::setColorMode( int m ) 282void KOEventViewer::setColorMode( int m )
283{ 283{
284 mColorMode = m; 284 mColorMode = m;
285} 285}
286void KOEventViewer::appendEvent(Event *event, int mode ) 286void KOEventViewer::appendEvent(Event *event, int mode )
287{ 287{
288 mMailSubject = ""; 288 mMailSubject = "";
289 mCurrentIncidence = event; 289 mCurrentIncidence = event;
290 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 290 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
291 bool wideScreen = ( QApplication::desktop()->width() >= 640 ); 291 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
292 topLevelWidget()->setCaption(i18n("Event Viewer")); 292 topLevelWidget()->setCaption(i18n("Event Viewer"));
293 if ( mode == 0 ) { 293 if ( mode == 0 ) {
294 addTag("h2",deTag(event->summary())); 294 addTag("h2",deTag(event->summary()));
295 formatReadOnly(event); 295 formatReadOnly(event);
296 } 296 }
297 else { 297 else {
298 if ( mColorMode == 1 ) { 298 if ( mColorMode == 1 ) {
299 mText +="<font color=\"#00A000\">"; 299 mText +="<font color=\"#00A000\">";
300 } 300 }
301 if ( mColorMode == 2 ) { 301 if ( mColorMode == 2 ) {
302 mText +="<font color=\"#C00000\">"; 302 mText +="<font color=\"#C00000\">";
303 } 303 }
304 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 304 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
305 if ( mode == 1 ) { 305 if ( mode == 1 ) {
306 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 306 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
307 } else { 307 } else {
308 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 308 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
309 } 309 }
310 formatReadOnly(event); 310 formatReadOnly(event);
311 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 311 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
312 if ( mColorMode ) 312 if ( mColorMode )
313 mText += "</font>"; 313 mText += "</font>";
314 } 314 }
315 mMailSubject += i18n( "Meeting " )+ event->summary(); 315 mMailSubject += i18n( "Meeting " )+ event->summary();
316 if (event->cancelled ()) { 316 if (event->cancelled ()) {
317 mText +="<font color=\"#B00000\">"; 317 mText +="<font color=\"#B00000\">";
318 addTag("i",i18n("This event has been cancelled!")); 318 addTag("i",i18n("This event has been cancelled!"));
319 mText.append("<br>"); 319 mText.append("<br>");
320 mText += "</font>"; 320 mText += "</font>";
321 mMailSubject += i18n("(cancelled)"); 321 mMailSubject += i18n("(cancelled)");
322 } 322 }
323 323
324 if (event->doesFloat()) { 324 if (event->doesFloat()) {
325 if (event->isMultiDay()) { 325 if (event->isMultiDay()) {
326 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") 326 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
327 .arg(event->dtStartDateStr(shortDate)) 327 .arg(event->dtStartDateStr(shortDate))
328 .arg(event->dtEndDateStr(shortDate))); 328 .arg(event->dtEndDateStr(shortDate)));
329 } else { 329 } else {
330 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); 330 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
331 } 331 }
332 } else { 332 } else {
333 if (event->isMultiDay()) { 333 if (event->isMultiDay()) {
334 mText.append(i18n("<p><b>From:</b> %1</p> ") 334 mText.append(i18n("<p><b>From:</b> %1</p> ")
335 .arg(event->dtStartStr( shortDate))); 335 .arg(event->dtStartStr( shortDate)));
336 mText.append(i18n("<p><b>To:</b> %1</p>") 336 mText.append(i18n("<p><b>To:</b> %1</p>")
337 .arg(event->dtEndStr(shortDate))); 337 .arg(event->dtEndStr(shortDate)));
338 } else { 338 } else {
339 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") 339 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
340 .arg(event->dtStartTimeStr()) 340 .arg(event->dtStartTimeStr())
341 .arg(event->dtEndTimeStr())); 341 .arg(event->dtEndTimeStr()));
342 mText.append(i18n("<p><b>On:</b> %1</p> ") 342 mText.append(i18n("<p><b>On:</b> %1</p> ")
343 .arg(event->dtStartDateStr( shortDate ))); 343 .arg(event->dtStartDateStr( shortDate )));
344 } 344 }
345 } 345 }
346 if (!event->location().isEmpty()) { 346 if (!event->location().isEmpty()) {
347 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); 347 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
348 mMailSubject += i18n(" at ") + event->location(); 348 mMailSubject += i18n(" at ") + event->location();
349 } 349 }
350 if (event->recurrence()->doesRecur()) { 350 if (event->recurrence()->doesRecur()) {
351 351
352 QString recurText = event->recurrence()->recurrenceText(); 352 QString recurText = event->recurrence()->recurrenceText();
353 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); 353 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
354 bool ok; 354 bool ok;
355 QDate start = QDate::currentDate(); 355 QDate start = QDate::currentDate();
356 QDateTime next; 356 QDateTime next;
357 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); 357 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
358 if ( ok ) { 358 if ( ok ) {
359 if ( wideScreen ){ 359 if ( wideScreen ){
360 addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); 360 addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) );
361 } else { 361 } else {
362 addTag("p",i18n("<b>Next recurrence is on:</b>") ); 362 addTag("p",i18n("<b>Next recurrence is on:</b>") );
363 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); 363 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
364 } 364 }
365 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); 365 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
366 366
367 } else { 367 } else {
368 bool last; 368 bool last;
369 QDate nextd; 369 QDate nextd;
370 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); 370 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
371 if ( last ) { 371 if ( last ) {
372 if ( wideScreen ){ 372 if ( wideScreen ){
373 addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); 373 addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate ));
374 } else{ 374 } else{
375 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 375 addTag("p",i18n("<b>Last recurrence was on:</b>") );
376 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); 376 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
377 } 377 }
378 } 378 }
379 } 379 }
380 } else { 380 } else {
381 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 381 mMailSubject += i18n(" - " )+event->dtStartStr( true );
382 382
383 } 383 }
384 384
385 385
386 if (event->isAlarmEnabled()) { 386 if (event->isAlarmEnabled()) {
387 Alarm *alarm =event->alarms().first() ; 387 Alarm *alarm =event->alarms().first() ;
388 QDateTime t = alarm->time(); 388 QDateTime t = alarm->time();
389 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 389 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
390 if(wideScreen ){ 390 if(wideScreen ){
391 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); 391 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
392 }else{ 392 }else{
393 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 393 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
394 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 394 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
395 } 395 }
396 //addTag("p",s); 396 //addTag("p",s);
397 } 397 }
398 398
399 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); 399 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
400 400
401 formatCategories(event); 401 formatCategories(event);
402 402
403 formatAttendees(event); 403 formatAttendees(event);
404 404
405 if ( KOPrefs::instance()->mEVshowCreated ) { 405 if ( KOPrefs::instance()->mEVshowCreated ) {
406 if(wideScreen ){ 406 if(wideScreen ){
407 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 407 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
408 }else{ 408 }else{
409 addTag("p",i18n("<b>Created: ") +" </b>"); 409 addTag("p",i18n("<b>Created: ") +" </b>");
410 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 410 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
411 } 411 }
412 412
413 413
414 } 414 }
415 if ( KOPrefs::instance()->mEVshowChanged ) { 415 if ( KOPrefs::instance()->mEVshowChanged ) {
416 if(wideScreen ){ 416 if(wideScreen ){
417 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 417 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
418 }else{ 418 }else{
419 addTag("p",i18n("<b>Last modified: ") +" </b>"); 419 addTag("p",i18n("<b>Last modified: ") +" </b>");
420 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 420 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
421 } 421 }
422 422
423 } 423 }
424 if ( KOPrefs::instance()->mEVshowDetails ) { 424 if ( KOPrefs::instance()->mEVshowDetails ) {
425 if (!event->description().isEmpty()) { 425 if (!event->description().isEmpty()) {
426 addTag("p",i18n("<b>Details: </b>")); 426 addTag("p",i18n("<b>Details: </b>"));
427 addTag("p",deTag(event->description())); 427 addTag("p",deTag(event->description()));
428 } 428 }
429 } 429 }
430 setText(mText); 430 setText(mText);
431 //QWhatsThis::add(this,mText); 431 //QWhatsThis::add(this,mText);
432 432
433} 433}
434 434
435void KOEventViewer::appendTodo(Todo *event, int mode ) 435void KOEventViewer::appendTodo(Todo *event, int mode )
436{ 436{
437 mMailSubject = ""; 437 mMailSubject = "";
438 mCurrentIncidence = event; 438 mCurrentIncidence = event;
439 topLevelWidget()->setCaption(i18n("Todo Viewer")); 439 topLevelWidget()->setCaption(i18n("Todo Viewer"));
440 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 440 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
441 bool wideScreen = ( QApplication::desktop()->width() >= 640 ); 441 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
442 if (mode == 0 ) { 442 if (mode == 0 ) {
443 addTag("h2",deTag(event->summary())); 443 addTag("h2",deTag(event->summary()));
444 formatReadOnly(event); 444 formatReadOnly(event);
445 } 445 }
446 else { 446 else {
447 if ( mColorMode == 1 ) { 447 if ( mColorMode == 1 ) {
448 mText +="<font color=\"#00A000\">"; 448 mText +="<font color=\"#00A000\">";
449 } 449 }
450 if ( mColorMode == 2 ) { 450 if ( mColorMode == 2 ) {
451 mText +="<font color=\"#B00000\">"; 451 mText +="<font color=\"#B00000\">";
452 } 452 }
453 if ( mode == 1 ) { 453 if ( mode == 1 ) {
454 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 454 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
455 } else { 455 } else {
456 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 456 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
457 } 457 }
458 formatReadOnly(event); 458 formatReadOnly(event);
459 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 459 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
460 if ( mColorMode ) 460 if ( mColorMode )
461 mText += "</font>"; 461 mText += "</font>";
462 } 462 }
463 mMailSubject += i18n( "Todo " )+ event->summary(); 463 mMailSubject += i18n( "Todo " )+ event->summary();
464 464
465 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { 465 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
466 mText +="<font color=\"#B00000\">"; 466 mText +="<font color=\"#B00000\">";
467 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); 467 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
468 mText += "</font>"; 468 mText += "</font>";
469 } else { 469 } else {
470 mText.append(i18n("<p><i>%1 % completed</i></p>") 470 mText.append(i18n("<p><i>%1 % completed</i></p>")
471 .arg(event->percentComplete())); 471 .arg(event->percentComplete()));
472 } 472 }
473 473
474 if (event->cancelled ()) { 474 if (event->cancelled ()) {
475 mText +="<font color=\"#B00000\">"; 475 mText +="<font color=\"#B00000\">";
476 addTag("i",i18n("This todo has been cancelled!")); 476 addTag("i",i18n("This todo has been cancelled!"));
477 mText.append("<br>"); 477 mText.append("<br>");
478 mText += "</font>"; 478 mText += "</font>";
479 mMailSubject += i18n("(cancelled)"); 479 mMailSubject += i18n("(cancelled)");
480 } 480 }
481 481
482 482
483 483
484 if (event->recurrence()->doesRecur()) { 484 if (event->recurrence()->doesRecur()) {
485 485
486 QString recurText = event->recurrence()->recurrenceText(); 486 QString recurText = event->recurrence()->recurrenceText();
487 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); 487 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
488 488
489 } 489 }
490 if (event->hasStartDate()) { 490 if (event->hasStartDate()) {
491 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 491 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
492 } 492 }
493 if (event->hasDueDate()) { 493 if (event->hasDueDate()) {
494 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 494 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
495 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 495 mMailSubject += i18n(" - " )+event->dtDueStr( true );
496 } 496 }
497 if (!event->location().isEmpty()) { 497 if (!event->location().isEmpty()) {
498 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); 498 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
499 mMailSubject += i18n(" at ") + event->location(); 499 mMailSubject += i18n(" at ") + event->location();
500 } 500 }
501 mText.append(i18n("<p><b>Priority:</b> %2</p>") 501 mText.append(i18n("<p><b>Priority:</b> %2</p>")
502 .arg(QString::number(event->priority()))); 502 .arg(QString::number(event->priority())));
503 503
504 if (event->isAlarmEnabled()) { 504 if (event->isAlarmEnabled()) {
505 Alarm *alarm =event->alarms().first() ; 505 Alarm *alarm =event->alarms().first() ;
506 QDateTime t = alarm->time(); 506 QDateTime t = alarm->time();
507 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 507 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
508 if ( wideScreen ) { 508 if ( wideScreen ) {
509 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); 509 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
510 } else { 510 } else {
511 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 511 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
512 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 512 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
513 } 513 }
514 } 514 }
515 515
516 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); 516 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
517 517
518 formatCategories(event); 518 formatCategories(event);
519 519
520 formatAttendees(event); 520 formatAttendees(event);
521 521
522 if ( KOPrefs::instance()->mEVshowCreated ) { 522 if ( KOPrefs::instance()->mEVshowCreated ) {
523 if(wideScreen ){ 523 if(wideScreen ){
524 524
525 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 525 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
526 526
527 } else { 527 } else {
528 addTag("p",i18n("<b>Created: ") +" </b>"); 528 addTag("p",i18n("<b>Created: ") +" </b>");
529 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 529 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
530 } 530 }
531 } 531 }
532 if ( KOPrefs::instance()->mEVshowChanged ) { 532 if ( KOPrefs::instance()->mEVshowChanged ) {
533 if(wideScreen ){ 533 if(wideScreen ){
534 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 534 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
535 535
536 } else { 536 } else {
537 addTag("p",i18n("<b>Last modified: ") +" </b>"); 537 addTag("p",i18n("<b>Last modified: ") +" </b>");
538 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 538 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
539 } 539 }
540 } 540 }
541 if ( event->relatedTo() ) { 541 if ( event->relatedTo() ) {
542 addTag("b",i18n("Parent todo:<br>")); 542 addTag("b",i18n("Parent todo:<br>"));
543 543
544 QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary()); 544 QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary());
545 545
546 mText += t_name; 546 mText += t_name;
547 mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">"; 547 mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">";
548 mText += deTag(event->relatedTo()->summary()); 548 mText += deTag(event->relatedTo()->summary());
549 mText += "</a><br>"; 549 mText += "</a><br>";
550 550
551 // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); 551 // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>");
552 } 552 }
553 QPtrList<Incidence> Relations = event->relations(); 553 QPtrList<Incidence> Relations = event->relations();
554 Incidence *to; 554 Incidence *to;
555 if ( Relations.first() ) 555 if ( Relations.first() )
556 addTag("b",i18n("Sub todos:<br>")); 556 addTag("b",i18n("Sub todos:<br>"));
557 for (to=Relations.first();to;to=Relations.next()) { 557 for (to=Relations.first();to;to=Relations.next()) {
558 QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary()); 558 QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary());
559 mText += t_name; 559 mText += t_name;
560 mText += "<a href=\"todo_uid:" + to->uid() + "\">"; 560 mText += "<a href=\"todo_uid:" + to->uid() + "\">";
561 mText += deTag(to->summary()); 561 mText += deTag(to->summary());
562 mText += "</a><br>"; 562 mText += "</a><br>";
563 563
564 } 564 }
565 565
566 if ( KOPrefs::instance()->mEVshowDetails ) { 566 if ( KOPrefs::instance()->mEVshowDetails ) {
567 if (!event->description().isEmpty()) { 567 if (!event->description().isEmpty()) {
568 addTag("p",i18n("<b>Details: </b>")); 568 addTag("p",i18n("<b>Details: </b>"));
569 addTag("p",deTag(event->description())); 569 addTag("p",deTag(event->description()));
570 } 570 }
571 } 571 }
572 setText(mText); 572 setText(mText);
573} 573}
574 574
575void KOEventViewer::formatCategories(Incidence *event) 575void KOEventViewer::formatCategories(Incidence *event)
576{ 576{
577 if (!event->categoriesStr().isEmpty()) { 577 if (!event->categoriesStr().isEmpty()) {
578 if (event->categories().count() == 1) { 578 if (event->categories().count() == 1) {
579 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace()); 579 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
580 } else { 580 } else {
581 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; 581 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
582 } 582 }
583 } 583 }
584} 584}
585void KOEventViewer::formatAttendees(Incidence *event) 585void KOEventViewer::formatAttendees(Incidence *event)
586{ 586{
587 QPtrList<Attendee> attendees = event->attendees(); 587 QPtrList<Attendee> attendees = event->attendees();
588 if (attendees.count()) { 588 if (attendees.count()) {
589 589
590 590
591 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 591 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
592 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 592 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
593 addTag("h3",i18n("Organizer")); 593 addTag("h3",i18n("Organizer"));
594 mText.append("<ul><li>"); 594 mText.append("<ul><li>");
595#ifndef KORG_NOKABC 595#ifndef KORG_NOKABC
596 596
597#ifdef DESKTOP_VERSION 597#ifdef DESKTOP_VERSION
598 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 598 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
599 KABC::Addressee::List addressList; 599 KABC::Addressee::List addressList;
600 addressList = add_book->findByEmail(event->organizer()); 600 addressList = add_book->findByEmail(event->organizer());
601 KABC::Addressee o = addressList.first(); 601 KABC::Addressee o = addressList.first();
602 if (!o.isEmpty() && addressList.size()<2) { 602 if (!o.isEmpty() && addressList.size()<2) {
603 mText += "<a href=\"uid:" + o.uid() + "\">"; 603 mText += "<a href=\"uid:" + o.uid() + "\">";
604 mText += o.formattedName(); 604 mText += o.formattedName();
605 mText += "</a>\n"; 605 mText += "</a>\n";
606 } else { 606 } else {
607 mText.append(event->organizer()); 607 mText.append(event->organizer());
608 } 608 }
609#else //DESKTOP_VERSION 609#else //DESKTOP_VERSION
610 mText += "<a href=\"uid:organizer\">"; 610 mText += "<a href=\"uid:organizer\">";
611 mText += event->organizer(); 611 mText += event->organizer();
612 mText += "</a>\n"; 612 mText += "</a>\n";
613#endif //DESKTOP_VERSION 613#endif //DESKTOP_VERSION
614 614
615 615
616#else 616#else
617 mText.append(event->organizer()); 617 mText.append(event->organizer());
618#endif 618#endif
619 619
620 if (iconPath) { 620 if (iconPath) {
621 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 621 mText += " <a href=\"mailto:" + event->organizer() + "\">";
622 mText += "<IMG src=\"" + iconPath + "\">"; 622 mText += "<IMG src=\"" + iconPath + "\">";
623 mText += "</a>\n"; 623 mText += "</a>\n";
624 } 624 }
625 mText.append("</li></ul>"); 625 mText.append("</li></ul>");
626 626
627 addTag("h3",i18n("Attendees")); 627 addTag("h3",i18n("Attendees"));
628 Attendee *a; 628 Attendee *a;
629 mText.append("<ul>"); 629 mText.append("<ul>");
630 int a_count = 0; 630 int a_count = 0;
631 int a_count_nr = 0; 631 int a_count_nr = 0;
632 632
633 for(a=attendees.first();a;a=attendees.next()) { 633 for(a=attendees.first();a;a=attendees.next()) {
634#ifndef KORG_NOKABC 634#ifndef KORG_NOKABC
635#ifdef DESKTOP_VERSION 635#ifdef DESKTOP_VERSION
636 if (a->name().isEmpty()) { 636 if (a->name().isEmpty()) {
637 addressList = add_book->findByEmail(a->email()); 637 addressList = add_book->findByEmail(a->email());
638 KABC::Addressee o = addressList.first(); 638 KABC::Addressee o = addressList.first();
639 if (!o.isEmpty() && addressList.size()<2) { 639 if (!o.isEmpty() && addressList.size()<2) {
640 mText += "<a href=\"uid:" + o.uid() + "\">"; 640 mText += "<a href=\"uid:" + o.uid() + "\">";
641 mText += o.formattedName(); 641 mText += o.formattedName();
642 mText += "</a>\n"; 642 mText += "</a>\n";
643 } else { 643 } else {
644 mText += "<li>"; 644 mText += "<li>";
645 mText.append(a->email()); 645 mText.append(a->email());
646 mText += "\n"; 646 mText += "\n";
647 } 647 }
648 } else { 648 } else {
649 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 649 mText += "<li><a href=\"uid:" + a->uid() + "\">";
650 if (!a->name().isEmpty()) mText += a->name(); 650 if (!a->name().isEmpty()) mText += a->name();
651 else mText += a->email(); 651 else mText += a->email();
652 mText += "</a>\n"; 652 mText += "</a>\n";
653 } 653 }
654#else //DESKTOP_VERSION 654#else //DESKTOP_VERSION
655 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 655 mText += "<li><a href=\"uid:" + a->uid() + "\">";
656 if (!a->name().isEmpty()) mText += a->name(); 656 if (!a->name().isEmpty()) mText += a->name();
657 else mText += a->email(); 657 else mText += a->email();
658 mText += "</a>\n"; 658 mText += "</a>\n";
659#endif //DESKTOP_VERSION 659#endif //DESKTOP_VERSION
660#else 660#else
661 //qDebug("nokabc "); 661 //qDebug("nokabc ");
662 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 662 mText += "<li><a href=\"uid:" + a->uid() + "\">";
663 if (!a->name().isEmpty()) mText += a->name(); 663 if (!a->name().isEmpty()) mText += a->name();
664 else mText += a->email(); 664 else mText += a->email();
665 mText += "</a>\n"; 665 mText += "</a>\n";
666#endif 666#endif
667 667
668 668
669 if (!a->email().isEmpty()) { 669 if (!a->email().isEmpty()) {
670 if (iconPath) { 670 if (iconPath) {
671 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; 671 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
672 if ( a->RSVP() ) { 672 if ( a->RSVP() ) {
673 ++a_count_nr; 673 ++a_count_nr;
674 mText += "<IMG src=\"" + iconPath + "\">"; 674 mText += "<IMG src=\"" + iconPath + "\">";
675 } 675 }
676 else { 676 else {
677 ++a_count; 677 ++a_count;
678 mText += "<IMG src=\"" + NOiconPath + "\">"; 678 mText += "<IMG src=\"" + NOiconPath + "\">";
679 } 679 }
680 mText += "</a>\n"; 680 mText += "</a>\n";
681 } 681 }
682 } 682 }
683 if (a->status() != Attendee::NeedsAction ) 683 if (a->status() != Attendee::NeedsAction )
684 mText +="[" + a->statusStr() + "] "; 684 mText +="[" + a->statusStr() + "] ";
685 if (a->role() == Attendee::Chair ) 685 if (a->role() == Attendee::Chair )
686 mText +="(" + a->roleStr().left(1) + ".)"; 686 mText +="(" + a->roleStr().left(1) + ".)";
687 } 687 }
688 mText.append("</li></ul>"); 688 mText.append("</li></ul>");
689 if ( (a_count+a_count_nr) > 1 ) { 689 if ( (a_count+a_count_nr) > 1 ) {
690 mText += "<a href=\"mailto:ALL\">"; 690 mText += "<a href=\"mailto:ALL\">";
691 mText += i18n( "Mail to all" ); 691 mText += i18n( "Mail to all" );
692 mText += "</a> ( "; 692 mText += "</a> ( ";
693 mText += "<IMG src=\"" + iconPath + "\">"; 693 mText += "<IMG src=\"" + iconPath + "\">";
694 mText += i18n( " and " ); 694 mText += i18n( " and " );
695 mText += "<IMG src=\"" + NOiconPath + "\"> )"; 695 mText += "<IMG src=\"" + NOiconPath + "\"> )";
696 mText += "<br>\n"; 696 mText += "<br>\n";
697 697
698 698
699 } 699 }
700 if ( a_count_nr > 1 ) { 700 if ( a_count_nr > 1 ) {
701 mText += "<a href=\"mailto:RSVP\">"; 701 mText += "<a href=\"mailto:RSVP\">";
702 mText += i18n( "Mail to selected" ); 702 mText += i18n( "Mail to selected" );
703 mText += "</a> ( "; 703 mText += "</a> ( ";
704 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); 704 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath );
705 mText += "<br>\n"; 705 mText += "<br>\n";
706 } 706 }
707 } 707 }
708 708
709} 709}
710void KOEventViewer::appendJournal(Journal *jour, int mode ) 710void KOEventViewer::appendJournal(Journal *jour, int mode )
711{ 711{
712 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 712 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
713 QString text_d = i18n("Journal from: "); 713 QString text_d = i18n("Journal from: ");
714 if ( !jour->summary().isEmpty() ) 714 if ( !jour->summary().isEmpty() )
715 text_d = jour->summary(); 715 text_d = jour->summary();
716 if (mode == 0 ) { 716 if (mode == 0 ) {
717 addTag("h2", text_d ); 717 addTag("h2", text_d );
718 } 718 }
719 else { 719 else {
720 if ( mode == 1 ) { 720 if ( mode == 1 ) {
721 addTag("h3",i18n( "Local: " ) + text_d ); 721 addTag("h3",i18n( "Local: " ) + text_d );
722 } else { 722 } else {
723 addTag("h3",i18n( "Remote: " ) + text_d ); 723 addTag("h3",i18n( "Remote: " ) + text_d );
724 } 724 }
725 } 725 }
726 topLevelWidget()->setCaption(i18n("Journal viewer")); 726 topLevelWidget()->setCaption(i18n("Journal viewer"));
727 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); 727 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
728 formatReadOnly(jour); 728 formatReadOnly(jour);
729 addTag("p","<b>"+i18n( "Last modified: " ) + "</b>"+KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); 729 addTag("p","<b>"+i18n( "Last modified: " ) + "</b>"+KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
730 730
731 if (!jour->description().isEmpty()) { 731 if (!jour->description().isEmpty()) {
732 addTag("p",deTag(jour->description())); 732 addTag("p",deTag(jour->description()));
733 } 733 }
734 setText(mText); 734 setText(mText);
735} 735}
736 736
737void KOEventViewer::formatReadOnly(Incidence *event) 737void KOEventViewer::formatReadOnly(Incidence *event)
738{ 738{
739 int id = event->calID(); 739 int id = event->calID();
740 if ( id > 1 ) { 740 if ( id > 1 ) {
741 addTag("p", "<em>("+i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName + ")</em>"); 741 addTag("p", "<em>("+i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName + ")</em>");
742 } 742 }
743 if (event->isReadOnly()) { 743 if (event->isReadOnly()) {
744 addTag("p","<em>(" + i18n("read-only") + ")</em>"); 744 addTag("p","<em>(" + i18n("read-only") + ")</em>");
745 } 745 }
746} 746}
747void KOEventViewer::setSyncMode( bool b ) 747void KOEventViewer::setSyncMode( bool b )
748{ 748{
749 mSyncMode = b; 749 mSyncMode = b;
750} 750}
751 751
752void KOEventViewer::setTodo(Todo *event, bool clearV ) 752void KOEventViewer::setTodo(Todo *event, bool clearV )
753{ 753{
754 if ( clearV ) 754 if ( clearV )
755 clearEvents(); 755 clearEvents();
756 if ( mSyncMode ) { 756 if ( mSyncMode ) {
757 if ( clearV ) 757 if ( clearV )
758 appendTodo(event,1 ); 758 appendTodo(event,1 );
759 else 759 else
760 appendTodo(event,2); 760 appendTodo(event,2);
761 } else 761 } else
762 appendTodo(event); 762 appendTodo(event);
763} 763}
764void KOEventViewer::setJournal(Journal *event, bool clearV ) 764void KOEventViewer::setJournal(Journal *event, bool clearV )
765{ 765{
766 if ( clearV ) 766 if ( clearV )
767 clearEvents(); 767 clearEvents();
768 if ( mSyncMode ) { 768 if ( mSyncMode ) {
769 if ( clearV ) 769 if ( clearV )
770 appendJournal(event, 1); 770 appendJournal(event, 1);
771 else 771 else
772 appendJournal(event, 2); 772 appendJournal(event, 2);
773 } else 773 } else
774 appendJournal(event); 774 appendJournal(event);
775} 775}
776 776
777void KOEventViewer::setEvent(Event *event) 777void KOEventViewer::setEvent(Event *event)
778{ 778{
779 clearEvents(); 779 clearEvents();
780 if ( mSyncMode ) 780 if ( mSyncMode )
781 appendEvent(event, 1); 781 appendEvent(event, 1);
782 else 782 else
783 appendEvent(event); 783 appendEvent(event);
784} 784}
785 785
786void KOEventViewer::addEvent(Event *event) 786void KOEventViewer::addEvent(Event *event)
787{ 787{
788 if ( mSyncMode ) 788 if ( mSyncMode )
789 appendEvent(event, 2); 789 appendEvent(event, 2);
790 else 790 else
791 appendEvent(event); 791 appendEvent(event);
792} 792}
793 793
794void KOEventViewer::clearEvents(bool now) 794void KOEventViewer::clearEvents(bool now)
795{ 795{
796 mText = ""; 796 mText = "";
797 if (now) setText(mText); 797 if (now) setText(mText);
798} 798}
799 799
800void KOEventViewer::addText(QString text) 800void KOEventViewer::addText(QString text)
801{ 801{
802 mText.append(text); 802 mText.append(text);
803 setText(mText); 803 setText(mText);
804} 804}
805QString KOEventViewer::deTag(QString text) 805QString KOEventViewer::deTag(QString text)
806{ 806{
807#if QT_VERSION >= 0x030000 807#if QT_VERSION >= 0x030000
808 text.replace( '<' , "&lt;" ); 808 text.replace( '<' , "&lt;" );
809 text.replace( '>' , "&gt;" ); 809 text.replace( '>' , "&gt;" );
810#else 810#else
811 if ( text.find ('<') >= 0 ) { 811 if ( text.find ('<') >= 0 ) {
812 text.replace( QRegExp("<") , "&lt;" ); 812 text.replace( QRegExp("<") , "&lt;" );
813 } 813 }
814 if ( text.find ('>') >= 0 ) { 814 if ( text.find ('>') >= 0 ) {
815 text.replace( QRegExp(">") , "&gt;" ); 815 text.replace( QRegExp(">") , "&gt;" );
816 } 816 }
817#endif 817#endif
818 return text; 818 return text;
819} 819}
820void KOEventViewer::keyPressEvent ( QKeyEvent * e ) 820void KOEventViewer::keyPressEvent ( QKeyEvent * e )
821{ 821{
822 switch ( e->key() ) { 822 switch ( e->key() ) {
823 case Qt::Key_Return: 823 case Qt::Key_Return:
824 case Qt::Key_Enter : 824 case Qt::Key_Enter :
825 e->ignore(); 825 e->ignore();
826 break; 826 break;
827 default: 827 default:
828 QTextBrowser::keyPressEvent ( e ); 828 QTextBrowser::keyPressEvent ( e );
829 break; 829 break;
830 } 830 }
831} 831}