summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-17 16:49:25 (UTC)
committer zautrix <zautrix>2005-04-17 16:49:25 (UTC)
commit70b45fe97813c4fd336b7ca8fdedab13f9c2e039 (patch) (unidiff)
tree37e89cf6cc411af8c646003fcfb0d5975f38272c
parent02dc5d8173393d2069951a5f847db5bdf69137f6 (diff)
downloadkdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.zip
kdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.tar.gz
kdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt274
-rw-r--r--changelog.txt136
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--korganizer/koeventviewer.cpp112
-rw-r--r--korganizer/kotodoview.cpp10
-rw-r--r--libkcal/incidence.cpp4
-rw-r--r--libkcal/incidence.h1
-rw-r--r--version2
8 files changed, 229 insertions, 312 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 03895fd..ef0bd8b 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,279 +1,41 @@
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.0.28 ************ 3********** VERSION 2.1.0 ************
4 4
5KO/Pi: 5Stable release 2.1.0!
6Fixed two problems in KO/Pi timetracking.
7Added context menu to month view for creating new events/todos.
8Fixed some other small bugs.
9 6
7Summary of changes/fixes compared to version 2.0.6:
10 8
11********** VERSION 2.0.27 ************ 9Many bugs of version 2.0.6 fixed.
10Most of them were small bugs, but some of them were important.
11It is recommended to use version 2.1.0 and not version 2.0.6.
12 12
13More bugfixes. 13Important changes:
14Added possibility to clone in KO/Pi a todo with all its subtodos.
15Added config option for alternate background in list views.
16
17Added a timetracker funtionality in KO/Pi for todos in the todo view.
18If a todo is set to started and then to stopped it is saving information about the runtime in
19<yourhome>/kdepim/apps/timetrackerdir.
20To read, display, print this information an external program is needed which will be developed.
21It will display the data in a Gantt timetable view with one row for each todo.
22It will have many possibilities sorting the data after category, parent todos, attendees, ... and for creating/printing status reports/summaries.
23Merging of data from different computers/users will be quite easy because every run is stored in a single file.
24
25********** VERSION 2.0.26 ************
26
27Added two more fields to the KA/Pi view config:
28A "Mobile (home)" and a "Mobile (work)" field.
29Fixed utf8 import (e.g. for Japaneese text) in KA/Pi.
30
31Some alarm applet enhancements, e.g. sound stops automatically if value of suspend spinbox changes.
32And again fixed some more small bugs.
33
34********** VERSION 2.0.25 ************
35
36And again fixed some bugs.
37
38********** VERSION 2.0.24 ************
39
40Fixed again a lot of small bugs.
41Some performance optimizations in date navigator.
42Month view displays now multi days events on top of each cell, such that it is more likely that all multi days items of one event are in the same row.
43
44********** VERSION 2.0.23 ************
45
46Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation.
47Fixed the (agenda) layout of KO/Pi on 5500er.
48Some usebility enhancements (e.g. reselection the current item of the todo view after some changes).
49
50********** VERSION 2.0.22 ************
51
52KO/Pi:
53Fix for creating events/todos via the abgenda context menu.
54Added option to split toolbar to 3 toolbars.
55(Toolbar moving s disabled for this option due to a bug in Qt somewhere).
56Added option to show one small filter-view-toolbar.
57Added a print option to the desktop version:
58Now you can print out the view of the "Event Viewer".
59That means you can print all data of one particular event/todo.
60Added scaling options to printout of Event Viewer and What'sNext View.
61Fixed some problems in the month view in "week start sunday" mode.
62KA/Pi:
63Added two more config options.
64Fixed resizing problem of address request dialog when orientation was switched.
65Cleaned up the menu structure.
66Fixed some more problems.
67
68Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views.
69
70And, this is a really cool option (Ben did suggest it):
71Now KO/Pi and KA/Pi can be run from a USB stick:
72All data is read from and written to the stick.
73You can enable this in the global configure option TAB with:
74Save using LOCAL storage.
75Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online.
76
77********** VERSION 2.0.21 ************
78
79Fixed another SMTP problem in OM/Pi.
80Some small changed in the new datenavigator in KO/Pi.
81Changed default setting for new filter in KA/Pi to "exclude categories".
82Changed the default font size for 640x480 display .
83Changed popup menu behaviour in agenda and list view.
84Fixed some layout problems of the date label size in the month view.
85Made month view update faster.
86Made first datenavigator repainting faster.
87Changed the title of the event/todo edit dialogs.
88Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course).
89Many small usebility fixes in KO/Pi.
90Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi.
91The set of possible "next views" are the views you have toolbar buttons for.
92
93Made alarm sound working on Linux.
94
95KO/Pi alarm applet changed:
96Made buttons in alarm dialog much bigger.
97Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger.
98The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings.
99
100And because this version is realeased at Easter, I added an Easter-egg:
101With a new undocumented command you can get a message box about the next alarm.
102Good luck to find it!
103
104
105
106********** VERSION 2.0.20 ************
107
108Two small fixes in OM/Pi.
109
110Better resizing of the new datenavigator in KO/Pi.
111
112********** VERSION 2.0.19 ************
113KO/Pi:
114Enhancements and bugfixes in the new datenavigator.
115Bugfix in this changelog:
116The datenavigator was changed in version 2.0.18, not the datepicker.
117
118********** VERSION 2.0.18 ************
119KO/Pi:
120Fixed some minor problems.
121Cleaned up the KO/Pi config dialog.
122Fixed problem moving events in aganda view.
123Made datepicker scaleable, i.e. if the datenavigator shows now a
124datenavigator matrix depending on its size.
125Birthdays are now displayed green in the datenavigator.
126What'sThis Help in datenavigator shows all events of the day.
127
128OM/Pi:
129Updated the backend mail library to the latest version.
130Please backup your mail before using this version.
131
132********** VERSION 2.0.17 ************
133
134KO/Pi:
135Tooltips in month view were not sorted. Fixed.
136Daylabel in agenda view ( for display of one day ) was too short. Fixed.
137Conflict display dialog for syncing was not on top of other windows. Fixed.
138Fixed some minor problems.
139
140Fixed an endless loop when importing vcs file with RESOURCES entry.
141
142********** VERSION 2.0.16 ************
143OM/Pi:
144Fixed the SMTP account setting the option.
145Fixed something in mail sending.
146
147KO/Pi:
148Added possibility to export selected events/todos as vcal file.
149
150********** VERSION 2.0.15 ************
151
152PwM/Pi:
153Added keyboard shorcuts for
154- toggling summary view (space bar)
155- delete item (delete + backspace key)
156- add new item ( i + n key)
157Fixed length of info in the title.
158
159KO/Pi-KA/Pi:
160Changed "ME" menu bar entry to an icon.
161
162KO/Pi:
163Fixed two minor bugs in displaying todos.
164If in month view a cell is selected, the key shortcut "d" shows now that date.
165Added complete info for a todo in month view as an icon left of the text.
166Fixed problems of displaying data when "<" or ">" are used in summary/location/description.
167Fixed problem of search dialog size when switching displays.
168Cancel key now closes date picker.
169Rearranged KO/Pi file menu structure.
170
171OM/Pi:
172Added to the SMTP account setting the option
173"No secure connection".
174You have to configure your SMTP accounts again, sorry.
175
176KA/Pi:
177Added support for importing quoted-printable.
178Support was added by Peter P.. Thanks, Peter!
179
180
181********** VERSION 2.0.14 ************
182
183Made Passwordmanager PwM/Pi more userfriendly:
184Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
185Fixed bug in KO/Pi todo printing.
186Made Qtopia calendar import possible on desktop .
187
188********** VERSION 2.0.13 ************
189
190Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
191
192In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
193
194OM/Pi:
195Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
196Added missing German translation.
197Added warning if path is specified in local folder settings of account config.
198
199********** VERSION 2.0.12 ************
200
201KO/Pi:
202Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
203Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
204Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
205
206Fixed problem in pi-sync mode when wrong password was sent.
207
208OM/Pi:
209Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
210Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
211
212********** VERSION 2.0.11 ************
213
214Fixed some problems in pi-sync mode
215(e.g. details of events were not synced properly)
216
217********** VERSION 2.0.10 ************
218
219KO/Pi:
220In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
221This is fixed.
222Changed the search dialog a bit to make it more user friendly.
223(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
224
225Added config option to hide the week number in KO/Pi toolbar.
226
227********** VERSION 2.0.9 ************
228
229Made month view icons for multiday events a bit nicer.
230Some minor fixes in KO/Pi
231(e.g. go to today did not work for new week view properly).
232
233
234********** VERSION 2.0.8 ************
235
236Fixed a problem in dependency info in the ipk files for the Zaurus.
237
238Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
239
240Added a "go today" button to the datepicker.
241
242Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
243and made it configureable to show these values.
244
245Fixed a problem for events (from external iCal files) that do have a duration but no end date.
246
247
248********** VERSION 2.0.7 ************
249
250Added global application font settings
251(for all KDE-Pim/Pi apps) to the general settings.
252
253Fixed a problem in OM/Pi when trying to login to some IMAP servers
254(like the IMAP server of Apple: mail.mac.com )
255 14
256Added recurring todos to KO/Pi. 15Added recurring todos to KO/Pi.
257 16
17Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
18
19Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
258 20
259********** VERSION 2.0.6 ************ 21Datenavigator can now display many months. Very useful on the desktop.
260 22
261Stable release 2.0.6! 23KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
262 24
263Some bugfixes in the pi-sync mode. 25Made alarm sound working on Linux desktop.
264Added German translation for pi-sync mode.
265 26
266KO/Pi: 27Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
267Made the todolist using alternate background.
268 28
269Other minor fixes in KO/Pi. 29Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
270 30
31Many other usebility enhancements.
32Special thanks to Ben for his suggestions!
271 33
272You can find the complete changelog 34You can find the complete changelog
273from version 1.7.7 to 2.0.5 35from version 1.7.7 to 2.1.0
274in the source package or on 36in the source package or on
275 37
276http://www.pi-sync.net/html/changelog.html 38http://www.pi-sync.net/html/changelog.html
277 39
278 40
279 41
diff --git a/changelog.txt b/changelog.txt
index 99be167..45e0322 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,196 +1,332 @@
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.0 ************
4
5Stable release 2.1.0!
6
7Summary of changes/fixes compared to version 2.0.6:
8
9Many bugs of version 2.0.6 fixed.
10Most of them were small bugs, but some of them were important.
11It is recommended to use version 2.1.0 and not version 2.0.6.
12
13Important changes:
14
15Added recurring todos to KO/Pi.
16
17Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
18
19Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
20
21Datenavigator can now display many months. Very useful on the desktop.
22
23KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
24
25Made alarm sound working on Linux desktop.
26
27Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
28
29Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
30
31Many other usebility enhancements.
32Special thanks to Ben for his suggestions!
33
34You can find the complete changelog
35from version 1.7.7 to 2.1.0
36in the source package or on
37
38http://www.pi-sync.net/html/changelog.html
39
40********** VERSION 2.0.28 ************
41
42KO/Pi:
43Fixed two problems in KO/Pi timetracking.
44Added context menu to month view for creating new events/todos.
45Fixed some other small bugs.
46
47
48********** VERSION 2.0.27 ************
49
50More bugfixes.
51Added possibility to clone in KO/Pi a todo with all its subtodos.
52Added config option for alternate background in list views.
53
54Added a timetracker funtionality in KO/Pi for todos in the todo view.
55If a todo is set to started and then to stopped it is saving information about the runtime in
56<yourhome>/kdepim/apps/timetrackerdir.
57To read, display, print this information an external program is needed which will be developed.
58It will display the data in a Gantt timetable view with one row for each todo.
59It will have many possibilities sorting the data after category, parent todos, attendees, ... and for creating/printing status reports/summaries.
60Merging of data from different computers/users will be quite easy because every run is stored in a single file.
61
62********** VERSION 2.0.26 ************
63
64Added two more fields to the KA/Pi view config:
65A "Mobile (home)" and a "Mobile (work)" field.
66Fixed utf8 import (e.g. for Japaneese text) in KA/Pi.
67
68Some alarm applet enhancements, e.g. sound stops automatically if value of suspend spinbox changes.
69And again fixed some more small bugs.
70
71********** VERSION 2.0.25 ************
72
73And again fixed some bugs.
74
75********** VERSION 2.0.24 ************
76
77Fixed again a lot of small bugs.
78Some performance optimizations in date navigator.
79Month view displays now multi days events on top of each cell, such that it is more likely that all multi days items of one event are in the same row.
80
81********** VERSION 2.0.23 ************
82
83Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation.
84Fixed the (agenda) layout of KO/Pi on 5500er.
85Some usebility enhancements (e.g. reselection the current item of the todo view after some changes).
86
87********** VERSION 2.0.22 ************
88
89KO/Pi:
90Fix for creating events/todos via the abgenda context menu.
91Added option to split toolbar to 3 toolbars.
92(Toolbar moving s disabled for this option due to a bug in Qt somewhere).
93Added option to show one small filter-view-toolbar.
94Added a print option to the desktop version:
95Now you can print out the view of the "Event Viewer".
96That means you can print all data of one particular event/todo.
97Added scaling options to printout of Event Viewer and What'sNext View.
98Fixed some problems in the month view in "week start sunday" mode.
99KA/Pi:
100Added two more config options.
101Fixed resizing problem of address request dialog when orientation was switched.
102Cleaned up the menu structure.
103Fixed some more problems.
104
105Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views.
106
107And, this is a really cool option (Ben did suggest it):
108Now KO/Pi and KA/Pi can be run from a USB stick:
109All data is read from and written to the stick.
110You can enable this in the global configure option TAB with:
111Save using LOCAL storage.
112Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online.
113
3********** VERSION 2.0.21 ************ 114********** VERSION 2.0.21 ************
4 115
116Fixed another SMTP problem in OM/Pi.
117Some small changed in the new datenavigator in KO/Pi.
118Changed default setting for new filter in KA/Pi to "exclude categories".
119Changed the default font size for 640x480 display .
120Changed popup menu behaviour in agenda and list view.
121Fixed some layout problems of the date label size in the month view.
122Made month view update faster.
123Made first datenavigator repainting faster.
124Changed the title of the event/todo edit dialogs.
125Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course).
126Many small usebility fixes in KO/Pi.
127Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi.
128The set of possible "next views" are the views you have toolbar buttons for.
129
130Made alarm sound working on Linux.
131
132KO/Pi alarm applet changed:
133Made buttons in alarm dialog much bigger.
134Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger.
135The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings.
136
137And because this version is realeased at Easter, I added an Easter-egg:
138With a new undocumented command you can get a message box about the next alarm.
139Good luck to find it!
140
5 141
6********** VERSION 2.0.20 ************ 142********** VERSION 2.0.20 ************
7 143
8Two small fixes in OM/Pi. 144Two small fixes in OM/Pi.
9 145
10Better resizing of the new datenavigator in KO/Pi. 146Better resizing of the new datenavigator in KO/Pi.
11 147
12********** VERSION 2.0.19 ************ 148********** VERSION 2.0.19 ************
13KO/Pi: 149KO/Pi:
14Enhancements and bugfixes in the new datenavigator. 150Enhancements and bugfixes in the new datenavigator.
15Bugfix in this changelog: 151Bugfix in this changelog:
16The datenavigator was changed in version 2.0.18, not the datepicker. 152The datenavigator was changed in version 2.0.18, not the datepicker.
17 153
18********** VERSION 2.0.18 ************ 154********** VERSION 2.0.18 ************
19KO/Pi: 155KO/Pi:
20Fixed some minor problems. 156Fixed some minor problems.
21Cleaned up the KO/Pi config dialog. 157Cleaned up the KO/Pi config dialog.
22Fixed problem moving events in aganda view. 158Fixed problem moving events in aganda view.
23Made datepicker scaleable, i.e. if the datenavigator shows now a 159Made datepicker scaleable, i.e. if the datenavigator shows now a
24datenavigator matrix depending on its size. 160datenavigator matrix depending on its size.
25Birthdays are now displayed green in the datenavigator. 161Birthdays are now displayed green in the datenavigator.
26What'sThis Help in datenavigator shows all events of the day. 162What'sThis Help in datenavigator shows all events of the day.
27 163
28OM/Pi: 164OM/Pi:
29Updated the backend mail library to the latest version. 165Updated the backend mail library to the latest version.
30Please backup your mail before using this version. 166Please backup your mail before using this version.
31 167
32********** VERSION 2.0.17 ************ 168********** VERSION 2.0.17 ************
33 169
34KO/Pi: 170KO/Pi:
35Tooltips in month view were not sorted. Fixed. 171Tooltips in month view were not sorted. Fixed.
36Daylabel in agenda view ( for display of one day ) was too short. Fixed. 172Daylabel in agenda view ( for display of one day ) was too short. Fixed.
37Conflict display dialog for syncing was not on top of other windows. Fixed. 173Conflict display dialog for syncing was not on top of other windows. Fixed.
38Fixed some minor problems. 174Fixed some minor problems.
39 175
40Fixed an endless loop when importing vcs file with RESOURCES entry. 176Fixed an endless loop when importing vcs file with RESOURCES entry.
41 177
42********** VERSION 2.0.16 ************ 178********** VERSION 2.0.16 ************
43OM/Pi: 179OM/Pi:
44Fixed the SMTP account setting the option. 180Fixed the SMTP account setting the option.
45Fixed something in mail sending. 181Fixed something in mail sending.
46 182
47KO/Pi: 183KO/Pi:
48Added possibility to export selected events/todos as vcal file. 184Added possibility to export selected events/todos as vcal file.
49 185
50********** VERSION 2.0.15 ************ 186********** VERSION 2.0.15 ************
51 187
52PwM/Pi: 188PwM/Pi:
53Added keyboard shorcuts for 189Added keyboard shorcuts for
54- toggling summary view (space bar) 190- toggling summary view (space bar)
55- delete item (delete + backspace key) 191- delete item (delete + backspace key)
56- add new item ( i + n key) 192- add new item ( i + n key)
57Fixed length of info in the title. 193Fixed length of info in the title.
58 194
59KO/Pi-KA/Pi: 195KO/Pi-KA/Pi:
60Changed "ME" menu bar entry to an icon. 196Changed "ME" menu bar entry to an icon.
61 197
62KO/Pi: 198KO/Pi:
63Fixed two minor bugs in displaying todos. 199Fixed two minor bugs in displaying todos.
64If in month view a cell is selected, the key shortcut "d" shows now that date. 200If in month view a cell is selected, the key shortcut "d" shows now that date.
65Added complete info for a todo in month view as an icon left of the text. 201Added complete info for a todo in month view as an icon left of the text.
66Fixed problems of displaying data when "<" or ">" are used in summary/location/description. 202Fixed problems of displaying data when "<" or ">" are used in summary/location/description.
67Fixed problem of search dialog size when switching displays. 203Fixed problem of search dialog size when switching displays.
68Cancel key now closes date picker. 204Cancel key now closes date picker.
69Rearranged KO/Pi file menu structure. 205Rearranged KO/Pi file menu structure.
70 206
71OM/Pi: 207OM/Pi:
72Added to the SMTP account setting the option 208Added to the SMTP account setting the option
73"No secure connection". 209"No secure connection".
74You have to configure your SMTP accounts again, sorry. 210You have to configure your SMTP accounts again, sorry.
75 211
76KA/Pi: 212KA/Pi:
77Added support for importing quoted-printable. 213Added support for importing quoted-printable.
78Support was added by Peter P.. Thanks, Peter! 214Support was added by Peter P.. Thanks, Peter!
79 215
80 216
81********** VERSION 2.0.14 ************ 217********** VERSION 2.0.14 ************
82 218
83Made Passwordmanager PwM/Pi more userfriendly: 219Made Passwordmanager PwM/Pi more userfriendly:
84Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 220Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
85Fixed bug in KO/Pi todo printing. 221Fixed bug in KO/Pi todo printing.
86Made Qtopia calendar import possible on desktop . 222Made Qtopia calendar import possible on desktop .
87 223
88********** VERSION 2.0.13 ************ 224********** VERSION 2.0.13 ************
89 225
90Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. 226Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
91 227
92In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". 228In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
93 229
94OM/Pi: 230OM/Pi:
95Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. 231Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
96Added missing German translation. 232Added missing German translation.
97Added warning if path is specified in local folder settings of account config. 233Added warning if path is specified in local folder settings of account config.
98 234
99********** VERSION 2.0.12 ************ 235********** VERSION 2.0.12 ************
100 236
101KO/Pi: 237KO/Pi:
102Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. 238Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
103Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. 239Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
104Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. 240Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
105 241
106Fixed problem in pi-sync mode when wrong password was sent. 242Fixed problem in pi-sync mode when wrong password was sent.
107 243
108OM/Pi: 244OM/Pi:
109Fixed a crash when displaying mails with "Show mail as html" was checked in the config. 245Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
110Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. 246Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
111 247
112********** VERSION 2.0.11 ************ 248********** VERSION 2.0.11 ************
113 249
114Fixed some problems in pi-sync mode 250Fixed some problems in pi-sync mode
115(e.g. details of events were not synced properly) 251(e.g. details of events were not synced properly)
116 252
117********** VERSION 2.0.10 ************ 253********** VERSION 2.0.10 ************
118 254
119KO/Pi: 255KO/Pi:
120In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. 256In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
121This is fixed. 257This is fixed.
122Changed the search dialog a bit to make it more user friendly. 258Changed the search dialog a bit to make it more user friendly.
123(E.g.: Removed message box about "no items found" and set key focus to search line edit after search). 259(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
124 260
125Added config option to hide the week number in KO/Pi toolbar. 261Added config option to hide the week number in KO/Pi toolbar.
126 262
127********** VERSION 2.0.9 ************ 263********** VERSION 2.0.9 ************
128 264
129Made month view icons for multiday events a bit nicer. 265Made month view icons for multiday events a bit nicer.
130Some minor fixes in KO/Pi 266Some minor fixes in KO/Pi
131(e.g. go to today did not work for new week view properly). 267(e.g. go to today did not work for new week view properly).
132 268
133 269
134********** VERSION 2.0.8 ************ 270********** VERSION 2.0.8 ************
135 271
136Fixed a problem in dependency info in the ipk files for the Zaurus. 272Fixed a problem in dependency info in the ipk files for the Zaurus.
137 273
138Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. 274Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
139 275
140Added a "go today" button to the datepicker. 276Added a "go today" button to the datepicker.
141 277
142Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) 278Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
143and made it configureable to show these values. 279and made it configureable to show these values.
144 280
145Fixed a problem for events (from external iCal files) that do have a duration but no end date. 281Fixed a problem for events (from external iCal files) that do have a duration but no end date.
146 282
147 283
148********** VERSION 2.0.7 ************ 284********** VERSION 2.0.7 ************
149 285
150Added global application font settings 286Added global application font settings
151(for all KDE-Pim/Pi apps) to the general settings. 287(for all KDE-Pim/Pi apps) to the general settings.
152 288
153Fixed a problem in OM/Pi when trying to login to some IMAP servers 289Fixed a problem in OM/Pi when trying to login to some IMAP servers
154(like the IMAP server of Apple: mail.mac.com ) 290(like the IMAP server of Apple: mail.mac.com )
155 291
156Added recurring todos to KO/Pi. 292Added recurring todos to KO/Pi.
157 293
158 294
159********** VERSION 2.0.6 ************ 295********** VERSION 2.0.6 ************
160 296
161Some bugfixes in the pi-sync mode. 297Some bugfixes in the pi-sync mode.
162Added German translation for pi-sync mode. 298Added German translation for pi-sync mode.
163 299
164KO/Pi: 300KO/Pi:
165Made the todolist using alternate background. 301Made the todolist using alternate background.
166 302
167Other minor fixes in KO/Pi. 303Other minor fixes in KO/Pi.
168 304
169 305
170********** VERSION 2.0.5 ************ 306********** VERSION 2.0.5 ************
171 307
172Bugfixes in KO/Pi. 308Bugfixes in KO/Pi.
173 309
174********** VERSION 2.0.4 ************ 310********** VERSION 2.0.4 ************
175 311
176KO/Pi: 312KO/Pi:
177Fixed problem loading translations for summary/location edit boxes in event/todo editor. 313Fixed problem loading translations for summary/location edit boxes in event/todo editor.
178 314
179Added a general "select week number" to the toolbar. 315Added a general "select week number" to the toolbar.
180 316
181Fixed some small problem of the new features introduced in version 2.0.3. 317Fixed some small problem of the new features introduced in version 2.0.3.
182 318
183Made it possible to specify one specific category as category color, 319Made it possible to specify one specific category as category color,
184if more than one categories are selected. 320if more than one categories are selected.
185 321
186Fixed a bug in saving colors for categories with non-ascii characters. 322Fixed a bug in saving colors for categories with non-ascii characters.
187(Like, e.g. German Umlauts). 323(Like, e.g. German Umlauts).
188Propably you have to set your colors again for those categories. 324Propably you have to set your colors again for those categories.
189 325
190 326
191********** VERSION 2.0.3 ************ 327********** VERSION 2.0.3 ************
192 328
193KO/Pi: 329KO/Pi:
194Added feature for changing alarm settings for many items at once: 330Added feature for changing alarm settings for many items at once:
195Open list view (or search dialog), select the desired items and choose in 331Open list view (or search dialog), select the desired items and choose in
196the popup menu: Set alarm for selected... 332the popup menu: Set alarm for selected...
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 3889b6f..3b6b52e 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -1,84 +1,84 @@
1Summary: A collection of PIM programs 1Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.0.28 3Version: 2.1.0
4Release: SuSE_9.2 4Release: SuSE_9.2
5Copyright:GPL 5Copyright:GPL
6Group: Productivity/Pim 6Group: Productivity/Pim
7Source:http://sourceforge.net/projects/kdepimpi/ 7Source:http://sourceforge.net/projects/kdepimpi/
8URL:http://sourceforge.net/projects/kdepimpi/ 8URL:http://sourceforge.net/projects/kdepimpi/
9Packager: zautrix 9Packager: zautrix
10 10
11%description 11%description
12This package contains the platform-independent PIM programs from 12This package contains the platform-independent PIM programs from
13www.pi-sync.info, compiled for SuSE 9.2: 13www.pi-sync.info, compiled for SuSE 9.2:
14KTimeTacker/Pi 14KTimeTacker/Pi
15KPhone/Pi 15KPhone/Pi
16KAddressbook/Pi 16KAddressbook/Pi
17KOrganizer/Pi 17KOrganizer/Pi
18PasswordManager/Pi 18PasswordManager/Pi
19KOPieMail/Pi 19KOPieMail/Pi
20 20
21These applications do not need anything from the KDE-desktop 21These applications do not need anything from the KDE-desktop
22at all to run on Linux. However, there is a dependency from 22at all to run on Linux. However, there is a dependency from
23two KDE libs, because a small command line program is included 23two KDE libs, because a small command line program is included
24to make it possible to sync with the KDE-desktop applications. 24to make it possible to sync with the KDE-desktop applications.
25 25
26These applications are independent from the KDE-desktop 26These applications are independent from the KDE-desktop
27environment. That means, nothing of your existing 27environment. That means, nothing of your existing
28KDE-desktop setup will be changed, or any data 28KDE-desktop setup will be changed, or any data
29(calendar-addressbook) used by the KDE-desktop 29(calendar-addressbook) used by the KDE-desktop
30applications will be changed or accessed. 30applications will be changed or accessed.
31These applications stores their data and config in 31These applications stores their data and config in
32$HOME/kdepim/ 32$HOME/kdepim/
33However, because the same file format is used, 33However, because the same file format is used,
34an easy exchange of data with the KDE-desktop 34an easy exchange of data with the KDE-desktop
35is possible. 35is possible.
36A small command line program is included 36A small command line program is included
37to make it possible to sync with the KDE-desktop applications. 37to make it possible to sync with the KDE-desktop applications.
38You do not need to call this program from the commandline, 38You do not need to call this program from the commandline,
39it is called from the KDE-Pim/Pi apps when you choose there: 39it is called from the KDE-Pim/Pi apps when you choose there:
40Sync with KDE_Desktop. 40Sync with KDE_Desktop.
41If something is going wrong, please start the 41If something is going wrong, please start the
42KDE-Pim/Pi program itself from the console to get detailed output. 42KDE-Pim/Pi program itself from the console to get detailed output.
43 43
44After installation, you should have a 44After installation, you should have a
45PIM-pi 45PIM-pi
46folder in your KDE start menu, where you can 46folder in your KDE start menu, where you can
47start the applications from. 47start the applications from.
48 48
49These programs makes it possible to sync your Zaurus easily 49These programs makes it possible to sync your Zaurus easily
50(with the KDE-Pim/Pi programs running on the Zaurus) 50(with the KDE-Pim/Pi programs running on the Zaurus)
51with the KDE-desktop calendar/addressbook data. 51with the KDE-desktop calendar/addressbook data.
52If you want to use that, you have to update your 52If you want to use that, you have to update your
53KDE-desktop to version 3.3.0 or higher. 53KDE-desktop to version 3.3.0 or higher.
54SuSE 9.2 contains KDE 3.3.0 such that no update is needed. 54SuSE 9.2 contains KDE 3.3.0 such that no update is needed.
55Actually - after the (non difficult) configuration is set up - 55Actually - after the (non difficult) configuration is set up -
56with two mouseklicks on the Zaurus, 56with two mouseklicks on the Zaurus,
57the Zaurus syncs with the corresponding KDE-Pim/Pi 57the Zaurus syncs with the corresponding KDE-Pim/Pi
58program on the Linux Desktop which syncs automatically 58program on the Linux Desktop which syncs automatically
59with the KDE-desktop data. 59with the KDE-desktop data.
60 60
61If you want to use the KDE-desktop calendar/addressbook applications, 61If you want to use the KDE-desktop calendar/addressbook applications,
62just install these apps in this package and use them as a syncing tool for the 62just install these apps in this package and use them as a syncing tool for the
63Zaurus <-> KDE-desktop sync. 63Zaurus <-> KDE-desktop sync.
64The sync requires a network connection from your Zaurus to 64The sync requires a network connection from your Zaurus to
65the PC. A detailed Sync HowTo is available in the 65the PC. A detailed Sync HowTo is available in the
66Help menu of the applications. 66Help menu of the applications.
67 67
68These applications makes it also possible, that you can sync 68These applications makes it also possible, that you can sync
69(or just export the data to) your mobile phone with your 69(or just export the data to) your mobile phone with your
70data of the KDE-desktop calendar/addressbook applications. 70data of the KDE-desktop calendar/addressbook applications.
71This is tested and working for Nokia mobile phones, 71This is tested and working for Nokia mobile phones,
72it may work with others as well. 72it may work with others as well.
73(More info about that: -> Sync HowTo) 73(More info about that: -> Sync HowTo)
74 74
75NOTE: 75NOTE:
76When using SuSE 9.1 you have to update your KDE to 3.3.x 76When using SuSE 9.1 you have to update your KDE to 3.3.x
77and you have to make an online update in SuSE 9.1 to make it 77and you have to make an online update in SuSE 9.1 to make it
78possible to get the infrared connection working, such that 78possible to get the infrared connection working, such that
79you can sync your (Nokia) mobile phone via infrared. 79you can sync your (Nokia) mobile phone via infrared.
80 80
81%files 81%files
82/opt/kde3/share/applnk/PIM-pi/ 82/opt/kde3/share/applnk/PIM-pi/
83/opt/kdepimpi/ 83/opt/kdepimpi/
84/usr/lib/libmicro* 84/usr/lib/libmicro*
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f39b5e1..c8c2f28 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -89,649 +89,661 @@ void KOEventViewer::printMe()
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(3) == "uid" ) 113 if ( n.left(3) == "uid" )
114#ifdef DESKTOP_VERSION 114#ifdef DESKTOP_VERSION
115 { 115 {
116 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 116 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
117 KABC::AddressBook::Iterator it; 117 KABC::AddressBook::Iterator it;
118 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 118 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
119 // LR I do not understand, why the uid string is different on zaurus and desktop 119 // LR I do not understand, why the uid string is different on zaurus and desktop
120 QString uid = "uid://"+(*it).uid(); 120 QString uid = "uid://"+(*it).uid();
121 121
122 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); 122 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
123 if (n == uid ) { 123 if (n == uid ) {
124 //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); 124 //qDebug("found %s ",(*it).mobileHomePhone().latin1() );
125 QDialog dia( this,"dia123", true ); 125 QDialog dia( this,"dia123", true );
126 dia.setCaption( i18n("Details of attendee") ); 126 dia.setCaption( i18n("Details of attendee") );
127 QVBoxLayout lay ( &dia ); 127 QVBoxLayout lay ( &dia );
128 KABC::AddresseeView av ( &dia ); 128 KABC::AddresseeView av ( &dia );
129 av.setAddressee( (*it) ); 129 av.setAddressee( (*it) );
130 lay.addWidget( &av ); 130 lay.addWidget( &av );
131 if ( QApplication::desktop()->width() < 480 ) 131 if ( QApplication::desktop()->width() < 480 )
132 dia.resize( 220, 240); 132 dia.resize( 220, 240);
133 else { 133 else {
134 dia.resize( 400,400); 134 dia.resize( 400,400);
135 } 135 }
136 dia.exec(); 136 dia.exec();
137 break; 137 break;
138 } 138 }
139 } 139 }
140 return; 140 return;
141 } 141 }
142#else 142#else
143 { 143 {
144 if ( "uid:organizer" == n ) { 144 if ( "uid:organizer" == n ) {
145 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); 145 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
146 return; 146 return;
147 } 147 }
148 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 148 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
149 if (attendees.count()) { 149 if (attendees.count()) {
150 Attendee *a; 150 Attendee *a;
151 for(a=attendees.first();a;a=attendees.next()) { 151 for(a=attendees.first();a;a=attendees.next()) {
152 if ( "uid:"+a->uid() == n ) { 152 if ( "uid:"+a->uid() == n ) {
153 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); 153 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
154 return; 154 return;
155 } 155 }
156 } 156 }
157 } 157 }
158 return; 158 return;
159 } 159 }
160 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 160 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
161 // the result should now arrive through method insertAttendees 161 // the result should now arrive through method insertAttendees
162 //QString uid = "uid:"+(*it).uid(); 162 //QString uid = "uid:"+(*it).uid();
163#endif 163#endif
164 if ( n.left(6) == "mailto" ) { 164 if ( n.left(6) == "mailto" ) {
165 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); 165 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
166#ifndef DESKTOP_VERSION 166#ifndef DESKTOP_VERSION
167 if ( n.mid(7,3) == "ALL" ) { 167 if ( n.mid(7,3) == "ALL" ) {
168 mailToAttendees( true ); 168 mailToAttendees( true );
169 } else if ( n.mid(7,4) == "RSVP" ) { 169 } else if ( n.mid(7,4) == "RSVP" ) {
170 mailToAttendees( false ); 170 mailToAttendees( false );
171 } else { 171 } else {
172 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); 172 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
173 e << n.mid(7); 173 e << n.mid(7);
174 } 174 }
175#endif 175#endif
176 176
177 } 177 }
178 178
179 179
180#ifndef KORG_NODCOP 180#ifndef KORG_NODCOP
181 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 181 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
182 QString tmpStr; 182 QString tmpStr;
183 if (n.startsWith("mailto:")) { 183 if (n.startsWith("mailto:")) {
184 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 184 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
185 //emit showIncidence(n); 185 //emit showIncidence(n);
186 return; 186 return;
187 } else if (n.startsWith("uid:")) { 187 } else if (n.startsWith("uid:")) {
188 DCOPClient *client = KApplication::kApplication()->dcopClient(); 188 DCOPClient *client = KApplication::kApplication()->dcopClient();
189 const QByteArray noParamData; 189 const QByteArray noParamData;
190 const QByteArray paramData; 190 const QByteArray paramData;
191 QByteArray replyData; 191 QByteArray replyData;
192 QCString replyTypeStr; 192 QCString replyTypeStr;
193#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 193#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
194 bool foundAbbrowser = PING_ABBROWSER; 194 bool foundAbbrowser = PING_ABBROWSER;
195 195
196 if (foundAbbrowser) { 196 if (foundAbbrowser) {
197 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 197 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
198 //client->send("kaddressbook","KAddressBookIface", 198 //client->send("kaddressbook","KAddressBookIface",
199 QDataStream arg(paramData, IO_WriteOnly); 199 QDataStream arg(paramData, IO_WriteOnly);
200 arg << n.mid(6); 200 arg << n.mid(6);
201 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); 201 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
202 return; 202 return;
203 } else { 203 } else {
204 /* 204 /*
205 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. 205 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
206 We start it without its main interface 206 We start it without its main interface
207 */ 207 */
208 KIconLoader* iconLoader = new KIconLoader(); 208 KIconLoader* iconLoader = new KIconLoader();
209 QString iconPath = iconLoader->iconPath("go",KIcon::Small); 209 QString iconPath = iconLoader->iconPath("go",KIcon::Small);
210 ActionManager::setStartedKAddressBook(true); 210 ActionManager::setStartedKAddressBook(true);
211 tmpStr = "kaddressbook --editor-only --uid "; 211 tmpStr = "kaddressbook --editor-only --uid ";
212 tmpStr += KProcess::quote(n.mid(6)); 212 tmpStr += KProcess::quote(n.mid(6));
213 KRun::runCommand(tmpStr,"KAddressBook",iconPath); 213 KRun::runCommand(tmpStr,"KAddressBook",iconPath);
214 return; 214 return;
215 } 215 }
216 } else { 216 } else {
217 //QTextBrowser::setSource(n); 217 //QTextBrowser::setSource(n);
218 } 218 }
219#endif 219#endif
220} 220}
221void KOEventViewer::mailToAttendees( bool all ) 221void KOEventViewer::mailToAttendees( bool all )
222{ 222{
223 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 223 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
224 if (attendees.count() == 0) return; 224 if (attendees.count() == 0) return;
225 QStringList nameList; 225 QStringList nameList;
226 QStringList emailList; 226 QStringList emailList;
227 QStringList uidList; 227 QStringList uidList;
228 Attendee* a; 228 Attendee* a;
229 for(a=attendees.first();a;a=attendees.next()) { 229 for(a=attendees.first();a;a=attendees.next()) {
230 if ( !all && !a->RSVP() ) continue; 230 if ( !all && !a->RSVP() ) continue;
231 if (!a->email().isEmpty()) { 231 if (!a->email().isEmpty()) {
232 nameList.append (a->name() ); 232 nameList.append (a->name() );
233 emailList.append (a->email() ); 233 emailList.append (a->email() );
234 uidList.append (a->uid() ); 234 uidList.append (a->uid() );
235 } 235 }
236 } 236 }
237 QString uid = "ComposeMailUIpick2"+mMailSubject; 237 QString uid = "ComposeMailUIpick2"+mMailSubject;
238#ifndef DESKTOP_VERSION 238#ifndef DESKTOP_VERSION
239 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 239 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
240#endif 240#endif
241 241
242} 242}
243void KOEventViewer::addTag(const QString & tag,const QString & text) 243void KOEventViewer::addTag(const QString & tag,const QString & text)
244{ 244{
245 int number=text.contains("\n"); 245 int number=text.contains("\n");
246 QString str = "<" + tag + ">"; 246 QString str = "<" + tag + ">";
247 QString tmpText=text; 247 QString tmpText=text;
248 QString tmpStr=str; 248 QString tmpStr=str;
249 if(number !=-1) 249 if(number !=-1)
250 { 250 {
251 if (number > 0) { 251 if (number > 0) {
252 int pos=0; 252 int pos=0;
253 QString tmp; 253 QString tmp;
254 for(int i=0;i<=number;i++) { 254 for(int i=0;i<=number;i++) {
255 pos=tmpText.find("\n"); 255 pos=tmpText.find("\n");
256 tmp=tmpText.left(pos); 256 tmp=tmpText.left(pos);
257 tmpText=tmpText.right(tmpText.length()-pos-1); 257 tmpText=tmpText.right(tmpText.length()-pos-1);
258 tmpStr+=tmp+"<br>"; 258 tmpStr+=tmp+"<br>";
259 } 259 }
260 } 260 }
261 else tmpStr += tmpText; 261 else tmpStr += tmpText;
262 tmpStr+="</" + tag + ">"; 262 tmpStr+="</" + tag + ">";
263 mText.append(tmpStr); 263 mText.append(tmpStr);
264 } 264 }
265 else 265 else
266 { 266 {
267 str += text + "</" + tag + ">"; 267 str += text + "</" + tag + ">";
268 mText.append(str); 268 mText.append(str);
269 } 269 }
270} 270}
271 271
272void KOEventViewer::setColorMode( int m ) 272void KOEventViewer::setColorMode( int m )
273{ 273{
274 mColorMode = m; 274 mColorMode = m;
275} 275}
276void KOEventViewer::appendEvent(Event *event, int mode ) 276void KOEventViewer::appendEvent(Event *event, int mode )
277{ 277{
278 mMailSubject = ""; 278 mMailSubject = "";
279 mCurrentIncidence = event; 279 mCurrentIncidence = event;
280 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 280 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
281 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
281 topLevelWidget()->setCaption(i18n("Event Viewer")); 282 topLevelWidget()->setCaption(i18n("Event Viewer"));
282 if ( mode == 0 ) { 283 if ( mode == 0 ) {
283 addTag("h2",deTag(event->summary())); 284 addTag("h2",deTag(event->summary()));
284 } 285 }
285 else { 286 else {
286 if ( mColorMode == 1 ) { 287 if ( mColorMode == 1 ) {
287 mText +="<font color=\"#00A000\">"; 288 mText +="<font color=\"#00A000\">";
288 } 289 }
289 if ( mColorMode == 2 ) { 290 if ( mColorMode == 2 ) {
290 mText +="<font color=\"#C00000\">"; 291 mText +="<font color=\"#C00000\">";
291 } 292 }
292 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 293 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
293 if ( mode == 1 ) { 294 if ( mode == 1 ) {
294 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 295 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
295 } else { 296 } else {
296 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 297 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
297 } 298 }
298 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 299 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
299 if ( mColorMode ) 300 if ( mColorMode )
300 mText += "</font>"; 301 mText += "</font>";
301 } 302 }
302 mMailSubject += i18n( "Meeting " )+ event->summary(); 303 mMailSubject += i18n( "Meeting " )+ event->summary();
303 if (event->cancelled ()) { 304 if (event->cancelled ()) {
304 mText +="<font color=\"#B00000\">"; 305 mText +="<font color=\"#B00000\">";
305 addTag("i",i18n("This event has been cancelled!")); 306 addTag("i",i18n("This event has been cancelled!"));
306 mText.append("<br>"); 307 mText.append("<br>");
307 mText += "</font>"; 308 mText += "</font>";
308 mMailSubject += i18n("(cancelled)"); 309 mMailSubject += i18n("(cancelled)");
309 } 310 }
310 311
311 if (event->doesFloat()) { 312 if (event->doesFloat()) {
312 if (event->isMultiDay()) { 313 if (event->isMultiDay()) {
313 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") 314 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
314 .arg(event->dtStartDateStr(shortDate)) 315 .arg(event->dtStartDateStr(shortDate))
315 .arg(event->dtEndDateStr(shortDate))); 316 .arg(event->dtEndDateStr(shortDate)));
316 } else { 317 } else {
317 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); 318 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
318 } 319 }
319 } else { 320 } else {
320 if (event->isMultiDay()) { 321 if (event->isMultiDay()) {
321 mText.append(i18n("<p><b>From:</b> %1</p> ") 322 mText.append(i18n("<p><b>From:</b> %1</p> ")
322 .arg(event->dtStartStr( shortDate))); 323 .arg(event->dtStartStr( shortDate)));
323 mText.append(i18n("<p><b>To:</b> %1</p>") 324 mText.append(i18n("<p><b>To:</b> %1</p>")
324 .arg(event->dtEndStr(shortDate))); 325 .arg(event->dtEndStr(shortDate)));
325 } else { 326 } else {
326 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") 327 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
327 .arg(event->dtStartTimeStr()) 328 .arg(event->dtStartTimeStr())
328 .arg(event->dtEndTimeStr())); 329 .arg(event->dtEndTimeStr()));
329 mText.append(i18n("<p><b>On:</b> %1</p> ") 330 mText.append(i18n("<p><b>On:</b> %1</p> ")
330 .arg(event->dtStartDateStr( shortDate ))); 331 .arg(event->dtStartDateStr( shortDate )));
331 } 332 }
332 } 333 }
333 if (!event->location().isEmpty()) { 334 if (!event->location().isEmpty()) {
334 addTag("b",i18n("Location: ")); 335 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
335 mText.append(deTag(event->location())+"<br>");
336 mMailSubject += i18n(" at ") + event->location(); 336 mMailSubject += i18n(" at ") + event->location();
337 } 337 }
338 if (event->recurrence()->doesRecur()) { 338 if (event->recurrence()->doesRecur()) {
339 339
340 QString recurText = event->recurrence()->recurrenceText(); 340 QString recurText = event->recurrence()->recurrenceText();
341 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); 341 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
342 bool ok; 342 bool ok;
343 QDate start = QDate::currentDate(); 343 QDate start = QDate::currentDate();
344 QDateTime next; 344 QDateTime next;
345 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); 345 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
346 if ( ok ) { 346 if ( ok ) {
347 addTag("p",i18n("<b>Next recurrence is on:</b>") ); 347 if ( wideScreen ){
348 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); 348 addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) );
349 } else {
350 addTag("p",i18n("<b>Next recurrence is on:</b>") );
351 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
352 }
349 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); 353 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
350 354
351 } else { 355 } else {
352 bool last; 356 bool last;
353 QDate nextd; 357 QDate nextd;
354 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); 358 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
355 if ( last ) { 359 if ( last ) {
356 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 360 if ( wideScreen ){
357 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); 361 addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate ));
362 } else{
363 addTag("p",i18n("<b>Last recurrence was on:</b>") );
364 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
365 }
358 } 366 }
359 } 367 }
360 } else { 368 } else {
361 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 369 mMailSubject += i18n(" - " )+event->dtStartStr( true );
362 370
363 } 371 }
364 372
365 373
366 if (event->isAlarmEnabled()) { 374 if (event->isAlarmEnabled()) {
367 Alarm *alarm =event->alarms().first() ; 375 Alarm *alarm =event->alarms().first() ;
368 QDateTime t = alarm->time(); 376 QDateTime t = alarm->time();
369 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 377 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
370 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 378 if(wideScreen ){
371 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 379 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
380 }else{
381 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
382 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
383 }
372 //addTag("p",s); 384 //addTag("p",s);
373 } 385 }
374 386
375 addTag("b",i18n("Access: ")); 387 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
376 mText.append(event->secrecyStr()+"<br>");
377 388
378
379
380 formatCategories(event); 389 formatCategories(event);
381 390
382 formatReadOnly(event); 391 formatReadOnly(event);
383 formatAttendees(event); 392 formatAttendees(event);
384 393
385 if ( KOPrefs::instance()->mEVshowCreated ) { 394 if ( KOPrefs::instance()->mEVshowCreated ) {
386#ifdef DESKTOP_VERSION 395 if(wideScreen ){
387 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 396 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
388#else 397 }else{
389 addTag("p",i18n("<b>Created: ") +" </b>"); 398 addTag("p",i18n("<b>Created: ") +" </b>");
390 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 399 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
391#endif 400 }
401
392 402
393 } 403 }
394 if ( KOPrefs::instance()->mEVshowChanged ) { 404 if ( KOPrefs::instance()->mEVshowChanged ) {
395#ifdef DESKTOP_VERSION 405 if(wideScreen ){
396 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 406 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
397#else 407 }else{
398 addTag("p",i18n("<b>Last modified: ") +" </b>"); 408 addTag("p",i18n("<b>Last modified: ") +" </b>");
399 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 409 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
400#endif 410 }
401 411
402 } 412 }
403 if ( KOPrefs::instance()->mEVshowDetails ) { 413 if ( KOPrefs::instance()->mEVshowDetails ) {
404 if (!event->description().isEmpty()) { 414 if (!event->description().isEmpty()) {
405 addTag("p",i18n("<b>Details: </b>")); 415 addTag("p",i18n("<b>Details: </b>"));
406 addTag("p",deTag(event->description())); 416 addTag("p",deTag(event->description()));
407 } 417 }
408 } 418 }
409 setText(mText); 419 setText(mText);
410 //QWhatsThis::add(this,mText); 420 //QWhatsThis::add(this,mText);
411 421
412} 422}
413 423
414void KOEventViewer::appendTodo(Todo *event, int mode ) 424void KOEventViewer::appendTodo(Todo *event, int mode )
415{ 425{
416 mMailSubject = ""; 426 mMailSubject = "";
417 mCurrentIncidence = event; 427 mCurrentIncidence = event;
418 topLevelWidget()->setCaption(i18n("Todo Viewer")); 428 topLevelWidget()->setCaption(i18n("Todo Viewer"));
419 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 429 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
430 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
420 if (mode == 0 ) 431 if (mode == 0 )
421 addTag("h2",deTag(event->summary())); 432 addTag("h2",deTag(event->summary()));
422 else { 433 else {
423 if ( mColorMode == 1 ) { 434 if ( mColorMode == 1 ) {
424 mText +="<font color=\"#00A000\">"; 435 mText +="<font color=\"#00A000\">";
425 } 436 }
426 if ( mColorMode == 2 ) { 437 if ( mColorMode == 2 ) {
427 mText +="<font color=\"#B00000\">"; 438 mText +="<font color=\"#B00000\">";
428 } 439 }
429 if ( mode == 1 ) { 440 if ( mode == 1 ) {
430 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 441 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
431 } else { 442 } else {
432 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 443 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
433 } 444 }
434 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 445 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
435 if ( mColorMode ) 446 if ( mColorMode )
436 mText += "</font>"; 447 mText += "</font>";
437 } 448 }
438 mMailSubject += i18n( "Todo " )+ event->summary(); 449 mMailSubject += i18n( "Todo " )+ event->summary();
439 450
440 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { 451 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
441 mText +="<font color=\"#B00000\">"; 452 mText +="<font color=\"#B00000\">";
442 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); 453 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
443 mText += "</font>"; 454 mText += "</font>";
444 } else { 455 } else {
445 mText.append(i18n("<p><i>%1 % completed</i></p>") 456 mText.append(i18n("<p><i>%1 % completed</i></p>")
446 .arg(event->percentComplete())); 457 .arg(event->percentComplete()));
447 } 458 }
448 459
449 if (event->cancelled ()) { 460 if (event->cancelled ()) {
450 mText +="<font color=\"#B00000\">"; 461 mText +="<font color=\"#B00000\">";
451 addTag("i",i18n("This todo has been cancelled!")); 462 addTag("i",i18n("This todo has been cancelled!"));
452 mText.append("<br>"); 463 mText.append("<br>");
453 mText += "</font>"; 464 mText += "</font>";
454 mMailSubject += i18n("(cancelled)"); 465 mMailSubject += i18n("(cancelled)");
455 } 466 }
456 467
457 468
458 469
459 if (event->recurrence()->doesRecur()) { 470 if (event->recurrence()->doesRecur()) {
460 471
461 QString recurText = event->recurrence()->recurrenceText(); 472 QString recurText = event->recurrence()->recurrenceText();
462 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); 473 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
463 474
464 } 475 }
465 if (event->hasStartDate()) { 476 if (event->hasStartDate()) {
466 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 477 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
467 } 478 }
468 if (event->hasDueDate()) { 479 if (event->hasDueDate()) {
469 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 480 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
470 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 481 mMailSubject += i18n(" - " )+event->dtDueStr( true );
471 } 482 }
472 if (!event->location().isEmpty()) { 483 if (!event->location().isEmpty()) {
473 addTag("b",i18n("Location: ")); 484 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
474 mText.append(deTag(event->location())+"<br>");
475 mMailSubject += i18n(" at ") + event->location(); 485 mMailSubject += i18n(" at ") + event->location();
476 } 486 }
477 mText.append(i18n("<p><b>Priority:</b> %2</p>") 487 mText.append(i18n("<p><b>Priority:</b> %2</p>")
478 .arg(QString::number(event->priority()))); 488 .arg(QString::number(event->priority())));
479 489
480 if (event->isAlarmEnabled()) { 490 if (event->isAlarmEnabled()) {
481 Alarm *alarm =event->alarms().first() ; 491 Alarm *alarm =event->alarms().first() ;
482 QDateTime t = alarm->time(); 492 QDateTime t = alarm->time();
483 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 493 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
484 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 494 if ( wideScreen ) {
485 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 495 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
486 //addTag("p",s); 496 } else {
497 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
498 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
499 }
487 } 500 }
488 501
489 addTag("b",i18n("Access: ")); 502 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
490 mText.append(event->secrecyStr()+"<br>");
491 503
492 formatCategories(event); 504 formatCategories(event);
493 505
494 formatReadOnly(event); 506 formatReadOnly(event);
495 formatAttendees(event); 507 formatAttendees(event);
496 508
497 if ( KOPrefs::instance()->mEVshowCreated ) { 509 if ( KOPrefs::instance()->mEVshowCreated ) {
498#ifdef DESKTOP_VERSION 510 if(wideScreen ){
499 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 511
500#else 512 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
501 addTag("p",i18n("<b>Created: ") +" </b>"); 513
502 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 514 } else {
503#endif 515 addTag("p",i18n("<b>Created: ") +" </b>");
504 516 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
517 }
505 } 518 }
506 if ( KOPrefs::instance()->mEVshowChanged ) { 519 if ( KOPrefs::instance()->mEVshowChanged ) {
507#ifdef DESKTOP_VERSION 520 if(wideScreen ){
508 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 521 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
509#else 522
510 addTag("p",i18n("<b>Last modified: ") +" </b>"); 523 } else {
511 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 524 addTag("p",i18n("<b>Last modified: ") +" </b>");
512#endif 525 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
513 526 }
514 } 527 }
515 if ( event->relatedTo() ) { 528 if ( event->relatedTo() ) {
516 addTag("b",i18n("Parent todo:<br>")); 529 addTag("b",i18n("Parent todo:<br>"));
517 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); 530 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
518 } 531 }
519 QPtrList<Incidence> Relations = event->relations(); 532 QPtrList<Incidence> Relations = event->relations();
520 Incidence *to; 533 Incidence *to;
521 if ( Relations.first() ) 534 if ( Relations.first() )
522 addTag("b",i18n("Sub todos:<br>")); 535 addTag("b",i18n("Sub todos:<br>"));
523 for (to=Relations.first();to;to=Relations.next()) { 536 for (to=Relations.first();to;to=Relations.next()) {
524 mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); 537 mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
525 538
526 } 539 }
527 540
528 if ( KOPrefs::instance()->mEVshowDetails ) { 541 if ( KOPrefs::instance()->mEVshowDetails ) {
529 if (!event->description().isEmpty()) { 542 if (!event->description().isEmpty()) {
530 addTag("p",i18n("<b>Details: </b>")); 543 addTag("p",i18n("<b>Details: </b>"));
531 addTag("p",deTag(event->description())); 544 addTag("p",deTag(event->description()));
532 } 545 }
533 } 546 }
534 setText(mText); 547 setText(mText);
535} 548}
536 549
537void KOEventViewer::formatCategories(Incidence *event) 550void KOEventViewer::formatCategories(Incidence *event)
538{ 551{
539 if (!event->categoriesStr().isEmpty()) { 552 if (!event->categoriesStr().isEmpty()) {
540 if (event->categories().count() == 1) { 553 if (event->categories().count() == 1) {
541 addTag("h3",i18n("Category")); 554 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
542 } else { 555 } else {
543 addTag("h3",i18n("Categories")); 556 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
544 } 557 }
545 addTag("p",event->categoriesStr());
546 } 558 }
547} 559}
548void KOEventViewer::formatAttendees(Incidence *event) 560void KOEventViewer::formatAttendees(Incidence *event)
549{ 561{
550 QPtrList<Attendee> attendees = event->attendees(); 562 QPtrList<Attendee> attendees = event->attendees();
551 if (attendees.count()) { 563 if (attendees.count()) {
552 564
553 565
554 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 566 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
555 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 567 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
556 addTag("h3",i18n("Organizer")); 568 addTag("h3",i18n("Organizer"));
557 mText.append("<ul><li>"); 569 mText.append("<ul><li>");
558#ifndef KORG_NOKABC 570#ifndef KORG_NOKABC
559 571
560#ifdef DESKTOP_VERSION 572#ifdef DESKTOP_VERSION
561 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 573 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
562 KABC::Addressee::List addressList; 574 KABC::Addressee::List addressList;
563 addressList = add_book->findByEmail(event->organizer()); 575 addressList = add_book->findByEmail(event->organizer());
564 KABC::Addressee o = addressList.first(); 576 KABC::Addressee o = addressList.first();
565 if (!o.isEmpty() && addressList.size()<2) { 577 if (!o.isEmpty() && addressList.size()<2) {
566 mText += "<a href=\"uid:" + o.uid() + "\">"; 578 mText += "<a href=\"uid:" + o.uid() + "\">";
567 mText += o.formattedName(); 579 mText += o.formattedName();
568 mText += "</a>\n"; 580 mText += "</a>\n";
569 } else { 581 } else {
570 mText.append(event->organizer()); 582 mText.append(event->organizer());
571 } 583 }
572#else //DESKTOP_VERSION 584#else //DESKTOP_VERSION
573 mText += "<a href=\"uid:organizer\">"; 585 mText += "<a href=\"uid:organizer\">";
574 mText += event->organizer(); 586 mText += event->organizer();
575 mText += "</a>\n"; 587 mText += "</a>\n";
576#endif //DESKTOP_VERSION 588#endif //DESKTOP_VERSION
577 589
578 590
579#else 591#else
580 mText.append(event->organizer()); 592 mText.append(event->organizer());
581#endif 593#endif
582 594
583 if (iconPath) { 595 if (iconPath) {
584 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 596 mText += " <a href=\"mailto:" + event->organizer() + "\">";
585 mText += "<IMG src=\"" + iconPath + "\">"; 597 mText += "<IMG src=\"" + iconPath + "\">";
586 mText += "</a>\n"; 598 mText += "</a>\n";
587 } 599 }
588 mText.append("</li></ul>"); 600 mText.append("</li></ul>");
589 601
590 addTag("h3",i18n("Attendees")); 602 addTag("h3",i18n("Attendees"));
591 Attendee *a; 603 Attendee *a;
592 mText.append("<ul>"); 604 mText.append("<ul>");
593 int a_count = 0; 605 int a_count = 0;
594 int a_count_nr = 0; 606 int a_count_nr = 0;
595 607
596 for(a=attendees.first();a;a=attendees.next()) { 608 for(a=attendees.first();a;a=attendees.next()) {
597#ifndef KORG_NOKABC 609#ifndef KORG_NOKABC
598#ifdef DESKTOP_VERSION 610#ifdef DESKTOP_VERSION
599 if (a->name().isEmpty()) { 611 if (a->name().isEmpty()) {
600 addressList = add_book->findByEmail(a->email()); 612 addressList = add_book->findByEmail(a->email());
601 KABC::Addressee o = addressList.first(); 613 KABC::Addressee o = addressList.first();
602 if (!o.isEmpty() && addressList.size()<2) { 614 if (!o.isEmpty() && addressList.size()<2) {
603 mText += "<a href=\"uid:" + o.uid() + "\">"; 615 mText += "<a href=\"uid:" + o.uid() + "\">";
604 mText += o.formattedName(); 616 mText += o.formattedName();
605 mText += "</a>\n"; 617 mText += "</a>\n";
606 } else { 618 } else {
607 mText += "<li>"; 619 mText += "<li>";
608 mText.append(a->email()); 620 mText.append(a->email());
609 mText += "\n"; 621 mText += "\n";
610 } 622 }
611 } else { 623 } else {
612 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 624 mText += "<li><a href=\"uid:" + a->uid() + "\">";
613 if (!a->name().isEmpty()) mText += a->name(); 625 if (!a->name().isEmpty()) mText += a->name();
614 else mText += a->email(); 626 else mText += a->email();
615 mText += "</a>\n"; 627 mText += "</a>\n";
616 } 628 }
617#else //DESKTOP_VERSION 629#else //DESKTOP_VERSION
618 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 630 mText += "<li><a href=\"uid:" + a->uid() + "\">";
619 if (!a->name().isEmpty()) mText += a->name(); 631 if (!a->name().isEmpty()) mText += a->name();
620 else mText += a->email(); 632 else mText += a->email();
621 mText += "</a>\n"; 633 mText += "</a>\n";
622#endif //DESKTOP_VERSION 634#endif //DESKTOP_VERSION
623#else 635#else
624 //qDebug("nokabc "); 636 //qDebug("nokabc ");
625 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 637 mText += "<li><a href=\"uid:" + a->uid() + "\">";
626 if (!a->name().isEmpty()) mText += a->name(); 638 if (!a->name().isEmpty()) mText += a->name();
627 else mText += a->email(); 639 else mText += a->email();
628 mText += "</a>\n"; 640 mText += "</a>\n";
629#endif 641#endif
630 642
631 643
632 if (!a->email().isEmpty()) { 644 if (!a->email().isEmpty()) {
633 if (iconPath) { 645 if (iconPath) {
634 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; 646 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
635 if ( a->RSVP() ) { 647 if ( a->RSVP() ) {
636 ++a_count_nr; 648 ++a_count_nr;
637 mText += "<IMG src=\"" + iconPath + "\">"; 649 mText += "<IMG src=\"" + iconPath + "\">";
638 } 650 }
639 else { 651 else {
640 ++a_count; 652 ++a_count;
641 mText += "<IMG src=\"" + NOiconPath + "\">"; 653 mText += "<IMG src=\"" + NOiconPath + "\">";
642 } 654 }
643 mText += "</a>\n"; 655 mText += "</a>\n";
644 } 656 }
645 } 657 }
646 if (a->status() != Attendee::NeedsAction ) 658 if (a->status() != Attendee::NeedsAction )
647 mText +="[" + a->statusStr() + "] "; 659 mText +="[" + a->statusStr() + "] ";
648 if (a->role() == Attendee::Chair ) 660 if (a->role() == Attendee::Chair )
649 mText +="(" + a->roleStr().left(1) + ".)"; 661 mText +="(" + a->roleStr().left(1) + ".)";
650 } 662 }
651 mText.append("</li></ul>"); 663 mText.append("</li></ul>");
652 if ( (a_count+a_count_nr) > 1 ) { 664 if ( (a_count+a_count_nr) > 1 ) {
653 mText += "<a href=\"mailto:ALL\">"; 665 mText += "<a href=\"mailto:ALL\">";
654 mText += i18n( "Mail to all" ); 666 mText += i18n( "Mail to all" );
655 mText += "</a> ( "; 667 mText += "</a> ( ";
656 mText += "<IMG src=\"" + iconPath + "\">"; 668 mText += "<IMG src=\"" + iconPath + "\">";
657 mText += i18n( " and " ); 669 mText += i18n( " and " );
658 mText += "<IMG src=\"" + NOiconPath + "\"> )"; 670 mText += "<IMG src=\"" + NOiconPath + "\"> )";
659 mText += "<br>\n"; 671 mText += "<br>\n";
660 672
661 673
662 } 674 }
663 if ( a_count_nr > 1 ) { 675 if ( a_count_nr > 1 ) {
664 mText += "<a href=\"mailto:RSVP\">"; 676 mText += "<a href=\"mailto:RSVP\">";
665 mText += i18n( "Mail to selected" ); 677 mText += i18n( "Mail to selected" );
666 mText += "</a> ( "; 678 mText += "</a> ( ";
667 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); 679 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath );
668 mText += "<br>\n"; 680 mText += "<br>\n";
669 } 681 }
670 } 682 }
671 683
672} 684}
673void KOEventViewer::appendJournal(Journal *jour, int mode ) 685void KOEventViewer::appendJournal(Journal *jour, int mode )
674{ 686{
675 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 687 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
676 if (mode == 0 ) { 688 if (mode == 0 ) {
677 addTag("h2",i18n("Journal from: ")); 689 addTag("h2",i18n("Journal from: "));
678 } 690 }
679 else { 691 else {
680 if ( mode == 1 ) { 692 if ( mode == 1 ) {
681 addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); 693 addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
682 } else { 694 } else {
683 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); 695 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
684 } 696 }
685 } 697 }
686 topLevelWidget()->setCaption("Journal Viewer"); 698 topLevelWidget()->setCaption("Journal Viewer");
687 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); 699 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
688 addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); 700 addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
689 if (!jour->description().isEmpty()) { 701 if (!jour->description().isEmpty()) {
690 addTag("p",deTag(jour->description())); 702 addTag("p",deTag(jour->description()));
691 } 703 }
692 setText(mText); 704 setText(mText);
693} 705}
694 706
695void KOEventViewer::formatReadOnly(Incidence *event) 707void KOEventViewer::formatReadOnly(Incidence *event)
696{ 708{
697 if (event->isReadOnly()) { 709 if (event->isReadOnly()) {
698 addTag("p","<em>(" + i18n("read-only") + ")</em>"); 710 addTag("p","<em>(" + i18n("read-only") + ")</em>");
699 } 711 }
700} 712}
701void KOEventViewer::setSyncMode( bool b ) 713void KOEventViewer::setSyncMode( bool b )
702{ 714{
703 mSyncMode = b; 715 mSyncMode = b;
704} 716}
705 717
706void KOEventViewer::setTodo(Todo *event, bool clearV ) 718void KOEventViewer::setTodo(Todo *event, bool clearV )
707{ 719{
708 if ( clearV ) 720 if ( clearV )
709 clearEvents(); 721 clearEvents();
710 if ( mSyncMode ) { 722 if ( mSyncMode ) {
711 if ( clearV ) 723 if ( clearV )
712 appendTodo(event,1 ); 724 appendTodo(event,1 );
713 else 725 else
714 appendTodo(event,2); 726 appendTodo(event,2);
715 } else 727 } else
716 appendTodo(event); 728 appendTodo(event);
717} 729}
718void KOEventViewer::setJournal(Journal *event, bool clearV ) 730void KOEventViewer::setJournal(Journal *event, bool clearV )
719{ 731{
720 if ( clearV ) 732 if ( clearV )
721 clearEvents(); 733 clearEvents();
722 if ( mSyncMode ) { 734 if ( mSyncMode ) {
723 if ( clearV ) 735 if ( clearV )
724 appendJournal(event, 1); 736 appendJournal(event, 1);
725 else 737 else
726 appendJournal(event, 2); 738 appendJournal(event, 2);
727 } else 739 } else
728 appendJournal(event); 740 appendJournal(event);
729} 741}
730 742
731void KOEventViewer::setEvent(Event *event) 743void KOEventViewer::setEvent(Event *event)
732{ 744{
733 clearEvents(); 745 clearEvents();
734 if ( mSyncMode ) 746 if ( mSyncMode )
735 appendEvent(event, 1); 747 appendEvent(event, 1);
736 else 748 else
737 appendEvent(event); 749 appendEvent(event);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 0a608dc..25be63a 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -275,405 +275,407 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
275 275
276 } else { 276 } else {
277 if ( !internalDrop ) { 277 if ( !internalDrop ) {
278 qDebug("Dnd: External Copy"); 278 qDebug("Dnd: External Copy");
279 } else 279 } else
280 qDebug("DnD: Internal copy: Copy pending"); 280 qDebug("DnD: Internal copy: Copy pending");
281 } 281 }
282 } 282 }
283 } 283 }
284#endif 284#endif
285} 285}
286void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 286void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
287{ 287{
288 if ( !e->isAutoRepeat() ) { 288 if ( !e->isAutoRepeat() ) {
289 mFlagKeyPressed = false; 289 mFlagKeyPressed = false;
290 } 290 }
291} 291}
292 292
293 293
294void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 294void KOTodoListView::keyPressEvent ( QKeyEvent * e )
295{ 295{
296 qApp->processEvents(); 296 qApp->processEvents();
297 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 297 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
298 e->ignore(); 298 e->ignore();
299 // qDebug(" ignore %d",e->isAutoRepeat() ); 299 // qDebug(" ignore %d",e->isAutoRepeat() );
300 return; 300 return;
301 } 301 }
302 if (! e->isAutoRepeat() ) 302 if (! e->isAutoRepeat() )
303 mFlagKeyPressed = true; 303 mFlagKeyPressed = true;
304 QListViewItem* cn; 304 QListViewItem* cn;
305 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 305 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
306 cn = currentItem(); 306 cn = currentItem();
307 if ( cn ) { 307 if ( cn ) {
308 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 308 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
309 if ( ci ){ 309 if ( ci ){
310 if ( e->state() == ShiftButton ) 310 if ( e->state() == ShiftButton )
311 ci->setOn( false ); 311 ci->setOn( false );
312 else 312 else
313 ci->setOn( true ); 313 ci->setOn( true );
314 cn = cn->itemBelow(); 314 cn = cn->itemBelow();
315 if ( cn ) { 315 if ( cn ) {
316 setCurrentItem ( cn ); 316 setCurrentItem ( cn );
317 ensureItemVisible ( cn ); 317 ensureItemVisible ( cn );
318 } 318 }
319 319
320 } 320 }
321 } 321 }
322 322
323 return; 323 return;
324 } 324 }
325 325
326 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 326 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
327 switch ( e->key() ) { 327 switch ( e->key() ) {
328 case Qt::Key_Down: 328 case Qt::Key_Down:
329 case Qt::Key_Up: 329 case Qt::Key_Up:
330 QListView::keyPressEvent ( e ); 330 QListView::keyPressEvent ( e );
331 break; 331 break;
332 case Qt::Key_Left: 332 case Qt::Key_Left:
333 case Qt::Key_Right: 333 case Qt::Key_Right:
334 QListView::keyPressEvent ( e ); 334 QListView::keyPressEvent ( e );
335 e->accept(); 335 e->accept();
336 return; 336 return;
337 break; 337 break;
338 default: 338 default:
339 e->ignore(); 339 e->ignore();
340 break; 340 break;
341 } 341 }
342 return; 342 return;
343 } 343 }
344 e->ignore(); 344 e->ignore();
345} 345}
346void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 346void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
347{ 347{
348 QListView::contentsMouseReleaseEvent(e); 348 QListView::contentsMouseReleaseEvent(e);
349 mMousePressed = false; 349 mMousePressed = false;
350} 350}
351 351
352void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 352void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
353{ 353{
354 if (!e) return; 354 if (!e) return;
355 355
356 QPoint vp = contentsToViewport(e->pos()); 356 QPoint vp = contentsToViewport(e->pos());
357 357
358 QListViewItem *item = itemAt(vp); 358 QListViewItem *item = itemAt(vp);
359 359
360 emit double_Clicked(item); 360 emit double_Clicked(item);
361 if (!item) return; 361 if (!item) return;
362 362
363 emit doubleClicked(item,vp,0); 363 emit doubleClicked(item,vp,0);
364} 364}
365 365
366///////////////////////////////////////////////////////////////////////////// 366/////////////////////////////////////////////////////////////////////////////
367 367
368KOQuickTodo::KOQuickTodo(QWidget *parent) : 368KOQuickTodo::KOQuickTodo(QWidget *parent) :
369 QLineEdit(parent) 369 QLineEdit(parent)
370{ 370{
371 setText(i18n("Click to add a new Todo")); 371 setText(i18n("Click to add a new Todo"));
372} 372}
373 373
374void KOQuickTodo::focusInEvent(QFocusEvent *ev) 374void KOQuickTodo::focusInEvent(QFocusEvent *ev)
375{ 375{
376 if ( text()==i18n("Click to add a new Todo") ) 376 if ( text()==i18n("Click to add a new Todo") )
377 setText(""); 377 setText("");
378 QLineEdit::focusInEvent(ev); 378 QLineEdit::focusInEvent(ev);
379} 379}
380 380
381void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 381void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
382{ 382{
383 setText(i18n("Click to add a new Todo")); 383 setText(i18n("Click to add a new Todo"));
384 QLineEdit::focusOutEvent(ev); 384 QLineEdit::focusOutEvent(ev);
385} 385}
386 386
387///////////////////////////////////////////////////////////////////////////// 387/////////////////////////////////////////////////////////////////////////////
388 388
389KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 389KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
390 KOrg::BaseView(calendar,parent,name) 390 KOrg::BaseView(calendar,parent,name)
391{ 391{
392 mPendingUpdateBeforeRepaint = false; 392 mPendingUpdateBeforeRepaint = false;
393 isFlatDisplay = false; 393 isFlatDisplay = false;
394 mNavigator = 0; 394 mNavigator = 0;
395 QBoxLayout *topLayout = new QVBoxLayout(this); 395 QBoxLayout *topLayout = new QVBoxLayout(this);
396 mName = QString ( name ); 396 mName = QString ( name );
397 mBlockUpdate = false; 397 mBlockUpdate = false;
398 mQuickAdd = new KOQuickTodo(this); 398 mQuickAdd = new KOQuickTodo(this);
399 topLayout->addWidget(mQuickAdd); 399 topLayout->addWidget(mQuickAdd);
400 400
401 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); 401 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide();
402 402
403 mTodoListView = new KOTodoListView(calendar,this, name ); 403 mTodoListView = new KOTodoListView(calendar,this, name );
404 topLayout->addWidget(mTodoListView); 404 topLayout->addWidget(mTodoListView);
405 //mTodoListView->header()->setMaximumHeight(30); 405 //mTodoListView->header()->setMaximumHeight(30);
406 mTodoListView->setRootIsDecorated(true); 406 mTodoListView->setRootIsDecorated(true);
407 mTodoListView->setAllColumnsShowFocus(true); 407 mTodoListView->setAllColumnsShowFocus(true);
408 408
409 mTodoListView->setShowSortIndicator(true); 409 mTodoListView->setShowSortIndicator(true);
410 410
411 mTodoListView->addColumn(i18n("Todo")); 411 mTodoListView->addColumn(i18n("Todo"));
412 mTodoListView->addColumn(i18n("Prio")); 412 mTodoListView->addColumn(i18n("Prio"));
413 mTodoListView->setColumnAlignment(1,AlignHCenter); 413 mTodoListView->setColumnAlignment(1,AlignHCenter);
414 mTodoListView->addColumn(i18n("Complete")); 414 mTodoListView->addColumn(i18n("Complete"));
415 mTodoListView->setColumnAlignment(2,AlignCenter); 415 mTodoListView->setColumnAlignment(2,AlignCenter);
416 416
417 mTodoListView->addColumn(i18n("Due Date")); 417 mTodoListView->addColumn(i18n("Due Date"));
418 mTodoListView->setColumnAlignment(3,AlignLeft); 418 mTodoListView->setColumnAlignment(3,AlignLeft);
419 mTodoListView->addColumn(i18n("Due Time")); 419 mTodoListView->addColumn(i18n("Due Time"));
420 mTodoListView->setColumnAlignment(4,AlignHCenter); 420 mTodoListView->setColumnAlignment(4,AlignHCenter);
421 421
422 mTodoListView->addColumn(i18n("Start Date")); 422 mTodoListView->addColumn(i18n("Start Date"));
423 mTodoListView->setColumnAlignment(5,AlignLeft); 423 mTodoListView->setColumnAlignment(5,AlignLeft);
424 mTodoListView->addColumn(i18n("Start Time")); 424 mTodoListView->addColumn(i18n("Start Time"));
425 mTodoListView->setColumnAlignment(6,AlignHCenter); 425 mTodoListView->setColumnAlignment(6,AlignHCenter);
426 426
427 mTodoListView->addColumn(i18n("Cancelled")); 427 mTodoListView->addColumn(i18n("Cancelled"));
428 mTodoListView->addColumn(i18n("Categories")); 428 mTodoListView->addColumn(i18n("Categories"));
429#if 0 429#if 0
430 mTodoListView->addColumn(i18n("Sort Id")); 430 mTodoListView->addColumn(i18n("Sort Id"));
431 mTodoListView->setColumnAlignment(4,AlignHCenter); 431 mTodoListView->setColumnAlignment(4,AlignHCenter);
432#endif 432#endif
433 433
434 mTodoListView->setMinimumHeight( 60 ); 434 mTodoListView->setMinimumHeight( 60 );
435 mTodoListView->setItemsRenameable( true ); 435 mTodoListView->setItemsRenameable( true );
436 mTodoListView->setRenameable( 0 ); 436 mTodoListView->setRenameable( 0 );
437 mTodoListView->setColumnWidth( 0, 120 ); 437 mTodoListView->setColumnWidth( 0, 120 );
438 mTodoListView->setColumnWidthMode(0, QListView::Manual); 438 mTodoListView->setColumnWidthMode(0, QListView::Manual);
439 mTodoListView->setColumnWidthMode(1, QListView::Manual); 439 mTodoListView->setColumnWidthMode(1, QListView::Manual);
440 mTodoListView->setColumnWidthMode(2, QListView::Manual); 440 mTodoListView->setColumnWidthMode(2, QListView::Manual);
441 mTodoListView->setColumnWidthMode(3, QListView::Manual); 441 mTodoListView->setColumnWidthMode(3, QListView::Manual);
442 mTodoListView->setColumnWidthMode(4, QListView::Manual); 442 mTodoListView->setColumnWidthMode(4, QListView::Manual);
443 mTodoListView->setColumnWidthMode(5, QListView::Manual); 443 mTodoListView->setColumnWidthMode(5, QListView::Manual);
444 mTodoListView->setColumnWidthMode(6, QListView::Manual); 444 mTodoListView->setColumnWidthMode(6, QListView::Manual);
445 mTodoListView->setColumnWidthMode(7, QListView::Manual); 445 mTodoListView->setColumnWidthMode(7, QListView::Manual);
446 mTodoListView->setColumnWidthMode(8, QListView::Manual); 446 mTodoListView->setColumnWidthMode(8, QListView::Manual);
447 447
448 448
449 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 449 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
450 450
451 mPriorityPopupMenu = new QPopupMenu(this); 451 mPriorityPopupMenu = new QPopupMenu(this);
452 for (int i = 1; i <= 5; i++) { 452 for (int i = 1; i <= 5; i++) {
453 QString label = QString ("%1").arg (i); 453 QString label = QString ("%1").arg (i);
454 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 454 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
455 } 455 }
456 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 456 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
457 457
458 mPercentageCompletedPopupMenu = new QPopupMenu(this); 458 mPercentageCompletedPopupMenu = new QPopupMenu(this);
459 for (int i = 0; i <= 100; i+=20) { 459 for (int i = 0; i <= 100; i+=20) {
460 QString label = QString ("%1 %").arg (i); 460 QString label = QString ("%1 %").arg (i);
461 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 461 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
462 } 462 }
463 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 463 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
464 464
465 465
466 466
467 mItemPopupMenu = new QPopupMenu(this); 467 mItemPopupMenu = new QPopupMenu(this);
468 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
469 SLOT (toggleRunningItem()));
470 mItemPopupMenu->insertSeparator();
468 mItemPopupMenu->insertItem(i18n("Show..."), this, 471 mItemPopupMenu->insertItem(i18n("Show..."), this,
469 SLOT (showTodo())); 472 SLOT (showTodo()));
470 mItemPopupMenu->insertItem(i18n("Edit..."), this, 473 mItemPopupMenu->insertItem(i18n("Edit..."), this,
471 SLOT (editTodo())); 474 SLOT (editTodo()));
472 mItemPopupMenu->insertItem( i18n("Delete"), this, 475 mItemPopupMenu->insertItem( i18n("Delete"), this,
473 SLOT (deleteTodo())); 476 SLOT (deleteTodo()));
474 mItemPopupMenu->insertItem( i18n("Clone..."), this, 477 mItemPopupMenu->insertItem( i18n("Clone..."), this,
475 SLOT (cloneTodo())); 478 SLOT (cloneTodo()));
476 mItemPopupMenu->insertItem( i18n("Move..."), this, 479 mItemPopupMenu->insertItem( i18n("Move..."), this,
477 SLOT (moveTodo())); 480 SLOT (moveTodo()));
478 mItemPopupMenu->insertItem( i18n("Beam..."), this, 481 mItemPopupMenu->insertItem( i18n("Beam..."), this,
479 SLOT (beamTodo())); 482 SLOT (beamTodo()));
480 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 483 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
481 SLOT (cancelTodo())); 484 SLOT (cancelTodo()));
482 mItemPopupMenu->insertSeparator(); 485 mItemPopupMenu->insertSeparator();
483 486 /*
484 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
485 SLOT (toggleRunningItem()));
486 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 487 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
487 SLOT (newTodo())); 488 SLOT (newTodo()));
489 */
488 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 490 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
489 SLOT (newSubTodo())); 491 SLOT (newSubTodo()));
490 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 492 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
491 SLOT (unparentTodo()),0,21); 493 SLOT (unparentTodo()),0,21);
492 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 494 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
493 SLOT (reparentTodo()),0,22); 495 SLOT (reparentTodo()),0,22);
494 mItemPopupMenu->insertSeparator(); 496 mItemPopupMenu->insertSeparator();
495#if 0 497#if 0
496 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), 498 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"),
497 this, SLOT( purgeCompleted() ) ); 499 this, SLOT( purgeCompleted() ) );
498 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 500 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
499 this, SLOT( toggleCompleted() ),0, 33 ); 501 this, SLOT( toggleCompleted() ),0, 33 );
500 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 502 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
501 this, SLOT( toggleQuickTodo() ),0, 34 ); 503 this, SLOT( toggleQuickTodo() ),0, 34 );
502 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 504 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
503 this, SLOT( toggleRunning() ),0, 35 ); 505 this, SLOT( toggleRunning() ),0, 35 );
504 506
505#endif 507#endif
506 mPopupMenu = new QPopupMenu(this); 508 mPopupMenu = new QPopupMenu(this);
507 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 509 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
508 SLOT (newTodo()),0,1); 510 SLOT (newTodo()),0,1);
509 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), 511 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"),
510 this, SLOT(purgeCompleted()),0,2); 512 this, SLOT(purgeCompleted()),0,2);
511 mPopupMenu->insertItem(i18n("Show Completed"), 513 mPopupMenu->insertItem(i18n("Show Completed"),
512 this, SLOT( toggleCompleted() ),0,3 ); 514 this, SLOT( toggleCompleted() ),0,3 );
513 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 515 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
514 this, SLOT( toggleQuickTodo() ),0,4 ); 516 this, SLOT( toggleQuickTodo() ),0,4 );
515 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 517 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
516 this, SLOT( toggleRunning() ),0,5 ); 518 this, SLOT( toggleRunning() ),0,5 );
517 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 519 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
518 this, SLOT( setAllOpen() ),0,6 ); 520 this, SLOT( setAllOpen() ),0,6 );
519 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 521 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
520 this, SLOT( setAllClose() ),0,7 ); 522 this, SLOT( setAllClose() ),0,7 );
521 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 523 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
522 this, SLOT( setAllFlat() ),0,8 ); 524 this, SLOT( setAllFlat() ),0,8 );
523 mDocPrefs = new DocPrefs( name ); 525 mDocPrefs = new DocPrefs( name );
524 526
525 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 527 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
526 mPopupMenu->setCheckable( true ); 528 mPopupMenu->setCheckable( true );
527 mItemPopupMenu->setCheckable( true ); 529 mItemPopupMenu->setCheckable( true );
528 530
529 531
530 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 532 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
531 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 533 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
532 534
533 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 535 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
534 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 536 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
535 537
536 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 538 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
537 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 539 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
538 540
539 541
540 // Double clicking conflicts with opening/closing the subtree 542 // Double clicking conflicts with opening/closing the subtree
541 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 543 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
542 SLOT( editItem( QListViewItem *) ) ); 544 SLOT( editItem( QListViewItem *) ) );
543 /* 545 /*
544 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 546 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
545 const QPoint &,int ) ), 547 const QPoint &,int ) ),
546 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 548 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
547 */ 549 */
548 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 550 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
549 const QPoint &,int ) ), 551 const QPoint &,int ) ),
550 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 552 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
551 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 553 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
552 SLOT( itemClicked( QListViewItem * ) ) ); 554 SLOT( itemClicked( QListViewItem * ) ) );
553 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 555 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
554 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 556 SLOT( itemDoubleClicked( QListViewItem * ) ) );
555 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 557 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
556 SLOT( updateView() ) ); 558 SLOT( updateView() ) );
557 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 559 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
558 SLOT( todoModified(Todo *, int) ) ); 560 SLOT( todoModified(Todo *, int) ) );
559 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 561 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
560 SLOT( itemStateChanged( QListViewItem * ) ) ); 562 SLOT( itemStateChanged( QListViewItem * ) ) );
561 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 563 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
562 SLOT( itemStateChanged( QListViewItem * ) ) ); 564 SLOT( itemStateChanged( QListViewItem * ) ) );
563 connect( mTodoListView, SIGNAL( paintNeeded() ), 565 connect( mTodoListView, SIGNAL( paintNeeded() ),
564 SLOT( paintNeeded()) ); 566 SLOT( paintNeeded()) );
565 567
566#if 0 568#if 0
567 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 569 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
568 SLOT(selectionChanged(QListViewItem *))); 570 SLOT(selectionChanged(QListViewItem *)));
569 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 571 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
570 SLOT(selectionChanged(QListViewItem *))); 572 SLOT(selectionChanged(QListViewItem *)));
571 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 573 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
572 SLOT(selectionChanged(QListViewItem *))); 574 SLOT(selectionChanged(QListViewItem *)));
573#endif 575#endif
574 576
575 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 577 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
576 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 578 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
577 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 579 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
578 580
579 connect( mTodoListView, SIGNAL(selectionChanged() ), 581 connect( mTodoListView, SIGNAL(selectionChanged() ),
580 SLOT( processSelectionChange() ) ); 582 SLOT( processSelectionChange() ) );
581 connect( mQuickAdd, SIGNAL( returnPressed () ), 583 connect( mQuickAdd, SIGNAL( returnPressed () ),
582 SLOT( addQuickTodo() ) ); 584 SLOT( addQuickTodo() ) );
583 585
584} 586}
585 587
586KOTodoView::~KOTodoView() 588KOTodoView::~KOTodoView()
587{ 589{
588 // delete mKOTodoViewWhatsThis; 590 // delete mKOTodoViewWhatsThis;
589 delete mDocPrefs; 591 delete mDocPrefs;
590} 592}
591QString KOTodoView::getWhatsThisText(QPoint p) 593QString KOTodoView::getWhatsThisText(QPoint p)
592{ 594{
593 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 595 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
594 if ( item ) 596 if ( item )
595 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 597 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
596 KOPrefs::instance()->mWTshowDetails, 598 KOPrefs::instance()->mWTshowDetails,
597 KOPrefs::instance()->mWTshowCreated, 599 KOPrefs::instance()->mWTshowCreated,
598 KOPrefs::instance()->mWTshowChanged); 600 KOPrefs::instance()->mWTshowChanged);
599 return i18n("That is the todo view" ); 601 return i18n("That is the todo view" );
600 602
601} 603}
602 604
603void KOTodoView::jumpToDate () 605void KOTodoView::jumpToDate ()
604{ 606{
605 // if (mActiveItem) { 607 // if (mActiveItem) {
606// mActiveItem->todo()); 608// mActiveItem->todo());
607// if ( mActiveItem->todo()->hasDueDate() ) 609// if ( mActiveItem->todo()->hasDueDate() )
608// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 610// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
609} 611}
610void KOTodoView::paintNeeded() 612void KOTodoView::paintNeeded()
611{ 613{
612 if ( mPendingUpdateBeforeRepaint ) { 614 if ( mPendingUpdateBeforeRepaint ) {
613 updateView(); 615 updateView();
614 mPendingUpdateBeforeRepaint = false; 616 mPendingUpdateBeforeRepaint = false;
615 } 617 }
616} 618}
617void KOTodoView::paintEvent(QPaintEvent * pevent) 619void KOTodoView::paintEvent(QPaintEvent * pevent)
618{ 620{
619 if ( mPendingUpdateBeforeRepaint ) { 621 if ( mPendingUpdateBeforeRepaint ) {
620 updateView(); 622 updateView();
621 mPendingUpdateBeforeRepaint = false; 623 mPendingUpdateBeforeRepaint = false;
622 } 624 }
623 KOrg::BaseView::paintEvent( pevent); 625 KOrg::BaseView::paintEvent( pevent);
624} 626}
625 627
626void KOTodoView::updateView() 628void KOTodoView::updateView()
627{ 629{
628 pendingSubtodo = 0; 630 pendingSubtodo = 0;
629 if ( mBlockUpdate ) { 631 if ( mBlockUpdate ) {
630 return; 632 return;
631 } 633 }
632 if ( !isVisible() ) { 634 if ( !isVisible() ) {
633 mPendingUpdateBeforeRepaint = true; 635 mPendingUpdateBeforeRepaint = true;
634 return; 636 return;
635 } 637 }
636 storeCurrentItem(); 638 storeCurrentItem();
637 //qDebug("KOTodoView::updateView() %x", this); 639 //qDebug("KOTodoView::updateView() %x", this);
638 if ( isFlatDisplay ) { 640 if ( isFlatDisplay ) {
639 displayAllFlat(); 641 displayAllFlat();
640 resetCurrentItem(); 642 resetCurrentItem();
641 return; 643 return;
642 } 644 }
643 //qDebug("update "); 645 //qDebug("update ");
644// kdDebug() << "KOTodoView::updateView()" << endl; 646// kdDebug() << "KOTodoView::updateView()" << endl;
645 QFont fo = KOPrefs::instance()->mTodoViewFont; 647 QFont fo = KOPrefs::instance()->mTodoViewFont;
646 648
647 649
648 mTodoListView->clear(); 650 mTodoListView->clear();
649 if ( mName == "todolistsmall" ) { 651 if ( mName == "todolistsmall" ) {
650 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 652 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
651 int ps = fo.pointSize() -2; 653 int ps = fo.pointSize() -2;
652 if ( ps > 12 ) 654 if ( ps > 12 )
653 ps -= 2; 655 ps -= 2;
654 fo.setPointSize( ps ); 656 fo.setPointSize( ps );
655 } 657 }
656 } 658 }
657 659
658 mTodoListView->setFont( fo ); 660 mTodoListView->setFont( fo );
659 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 661 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
660 //mTodoListView->header()->setMaximumHeight(fm.height()); 662 //mTodoListView->header()->setMaximumHeight(fm.height());
661 QPtrList<Todo> todoList = calendar()->todos(); 663 QPtrList<Todo> todoList = calendar()->todos();
662 664
663/* 665/*
664 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 666 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
665 Event *t; 667 Event *t;
666 for(t = todoList.first(); t; t = todoList.next()) { 668 for(t = todoList.first(); t; t = todoList.next()) {
667 kdDebug() << " " << t->getSummary() << endl; 669 kdDebug() << " " << t->getSummary() << endl;
668 670
669 if (t->getRelatedTo()) { 671 if (t->getRelatedTo()) {
670 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 672 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
671 } 673 }
672 674
673 QPtrList<Event> l = t->getRelations(); 675 QPtrList<Event> l = t->getRelations();
674 Event *c; 676 Event *c;
675 for(c=l.first();c;c=l.next()) { 677 for(c=l.first();c;c=l.next()) {
676 kdDebug() << " - relation: " << c->getSummary() << endl; 678 kdDebug() << " - relation: " << c->getSummary() << endl;
677 } 679 }
678 } 680 }
679*/ 681*/
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 78fa24f..9c35b1d 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -191,384 +191,388 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
191 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) { 191 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) {
192 if ( i1.hasRecurrenceID() ) { 192 if ( i1.hasRecurrenceID() ) {
193 if ( i1.recurrenceID() != i2.recurrenceID() ) 193 if ( i1.recurrenceID() != i2.recurrenceID() )
194 return false; 194 return false;
195 } 195 }
196 196
197 } else { 197 } else {
198 return false; 198 return false;
199 } 199 }
200 200
201 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) 201 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) )
202 return false; 202 return false;
203 if ( i1.hasStartDate() == i2.hasStartDate() ) { 203 if ( i1.hasStartDate() == i2.hasStartDate() ) {
204 if ( i1.hasStartDate() ) { 204 if ( i1.hasStartDate() ) {
205 if ( i1.dtStart() != i2.dtStart() ) 205 if ( i1.dtStart() != i2.dtStart() )
206 return false; 206 return false;
207 } 207 }
208 } else { 208 } else {
209 return false; 209 return false;
210 } 210 }
211 if (!( *i1.recurrence() == *i2.recurrence()) ) { 211 if (!( *i1.recurrence() == *i2.recurrence()) ) {
212 qDebug("recurrence is NOT equal "); 212 qDebug("recurrence is NOT equal ");
213 return false; 213 return false;
214 } 214 }
215 return 215 return
216 // i1.created() == i2.created() && 216 // i1.created() == i2.created() &&
217 stringCompare( i1.description(), i2.description() ) && 217 stringCompare( i1.description(), i2.description() ) &&
218 stringCompare( i1.summary(), i2.summary() ) && 218 stringCompare( i1.summary(), i2.summary() ) &&
219 i1.categories() == i2.categories() && 219 i1.categories() == i2.categories() &&
220 // no need to compare mRelatedTo 220 // no need to compare mRelatedTo
221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && 221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) &&
222 // i1.relations() == i2.relations() && 222 // i1.relations() == i2.relations() &&
223 i1.exDates() == i2.exDates() && 223 i1.exDates() == i2.exDates() &&
224 i1.attachments() == i2.attachments() && 224 i1.attachments() == i2.attachments() &&
225 i1.resources() == i2.resources() && 225 i1.resources() == i2.resources() &&
226 i1.secrecy() == i2.secrecy() && 226 i1.secrecy() == i2.secrecy() &&
227 i1.priority() == i2.priority() && 227 i1.priority() == i2.priority() &&
228 i1.cancelled() == i2.cancelled() && 228 i1.cancelled() == i2.cancelled() &&
229 stringCompare( i1.location(), i2.location() ); 229 stringCompare( i1.location(), i2.location() );
230} 230}
231 231
232Incidence* Incidence::recreateCloneException( QDate d ) 232Incidence* Incidence::recreateCloneException( QDate d )
233{ 233{
234 Incidence* newInc = clone(); 234 Incidence* newInc = clone();
235 newInc->recreate(); 235 newInc->recreate();
236 if ( doesRecur() ) { 236 if ( doesRecur() ) {
237 addExDate( d ); 237 addExDate( d );
238 newInc->recurrence()->unsetRecurs(); 238 newInc->recurrence()->unsetRecurs();
239 if ( type() == "Event") { 239 if ( type() == "Event") {
240 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 240 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
241 QTime tim = dtStart().time(); 241 QTime tim = dtStart().time();
242 newInc->setDtStart( QDateTime(d, tim) ); 242 newInc->setDtStart( QDateTime(d, tim) );
243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
244 } else { 244 } else {
245 int len = dtStart().secsTo( ((Todo*)this)->dtDue()); 245 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
246 QTime tim = ((Todo*)this)->dtDue().time(); 246 QTime tim = ((Todo*)this)->dtDue().time();
247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); 247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); 248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
249 ((Todo*)this)->setRecurDates(); 249 ((Todo*)this)->setRecurDates();
250 } 250 }
251 newInc->setExDates( DateList () ); 251 newInc->setExDates( DateList () );
252 } 252 }
253 return newInc; 253 return newInc;
254} 254}
255 255
256void Incidence::recreate() 256void Incidence::recreate()
257{ 257{
258 setCreated(QDateTime::currentDateTime()); 258 setCreated(QDateTime::currentDateTime());
259 259
260 setUid(CalFormat::createUniqueId()); 260 setUid(CalFormat::createUniqueId());
261 261
262 setRevision(0); 262 setRevision(0);
263 setIDStr( ":" ); 263 setIDStr( ":" );
264 setLastModified(QDateTime::currentDateTime()); 264 setLastModified(QDateTime::currentDateTime());
265} 265}
266void Incidence::cloneRelations( Incidence * newInc ) 266void Incidence::cloneRelations( Incidence * newInc )
267{ 267{
268 // newInc is already a clone of this incidence 268 // newInc is already a clone of this incidence
269 Incidence * inc; 269 Incidence * inc;
270 Incidence * cloneInc; 270 Incidence * cloneInc;
271 QPtrList<Incidence> Relations = relations(); 271 QPtrList<Incidence> Relations = relations();
272 for (inc=Relations.first();inc;inc=Relations.next()) { 272 for (inc=Relations.first();inc;inc=Relations.next()) {
273 cloneInc = inc->clone(); 273 cloneInc = inc->clone();
274 cloneInc->recreate(); 274 cloneInc->recreate();
275 cloneInc->setRelatedTo( newInc ); 275 cloneInc->setRelatedTo( newInc );
276 inc->cloneRelations( cloneInc ); 276 inc->cloneRelations( cloneInc );
277 } 277 }
278} 278}
279void Incidence::setReadOnly( bool readOnly ) 279void Incidence::setReadOnly( bool readOnly )
280{ 280{
281 IncidenceBase::setReadOnly( readOnly ); 281 IncidenceBase::setReadOnly( readOnly );
282 recurrence()->setRecurReadOnly( readOnly); 282 recurrence()->setRecurReadOnly( readOnly);
283} 283}
284 284
285void Incidence::setCreated(QDateTime created) 285void Incidence::setCreated(QDateTime created)
286{ 286{
287 if (mReadOnly) return; 287 if (mReadOnly) return;
288 mCreated = getEvenTime(created); 288 mCreated = getEvenTime(created);
289} 289}
290 290
291QDateTime Incidence::created() const 291QDateTime Incidence::created() const
292{ 292{
293 return mCreated; 293 return mCreated;
294} 294}
295 295
296void Incidence::setRevision(int rev) 296void Incidence::setRevision(int rev)
297{ 297{
298 if (mReadOnly) return; 298 if (mReadOnly) return;
299 mRevision = rev; 299 mRevision = rev;
300 300
301 updated(); 301 updated();
302} 302}
303 303
304int Incidence::revision() const 304int Incidence::revision() const
305{ 305{
306 return mRevision; 306 return mRevision;
307} 307}
308 308
309void Incidence::setDtStart(const QDateTime &dtStart) 309void Incidence::setDtStart(const QDateTime &dtStart)
310{ 310{
311 311
312 QDateTime dt = getEvenTime(dtStart); 312 QDateTime dt = getEvenTime(dtStart);
313 recurrence()->setRecurStart( dt); 313 recurrence()->setRecurStart( dt);
314 IncidenceBase::setDtStart( dt ); 314 IncidenceBase::setDtStart( dt );
315} 315}
316 316
317void Incidence::setDescription(const QString &description) 317void Incidence::setDescription(const QString &description)
318{ 318{
319 if (mReadOnly) return; 319 if (mReadOnly) return;
320 mDescription = description; 320 mDescription = description;
321 updated(); 321 updated();
322} 322}
323 323
324QString Incidence::description() const 324QString Incidence::description() const
325{ 325{
326 return mDescription; 326 return mDescription;
327} 327}
328 328
329 329
330void Incidence::setSummary(const QString &summary) 330void Incidence::setSummary(const QString &summary)
331{ 331{
332 if (mReadOnly) return; 332 if (mReadOnly) return;
333 mSummary = summary; 333 mSummary = summary;
334 updated(); 334 updated();
335} 335}
336 336
337QString Incidence::summary() const 337QString Incidence::summary() const
338{ 338{
339 return mSummary; 339 return mSummary;
340} 340}
341void Incidence::checkCategories() 341void Incidence::checkCategories()
342{ 342{
343 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); 343 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday"));
344 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); 344 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday"));
345 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); 345 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary"));
346} 346}
347 347
348void Incidence::setCategories(const QStringList &categories) 348void Incidence::setCategories(const QStringList &categories)
349{ 349{
350 if (mReadOnly) return; 350 if (mReadOnly) return;
351 mCategories = categories; 351 mCategories = categories;
352 checkCategories(); 352 checkCategories();
353 updated(); 353 updated();
354} 354}
355 355
356// TODO: remove setCategories(QString) function 356// TODO: remove setCategories(QString) function
357void Incidence::setCategories(const QString &catStr) 357void Incidence::setCategories(const QString &catStr)
358{ 358{
359 if (mReadOnly) return; 359 if (mReadOnly) return;
360 mCategories.clear(); 360 mCategories.clear();
361 361
362 if (catStr.isEmpty()) return; 362 if (catStr.isEmpty()) return;
363 363
364 mCategories = QStringList::split(",",catStr); 364 mCategories = QStringList::split(",",catStr);
365 365
366 QStringList::Iterator it; 366 QStringList::Iterator it;
367 for(it = mCategories.begin();it != mCategories.end(); ++it) { 367 for(it = mCategories.begin();it != mCategories.end(); ++it) {
368 *it = (*it).stripWhiteSpace(); 368 *it = (*it).stripWhiteSpace();
369 } 369 }
370 checkCategories(); 370 checkCategories();
371 updated(); 371 updated();
372} 372}
373 373
374QStringList Incidence::categories() const 374QStringList Incidence::categories() const
375{ 375{
376 return mCategories; 376 return mCategories;
377} 377}
378 378
379QString Incidence::categoriesStr() 379QString Incidence::categoriesStr()
380{ 380{
381 return mCategories.join(","); 381 return mCategories.join(",");
382} 382}
383QString Incidence::categoriesStrWithSpace()
384{
385 return mCategories.join(", ");
386}
383 387
384void Incidence::setRelatedToUid(const QString &relatedToUid) 388void Incidence::setRelatedToUid(const QString &relatedToUid)
385{ 389{
386 if (mReadOnly) return; 390 if (mReadOnly) return;
387 mRelatedToUid = relatedToUid; 391 mRelatedToUid = relatedToUid;
388} 392}
389 393
390QString Incidence::relatedToUid() const 394QString Incidence::relatedToUid() const
391{ 395{
392 return mRelatedToUid; 396 return mRelatedToUid;
393} 397}
394 398
395void Incidence::setRelatedTo(Incidence *relatedTo) 399void Incidence::setRelatedTo(Incidence *relatedTo)
396{ 400{
397 //qDebug("Incidence::setRelatedTo %d ", relatedTo); 401 //qDebug("Incidence::setRelatedTo %d ", relatedTo);
398 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); 402 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() );
399 if (mReadOnly || mRelatedTo == relatedTo) return; 403 if (mReadOnly || mRelatedTo == relatedTo) return;
400 if(mRelatedTo) { 404 if(mRelatedTo) {
401 // updated(); 405 // updated();
402 mRelatedTo->removeRelation(this); 406 mRelatedTo->removeRelation(this);
403 } 407 }
404 mRelatedTo = relatedTo; 408 mRelatedTo = relatedTo;
405 if (mRelatedTo) { 409 if (mRelatedTo) {
406 mRelatedTo->addRelation(this); 410 mRelatedTo->addRelation(this);
407 mRelatedToUid = mRelatedTo->uid(); 411 mRelatedToUid = mRelatedTo->uid();
408 } else { 412 } else {
409 mRelatedToUid = ""; 413 mRelatedToUid = "";
410 } 414 }
411} 415}
412 416
413Incidence *Incidence::relatedTo() const 417Incidence *Incidence::relatedTo() const
414{ 418{
415 return mRelatedTo; 419 return mRelatedTo;
416} 420}
417 421
418QPtrList<Incidence> Incidence::relations() const 422QPtrList<Incidence> Incidence::relations() const
419{ 423{
420 return mRelations; 424 return mRelations;
421} 425}
422 426
423void Incidence::addRelation(Incidence *event) 427void Incidence::addRelation(Incidence *event)
424{ 428{
425 if( mRelations.findRef( event ) == -1 ) { 429 if( mRelations.findRef( event ) == -1 ) {
426 mRelations.append(event); 430 mRelations.append(event);
427 //updated(); 431 //updated();
428 } 432 }
429} 433}
430 434
431void Incidence::removeRelation(Incidence *event) 435void Incidence::removeRelation(Incidence *event)
432{ 436{
433 437
434 mRelations.removeRef(event); 438 mRelations.removeRef(event);
435 439
436// if (event->getRelatedTo() == this) event->setRelatedTo(0); 440// if (event->getRelatedTo() == this) event->setRelatedTo(0);
437} 441}
438 442
439bool Incidence::recursOn(const QDate &qd) const 443bool Incidence::recursOn(const QDate &qd) const
440{ 444{
441 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; 445 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true;
442 else return false; 446 else return false;
443} 447}
444 448
445void Incidence::setExDates(const DateList &exDates) 449void Incidence::setExDates(const DateList &exDates)
446{ 450{
447 if (mReadOnly) return; 451 if (mReadOnly) return;
448 mExDates = exDates; 452 mExDates = exDates;
449 453
450 recurrence()->setRecurExDatesCount(mExDates.count()); 454 recurrence()->setRecurExDatesCount(mExDates.count());
451 455
452 updated(); 456 updated();
453} 457}
454 458
455void Incidence::addExDate(const QDate &date) 459void Incidence::addExDate(const QDate &date)
456{ 460{
457 if (mReadOnly) return; 461 if (mReadOnly) return;
458 mExDates.append(date); 462 mExDates.append(date);
459 463
460 recurrence()->setRecurExDatesCount(mExDates.count()); 464 recurrence()->setRecurExDatesCount(mExDates.count());
461 465
462 updated(); 466 updated();
463} 467}
464 468
465DateList Incidence::exDates() const 469DateList Incidence::exDates() const
466{ 470{
467 return mExDates; 471 return mExDates;
468} 472}
469 473
470bool Incidence::isException(const QDate &date) const 474bool Incidence::isException(const QDate &date) const
471{ 475{
472 DateList::ConstIterator it; 476 DateList::ConstIterator it;
473 for( it = mExDates.begin(); it != mExDates.end(); ++it ) { 477 for( it = mExDates.begin(); it != mExDates.end(); ++it ) {
474 if ( (*it) == date ) { 478 if ( (*it) == date ) {
475 return true; 479 return true;
476 } 480 }
477 } 481 }
478 482
479 return false; 483 return false;
480} 484}
481 485
482void Incidence::addAttachment(Attachment *attachment) 486void Incidence::addAttachment(Attachment *attachment)
483{ 487{
484 if (mReadOnly || !attachment) return; 488 if (mReadOnly || !attachment) return;
485 mAttachments.append(attachment); 489 mAttachments.append(attachment);
486 updated(); 490 updated();
487} 491}
488 492
489void Incidence::deleteAttachment(Attachment *attachment) 493void Incidence::deleteAttachment(Attachment *attachment)
490{ 494{
491 mAttachments.removeRef(attachment); 495 mAttachments.removeRef(attachment);
492} 496}
493 497
494void Incidence::deleteAttachments(const QString& mime) 498void Incidence::deleteAttachments(const QString& mime)
495{ 499{
496 Attachment *at = mAttachments.first(); 500 Attachment *at = mAttachments.first();
497 while (at) { 501 while (at) {
498 if (at->mimeType() == mime) 502 if (at->mimeType() == mime)
499 mAttachments.remove(); 503 mAttachments.remove();
500 else 504 else
501 at = mAttachments.next(); 505 at = mAttachments.next();
502 } 506 }
503} 507}
504 508
505QPtrList<Attachment> Incidence::attachments() const 509QPtrList<Attachment> Incidence::attachments() const
506{ 510{
507 return mAttachments; 511 return mAttachments;
508} 512}
509 513
510QPtrList<Attachment> Incidence::attachments(const QString& mime) const 514QPtrList<Attachment> Incidence::attachments(const QString& mime) const
511{ 515{
512 QPtrList<Attachment> attachments; 516 QPtrList<Attachment> attachments;
513 QPtrListIterator<Attachment> it( mAttachments ); 517 QPtrListIterator<Attachment> it( mAttachments );
514 Attachment *at; 518 Attachment *at;
515 while ( (at = it.current()) ) { 519 while ( (at = it.current()) ) {
516 if (at->mimeType() == mime) 520 if (at->mimeType() == mime)
517 attachments.append(at); 521 attachments.append(at);
518 ++it; 522 ++it;
519 } 523 }
520 524
521 return attachments; 525 return attachments;
522} 526}
523 527
524void Incidence::setResources(const QStringList &resources) 528void Incidence::setResources(const QStringList &resources)
525{ 529{
526 if (mReadOnly) return; 530 if (mReadOnly) return;
527 mResources = resources; 531 mResources = resources;
528 updated(); 532 updated();
529} 533}
530 534
531QStringList Incidence::resources() const 535QStringList Incidence::resources() const
532{ 536{
533 return mResources; 537 return mResources;
534} 538}
535 539
536 540
537void Incidence::setPriority(int priority) 541void Incidence::setPriority(int priority)
538{ 542{
539 if (mReadOnly) return; 543 if (mReadOnly) return;
540 mPriority = priority; 544 mPriority = priority;
541 updated(); 545 updated();
542} 546}
543 547
544int Incidence::priority() const 548int Incidence::priority() const
545{ 549{
546 return mPriority; 550 return mPriority;
547} 551}
548 552
549void Incidence::setSecrecy(int sec) 553void Incidence::setSecrecy(int sec)
550{ 554{
551 if (mReadOnly) return; 555 if (mReadOnly) return;
552 mSecrecy = sec; 556 mSecrecy = sec;
553 updated(); 557 updated();
554} 558}
555 559
556int Incidence::secrecy() const 560int Incidence::secrecy() const
557{ 561{
558 return mSecrecy; 562 return mSecrecy;
559} 563}
560 564
561QString Incidence::secrecyStr() const 565QString Incidence::secrecyStr() const
562{ 566{
563 return secrecyName(mSecrecy); 567 return secrecyName(mSecrecy);
564} 568}
565 569
566QString Incidence::secrecyName(int secrecy) 570QString Incidence::secrecyName(int secrecy)
567{ 571{
568 switch (secrecy) { 572 switch (secrecy) {
569 case SecrecyPublic: 573 case SecrecyPublic:
570 return i18n("Public"); 574 return i18n("Public");
571 break; 575 break;
572 case SecrecyPrivate: 576 case SecrecyPrivate:
573 return i18n("Private"); 577 return i18n("Private");
574 break; 578 break;
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index 60070a2..327e7dd 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -1,315 +1,316 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef INCIDENCE_H 20#ifndef INCIDENCE_H
21#define INCIDENCE_H 21#define INCIDENCE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <qvaluelist.h>
29 29
30#include "recurrence.h" 30#include "recurrence.h"
31#include "alarm.h" 31#include "alarm.h"
32#include "attachment.h" 32#include "attachment.h"
33#include "listbase.h" 33#include "listbase.h"
34#include "incidencebase.h" 34#include "incidencebase.h"
35 35
36namespace KCal { 36namespace KCal {
37 37
38class Event; 38class Event;
39class Todo; 39class Todo;
40class Journal; 40class Journal;
41 41
42/** 42/**
43 This class provides the base class common to all calendar components. 43 This class provides the base class common to all calendar components.
44*/ 44*/
45class Incidence : public IncidenceBase 45class Incidence : public IncidenceBase
46{ 46{
47 public: 47 public:
48 /** 48 /**
49 This class provides the interface for a visitor of calendar components. It 49 This class provides the interface for a visitor of calendar components. It
50 serves as base class for concrete visitors, which implement certain actions on 50 serves as base class for concrete visitors, which implement certain actions on
51 calendar components. It allows to add functions, which operate on the concrete 51 calendar components. It allows to add functions, which operate on the concrete
52 types of calendar components, without changing the calendar component classes. 52 types of calendar components, without changing the calendar component classes.
53 */ 53 */
54 class Visitor 54 class Visitor
55 { 55 {
56 public: 56 public:
57 /** Destruct Incidence::Visitor */ 57 /** Destruct Incidence::Visitor */
58 virtual ~Visitor() {} 58 virtual ~Visitor() {}
59 59
60 /** 60 /**
61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
62 on an Event object. 62 on an Event object.
63 */ 63 */
64 virtual bool visit(Event *) { return false; } 64 virtual bool visit(Event *) { return false; }
65 /** 65 /**
66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
67 on an Todo object. 67 on an Todo object.
68 */ 68 */
69 virtual bool visit(Todo *) { return false; } 69 virtual bool visit(Todo *) { return false; }
70 /** 70 /**
71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
72 on an Journal object. 72 on an Journal object.
73 */ 73 */
74 virtual bool visit(Journal *) { return false; } 74 virtual bool visit(Journal *) { return false; }
75 75
76 protected: 76 protected:
77 /** Constructor is protected to prevent direct creation of visitor base class. */ 77 /** Constructor is protected to prevent direct creation of visitor base class. */
78 Visitor() {} 78 Visitor() {}
79 }; 79 };
80 80
81 /** 81 /**
82 This class implements a visitor for adding an Incidence to a resource 82 This class implements a visitor for adding an Incidence to a resource
83 supporting addEvent(), addTodo() and addJournal() calls. 83 supporting addEvent(), addTodo() and addJournal() calls.
84 */ 84 */
85 template<class T> 85 template<class T>
86 class AddVisitor : public Visitor 86 class AddVisitor : public Visitor
87 { 87 {
88 public: 88 public:
89 AddVisitor( T *r ) : mResource( r ) {} 89 AddVisitor( T *r ) : mResource( r ) {}
90 bool visit( Event *e ) { return mResource->addEvent( e ); } 90 bool visit( Event *e ) { return mResource->addEvent( e ); }
91 bool visit( Todo *t ) { return mResource->addTodo( t ); } 91 bool visit( Todo *t ) { return mResource->addTodo( t ); }
92 bool visit( Journal *j ) { return mResource->addJournal( j ); } 92 bool visit( Journal *j ) { return mResource->addJournal( j ); }
93 93
94 private: 94 private:
95 T *mResource; 95 T *mResource;
96 }; 96 };
97 97
98 /** enumeration for describing an event's secrecy. */ 98 /** enumeration for describing an event's secrecy. */
99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; 99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 };
100 typedef ListBase<Incidence> List; 100 typedef ListBase<Incidence> List;
101 Incidence(); 101 Incidence();
102 Incidence(const Incidence &); 102 Incidence(const Incidence &);
103 ~Incidence(); 103 ~Incidence();
104 104
105 /** 105 /**
106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to 106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to
107 provide this implementation: 107 provide this implementation:
108 <pre> 108 <pre>
109 bool accept(Visitor &v) { return v.visit(this); } 109 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 110 </pre>
111 */ 111 */
112 virtual bool accept(Visitor &) { return false; } 112 virtual bool accept(Visitor &) { return false; }
113 113
114 virtual Incidence *clone() = 0; 114 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 115 virtual void cloneRelations( Incidence * );
116 116
117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0;
118 void setReadOnly( bool ); 118 void setReadOnly( bool );
119 119
120 /** 120 /**
121 Recreate event. The event is made a new unique event, but already stored 121 Recreate event. The event is made a new unique event, but already stored
122 event information is preserved. Sets uniquie id, creation date, last 122 event information is preserved. Sets uniquie id, creation date, last
123 modification date and revision number. 123 modification date and revision number.
124 */ 124 */
125 void recreate(); 125 void recreate();
126 Incidence* recreateCloneException(QDate); 126 Incidence* recreateCloneException(QDate);
127 127
128 /** set creation date */ 128 /** set creation date */
129 void setCreated(QDateTime); 129 void setCreated(QDateTime);
130 /** return time and date of creation. */ 130 /** return time and date of creation. */
131 QDateTime created() const; 131 QDateTime created() const;
132 132
133 /** set the number of revisions this event has seen */ 133 /** set the number of revisions this event has seen */
134 void setRevision(int rev); 134 void setRevision(int rev);
135 /** return the number of revisions this event has seen */ 135 /** return the number of revisions this event has seen */
136 int revision() const; 136 int revision() const;
137 137
138 /** Set starting date/time. */ 138 /** Set starting date/time. */
139 virtual void setDtStart(const QDateTime &dtStart); 139 virtual void setDtStart(const QDateTime &dtStart);
140 /** Return the incidence's ending date/time as a QDateTime. */ 140 /** Return the incidence's ending date/time as a QDateTime. */
141 virtual QDateTime dtEnd() const { return QDateTime(); } 141 virtual QDateTime dtEnd() const { return QDateTime(); }
142 142
143 /** sets the event's lengthy description. */ 143 /** sets the event's lengthy description. */
144 void setDescription(const QString &description); 144 void setDescription(const QString &description);
145 /** returns a reference to the event's description. */ 145 /** returns a reference to the event's description. */
146 QString description() const; 146 QString description() const;
147 147
148 /** sets the event's short summary. */ 148 /** sets the event's short summary. */
149 void setSummary(const QString &summary); 149 void setSummary(const QString &summary);
150 /** returns a reference to the event's summary. */ 150 /** returns a reference to the event's summary. */
151 QString summary() const; 151 QString summary() const;
152 152
153 /** set event's applicable categories */ 153 /** set event's applicable categories */
154 void setCategories(const QStringList &categories); 154 void setCategories(const QStringList &categories);
155 /** set event's categories based on a comma delimited string */ 155 /** set event's categories based on a comma delimited string */
156 void setCategories(const QString &catStr); 156 void setCategories(const QString &catStr);
157 /** return categories in a list */ 157 /** return categories in a list */
158 QStringList categories() const; 158 QStringList categories() const;
159 /** return categories as a comma separated string */ 159 /** return categories as a comma separated string */
160 QString categoriesStr(); 160 QString categoriesStr();
161 QString categoriesStrWithSpace();
161 162
162 /** point at some other event to which the event relates. This function should 163 /** point at some other event to which the event relates. This function should
163 * only be used when constructing a calendar before the related Event 164 * only be used when constructing a calendar before the related Event
164 * exists. */ 165 * exists. */
165 void setRelatedToUid(const QString &); 166 void setRelatedToUid(const QString &);
166 /** what event does this one relate to? This function should 167 /** what event does this one relate to? This function should
167 * only be used when constructing a calendar before the related Event 168 * only be used when constructing a calendar before the related Event
168 * exists. */ 169 * exists. */
169 QString relatedToUid() const; 170 QString relatedToUid() const;
170 /** point at some other event to which the event relates */ 171 /** point at some other event to which the event relates */
171 void setRelatedTo(Incidence *relatedTo); 172 void setRelatedTo(Incidence *relatedTo);
172 /** what event does this one relate to? */ 173 /** what event does this one relate to? */
173 Incidence *relatedTo() const; 174 Incidence *relatedTo() const;
174 /** All events that are related to this event */ 175 /** All events that are related to this event */
175 QPtrList<Incidence> relations() const; 176 QPtrList<Incidence> relations() const;
176 /** Add an event which is related to this event */ 177 /** Add an event which is related to this event */
177 void addRelation(Incidence *); 178 void addRelation(Incidence *);
178 /** Remove event that is related to this event */ 179 /** Remove event that is related to this event */
179 void removeRelation(Incidence *); 180 void removeRelation(Incidence *);
180 181
181 /** returns the list of dates which are exceptions to the recurrence rule */ 182 /** returns the list of dates which are exceptions to the recurrence rule */
182 DateList exDates() const; 183 DateList exDates() const;
183 /** sets the list of dates which are exceptions to the recurrence rule */ 184 /** sets the list of dates which are exceptions to the recurrence rule */
184 void setExDates(const DateList &_exDates); 185 void setExDates(const DateList &_exDates);
185 void setExDates(const char *dates); 186 void setExDates(const char *dates);
186 /** Add a date to the list of exceptions of the recurrence rule. */ 187 /** Add a date to the list of exceptions of the recurrence rule. */
187 void addExDate(const QDate &date); 188 void addExDate(const QDate &date);
188 189
189 /** returns true if there is an exception for this date in the recurrence 190 /** returns true if there is an exception for this date in the recurrence
190 rule set, or false otherwise. */ 191 rule set, or false otherwise. */
191 bool isException(const QDate &qd) const; 192 bool isException(const QDate &qd) const;
192 193
193 /** add attachment to this event */ 194 /** add attachment to this event */
194 void addAttachment(Attachment *attachment); 195 void addAttachment(Attachment *attachment);
195 /** remove and delete a specific attachment */ 196 /** remove and delete a specific attachment */
196 void deleteAttachment(Attachment *attachment); 197 void deleteAttachment(Attachment *attachment);
197 /** remove and delete all attachments with this mime type */ 198 /** remove and delete all attachments with this mime type */
198 void deleteAttachments(const QString& mime); 199 void deleteAttachments(const QString& mime);
199 /** return list of all associated attachments */ 200 /** return list of all associated attachments */
200 QPtrList<Attachment> attachments() const; 201 QPtrList<Attachment> attachments() const;
201 /** find a list of attachments with this mime type */ 202 /** find a list of attachments with this mime type */
202 QPtrList<Attachment> attachments(const QString& mime) const; 203 QPtrList<Attachment> attachments(const QString& mime) const;
203 204
204 /** sets the event's status the value specified. See the enumeration 205 /** sets the event's status the value specified. See the enumeration
205 * above for possible values. */ 206 * above for possible values. */
206 void setSecrecy(int); 207 void setSecrecy(int);
207 /** return the event's secrecy. */ 208 /** return the event's secrecy. */
208 int secrecy() const; 209 int secrecy() const;
209 /** return the event's secrecy in string format. */ 210 /** return the event's secrecy in string format. */
210 QString secrecyStr() const; 211 QString secrecyStr() const;
211 /** return list of all availbale secrecy classes */ 212 /** return list of all availbale secrecy classes */
212 static QStringList secrecyList(); 213 static QStringList secrecyList();
213 /** return human-readable name of secrecy class */ 214 /** return human-readable name of secrecy class */
214 static QString secrecyName(int); 215 static QString secrecyName(int);
215 216
216 /** returns TRUE if the date specified is one on which the event will 217 /** returns TRUE if the date specified is one on which the event will
217 * recur. */ 218 * recur. */
218 bool recursOn(const QDate &qd) const; 219 bool recursOn(const QDate &qd) const;
219 220
220 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?): 221 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?):
221 222
222 /** set resources used, such as Office, Car, etc. */ 223 /** set resources used, such as Office, Car, etc. */
223 void setResources(const QStringList &resources); 224 void setResources(const QStringList &resources);
224 /** return list of current resources */ 225 /** return list of current resources */
225 QStringList resources() const; 226 QStringList resources() const;
226 227
227 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ 228 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
228 void setPriority(int priority); 229 void setPriority(int priority);
229 /** get the event's priority */ 230 /** get the event's priority */
230 int priority() const; 231 int priority() const;
231 232
232 /** All alarms that are associated with this incidence */ 233 /** All alarms that are associated with this incidence */
233 QPtrList<Alarm> alarms() const; 234 QPtrList<Alarm> alarms() const;
234 /** Create a new alarm which is associated with this incidence */ 235 /** Create a new alarm which is associated with this incidence */
235 Alarm* newAlarm(); 236 Alarm* newAlarm();
236 /** Add an alarm which is associated with this incidence */ 237 /** Add an alarm which is associated with this incidence */
237 void addAlarm(Alarm*); 238 void addAlarm(Alarm*);
238 /** Remove an alarm that is associated with this incidence */ 239 /** Remove an alarm that is associated with this incidence */
239 void removeAlarm(Alarm*); 240 void removeAlarm(Alarm*);
240 /** Remove all alarms that are associated with this incidence */ 241 /** Remove all alarms that are associated with this incidence */
241 void clearAlarms(); 242 void clearAlarms();
242 /** return whether any alarm associated with this incidence is enabled */ 243 /** return whether any alarm associated with this incidence is enabled */
243 bool isAlarmEnabled() const; 244 bool isAlarmEnabled() const;
244 245
245 /** 246 /**
246 Return the recurrence rule associated with this incidence. If there is 247 Return the recurrence rule associated with this incidence. If there is
247 none, returns an appropriate (non-0) object. 248 none, returns an appropriate (non-0) object.
248 */ 249 */
249 Recurrence *recurrence() const; 250 Recurrence *recurrence() const;
250 void setRecurrence(Recurrence * r); 251 void setRecurrence(Recurrence * r);
251 /** 252 /**
252 Forward to Recurrence::doesRecur(). 253 Forward to Recurrence::doesRecur().
253 */ 254 */
254 ushort doesRecur() const; 255 ushort doesRecur() const;
255 256
256 /** set the event's/todo's location. Do _not_ use it with journal */ 257 /** set the event's/todo's location. Do _not_ use it with journal */
257 void setLocation(const QString &location); 258 void setLocation(const QString &location);
258 /** return the event's/todo's location. Do _not_ use it with journal */ 259 /** return the event's/todo's location. Do _not_ use it with journal */
259 QString location() const; 260 QString location() const;
260 /** returns TRUE or FALSE depending on whether the todo has a start date */ 261 /** returns TRUE or FALSE depending on whether the todo has a start date */
261 bool hasStartDate() const; 262 bool hasStartDate() const;
262 /** sets the event's hasStartDate value. */ 263 /** sets the event's hasStartDate value. */
263 void setHasStartDate(bool f); 264 void setHasStartDate(bool f);
264 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const; 265 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const;
265 bool cancelled() const; 266 bool cancelled() const;
266 void setCancelled( bool b ); 267 void setCancelled( bool b );
267 268
268 bool hasRecurrenceID() const; 269 bool hasRecurrenceID() const;
269 void setHasRecurrenceID( bool b ); 270 void setHasRecurrenceID( bool b );
270 271
271 void setRecurrenceID(QDateTime); 272 void setRecurrenceID(QDateTime);
272 QDateTime recurrenceID () const; 273 QDateTime recurrenceID () const;
273 QDateTime dtStart() const; 274 QDateTime dtStart() const;
274 bool isHoliday() const; 275 bool isHoliday() const;
275 bool isBirthday() const; 276 bool isBirthday() const;
276 bool isAnniversary() const; 277 bool isAnniversary() const;
277 278
278 279
279protected: 280protected:
280 QPtrList<Alarm> mAlarms; 281 QPtrList<Alarm> mAlarms;
281 QPtrList<Incidence> mRelations; 282 QPtrList<Incidence> mRelations;
282 QDateTime mRecurrenceID; 283 QDateTime mRecurrenceID;
283 bool mHasRecurrenceID; 284 bool mHasRecurrenceID;
284 private: 285 private:
285 void checkCategories(); 286 void checkCategories();
286 bool mHoliday, mBirthday, mAnniversary; 287 bool mHoliday, mBirthday, mAnniversary;
287 int mRevision; 288 int mRevision;
288 bool mCancelled; 289 bool mCancelled;
289 290
290 // base components of jounal, event and todo 291 // base components of jounal, event and todo
291 QDateTime mCreated; 292 QDateTime mCreated;
292 QString mDescription; 293 QString mDescription;
293 QString mSummary; 294 QString mSummary;
294 QStringList mCategories; 295 QStringList mCategories;
295 Incidence *mRelatedTo; 296 Incidence *mRelatedTo;
296 QString mRelatedToUid; 297 QString mRelatedToUid;
297 DateList mExDates; 298 DateList mExDates;
298 QPtrList<Attachment> mAttachments; 299 QPtrList<Attachment> mAttachments;
299 QStringList mResources; 300 QStringList mResources;
300 bool mHasStartDate; // if todo has associated start date 301 bool mHasStartDate; // if todo has associated start date
301 302
302 int mSecrecy; 303 int mSecrecy;
303 int mPriority; // 1 = highest, 2 = less, etc. 304 int mPriority; // 1 = highest, 2 = less, etc.
304 305
305 //QPtrList<Alarm> mAlarms; 306 //QPtrList<Alarm> mAlarms;
306 Recurrence *mRecurrence; 307 Recurrence *mRecurrence;
307 308
308 QString mLocation; 309 QString mLocation;
309}; 310};
310 311
311bool operator==( const Incidence&, const Incidence& ); 312bool operator==( const Incidence&, const Incidence& );
312 313
313} 314}
314 315
315#endif 316#endif
diff --git a/version b/version
index a87e533..da7dcfc 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.0.28"; version = "2.1.0";