summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--kmicromail/koprefs.cpp1
-rw-r--r--kmicromail/koprefs.h2
-rw-r--r--kmicromail/koprefsdialog.cpp3
-rw-r--r--kmicromail/mailistviewitem.cpp49
-rw-r--r--kmicromail/mainwindow.cpp4
-rw-r--r--kmicromail/opiemail.cpp17
-rw-r--r--kmicromail/opiemail.h3
-rw-r--r--kmicromail/viewmail.cpp25
-rw-r--r--kmicromail/viewmail.h4
-rw-r--r--kmicromail/viewmailbase.cpp8
-rw-r--r--kmicromail/viewmailbase.h2
12 files changed, 68 insertions, 52 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index cbed872..2516b2a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,793 +1,795 @@
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 1.9.20 ************ 3********** VERSION 1.9.20 ************
4 4
5KO/Pi: 5KO/Pi:
6Added for the "dislplay one day" agenda mode 6Added for the "dislplay one day" agenda mode
7info in the caption and in the day lables: 7info in the caption and in the day lables:
8Now it is displayed, if the selected day is from "day before yesterday" 8Now it is displayed, if the selected day is from "day before yesterday"
9to "day after tomorrow". 9to "day after tomorrow".
10Made it possible to delete a Todo, which has sub-todos. 10Made it possible to delete a Todo, which has sub-todos.
11Fixed two small problems in the todo view. 11Fixed two small problems in the todo view.
12Added missing German translation for filter edit and print dialog. 12Added missing German translation for filter edit and print dialog.
13Made search dialog closeable by cancel key. 13Made search dialog closeable by cancel key.
14 14
15Made it possible to select in the date picker the (ligt grey ) 15Made it possible to select in the date picker the (ligt grey )
16dates of the prev./next month with the mouse. 16dates of the prev./next month with the mouse.
17 17
18OM/Pi: 18OM/Pi:
19"Delete mail" icon in main window now deletes all selected mails. 19"Delete mail" icon in main window now deletes all selected mails.
20Fixed the problem, that the state flag of imap mails was ignored. 20Fixed the problem, that the state flag of imap mails was ignored.
21Now mails with "FLAG_SEEN" on the imap server get no icon in the list view 21Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
22to idecate that they are already seen. 22to idecate that they are already seen.
23Fixed the problem that the body of some mails was not displayed in the 23Fixed the problem that the body of some mails was not displayed in the
24mail viewer when fetching them from the imap server directly to read them. 24mail viewer when fetching them from the imap server directly to read them.
25Made it (configurable) possible to show the "To:" field in the list view.
26Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
25 27
26 28
27 29
28********** VERSION 1.9.19 ************ 30********** VERSION 1.9.19 ************
29 31
30Added a lot of missing translations to KA/Pi, 32Added a lot of missing translations to KA/Pi,
31Added some missing translations to KO/Pi and OM/Pi. 33Added some missing translations to KO/Pi and OM/Pi.
32 34
33Fixed some minor problems in KA/Pi + KO/Pi. 35Fixed some minor problems in KA/Pi + KO/Pi.
34 36
35Fixed a crash when closing PwM/Pi. 37Fixed a crash when closing PwM/Pi.
36Added German translation for PwM/Pi. 38Added German translation for PwM/Pi.
37 39
38Made view change and Month View update faster in KO/Pi. 40Made view change and Month View update faster in KO/Pi.
39 41
40 42
41********** VERSION 1.9.18 ************ 43********** VERSION 1.9.18 ************
42 44
43FYI: The VERSION 1.9.17 was a testing release only. 45FYI: The VERSION 1.9.17 was a testing release only.
44Please read the changelog of VERSION 1.9.17 as well. 46Please read the changelog of VERSION 1.9.17 as well.
45 47
46Cleaned up the syncing config dialog. 48Cleaned up the syncing config dialog.
47Added sync config options for date range for events. 49Added sync config options for date range for events.
48Added sync config options for filters on incoming data. 50Added sync config options for filters on incoming data.
49Added sync config options for filters on outgoing data. 51Added sync config options for filters on outgoing data.
50Please read the updated SyncHowTo about the new filter settings. 52Please read the updated SyncHowTo about the new filter settings.
51These filter settings make it now possible to sync with shared 53These filter settings make it now possible to sync with shared
52calendars without writing back private or confidential data 54calendars without writing back private or confidential data
53(via the outgoing filters). 55(via the outgoing filters).
54To sync only with particular parts of a shared calendar, 56To sync only with particular parts of a shared calendar,
55the incoming filter settings can be used. 57the incoming filter settings can be used.
56An example can be found in the SyncHowTo. 58An example can be found in the SyncHowTo.
57Same for shared addressbooks. 59Same for shared addressbooks.
58 60
59Added a setting for the global kdepim data storage. 61Added a setting for the global kdepim data storage.
60Usually the data is stored in (yourhomedir/kdepim). 62Usually the data is stored in (yourhomedir/kdepim).
61Now you can set in the Global config dialog TAB, subTAB "Data storage path" 63Now you can set in the Global config dialog TAB, subTAB "Data storage path"
62a directory where all the kdepim data is stored. 64a directory where all the kdepim data is stored.
63That makes it easy to save all kdepim data on a SD card on the Z, for example. 65That makes it easy to save all kdepim data on a SD card on the Z, for example.
64 66
65KO/Pi: 67KO/Pi:
66The timeedit input has a pulldown list for times. 68The timeedit input has a pulldown list for times.
67If opened, this pulldown list should now has the right time highlighted. 69If opened, this pulldown list should now has the right time highlighted.
68Added the possibility to exclude events/todos/journals in a filter. 70Added the possibility to exclude events/todos/journals in a filter.
69You should exclude journals, if you do not want them to sync with a public calendar. 71You should exclude journals, if you do not want them to sync with a public calendar.
70 72
71KA/Pi: 73KA/Pi:
72Added the possibility to in/exclude public/private/confidential contacts to a filter. 74Added the possibility to in/exclude public/private/confidential contacts to a filter.
73If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... 75If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ...
74Added printing of card view and details view on desktop. 76Added printing of card view and details view on desktop.
75Printing of list view is not working... 77Printing of list view is not working...
76Added button for removing pictures in contact editor. 78Added button for removing pictures in contact editor.
77Parsing data fix of KA/Pi version 1.9.17. 79Parsing data fix of KA/Pi version 1.9.17.
78Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. 80Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
79Fixed some syncing merging problems. 81Fixed some syncing merging problems.
80 82
81 83
82********** VERSION 1.9.17 ************ 84********** VERSION 1.9.17 ************
83 85
84KO/Pi: 86KO/Pi:
85Fixed that tooltips were not updated after moving an item in agenda view. 87Fixed that tooltips were not updated after moving an item in agenda view.
86Fixed a bug in sorting start date for recurring events in list view. 88Fixed a bug in sorting start date for recurring events in list view.
87Changed the left button in todo viewer from "Agenda" to "Set completed". 89Changed the left button in todo viewer from "Agenda" to "Set completed".
88This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. 90This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View.
89Added more info in the todo viewer: Startdate, parent/sub todos. 91Added more info in the todo viewer: Startdate, parent/sub todos.
90 92
91 93
92KA/Pi: 94KA/Pi:
93All fields search does now actually search all the (possible) fields, 95All fields search does now actually search all the (possible) fields,
94not only those listed in the contact list. 96not only those listed in the contact list.
95Made is possible to inline a picture in a vcard on the Z. 97Made is possible to inline a picture in a vcard on the Z.
96This was only possible on the desktop, now is it possible on the Z as well. 98This was only possible on the desktop, now is it possible on the Z as well.
97Fixed of missing save settings after filter configuration. 99Fixed of missing save settings after filter configuration.
98Made saving of addressbook much faster. 100Made saving of addressbook much faster.
99Fixed extension widget layout problem. 101Fixed extension widget layout problem.
100Fixed saving of default formatted name settings. 102Fixed saving of default formatted name settings.
101Fixed formatted name handling in edit dialog. 103Fixed formatted name handling in edit dialog.
102Added an option for changing formatted names of many contacts 104Added an option for changing formatted names of many contacts
103(menu: File - Change - Set formatted name). 105(menu: File - Change - Set formatted name).
104 106
105QWhatsThis was not working on the Z ( only black rectangle was shown). 107QWhatsThis was not working on the Z ( only black rectangle was shown).
106This is Fixed. 108This is Fixed.
107 109
108KDE-Sync: 110KDE-Sync:
109Now readonly KDE resources are synced as well. 111Now readonly KDE resources are synced as well.
110(They are not changed in KDE itself, of course). 112(They are not changed in KDE itself, of course).
111 113
112 114
113 115
114********** VERSION 1.9.16 ************ 116********** VERSION 1.9.16 ************
115 117
116KO/Pi: 118KO/Pi:
117Fixed search dialog size on Z 6000 (480x640 display). 119Fixed search dialog size on Z 6000 (480x640 display).
118Added setting to hide/show time in agenda items. 120Added setting to hide/show time in agenda items.
119Added setting to hide not running todos in todo view. 121Added setting to hide not running todos in todo view.
120Added columns for start date/time in todo view. 122Added columns for start date/time in todo view.
121Replaced the solid half-hour lines in agenda view by dot lines. 123Replaced the solid half-hour lines in agenda view by dot lines.
122Added possibility of printing the What's Next View on the desktop 124Added possibility of printing the What's Next View on the desktop
123(i.e. Windows and Linux). 125(i.e. Windows and Linux).
124Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 126Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
125Added tooltips in month view.(Tooltips only available on desktop) 127Added tooltips in month view.(Tooltips only available on desktop)
126 128
127Fixed a strange problem in KO/Pi alarm applet. 129Fixed a strange problem in KO/Pi alarm applet.
128Did not find the actual problem, 130Did not find the actual problem,
129such that now Qtopia reboots again if deinstalling the alarm applet. 131such that now Qtopia reboots again if deinstalling the alarm applet.
130But the alarm applet should work again. 132But the alarm applet should work again.
131 133
132KA/Pi: 134KA/Pi:
133Fixed the problem, that internal pictures were not saved. 135Fixed the problem, that internal pictures were not saved.
134 136
135Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 137Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
136 138
137Fixed some minor problems. (Like word wrap in help text windows). 139Fixed some minor problems. (Like word wrap in help text windows).
138 140
139Fixed a compiling problem in microkde/kresources. 141Fixed a compiling problem in microkde/kresources.
140 142
141KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 143KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
142This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 144This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
143such that now syncing KO/Pi with Sharp DTM should work on the 145such that now syncing KO/Pi with Sharp DTM should work on the
144Zaurus C 3000 model. 146Zaurus C 3000 model.
145 147
146********** VERSION 1.9.15 ************ 148********** VERSION 1.9.15 ************
147 149
148Usebilty enhancements in KO/Pi: 150Usebilty enhancements in KO/Pi:
149When clicking on the date in a month view cell, the day view is shown. 151When clicking on the date in a month view cell, the day view is shown.
150Old behaviour was, that the "new event" dialog popped up. 152Old behaviour was, that the "new event" dialog popped up.
151 153
152Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 154Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
153That means, you can restore the latest 155That means, you can restore the latest
154event/todo/journal you have deleted. 156event/todo/journal you have deleted.
155A journal is deleted, if you clear all the text of the journal. 157A journal is deleted, if you clear all the text of the journal.
156 158
157Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 159Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
158 160
159KA/Pi starting in 480x640 resolution: 161KA/Pi starting in 480x640 resolution:
160Hide the filter action in toolbar 162Hide the filter action in toolbar
161and added icons for undo/delete/redo in toolbar. 163and added icons for undo/delete/redo in toolbar.
162 164
163Change in OM/Pi ViewMail dialog: 165Change in OM/Pi ViewMail dialog:
164When clicking on the "delete" icon the mail is deleted after confirmation as usual. 166When clicking on the "delete" icon the mail is deleted after confirmation as usual.
165But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 167But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
166 168
167Fixed a crash when deleting mail-accounts in OM/Pi. 169Fixed a crash when deleting mail-accounts in OM/Pi.
168 170
169 171
170********** VERSION 1.9.14 ************ 172********** VERSION 1.9.14 ************
171 173
172Fixed some problems with the dialog sizes when switching 174Fixed some problems with the dialog sizes when switching
173portrait/landscape mode on 640x480 PDA display. 175portrait/landscape mode on 640x480 PDA display.
174 176
175Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 177Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
176 178
177Fixed an ugly bug in KOpieMail: 179Fixed an ugly bug in KOpieMail:
178KOpieMail was not able to write files (mails) to MSDOS file system, 180KOpieMail was not able to write files (mails) to MSDOS file system,
179like on an usual preformatted SD card. That should work now. 181like on an usual preformatted SD card. That should work now.
180To save your mail data on the Sd card do the following: 182To save your mail data on the Sd card do the following:
181Create a dir on the SD card: 183Create a dir on the SD card:
182mkdir /mnt/card/localmail 184mkdir /mnt/card/localmail
183Go to your home dir: 185Go to your home dir:
184cd 186cd
185Go to kopiemail data storage dir: 187Go to kopiemail data storage dir:
186cd kdepim/apps/kopiemail 188cd kdepim/apps/kopiemail
187Create a symlink to the SD card: 189Create a symlink to the SD card:
188ls -s /mnt/card/localmail 190ls -s /mnt/card/localmail
189Now KOpieMail will store all mails on the SD card. 191Now KOpieMail will store all mails on the SD card.
190 192
191KO/Pi Monthview: 193KO/Pi Monthview:
192Now "Go to Today" selects the current month from day 1-end, 194Now "Go to Today" selects the current month from day 1-end,
193not the current date + some days. 195not the current date + some days.
194I.e. "Go to Today" shows now always 196I.e. "Go to Today" shows now always
195the current month with first day of month in the first row. 197the current month with first day of month in the first row.
196 198
197Added missing German translation. 199Added missing German translation.
198 200
199Fixed icons of executeable on Wintendo. 201Fixed icons of executeable on Wintendo.
200 202
201Added a "Show next Mail" button to the OM/Pi 203Added a "Show next Mail" button to the OM/Pi
202mail viewer such that the mail below the current mail 204mail viewer such that the mail below the current mail
203in the mail list view of the current folder 205in the mail list view of the current folder
204can be read with a single click. 206can be read with a single click.
205 207
206 208
207********** VERSION 1.9.13 ************ 209********** VERSION 1.9.13 ************
208 210
209Fixed nasty PwM/Pi file reading bug, when 211Fixed nasty PwM/Pi file reading bug, when
210the used hash algo of file is different then the global 212the used hash algo of file is different then the global
211hash algo. 213hash algo.
212 214
213Added KA/Pi support for opie mailit mailapplication. 215Added KA/Pi support for opie mailit mailapplication.
214 216
215Fixed some bugs in OM/Pi. 217Fixed some bugs in OM/Pi.
216Now character conversion tables are available for the Zaurus 218Now character conversion tables are available for the Zaurus
217to make OM/Pi working properly. 219to make OM/Pi working properly.
218To get the character conversion in OM/Pi working, please download 220To get the character conversion in OM/Pi working, please download
219at the sourceforge project site the package 221at the sourceforge project site the package
220sr-character-conversion_SharpROM_arm.ipk.zip 222sr-character-conversion_SharpROM_arm.ipk.zip
221(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 223(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
222from the section "general files for KDE/Pim" 224from the section "general files for KDE/Pim"
223Instructions how to install this package are in a ReadMe in this file. 225Instructions how to install this package are in a ReadMe in this file.
224 226
225 227
226Fixed the orientation change problem in KA/Pi when switching 228Fixed the orientation change problem in KA/Pi when switching
227portrait/landscape mode. 229portrait/landscape mode.
228 230
229French translation available for KA/Pi and OM/Pi. 231French translation available for KA/Pi and OM/Pi.
230 232
231Fixed some problems with categories in KO/Pi in DTM sync. 233Fixed some problems with categories in KO/Pi in DTM sync.
232 234
233Added selection dialog for export to phone in KA/Pi. 235Added selection dialog for export to phone in KA/Pi.
234 236
235If in KO/Pi is an attendee selected to add to a meeting and this 237If in KO/Pi is an attendee selected to add to a meeting and this
236attendee is already in the list of attendees, this person is not added 238attendee is already in the list of attendees, this person is not added
237again. 239again.
238 240
239Some menu cleanup in KA/Pi. 241Some menu cleanup in KA/Pi.
240 242
241********** VERSION 1.9.12 ************ 243********** VERSION 1.9.12 ************
242 244
243Fix for the bug in KO/Pi What's Next view of version 1.9.11. 245Fix for the bug in KO/Pi What's Next view of version 1.9.11.
244 246
245Bugfix: Licence file is now shown again. 247Bugfix: Licence file is now shown again.
246 248
247OM/Pi now supports Unicode (utf8 charset). 249OM/Pi now supports Unicode (utf8 charset).
248Fixed some bugs in OM/Pi. 250Fixed some bugs in OM/Pi.
249 251
250KA/Pi has more German translation. 252KA/Pi has more German translation.
251 253
252 254
253********** VERSION 1.9.11 ************ 255********** VERSION 1.9.11 ************
254 256
255Fixed several problems in PWM/Pi, like 257Fixed several problems in PWM/Pi, like
256asking the user, if unsaved changed are pending 258asking the user, if unsaved changed are pending
257when closing the app. 259when closing the app.
258And PwM/Pi handles now different texts for the 260And PwM/Pi handles now different texts for the
259fields Description, Username, Password, configurable per category. 261fields Description, Username, Password, configurable per category.
260 262
261Fixed a crash in KO/Pi , when importing/loading vcs files 263Fixed a crash in KO/Pi , when importing/loading vcs files
262which have an entry with an attendee with state: 264which have an entry with an attendee with state:
263NEEDS ACTION 265NEEDS ACTION
264 266
265Fixed some problems in the German translation of OM/Pi, 267Fixed some problems in the German translation of OM/Pi,
266which makes some dialogs not fitting on the screen 268which makes some dialogs not fitting on the screen
267of the Z 5500. 269of the Z 5500.
268 270
269Fixed Qtopia crash, when disabling/deinstalling 271Fixed Qtopia crash, when disabling/deinstalling
270KO/Pi alarm applet. 272KO/Pi alarm applet.
271 273
272Implemented direct KDE<->KA/Pi sync for KA/Pi running 274Implemented direct KDE<->KA/Pi sync for KA/Pi running
273on Linux desktop. 275on Linux desktop.
274 276
275Added feature "remove sync info" to sync menu. 277Added feature "remove sync info" to sync menu.
276 278
277Tweaked the KO/Pi What's next view a bit, added 279Tweaked the KO/Pi What's next view a bit, added
278setting to hide events that are done. 280setting to hide events that are done.
279 281
280Disabled "beam receive enabled" on startup to 282Disabled "beam receive enabled" on startup to
281avoid problems if Fastload is enabled. 283avoid problems if Fastload is enabled.
282Please set "beam receive enabled", 284Please set "beam receive enabled",
283if you want to receive data via IR. 285if you want to receive data via IR.
284 286
285Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 287Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
286on Linux desktop. 288on Linux desktop.
287 289
288Made in KA/Pi scrolling possible, if details view is selected. 290Made in KA/Pi scrolling possible, if details view is selected.
289(The keyboard focus is set automatically to the search line) 291(The keyboard focus is set automatically to the search line)
290 292
291Fixed a bug in DMT sync, that a new entry in DTM was added 293Fixed a bug in DMT sync, that a new entry in DTM was added
292on every sync to Kx/Pi. 294on every sync to Kx/Pi.
293 295
294Fixed missing writing of KA/Pi categories to DMT entries when syncing. 296Fixed missing writing of KA/Pi categories to DMT entries when syncing.
295 297
296Fixed a bug in DMT sync with todos created in KO/Pi containing 298Fixed a bug in DMT sync with todos created in KO/Pi containing
297non-latin1 characters. 299non-latin1 characters.
298 300
299Rearranged package contents of Sharp-ipks and made all 301Rearranged package contents of Sharp-ipks and made all
300packages installable on SD again. 302packages installable on SD again.
301 303
302Fixed the writing of addressbook data in DTM sync. 304Fixed the writing of addressbook data in DTM sync.
303Empty fields in KA/Pi were not removed. 305Empty fields in KA/Pi were not removed.
304 306
305Added better category handling in KA/Pi: 307Added better category handling in KA/Pi:
306Added item 308Added item
307Edit Categories and 309Edit Categories and
308Manage new categories 310Manage new categories
309to the settings menu. 311to the settings menu.
310Possible to configure a view to display categories. 312Possible to configure a view to display categories.
311 313
312Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. 314Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
313 315
314Fixed displaying of "free" days and time in KO Monthview and Agendaview. 316Fixed displaying of "free" days and time in KO Monthview and Agendaview.
315 317
316... and many other bugfixes. 318... and many other bugfixes.
317 319
318********** VERSION 1.9.10 ************ 320********** VERSION 1.9.10 ************
319 321
320Many internal small bugfixes. 322Many internal small bugfixes.
321And fix of the "big" bug in KO/Pi, 323And fix of the "big" bug in KO/Pi,
322that after Syncing the appointments had an offset by several hours. 324that after Syncing the appointments had an offset by several hours.
323That was a problem with the internal timezone setting, 325That was a problem with the internal timezone setting,
324introduced by the changed timezone configuration settings. 326introduced by the changed timezone configuration settings.
325 327
326German translation for OM/Pi is now available. 328German translation for OM/Pi is now available.
327 329
328 330
329********** VERSION 1.9.9 ************ 331********** VERSION 1.9.9 ************
330 332
331KDE-Pim/Pi has a new Member! 333KDE-Pim/Pi has a new Member!
332It is called PWM/Pi (Passwordmanager/platform-independent) 334It is called PWM/Pi (Passwordmanager/platform-independent)
333and it is available for the Zaurus. 335and it is available for the Zaurus.
334It is planned, that it will be available later for Windows. 336It is planned, that it will be available later for Windows.
335(And for Linux, of course). 337(And for Linux, of course).
336It is a port of the Passwordmanager of KDE. 338It is a port of the Passwordmanager of KDE.
337It will need the MicroKDElibs to run. 339It will need the MicroKDElibs to run.
338 340
339Made loading of addressbooks in KA/Pi up to 7 times faster! 341Made loading of addressbooks in KA/Pi up to 7 times faster!
340The bigger your addressbook file, the more starting speed 342The bigger your addressbook file, the more starting speed
341will you gain. (relatively) 343will you gain. (relatively)
342 344
343The Qtopia addressbook connector is now platform independend 345The Qtopia addressbook connector is now platform independend
344as well and should work on any platform for importing/exporting 346as well and should work on any platform for importing/exporting
345Qtopia and Opie XML files. 347Qtopia and Opie XML files.
346 348
347Added a +30min feature to the timezone settings to make 349Added a +30min feature to the timezone settings to make
348KDE-Pim/Pi useable in Australia and other parts on the 350KDE-Pim/Pi useable in Australia and other parts on the
349world with strange timezones ;-) 351world with strange timezones ;-)
350 352
351German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 353German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
352 354
353It is now possible to disable the 355It is now possible to disable the
354"receive data via infrared" feature, such that syncing with 356"receive data via infrared" feature, such that syncing with
355Outlook is now possible again with Kx/Pi runing. 357Outlook is now possible again with Kx/Pi runing.
356Please disable it, before syncing Sharp DTM with Outlook. 358Please disable it, before syncing Sharp DTM with Outlook.
357For your convenience, the "receive data via infrared" feature 359For your convenience, the "receive data via infrared" feature
358is disabled automatically, if you sync Kx/Pi with DTM. 360is disabled automatically, if you sync Kx/Pi with DTM.
359You have to enable it again manually after syncing. 361You have to enable it again manually after syncing.
360Enabling this feature makes it impossible to start the 362Enabling this feature makes it impossible to start the
361Sharp DTM apps. If this feature is enabled, you will only get the 363Sharp DTM apps. If this feature is enabled, you will only get the
362alarm notification from KO/Pi and not from the Sharp calendar. 364alarm notification from KO/Pi and not from the Sharp calendar.
363This is very useful if you sync KO/Pi with Sharp DTM, 365This is very useful if you sync KO/Pi with Sharp DTM,
364because after syncing you usually would get notified about 366because after syncing you usually would get notified about
365an alarm by KO/Pi and the Sharp Calendar. 367an alarm by KO/Pi and the Sharp Calendar.
366 368
367Together with the Linux desktop version of KO/Pi 369Together with the Linux desktop version of KO/Pi
368it is now possible to sync KO/Pi on the Zaurus 370it is now possible to sync KO/Pi on the Zaurus
369with the complete KDE-desktop (3.3 or later) 371with the complete KDE-desktop (3.3 or later)
370calendar data easily. 372calendar data easily.
371That makes it possible to sync the Z with one 373That makes it possible to sync the Z with one
372click of a mouse with the KDE-Desktop. 374click of a mouse with the KDE-Desktop.
373This feature it available for all Zaurus platforms KO/Pi 375This feature it available for all Zaurus platforms KO/Pi
374is running on. 376is running on.
375The only thing needed is a running KO/Pi on Linux and 377The only thing needed is a running KO/Pi on Linux and
376a compiled version of the small 378a compiled version of the small
377KDE-Pim/Pi<->KDE-Desktop access command line program, 379KDE-Pim/Pi<->KDE-Desktop access command line program,
378which is in the KDE-Pim/Pi sources available. 380which is in the KDE-Pim/Pi sources available.
379 381
380The "KDE-desktop" syncing feature for KA/Pi will follow 382The "KDE-desktop" syncing feature for KA/Pi will follow
381in the next releases. 383in the next releases.
382 384
383Fixed the vcard export bug, which had the version 1.9.8. 385Fixed the vcard export bug, which had the version 1.9.8.
384 386
385Added missing GERMAN translation to KO/Pi. 387Added missing GERMAN translation to KO/Pi.
386Hi PsionX, could you add the missing french translation?Thx! 388Hi PsionX, could you add the missing french translation?Thx!
387 389
388Translation files for KA/Pi are available as well. 390Translation files for KA/Pi are available as well.
389GERMAN translation will be available in the next release. 391GERMAN translation will be available in the next release.
390PsionX ( yres, you again ;-) ), could you start translating 392PsionX ( yres, you again ;-) ), could you start translating
391KA/Pi? Thx! 393KA/Pi? Thx!
392 394
393You can download the version 1.9.9 at 395You can download the version 1.9.9 at
394 396
395http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 397http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
396 398
397Note: 399Note:
398To run the mail program OM/Pi you need libopenssl. 400To run the mail program OM/Pi you need libopenssl.
399A link to a download loaction is available at 401A link to a download loaction is available at
400ZSI at www.killefiz.de 402ZSI at www.killefiz.de
401 403
402 404
403********** VERSION 1.9.8 ************ 405********** VERSION 1.9.8 ************
404 406
405Fixed character decoding in OM/Pi. 407Fixed character decoding in OM/Pi.
406(e.g. German "Umlaute" were not displayed properly.) 408(e.g. German "Umlaute" were not displayed properly.)
407 409
408Made is possible to reparent todos in KO/Pi. 410Made is possible to reparent todos in KO/Pi.
409Use contextmenu or keys (look at Help-Keys + Colors) for that. 411Use contextmenu or keys (look at Help-Keys + Colors) for that.
410 412
411Added the missing Sync-Howto and WhatsNew to the packages. 413Added the missing Sync-Howto and WhatsNew to the packages.
412 414
413KO/Pi on Linux desktop can now sync with KDE desktop. 415KO/Pi on Linux desktop can now sync with KDE desktop.
414That means: When using KO/Pi on Linux desktop for syncing with 416That means: When using KO/Pi on Linux desktop for syncing with
415KDE desktop and the Zaurus, the Zaurus can be synced now 417KDE desktop and the Zaurus, the Zaurus can be synced now
416with all KDE-Calendar resources, not only with one local file. 418with all KDE-Calendar resources, not only with one local file.
417(That makes it possible to sync the Zaurus with the 419(That makes it possible to sync the Zaurus with the
418calendar data on a Kolab server) 420calendar data on a Kolab server)
419 421
420KA/Pi syncing with KDE desktop will be available in the next version. 422KA/Pi syncing with KDE desktop will be available in the next version.
421 423
422 424
423********** VERSION 1.9.7 ************ 425********** VERSION 1.9.7 ************
424 426
425KO/Pi - KA/Pi on Windows: 427KO/Pi - KA/Pi on Windows:
426Now a directory can be defined by the user, where the 428Now a directory can be defined by the user, where the
427application/config data should be saved. 429application/config data should be saved.
428 Define your desired path in the evironment variable 430 Define your desired path in the evironment variable
429 MICROKDEHOME 431 MICROKDEHOME
430 before starting KO/Pi or KA/Pi. 432 before starting KO/Pi or KA/Pi.
431 433
432An easy Kx/Pi to Kx/Pi syncing is now possible 434An easy Kx/Pi to Kx/Pi syncing is now possible
433(it is called Pi-Sync) via network. 435(it is called Pi-Sync) via network.
434Please look at the Sync Howto. 436Please look at the Sync Howto.
435 437
436Exporting of calendar data and contacts to mobile phones is now possible. 438Exporting of calendar data and contacts to mobile phones is now possible.
437The SyncHowto is updated with information howto 439The SyncHowto is updated with information howto
438access/sync mobile phones. 440access/sync mobile phones.
439Please look at the Sync Howto. 441Please look at the Sync Howto.
440 442
441Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 443Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
442Please disable Fastload for the original contact/calendar applications 444Please disable Fastload for the original contact/calendar applications
443and close them. 445and close them.
444KO/Pi and KA/Pi must be running in order to receive the data. 446KO/Pi and KA/Pi must be running in order to receive the data.
445(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 447(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
446 448
447In the KA/Pi details view are now the preferred tel. numbers displayed on top 449In the KA/Pi details view are now the preferred tel. numbers displayed on top
448of the other data ( emails/tel.numbers/addresses) 450of the other data ( emails/tel.numbers/addresses)
449 451
450Fixed some syncing problems in KA/Pi. 452Fixed some syncing problems in KA/Pi.
451 453
452Added font settings for the KA/Pi details view. 454Added font settings for the KA/Pi details view.
453Added fields "children's name" and "gender" to KA/Pi. 455Added fields "children's name" and "gender" to KA/Pi.
454 456
455Made searching in KA/Pi better: 457Made searching in KA/Pi better:
456Now the first item in a view is selected after a search automatically and 458Now the first item in a view is selected after a search automatically and
457the views can be scrolled up/down when the search input field has the keyboard focus. 459the views can be scrolled up/down when the search input field has the keyboard focus.
458 460
459And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 461And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
460 462
461 463
462********** VERSION 1.9.6 ************ 464********** VERSION 1.9.6 ************
463 465
464Changes in the external application communication on the Zaurus 466Changes in the external application communication on the Zaurus
465in order to use less RAM when the apps are running. 467in order to use less RAM when the apps are running.
466First syncing of addressbooks (KA/Pi) is possible. 468First syncing of addressbooks (KA/Pi) is possible.
467 469
468 470
469********** VERSION 1.9.5a ************ 471********** VERSION 1.9.5a ************
470 472
471Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 473Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
472Fixed some small bugs. 474Fixed some small bugs.
473KA/Pi shows now the birthday in summary view. 475KA/Pi shows now the birthday in summary view.
474Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 476Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
475for displaying dates. 477for displaying dates.
476 478
477 479
478********** VERSION 1.9.5 ************ 480********** VERSION 1.9.5 ************
479 481
480There is still no Addressbook syncing! 482There is still no Addressbook syncing!
481 483
482New in 1.9.5: 484New in 1.9.5:
483 485
484Many bugfixes. 486Many bugfixes.
485Better searching in KA/Pi. 487Better searching in KA/Pi.
486You can configure in KA/Pi if you want to search only after 488You can configure in KA/Pi if you want to search only after
487<return> key pressed. 489<return> key pressed.
488 490
489Better mail downloading in OM/Pi. 491Better mail downloading in OM/Pi.
490 492
491First experimental alpha version of sync of KO/Pi with mobile phones. 493First experimental alpha version of sync of KO/Pi with mobile phones.
492See gammu documentation for supported phones. 494See gammu documentation for supported phones.
493You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp. 495You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp.
494Quick hint how to use: 496Quick hint how to use:
495NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 497NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
496Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 498Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
497Create syncprofile - mobile device 499Create syncprofile - mobile device
498Remove entry for model. (Leave empty ). 500Remove entry for model. (Leave empty ).
499Enable infrared on Zaurus and your Phone. 501Enable infrared on Zaurus and your Phone.
500Sync. 502Sync.
501To get a more detailed log, start kopi from konsole. 503To get a more detailed log, start kopi from konsole.
502 504
503********** VERSION 1.9.4 ************ 505********** VERSION 1.9.4 ************
504 506
505This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 507This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
506 508
507WARNING: 509WARNING:
508PLEASE BACKUP ALL YOUR DATA! 510PLEASE BACKUP ALL YOUR DATA!
509We have changed a lot and maybe there are some unknown problems. 511We have changed a lot and maybe there are some unknown problems.
510 512
511SYNC HANDLING HAS CHANGED! 513SYNC HANDLING HAS CHANGED!
512Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 514Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
513(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 515(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
514 516
515You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 517You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
516If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well. 518If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well.
517 519
518As programs are available: 520As programs are available:
519KO/Pi (korganizer ipk) - a calendar program. 521KO/Pi (korganizer ipk) - a calendar program.
520KA/Pi (kaddressbook ipk ) - an addressbook 522KA/Pi (kaddressbook ipk ) - an addressbook
521OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 523OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
522 524
523An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 525An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
524(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 526(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
525 527
526All the applications are installed in a "Pim" TAB. 528All the applications are installed in a "Pim" TAB.
527If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk 529If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk
528 530
529All the application are integrated. 531All the application are integrated.
530Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail. 532Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail.
531 533
532HINT: 534HINT:
533If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 535If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
534 536
535What's new? 537What's new?
536 538
537SYNC HANDLING HAS CHANGED! 539SYNC HANDLING HAS CHANGED!
538Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 540Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
539(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 541(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
540 542
541New in OM/Pi: 543New in OM/Pi:
542When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails. 544When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails.
543 545
544New in KO/Pi: 546New in KO/Pi:
545French is now available for KO/Pi. 547French is now available for KO/Pi.
546Choose menu:Actions - Configure:TAB locale 548Choose menu:Actions - Configure:TAB locale
547Syncing has changed. 549Syncing has changed.
548Phone sync available soon. 550Phone sync available soon.
549Not much changes, I cannot remember them ... 551Not much changes, I cannot remember them ...
550 552
551New in KA/Pi: 553New in KA/Pi:
552Beaming possible. 554Beaming possible.
553Sharp DTM readonly access possible( create a new DTM resource ); 555Sharp DTM readonly access possible( create a new DTM resource );
554Better searching possible. 556Better searching possible.
555Search is performed only after pressing the return key. 557Search is performed only after pressing the return key.
556Use wildcard * to specify parts of a name. 558Use wildcard * to specify parts of a name.
557 559
558Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * . 560Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * .
559 561
560A big improvement is the new management of the contact access. 562A big improvement is the new management of the contact access.
561In version 1.9.3, every application was using their own addressbook access data. 563In version 1.9.3, every application was using their own addressbook access data.
562That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 564That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
563That was wasting of memory, if you had several hundreds of contacts. 565That was wasting of memory, if you had several hundreds of contacts.
564 566
565Now only KA/Pi accesses the addressbook. 567Now only KA/Pi accesses the addressbook.
566If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them. 568If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them.
567If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 569If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
568That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 570That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
569 571
570New in the KO/Pi alarm applet: 572New in the KO/Pi alarm applet:
571Configure your own timer popup menu! 573Configure your own timer popup menu!
572(Text and minutes for timer countdown) 574(Text and minutes for timer countdown)
573Just edit the file 575Just edit the file
574(yourhomedir)/.kopialarmtimerrc 576(yourhomedir)/.kopialarmtimerrc
575and start/stop a timer to get a new menu with the data of this file. 577and start/stop a timer to get a new menu with the data of this file.
576 578
577********** VERSION 1.9.3 ************ 579********** VERSION 1.9.3 ************
5781) 5801)
579Now KO/Pi on Windows imports directly the calendar data of 581Now KO/Pi on Windows imports directly the calendar data of
580an installed Outlook. Should work with OL version >= 2000. 582an installed Outlook. Should work with OL version >= 2000.
581 583
582********** VERSION 1.9.2 ************ 584********** VERSION 1.9.2 ************
5831) 5851)
584KDE-Pim/Pi has got a new member: 586KDE-Pim/Pi has got a new member:
585KmicroMail (KM/Pi) is a mail program, 587KmicroMail (KM/Pi) is a mail program,
586which can handle IMAP and POP mail access. 588which can handle IMAP and POP mail access.
587It is based on Opie-Mail v3. 589It is based on Opie-Mail v3.
588All dependencies to the Opie libraries ar removed, 590All dependencies to the Opie libraries ar removed,
589such that no additional Opie lib is needed. 591such that no additional Opie lib is needed.
590It is already integrated in KO/Pi and KA/Pi. 592It is already integrated in KO/Pi and KA/Pi.
591It it now available for the Zaurus,probably it 593It it now available for the Zaurus,probably it
592will be available for other platforms later. 594will be available for other platforms later.
593Hint: 595Hint:
594Create your own contact (name + email) 596Create your own contact (name + email)
595in KA/Pi, select this contact and choose menu: 597in KA/Pi, select this contact and choose menu:
596Settings - Set Who Am I. 598Settings - Set Who Am I.
597Now the settings of this contact are used as 599Now the settings of this contact are used as
598the sender data in KM/Pi. 600the sender data in KM/Pi.
5992) 6012)
600KDE-Pim/Pi is split up in five different 602KDE-Pim/Pi is split up in five different
601packages now precompiled for Sharp Zaurus: 603packages now precompiled for Sharp Zaurus:
602--kmicrokdelibs_1.9.2_arm.ipk 604--kmicrokdelibs_1.9.2_arm.ipk
603The libs are needed for any 605The libs are needed for any
604of the following programs: 606of the following programs:
605--kaddressbook_1.9.2_arm.ipk 607--kaddressbook_1.9.2_arm.ipk
606--kmicromail_1.9.2_arm.ipk 608--kmicromail_1.9.2_arm.ipk
607--korganizer_1.9.2_arm.ipk 609--korganizer_1.9.2_arm.ipk
608Independ from that, there is the alarm applet 610Independ from that, there is the alarm applet
609available for KO/Pi, which also offers 611available for KO/Pi, which also offers
610quick access for a new mail or 612quick access for a new mail or
611showing the addressbook.: 613showing the addressbook.:
612--korganizer-alarm_1.9.2_arm.ipk 614--korganizer-alarm_1.9.2_arm.ipk
613Independend means, that the alarm applet 615Independend means, that the alarm applet
614does not need any of the libs or programs above to run. 616does not need any of the libs or programs above to run.
615But it would be quite useless without these programs. 617But it would be quite useless without these programs.
616NOTE: 618NOTE:
617If you get a 619If you get a
618"This application depends on other programs" 620"This application depends on other programs"
619during installation of 621during installation of
620--kmicrokdelibs_1.9.2_arm.ipk 622--kmicrokdelibs_1.9.2_arm.ipk
621you probably do not have to care about that. 623you probably do not have to care about that.
622kmicrokdelibs_1.9.2 will come with some 624kmicrokdelibs_1.9.2 will come with some
623resource plugins, which needs additional libraries. 625resource plugins, which needs additional libraries.
624(E.g. libopie1, if you want to use the 626(E.g. libopie1, if you want to use the
625opie resource connector in KA/Pi). 627opie resource connector in KA/Pi).
626If you do not have this libraries installed, 628If you do not have this libraries installed,
627you simply cannot use the resource. 629you simply cannot use the resource.
628To make it clear: 630To make it clear:
629If the libraries are missing, the applications 631If the libraries are missing, the applications
630using kmicrokdelibs will start, 632using kmicrokdelibs will start,
631because the resources are plugins. 633because the resources are plugins.
6323) 6343)
633KO/Pi and friends are now installable on SD-Card! 635KO/Pi and friends are now installable on SD-Card!
634It is recommended to install all libs and apps 636It is recommended to install all libs and apps
635on the SD card or all in the internal storage. 637on the SD card or all in the internal storage.
636There may be problems, if this is mixed. 638There may be problems, if this is mixed.
6374) 6394)
638Fixed two bugs in the alarm notification on Windows. 640Fixed two bugs in the alarm notification on Windows.
6395) 6415)
640Great improvement! 642Great improvement!
641KO/Pi uses now the latest version of libical. 643KO/Pi uses now the latest version of libical.
642Libical is the library which actually reads 644Libical is the library which actually reads
643the calendar files and extract the data from it. 645the calendar files and extract the data from it.
644With the old version, there were problems 646With the old version, there were problems
645(crashes or program hangs) when licical did read 647(crashes or program hangs) when licical did read
646files, which were not stored from KO/Pi. 648files, which were not stored from KO/Pi.
647I do not know, if the new libical works perfect, 649I do not know, if the new libical works perfect,
648but actually it works much better than 650but actually it works much better than
649the old version. 651the old version.
650There are no problems with compatibility with 652There are no problems with compatibility with
651old calendar files of KO/Pi, of course! 653old calendar files of KO/Pi, of course!
6526) 6546)
653New in KA/Pi: 655New in KA/Pi:
654Opie addressbook resource connector available! 656Opie addressbook resource connector available!
655You will need libopie1 and the opie addressbook, 657You will need libopie1 and the opie addressbook,
656of course. 658of course.
657With the Opie addressbook resource connector, 659With the Opie addressbook resource connector,
658you can access the Opie addressbook readonly in KA/Pi. 660you can access the Opie addressbook readonly in KA/Pi.
659If you want to edit or import the data into KA/Pi, 661If you want to edit or import the data into KA/Pi,
660do this: 662do this:
661a) Create an Opie resource. 663a) Create an Opie resource.
662 (Menu: Settings-Configure Resources). 664 (Menu: Settings-Configure Resources).
663After configuration and restarting KA/Pi you should see 665After configuration and restarting KA/Pi you should see
664the Opie contacts in KA/Pi. 666the Opie contacts in KA/Pi.
665b) Select some or all Opie contacts. 667b) Select some or all Opie contacts.
666(NOTE: +++++ 668(NOTE: +++++
667To know exactly, what contacts are Opie contacts, 669To know exactly, what contacts are Opie contacts,
668do this: Choose menu: 670do this: Choose menu:
669View-Modify View - TAB Fields. 671View-Modify View - TAB Fields.
670Select in the above list "Resource" and click 672Select in the above list "Resource" and click
671down arrow to add it to the "Selected fields". 673down arrow to add it to the "Selected fields".
672Click OK. 674Click OK.
673Now you have a new column "Resource" in your list, 675Now you have a new column "Resource" in your list,
674where you can see, what an Opie resource is. 676where you can see, what an Opie resource is.
675++++ NOTE end.) 677++++ NOTE end.)
676Ok, we do have now some Opie contacts seleted. 678Ok, we do have now some Opie contacts seleted.
677(Use SHIFT or CTRL key in order to multiple select). 679(Use SHIFT or CTRL key in order to multiple select).
678c) Choose menu: Edit-Copy. 680c) Choose menu: Edit-Copy.
679d) Choose menu: Edit-Paste. 681d) Choose menu: Edit-Paste.
680e) Select the resource, you want to add the contacts to. 682e) Select the resource, you want to add the contacts to.
681Congrats! Now you have read/write access to the copied 683Congrats! Now you have read/write access to the copied
682opie contacts as "real" KA/Pi contacts. 684opie contacts as "real" KA/Pi contacts.
683 685
684 686
685********** VERSION 1.9.1 ************ 687********** VERSION 1.9.1 ************
6861) 6881)
687 +++ IMPORTANT 1 +++ 689 +++ IMPORTANT 1 +++
688 690
689The storing place of the default calendar 691The storing place of the default calendar
690file has changed! 692file has changed!
691The default calendar file was 693The default calendar file was
692Applications/korganizer/mycalendar.ics 694Applications/korganizer/mycalendar.ics
693on Zaurus and 695on Zaurus and
694(yourHomeDir)/korganizer/mycalendar.ics 696(yourHomeDir)/korganizer/mycalendar.ics
695on Windows/Linux desktop. Now it is 697on Windows/Linux desktop. Now it is
696(yourHomeDir)/kdepim/korganizer/mycalendar.ics 698(yourHomeDir)/kdepim/korganizer/mycalendar.ics
697on Zaurus, Windows and Linux. 699on Zaurus, Windows and Linux.
698To load the old file, choose menu 700To load the old file, choose menu
699File-Load calendar backup. 701File-Load calendar backup.
700(It should be loaded automatically 702(It should be loaded automatically
701at startup with a warning message displayed). 703at startup with a warning message displayed).
702The place of the configuration file has changed too. 704The place of the configuration file has changed too.
703If you want to use your old KO/Pi config, 705If you want to use your old KO/Pi config,
704copy it to 706copy it to
705(yourHomeDir)/kdepim/config/korganizerrc 707(yourHomeDir)/kdepim/config/korganizerrc
706Please read VERSION 1.9.0 - topic 3) as well! 708Please read VERSION 1.9.0 - topic 3) as well!
707 709
708 +++ IMPORTANT 2 +++ 710 +++ IMPORTANT 2 +++
709 711
710Because of the new paths, you will need 712Because of the new paths, you will need
711a new version of the KO/Pi alarm applet 713a new version of the KO/Pi alarm applet
712for Zaurus. 714for Zaurus.
713Use version >= 1.9.1 715Use version >= 1.9.1
714 716
7152) 7172)
716Now the QWhat'sThis Icon works for items 718Now the QWhat'sThis Icon works for items
717in the month view as well. 719in the month view as well.
718(See VERSION 1.7.8 Topic 1) ). 720(See VERSION 1.7.8 Topic 1) ).
7193) 7213)
720You can import birtsdays/anniversaries 722You can import birtsdays/anniversaries
721from KA/Pi into KO/Pi. 723from KA/Pi into KO/Pi.
722Choose menu File-Import birthdays. 724Choose menu File-Import birthdays.
723If you import twice, already imported items 725If you import twice, already imported items
724will not be imported again, if they 726will not be imported again, if they
725have not been changed in KO/Pi. 727have not been changed in KO/Pi.
7264) 7284)
727When syncing with sharp DTM, now a progress 729When syncing with sharp DTM, now a progress
728is shown, when the data is written back. 730is shown, when the data is written back.
729If there is much data in KO/Pi and no data 731If there is much data in KO/Pi and no data
730in DTM, that can take a long time. 732in DTM, that can take a long time.
731(But only for the first time ). 733(But only for the first time ).
7325) 7345)
733In the search dialog, you can search 735In the search dialog, you can search
734now for the name/email of an attendee 736now for the name/email of an attendee
735of an event/todo. 737of an event/todo.
736To get more space for displaying 738To get more space for displaying
737search results, the buttons 739search results, the buttons
738for "search" and "close" on the 740for "search" and "close" on the
739bottom are removed in the PDA version. 741bottom are removed in the PDA version.
740You have to click OK in the top right 742You have to click OK in the top right
741corner to do a search. 743corner to do a search.
7426) 7446)
743Now it is possible to disable the displaying 745Now it is possible to disable the displaying
744of todo items in the Allday part of the Agenda. 746of todo items in the Allday part of the Agenda.
745Choose Menu Action-Configure, 747Choose Menu Action-Configure,
746TAB Todo View, checkbox 748TAB Todo View, checkbox
747"Allday Agenda view shows todos" 749"Allday Agenda view shows todos"
7487) 7507)
749If FastLoad is enabled, now the settings and the 751If FastLoad is enabled, now the settings and the
750calendar data are saved, when KO/Pi is closed. 752calendar data are saved, when KO/Pi is closed.
751(If no Fastload is enabled, KO/Pi saves 753(If no Fastload is enabled, KO/Pi saves
752the data as well, of course) 754the data as well, of course)
7538) 7558)
754The Agenda View has a minimize-splitter now, 756The Agenda View has a minimize-splitter now,
755such that the height of the allday part can be 757such that the height of the allday part can be
756changed quickly. 758changed quickly.
757 759
758********** VERSION 1.9.0 ************ 760********** VERSION 1.9.0 ************
7591) 7611)
760KO/Pi is now merged with the new microKDE from KA/Pi. 762KO/Pi is now merged with the new microKDE from KA/Pi.
761KO/Pi accesses now KA/Pi as the addressbook. 763KO/Pi accesses now KA/Pi as the addressbook.
762The other ddressbook-plugins are not working any longer. 764The other ddressbook-plugins are not working any longer.
763(It is planned, that later KA/Pi itself uses these plugins) 765(It is planned, that later KA/Pi itself uses these plugins)
764New versions of KO/Pi are only available 766New versions of KO/Pi are only available
765together with KA/Pi as the KDE-Pim/Pi package. 767together with KA/Pi as the KDE-Pim/Pi package.
7662) 7682)
767If you click on an attendee of a meeting in the 769If you click on an attendee of a meeting in the
768event viewer, a detailed summary of the 770event viewer, a detailed summary of the
769attendee is shown. 771attendee is shown.
7703) 7723)
771The place of the configuration file has changed. 773The place of the configuration file has changed.
772If you want to use your old KO/Pi config, copy 774If you want to use your old KO/Pi config, copy
773Applications/korganizer/config_korganizerrc 775Applications/korganizer/config_korganizerrc
774to 776to
775Applications/korganizer/config/korganizerrc 777Applications/korganizer/config/korganizerrc
776 778
777********** VERSION 1.7.8 ************ 779********** VERSION 1.7.8 ************
7781) 7801)
779Now the QWhat'sThis ist working. 781Now the QWhat'sThis ist working.
780Enable the QWhat'sThis icon in the toolbar. 782Enable the QWhat'sThis icon in the toolbar.
781(You have to restart to reload the changed toolbar config). 783(You have to restart to reload the changed toolbar config).
782Now click on the QWhat'sThis Icon 784Now click on the QWhat'sThis Icon
783in the top right corner of KO/Pi. 785in the top right corner of KO/Pi.
784Then click on an item in the Agenda View: 786Then click on an item in the Agenda View:
785You will get a detailed display of the items content. 787You will get a detailed display of the items content.
7862) 7882)
787Some other very minor changes. 789Some other very minor changes.
788But I have forgotten the details ... 790But I have forgotten the details ...
789For that reason I start this log here: 791For that reason I start this log here:
790To document my changes, when I am doing it. 792To document my changes, when I am doing it.
791 793
792********** VERSION 1.7.7 ************ 794********** VERSION 1.7.7 ************
793Stable Version of KO/Pi 795Stable Version of KO/Pi
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index 342bbf3..2bae5f6 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -1,125 +1,126 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44 44
45#include "koprefs.h" 45#include "koprefs.h"
46#include "mainwindow.h" 46#include "mainwindow.h"
47 47
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("kopiemailrc") 53 KPimPrefs("kopiemailrc")
54{ 54{
55 mAppFont = QFont("helvetica",12); 55 mAppFont = QFont("helvetica",12);
56 mComposeFont = QFont("helvetica",12); 56 mComposeFont = QFont("helvetica",12);
57 mReadFont = QFont("helvetica",12); 57 mReadFont = QFont("helvetica",12);
58 58
59 KPrefs::setCurrentGroup("General"); 59 KPrefs::setCurrentGroup("General");
60 addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); 60 addItemString("SendCodec",&mSendCodec,i18n ("userdefined") );
61 addItemString("SenderName",&mName,i18n ("Please set at") ); 61 addItemString("SenderName",&mName,i18n ("Please set at") );
62 addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); 62 addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") );
63 addItemBool("ViewMailAsHtml",&mViewAsHtml,false); 63 addItemBool("ViewMailAsHtml",&mViewAsHtml,false);
64 addItemBool("SendMailLater",&mSendLater,true); 64 addItemBool("SendMailLater",&mSendLater,true);
65 addItemBool("ShowToField",&mShowToField,false);
65 addItemBool("UseKapi",&mUseKapi,false); 66 addItemBool("UseKapi",&mUseKapi,false);
66 addItemInt("CurrentCodec",&mCurrentCodec,0); 67 addItemInt("CurrentCodec",&mCurrentCodec,0);
67 68
68 KPrefs::setCurrentGroup("Fonts"); 69 KPrefs::setCurrentGroup("Fonts");
69 addItemFont("Application Font",&mAppFont); 70 addItemFont("Application Font",&mAppFont);
70 addItemFont("Compose Font",&mComposeFont); 71 addItemFont("Compose Font",&mComposeFont);
71 addItemFont("Read Font",&mReadFont); 72 addItemFont("Read Font",&mReadFont);
72 fillMailDefaults(); 73 fillMailDefaults();
73 isDirty = false; 74 isDirty = false;
74} 75}
75 76
76 77
77KOPrefs::~KOPrefs() 78KOPrefs::~KOPrefs()
78{ 79{
79 if ( isDirty ) 80 if ( isDirty )
80 writeConfig(); 81 writeConfig();
81 if (mInstance == this) 82 if (mInstance == this)
82 mInstance = insd.setObject(0); 83 mInstance = insd.setObject(0);
83 84
84} 85}
85 86
86 87
87KOPrefs *KOPrefs::instance() 88KOPrefs *KOPrefs::instance()
88{ 89{
89 if (!mInstance) { 90 if (!mInstance) {
90 mInstance = insd.setObject(new KOPrefs()); 91 mInstance = insd.setObject(new KOPrefs());
91 mInstance->readConfig(); 92 mInstance->readConfig();
92 } 93 }
93 94
94 return mInstance; 95 return mInstance;
95} 96}
96 97
97void KOPrefs::usrSetDefaults() 98void KOPrefs::usrSetDefaults()
98{ 99{
99 100
100} 101}
101 102
102void KOPrefs::fillMailDefaults() 103void KOPrefs::fillMailDefaults()
103{ 104{
104 if (mName.isEmpty()) mName = i18n ("Please set at"); 105 if (mName.isEmpty()) mName = i18n ("Please set at");
105 if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); 106 if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB");
106} 107}
107 108
108void KOPrefs::usrReadConfig() 109void KOPrefs::usrReadConfig()
109{ 110{
110 111
111 KPimPrefs::usrReadConfig(); 112 KPimPrefs::usrReadConfig();
112} 113}
113 114
114 115
115void KOPrefs::usrWriteConfig() 116void KOPrefs::usrWriteConfig()
116{ 117{
117 KPimPrefs::usrWriteConfig(); 118 KPimPrefs::usrWriteConfig();
118} 119}
119 120
120 121
121 122
122KConfig* KOPrefs::getConfig() 123KConfig* KOPrefs::getConfig()
123{ 124{
124 return config(); 125 return config();
125} 126}
diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h
index 91f3fa3..f2c4fbb 100644
--- a/kmicromail/koprefs.h
+++ b/kmicromail/koprefs.h
@@ -1,80 +1,80 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28 28
29class KConfig; 29class KConfig;
30class QFont; 30class QFont;
31class QColor; 31class QColor;
32class QStringList; 32class QStringList;
33 33
34class KOPrefs : public KPimPrefs 34class KOPrefs : public KPimPrefs
35{ 35{
36 public: 36 public:
37 virtual ~KOPrefs(); 37 virtual ~KOPrefs();
38 38
39 /** Get instance of KOPrefs. It is made sure that there is only one 39 /** Get instance of KOPrefs. It is made sure that there is only one
40 instance. */ 40 instance. */
41 static KOPrefs *instance(); 41 static KOPrefs *instance();
42 42
43 /** Set preferences to default values */ 43 /** Set preferences to default values */
44 void usrSetDefaults(); 44 void usrSetDefaults();
45 45
46 /** Read preferences from config file */ 46 /** Read preferences from config file */
47 void usrReadConfig(); 47 void usrReadConfig();
48 48
49 /** Write preferences to config file */ 49 /** Write preferences to config file */
50 void usrWriteConfig(); 50 void usrWriteConfig();
51 void setCategoryDefaults(){;}; 51 void setCategoryDefaults(){;};
52 52
53 protected: 53 protected:
54 54
55 /** Fill empty mail fields with default values. */ 55 /** Fill empty mail fields with default values. */
56 void fillMailDefaults(); 56 void fillMailDefaults();
57 57
58 private: 58 private:
59 /** Constructor disabled for public. Use instance() to create a KOPrefs 59 /** Constructor disabled for public. Use instance() to create a KOPrefs
60 object. */ 60 object. */
61 KOPrefs(); 61 KOPrefs();
62 62
63 static KOPrefs *mInstance; 63 static KOPrefs *mInstance;
64 public: 64 public:
65 // preferences data 65 // preferences data
66 KConfig* getConfig(); 66 KConfig* getConfig();
67 QFont mAppFont; 67 QFont mAppFont;
68 QFont mComposeFont; 68 QFont mComposeFont;
69 QFont mReadFont; 69 QFont mReadFont;
70 QString mName; 70 QString mName;
71 QString mSendCodec; 71 QString mSendCodec;
72 QString mEmail; 72 QString mEmail;
73 QString mCurrentCodeName; 73 QString mCurrentCodeName;
74 int mCurrentCodec; 74 int mCurrentCodec;
75 bool mSendLater, mViewAsHtml, mUseKapi, isDirty; 75 bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField;
76 private: 76 private:
77 77
78}; 78};
79 79
80#endif 80#endif
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 13d6681..5c8a5a9 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -1,1724 +1,1727 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#include <kdialog.h> 23#include <kdialog.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <klineedit.h> 57#include <klineedit.h>
58 58
59 59
60#include "koprefs.h" 60#include "koprefs.h"
61 61
62#include "koprefsdialog.h" 62#include "koprefsdialog.h"
63//#include <kprefswidget.h> 63//#include <kprefswidget.h>
64 64
65 65
66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
67 KPrefsDialog(KOPrefs::instance(),parent,name,true) 67 KPrefsDialog(KOPrefs::instance(),parent,name,true)
68{ 68{
69 69
70 setCaption( i18n("Settings - some need a restart (nr)")); 70 setCaption( i18n("Settings - some need a restart (nr)"));
71 setupGlobalTab(); 71 setupGlobalTab();
72 setupMainTab(); 72 setupMainTab();
73 setupMailTab();; 73 setupMailTab();;
74 setupFontsTab(); 74 setupFontsTab();
75 readConfig(); 75 readConfig();
76 76
77#if 0 77#if 0
78 78
79 setupMainTab(); 79 setupMainTab();
80 setupLocaleTab(); 80 setupLocaleTab();
81 setupTimeZoneTab(); 81 setupTimeZoneTab();
82 setupTimeTab(); 82 setupTimeTab();
83 setupLocaleDateTab(); 83 setupLocaleDateTab();
84 setupFontsTab(); 84 setupFontsTab();
85 setupColorsTab(); 85 setupColorsTab();
86 setupViewsTab(); 86 setupViewsTab();
87 //setupSyncTab(); 87 //setupSyncTab();
88 //setupSyncAlgTab(); 88 //setupSyncAlgTab();
89 //setupPrinterTab(); 89 //setupPrinterTab();
90 //setupGroupSchedulingTab(); 90 //setupGroupSchedulingTab();
91 //setupGroupAutomationTab(); 91 //setupGroupAutomationTab();
92#endif 92#endif
93} 93}
94 94
95#include "kpimglobalprefs.h" 95#include "kpimglobalprefs.h"
96 96
97KOPrefsDialog::~KOPrefsDialog() 97KOPrefsDialog::~KOPrefsDialog()
98{ 98{
99} 99}
100void KOPrefsDialog::setupGlobalTab() 100void KOPrefsDialog::setupGlobalTab()
101{ 101{
102 QFrame *topFrame = addPage(i18n("Global"),0,0); 102 QFrame *topFrame = addPage(i18n("Global"),0,0);
103 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 103 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
104 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 104 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
105 topLayout->addWidget( kdelibcfg ); 105 topLayout->addWidget( kdelibcfg );
106 106
107 107
108} 108}
109void KOPrefsDialog::setupMainTab() 109void KOPrefsDialog::setupMainTab()
110{ 110{
111 QFrame *topFrame = addPage(i18n("General"),0,0); 111 QFrame *topFrame = addPage(i18n("General"),0,0);
112 112
113 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 113 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
114 topLayout->setSpacing(spacingHint()); 114 topLayout->setSpacing(spacingHint());
115 topLayout->setMargin(marginHint()); 115 topLayout->setMargin(marginHint());
116 116
117 117
118 mNameEdit = new QLineEdit(topFrame); 118 mNameEdit = new QLineEdit(topFrame);
119 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 119 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
120 topLayout->addWidget(mNameLabel,0,0); 120 topLayout->addWidget(mNameLabel,0,0);
121 topLayout->addWidget(mNameEdit,0,1); 121 topLayout->addWidget(mNameEdit,0,1);
122 122
123 mEmailEdit = new QLineEdit(topFrame); 123 mEmailEdit = new QLineEdit(topFrame);
124 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 124 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
125 topLayout->addWidget(mEmailLabel,1,0); 125 topLayout->addWidget(mEmailLabel,1,0);
126 topLayout->addWidget(mEmailEdit,1,1); 126 topLayout->addWidget(mEmailEdit,1,1);
127 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); 127 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame);
128 topLayout->addMultiCellWidget(lab,2,2,0,1); 128 topLayout->addMultiCellWidget(lab,2,2,0,1);
129 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), 129 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"),
130 &(KOPrefs::instance()->mUseKapi),topFrame); 130 &(KOPrefs::instance()->mUseKapi),topFrame);
131 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); 131 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1);
132} 132}
133 133
134void KOPrefsDialog::setupMailTab() 134void KOPrefsDialog::setupMailTab()
135{ 135{
136 QFrame *topFrame = addPage(i18n("Mail"),0,0); 136 QFrame *topFrame = addPage(i18n("Mail"),0,0);
137 137
138 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 138 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
139 topLayout->setSpacing(spacingHint()); 139 topLayout->setSpacing(spacingHint());
140 topLayout->setMargin(marginHint()); 140 topLayout->setMargin(marginHint());
141 141
142 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), 142 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"),
143 &(KOPrefs::instance()->mViewAsHtml),topFrame); 143 &(KOPrefs::instance()->mViewAsHtml),topFrame);
144 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); 144 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1);
145 145
146 146
147 ttt = addWidBool(i18n("Send mails later"), 147 ttt = addWidBool(i18n("Send mails later"),
148 &(KOPrefs::instance()->mSendLater),topFrame); 148 &(KOPrefs::instance()->mSendLater),topFrame);
149 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); 149 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
150 ttt = addWidBool(i18n("Show \"To\" field in list view"),
151 &(KOPrefs::instance()->mShowToField),topFrame);
152 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1);
150 /* 153 /*
151 mCodecEdit = new QLineEdit(topFrame); 154 mCodecEdit = new QLineEdit(topFrame);
152 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); 155 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
153 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); 156 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
154 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); 157 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1);
155 */ 158 */
156} 159}
157void KOPrefsDialog::setupFontsTab() 160void KOPrefsDialog::setupFontsTab()
158{ 161{
159 162
160 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 163 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
161 // DesktopIcon("fonts",KIcon::SizeMedium)); 164 // DesktopIcon("fonts",KIcon::SizeMedium));
162 165
163 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 166 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
164 topLayout->setSpacing(1); 167 topLayout->setSpacing(1);
165 topLayout->setMargin(3); 168 topLayout->setMargin(3);
166 KPrefsDialogWidFont * tVFont; 169 KPrefsDialogWidFont * tVFont;
167 int i = 0; 170 int i = 0;
168 KPrefsDialogWidFont *timeLabelsFont = 171 KPrefsDialogWidFont *timeLabelsFont =
169 addWidFont(i18n("OK"),i18n("Application(nr)"), 172 addWidFont(i18n("OK"),i18n("Application(nr)"),
170 &(KOPrefs::instance()->mAppFont),topFrame); 173 &(KOPrefs::instance()->mAppFont),topFrame);
171 topLayout->addWidget(timeLabelsFont->label(),i,0); 174 topLayout->addWidget(timeLabelsFont->label(),i,0);
172 topLayout->addWidget(timeLabelsFont->preview(),i,1); 175 topLayout->addWidget(timeLabelsFont->preview(),i,1);
173 topLayout->addWidget(timeLabelsFont->button(),i,2); 176 topLayout->addWidget(timeLabelsFont->button(),i,2);
174 ++i; 177 ++i;
175 178
176 179
177 timeLabelsFont = 180 timeLabelsFont =
178 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), 181 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"),
179 &(KOPrefs::instance()->mComposeFont),topFrame); 182 &(KOPrefs::instance()->mComposeFont),topFrame);
180 topLayout->addWidget(timeLabelsFont->label(),i,0); 183 topLayout->addWidget(timeLabelsFont->label(),i,0);
181 topLayout->addWidget(timeLabelsFont->preview(),i,1); 184 topLayout->addWidget(timeLabelsFont->preview(),i,1);
182 topLayout->addWidget(timeLabelsFont->button(),i,2); 185 topLayout->addWidget(timeLabelsFont->button(),i,2);
183 ++i; 186 ++i;
184 187
185 KPrefsDialogWidFont *timeBarFont = 188 KPrefsDialogWidFont *timeBarFont =
186 addWidFont(i18n("Hello"),i18n("Read mail:"), 189 addWidFont(i18n("Hello"),i18n("Read mail:"),
187 &(KOPrefs::instance()->mReadFont),topFrame); 190 &(KOPrefs::instance()->mReadFont),topFrame);
188 topLayout->addWidget(timeBarFont->label(),i,0); 191 topLayout->addWidget(timeBarFont->label(),i,0);
189 topLayout->addWidget(timeBarFont->preview(),i,1); 192 topLayout->addWidget(timeBarFont->preview(),i,1);
190 topLayout->addWidget(timeBarFont->button(),i,2); 193 topLayout->addWidget(timeBarFont->button(),i,2);
191 ++i; 194 ++i;
192 195
193 topLayout->setColStretch(1,1); 196 topLayout->setColStretch(1,1);
194 topLayout->setRowStretch(4,1); 197 topLayout->setRowStretch(4,1);
195 198
196} 199}
197void KOPrefsDialog::usrReadConfig() 200void KOPrefsDialog::usrReadConfig()
198{ 201{
199 202
200 mNameEdit->setText(KOPrefs::instance()->mName); 203 mNameEdit->setText(KOPrefs::instance()->mName);
201 mEmailEdit->setText(KOPrefs::instance()->mEmail); 204 mEmailEdit->setText(KOPrefs::instance()->mEmail);
202 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); 205 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec);
203 kdelibcfg->readConfig(); 206 kdelibcfg->readConfig();
204} 207}
205void KOPrefsDialog::usrWriteConfig() 208void KOPrefsDialog::usrWriteConfig()
206{ 209{
207 KOPrefs::instance()->mName = mNameEdit->text(); 210 KOPrefs::instance()->mName = mNameEdit->text();
208 KOPrefs::instance()->mEmail = mEmailEdit->text(); 211 KOPrefs::instance()->mEmail = mEmailEdit->text();
209 //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); 212 //KOPrefs::instance()->mSendCodec = mCodecEdit->text();
210 kdelibcfg->writeConfig(); 213 kdelibcfg->writeConfig();
211 214
212 215
213} 216}
214 217
215#if 0 218#if 0
216void KOPrefsDialog::setupLocaleDateTab() 219void KOPrefsDialog::setupLocaleDateTab()
217{ 220{
218QFrame *topFrame = addPage(i18n("Date Format"),0,0); 221QFrame *topFrame = addPage(i18n("Date Format"),0,0);
219 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 222 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
220 topLayout->setSpacing(spacingHint()); 223 topLayout->setSpacing(spacingHint());
221 topLayout->setMargin(marginHint()); 224 topLayout->setMargin(marginHint());
222 int iii = 0; 225 int iii = 0;
223 226
224 227
225 KPrefsWidRadios *syncPrefsGroup = 228 KPrefsWidRadios *syncPrefsGroup =
226 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 229 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
227 QString format; 230 QString format;
228 if ( QApplication::desktop()->width() < 480 ) 231 if ( QApplication::desktop()->width() < 480 )
229 format = "(%d.%m.%Y)"; 232 format = "(%d.%m.%Y)";
230 else 233 else
231 format = "(%d.%m.%Y|%A %d %B %Y)"; 234 format = "(%d.%m.%Y|%A %d %B %Y)";
232 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 235 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
233 if ( QApplication::desktop()->width() < 480 ) 236 if ( QApplication::desktop()->width() < 480 )
234 format = "(%m.%d.%Y)"; 237 format = "(%m.%d.%Y)";
235 else 238 else
236 format = "(%m.%d.%Y|%A %B %d %Y)"; 239 format = "(%m.%d.%Y|%A %B %d %Y)";
237 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 240 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
238 if ( QApplication::desktop()->width() < 480 ) 241 if ( QApplication::desktop()->width() < 480 )
239 format = "(%Y-%m-%d)"; 242 format = "(%Y-%m-%d)";
240 else 243 else
241 format = "(%Y-%m-%d|%A %Y %B %d)"; 244 format = "(%Y-%m-%d|%A %Y %B %d)";
242 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 245 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
243 syncPrefsGroup->addRadio(i18n("User defined")); 246 syncPrefsGroup->addRadio(i18n("User defined"));
244 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 247 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
245 ++iii; 248 ++iii;
246 ++iii; 249 ++iii;
247 QLabel * lab; 250 QLabel * lab;
248 mUserDateFormatLong = new QLineEdit(topFrame); 251 mUserDateFormatLong = new QLineEdit(topFrame);
249 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 252 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
250 topLayout->addWidget(lab ,iii,0); 253 topLayout->addWidget(lab ,iii,0);
251 topLayout->addWidget(mUserDateFormatLong,iii,1); 254 topLayout->addWidget(mUserDateFormatLong,iii,1);
252 ++iii; 255 ++iii;
253 mUserDateFormatShort = new QLineEdit(topFrame); 256 mUserDateFormatShort = new QLineEdit(topFrame);
254 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 257 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
255 topLayout->addWidget(lab ,iii,0); 258 topLayout->addWidget(lab ,iii,0);
256 topLayout->addWidget(mUserDateFormatShort,iii,1); 259 topLayout->addWidget(mUserDateFormatShort,iii,1);
257 ++iii; 260 ++iii;
258 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 261 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
259 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 262 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
260 ++iii; 263 ++iii;
261 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 264 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
262 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 265 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
263 ++iii; 266 ++iii;
264 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 267 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
265 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 268 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
266 ++iii; 269 ++iii;
267 270
268} 271}
269 272
270void KOPrefsDialog::setupLocaleTab() 273void KOPrefsDialog::setupLocaleTab()
271{ 274{
272 QFrame *topFrame = addPage(i18n("Locale"),0,0); 275 QFrame *topFrame = addPage(i18n("Locale"),0,0);
273 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 276 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
274 topLayout->setSpacing(spacingHint()); 277 topLayout->setSpacing(spacingHint());
275 topLayout->setMargin(marginHint()); 278 topLayout->setMargin(marginHint());
276 int iii = 0; 279 int iii = 0;
277 KPrefsWidRadios *syncPrefsGroup = 280 KPrefsWidRadios *syncPrefsGroup =
278 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 281 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
279 syncPrefsGroup->addRadio(i18n("English")); 282 syncPrefsGroup->addRadio(i18n("English"));
280 syncPrefsGroup->addRadio(i18n("German")); 283 syncPrefsGroup->addRadio(i18n("German"));
281 syncPrefsGroup->addRadio(i18n("French")); 284 syncPrefsGroup->addRadio(i18n("French"));
282 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 285 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
283 if ( QApplication::desktop()->width() < 300 ) 286 if ( QApplication::desktop()->width() < 300 )
284 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 287 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
285 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 288 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
286 ++iii; 289 ++iii;
287 290
288 syncPrefsGroup = 291 syncPrefsGroup =
289 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 292 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
290 if ( QApplication::desktop()->width() > 300 ) 293 if ( QApplication::desktop()->width() > 300 )
291 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 294 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
292 syncPrefsGroup->addRadio(i18n("24:00")); 295 syncPrefsGroup->addRadio(i18n("24:00"));
293 syncPrefsGroup->addRadio(i18n("12:00am")); 296 syncPrefsGroup->addRadio(i18n("12:00am"));
294 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 297 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
295 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 298 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
296 ++iii; 299 ++iii;
297 KPrefsDialogWidBool *sb; 300 KPrefsDialogWidBool *sb;
298 if ( QApplication::desktop()->width() < 300 ) { 301 if ( QApplication::desktop()->width() < 300 ) {
299 sb = 302 sb =
300 addWidBool(i18n("Week starts on Sunday"), 303 addWidBool(i18n("Week starts on Sunday"),
301 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 304 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
302 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 305 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
303 ++iii; 306 ++iii;
304 sb = 307 sb =
305 addWidBool(i18n("Use short date in (WN/E) view"), 308 addWidBool(i18n("Use short date in (WN/E) view"),
306 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 309 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
307 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 310 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
308 } 311 }
309 else { 312 else {
310 QWidget * hb = new QWidget( topFrame ); 313 QWidget * hb = new QWidget( topFrame );
311 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 314 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
312 sb = 315 sb =
313 addWidBool(i18n("Week starts on Sunday"), 316 addWidBool(i18n("Week starts on Sunday"),
314 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 317 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
315 hbLayout->addWidget(sb->checkBox() ); 318 hbLayout->addWidget(sb->checkBox() );
316 sb = 319 sb =
317 addWidBool(i18n("Use short date in (WN/E) view"), 320 addWidBool(i18n("Use short date in (WN/E) view"),
318 &(KOPrefs::instance()->mShortDateInViewer),hb); 321 &(KOPrefs::instance()->mShortDateInViewer),hb);
319 hbLayout->addWidget(sb->checkBox() ); 322 hbLayout->addWidget(sb->checkBox() );
320 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 323 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
321 324
322 } 325 }
323 //#ifndef DESKTOP_VERSION 326 //#ifndef DESKTOP_VERSION
324#if 0 327#if 0
325 ++iii; 328 ++iii;
326 sb = 329 sb =
327 addWidBool(i18n("Quick load/save (w/o Unicode)"), 330 addWidBool(i18n("Quick load/save (w/o Unicode)"),
328 &(KOPrefs::instance()->mUseQuicksave),topFrame); 331 &(KOPrefs::instance()->mUseQuicksave),topFrame);
329 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 332 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
330#endif 333#endif
331} 334}
332void KOPrefsDialog::showSyncPage() 335void KOPrefsDialog::showSyncPage()
333{ 336{
334 showPage ( 2 ) ; 337 showPage ( 2 ) ;
335 338
336} 339}
337void KOPrefsDialog::setupSyncAlgTab() 340void KOPrefsDialog::setupSyncAlgTab()
338{ 341{
339#if 0 342#if 0
340 QLabel * lab; 343 QLabel * lab;
341 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 344 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
342 mSetupSyncAlgTab = topFrame; 345 mSetupSyncAlgTab = topFrame;
343 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 346 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
344 topLayout->setSpacing(spacingHint()); 347 topLayout->setSpacing(spacingHint());
345 topLayout->setMargin(marginHint()); 348 topLayout->setMargin(marginHint());
346 int iii = 0; 349 int iii = 0;
347 350
348 KPrefsDialogWidBool *sb = 351 KPrefsDialogWidBool *sb =
349 addWidBool(i18n("Ask for preferences before syncing"), 352 addWidBool(i18n("Ask for preferences before syncing"),
350 &(KOPrefs::instance()->mAskForPreferences),topFrame); 353 &(KOPrefs::instance()->mAskForPreferences),topFrame);
351 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 354 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
352 355
353 ++iii; 356 ++iii;
354 357
355 KPrefsWidRadios *syncPrefsGroup = 358 KPrefsWidRadios *syncPrefsGroup =
356 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 359 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
357 topFrame); 360 topFrame);
358 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 361 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
359 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 362 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
360 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 363 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
361 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 364 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
362 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 365 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
363 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 366 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
364 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 367 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
365 ++iii; 368 ++iii;
366 sb = 369 sb =
367 addWidBool(i18n("Show summary after syncing"), 370 addWidBool(i18n("Show summary after syncing"),
368 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 371 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
369 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 372 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
370 373
371 ++iii; 374 ++iii;
372#endif 375#endif
373 376
374 377
375 378
376} 379}
377 380
378 381
379void KOPrefsDialog::setupSyncTab() 382void KOPrefsDialog::setupSyncTab()
380{ 383{
381#if 0 384#if 0
382 QLabel * lab; 385 QLabel * lab;
383 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 386 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
384 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 387 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
385 topLayout->setSpacing(spacingHint()); 388 topLayout->setSpacing(spacingHint());
386 topLayout->setMargin(marginHint()); 389 topLayout->setMargin(marginHint());
387 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 390 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
388 int iii = 0; 391 int iii = 0;
389 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 392 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
390 ++iii; 393 ++iii;
391 394
392 mRemoteIPEdit = new QLineEdit(topFrame); 395 mRemoteIPEdit = new QLineEdit(topFrame);
393 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 396 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
394 topLayout->addWidget(lab ,iii,0); 397 topLayout->addWidget(lab ,iii,0);
395 topLayout->addWidget(mRemoteIPEdit,iii,1); 398 topLayout->addWidget(mRemoteIPEdit,iii,1);
396 ++iii; 399 ++iii;
397 mRemoteUser = new QLineEdit(topFrame); 400 mRemoteUser = new QLineEdit(topFrame);
398 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 401 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
399 topLayout->addWidget(lab ,iii,0); 402 topLayout->addWidget(lab ,iii,0);
400 topLayout->addWidget(mRemoteUser, iii,1); 403 topLayout->addWidget(mRemoteUser, iii,1);
401 ++iii; 404 ++iii;
402 405
403 mRemoteFile = new QLineEdit(topFrame); 406 mRemoteFile = new QLineEdit(topFrame);
404 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 407 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
405 topLayout->addWidget(lab ,iii,0); 408 topLayout->addWidget(lab ,iii,0);
406 topLayout->addWidget(mRemoteFile,iii,1); 409 topLayout->addWidget(mRemoteFile,iii,1);
407 ++iii; 410 ++iii;
408 411
409 mLocalTempFile = new QLineEdit(topFrame); 412 mLocalTempFile = new QLineEdit(topFrame);
410 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 413 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
411 topLayout->addWidget(lab ,iii,0); 414 topLayout->addWidget(lab ,iii,0);
412 topLayout->addWidget(mLocalTempFile,iii,1); 415 topLayout->addWidget(mLocalTempFile,iii,1);
413 ++iii; 416 ++iii;
414 417
415 KPrefsDialogWidBool *wb = 418 KPrefsDialogWidBool *wb =
416 addWidBool(i18n("Write back synced file"), 419 addWidBool(i18n("Write back synced file"),
417 &(KOPrefs::instance()->mWriteBackFile),topFrame); 420 &(KOPrefs::instance()->mWriteBackFile),topFrame);
418 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 421 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
419 ++iii; 422 ++iii;
420 wb = 423 wb =
421 addWidBool(i18n("Write back existing entries only"), 424 addWidBool(i18n("Write back existing entries only"),
422 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 425 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
423 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 426 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
424 ++iii; 427 ++iii;
425 428
426#endif 429#endif
427} 430}
428 431
429void KOPrefsDialog::setupMainTab() 432void KOPrefsDialog::setupMainTab()
430{ 433{
431 QFrame *topFrame = addPage(i18n("General"),0,0); 434 QFrame *topFrame = addPage(i18n("General"),0,0);
432 // DesktopIcon("identity",KIcon::SizeMedium)); 435 // DesktopIcon("identity",KIcon::SizeMedium));
433 436
434 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 437 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
435 topLayout->setSpacing(spacingHint()); 438 topLayout->setSpacing(spacingHint());
436 topLayout->setMargin(marginHint()); 439 topLayout->setMargin(marginHint());
437 440
438 // KPrefsDialogWidBool *emailControlCenter = 441 // KPrefsDialogWidBool *emailControlCenter =
439// addWidBool(i18n("&Use email settings from Control Center"), 442// addWidBool(i18n("&Use email settings from Control Center"),
440// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 443// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
441// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 444// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
442 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 445 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
443 // SLOT(toggleEmailSettings(bool))); 446 // SLOT(toggleEmailSettings(bool)));
444 447
445 mNameEdit = new QLineEdit(topFrame); 448 mNameEdit = new QLineEdit(topFrame);
446 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 449 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
447 topLayout->addWidget(mNameLabel,0,0); 450 topLayout->addWidget(mNameLabel,0,0);
448 topLayout->addWidget(mNameEdit,0,1); 451 topLayout->addWidget(mNameEdit,0,1);
449 452
450 mEmailEdit = new QLineEdit(topFrame); 453 mEmailEdit = new QLineEdit(topFrame);
451 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 454 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
452 topLayout->addWidget(mEmailLabel,1,0); 455 topLayout->addWidget(mEmailLabel,1,0);
453 topLayout->addWidget(mEmailEdit,1,1); 456 topLayout->addWidget(mEmailEdit,1,1);
454 KPrefsDialogWidBool *wb; 457 KPrefsDialogWidBool *wb;
455 QHBox *dummy; 458 QHBox *dummy;
456 if ( QApplication::desktop()->width() > 480 ) { 459 if ( QApplication::desktop()->width() > 480 ) {
457 dummy = new QHBox(topFrame); 460 dummy = new QHBox(topFrame);
458 } else { 461 } else {
459 dummy = new QVBox(topFrame); 462 dummy = new QVBox(topFrame);
460 } 463 }
461 464
462 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 465 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
463 addWidBool(i18n("Full menu bar(nr)"), 466 addWidBool(i18n("Full menu bar(nr)"),
464 &(KOPrefs::instance()->mShowFullMenu),dummy); 467 &(KOPrefs::instance()->mShowFullMenu),dummy);
465 468
466 469
467 addWidBool(i18n("Mini icons in toolbar(nr)"), 470 addWidBool(i18n("Mini icons in toolbar(nr)"),
468 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 471 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
469 472
470 473
471 dummy = new QHBox(topFrame); 474 dummy = new QHBox(topFrame);
472 new QLabel(i18n("Days in What's Next:"),dummy); 475 new QLabel(i18n("Days in What's Next:"),dummy);
473 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 476 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
474 477
475 topLayout->addMultiCellWidget(dummy,3,3,0,1); 478 topLayout->addMultiCellWidget(dummy,3,3,0,1);
476 479
477 480
478 481
479 dummy = new QHBox(topFrame); 482 dummy = new QHBox(topFrame);
480 new QLabel(i18n("Days in Next-X-Days:"),dummy); 483 new QLabel(i18n("Days in Next-X-Days:"),dummy);
481 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 484 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
482 485
483 topLayout->addMultiCellWidget(dummy,4,4,0,1); 486 topLayout->addMultiCellWidget(dummy,4,4,0,1);
484 487
485 QHBox *prioBox = new QHBox(topFrame); 488 QHBox *prioBox = new QHBox(topFrame);
486 // intervalBox->setSpacing(spacingHint()); 489 // intervalBox->setSpacing(spacingHint());
487 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 490 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
488 QString messa = i18n("Show topmost todo prios in What's Next:"); 491 QString messa = i18n("Show topmost todo prios in What's Next:");
489 492
490 if ( QApplication::desktop()->width() < 300 ) 493 if ( QApplication::desktop()->width() < 300 )
491 messa = i18n("Show topmost todo prios in What's N.:"); 494 messa = i18n("Show topmost todo prios in What's N.:");
492 QLabel *prioLabel = new QLabel(messa, prioBox); 495 QLabel *prioLabel = new QLabel(messa, prioBox);
493 mPrioSpin = new QSpinBox(0,5,1,prioBox); 496 mPrioSpin = new QSpinBox(0,5,1,prioBox);
494 if ( QApplication::desktop()->width() < 300 ) 497 if ( QApplication::desktop()->width() < 300 )
495 mPrioSpin->setFixedWidth( 40 ); 498 mPrioSpin->setFixedWidth( 40 );
496 499
497 // KPrefsDialogWidBool *bcc = 500 // KPrefsDialogWidBool *bcc =
498// addWidBool(i18n("Send copy to owner when mailing events"), 501// addWidBool(i18n("Send copy to owner when mailing events"),
499// &(KOPrefs::instance()->mBcc),topFrame); 502// &(KOPrefs::instance()->mBcc),topFrame);
500// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 503// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
501 504
502 505
503 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 506 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
504 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 507 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
505 508
506 // addWidBool(i18n("Enable automatic saving of calendar"), 509 // addWidBool(i18n("Enable automatic saving of calendar"),
507 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 510 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
508 511
509 QHBox *intervalBox = new QHBox(topFrame); 512 QHBox *intervalBox = new QHBox(topFrame);
510 // intervalBox->setSpacing(spacingHint()); 513 // intervalBox->setSpacing(spacingHint());
511 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 514 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
512 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 515 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
513 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 516 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
514 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 517 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
515 /* 518 /*
516 QHBox * agendasize = new QHBox ( topFrame ); 519 QHBox * agendasize = new QHBox ( topFrame );
517 520
518 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 521 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
519 522
520 523
521 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 524 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
522 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 525 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
523 */ 526 */
524 KPrefsDialogWidBool *verticalScreen = 527 KPrefsDialogWidBool *verticalScreen =
525 addWidBool(i18n("Show vertical screen (Needs restart)"), 528 addWidBool(i18n("Show vertical screen (Needs restart)"),
526 &(KOPrefs::instance()->mVerticalScreen),topFrame); 529 &(KOPrefs::instance()->mVerticalScreen),topFrame);
527 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 530 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
528 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); 531 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
529 532
530 KPrefsDialogWidBool *ask = 533 KPrefsDialogWidBool *ask =
531 addWidBool(i18n("Ask for quit when closing KO/Pi"), 534 addWidBool(i18n("Ask for quit when closing KO/Pi"),
532 &(KOPrefs::instance()->mAskForQuit),topFrame); 535 &(KOPrefs::instance()->mAskForQuit),topFrame);
533 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); 536 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
534 537
535 538
536 /* 539 /*
537 KPrefsDialogWidBool *confirmCheck = 540 KPrefsDialogWidBool *confirmCheck =
538 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 541 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
539 topFrame); 542 topFrame);
540 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 543 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
541 544
542 545
543 mEnableGroupScheduling = 546 mEnableGroupScheduling =
544 addWidBool(i18n("Enable group scheduling"), 547 addWidBool(i18n("Enable group scheduling"),
545 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 548 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
546 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 549 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
547 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 550 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
548 SLOT(warningGroupScheduling())); 551 SLOT(warningGroupScheduling()));
549 552
550 mEnableProjectView = 553 mEnableProjectView =
551 addWidBool(i18n("Enable project view"), 554 addWidBool(i18n("Enable project view"),
552 &(KOPrefs::instance()->mEnableProjectView),topFrame); 555 &(KOPrefs::instance()->mEnableProjectView),topFrame);
553 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 556 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
554 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 557 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
555 SLOT(warningProjectView())); 558 SLOT(warningProjectView()));
556 559
557 // Can't be disabled anymore 560 // Can't be disabled anymore
558 mEnableGroupScheduling->checkBox()->hide(); 561 mEnableGroupScheduling->checkBox()->hide();
559 562
560 // Disable setting, because this feature now becomes stable 563 // Disable setting, because this feature now becomes stable
561 mEnableProjectView->checkBox()->hide(); 564 mEnableProjectView->checkBox()->hide();
562 565
563 KPrefsWidRadios *defaultFormatGroup = 566 KPrefsWidRadios *defaultFormatGroup =
564 addWidRadios(i18n("Default Calendar Format"), 567 addWidRadios(i18n("Default Calendar Format"),
565 &(KOPrefs::instance()->mDefaultFormat),topFrame); 568 &(KOPrefs::instance()->mDefaultFormat),topFrame);
566 defaultFormatGroup->addRadio(i18n("vCalendar")); 569 defaultFormatGroup->addRadio(i18n("vCalendar"));
567 defaultFormatGroup->addRadio(i18n("iCalendar")); 570 defaultFormatGroup->addRadio(i18n("iCalendar"));
568 571
569 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 572 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
570 573
571 // Default format unconditionally is iCalendar 574 // Default format unconditionally is iCalendar
572 defaultFormatGroup->groupBox()->hide(); 575 defaultFormatGroup->groupBox()->hide();
573 576
574 KPrefsWidRadios *mailClientGroup = 577 KPrefsWidRadios *mailClientGroup =
575 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 578 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
576 topFrame); 579 topFrame);
577 mailClientGroup->addRadio(i18n("KMail")); 580 mailClientGroup->addRadio(i18n("KMail"));
578 mailClientGroup->addRadio(i18n("Sendmail")); 581 mailClientGroup->addRadio(i18n("Sendmail"));
579 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 582 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
580 583
581 KPrefsDialogWidBool *htmlsave = 584 KPrefsDialogWidBool *htmlsave =
582 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 585 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
583 topFrame); 586 topFrame);
584 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 587 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
585 588
586 KPrefsWidRadios *destinationGroup = 589 KPrefsWidRadios *destinationGroup =
587 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 590 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
588 topFrame); 591 topFrame);
589 destinationGroup->addRadio(i18n("be added to the standard resource")); 592 destinationGroup->addRadio(i18n("be added to the standard resource"));
590 destinationGroup->addRadio(i18n("be asked which resource to use")); 593 destinationGroup->addRadio(i18n("be asked which resource to use"));
591 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 594 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
592 595
593 topLayout->setRowStretch(14,1); 596 topLayout->setRowStretch(14,1);
594 */ 597 */
595} 598}
596 599
597 600
598void KOPrefsDialog::setupTimeTab() 601void KOPrefsDialog::setupTimeTab()
599{ 602{
600 QFrame *topFrame = addPage(i18n("Time"),0,0); 603 QFrame *topFrame = addPage(i18n("Time"),0,0);
601 // DesktopIcon("clock",KIcon::SizeMedium)); 604 // DesktopIcon("clock",KIcon::SizeMedium));
602 605
603 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 606 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
604 topLayout->setSpacing(spacingHint()); 607 topLayout->setSpacing(spacingHint());
605 topLayout->setMargin(marginHint()); 608 topLayout->setMargin(marginHint());
606 609
607 QHBox *dummy = new QHBox(topFrame); 610 QHBox *dummy = new QHBox(topFrame);
608 KPrefsWidTime *dayBegins = 611 KPrefsWidTime *dayBegins =
609 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 612 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
610 dummy); 613 dummy);
611 //topLayout->addWidget(dayBegins->label(),2,0); 614 //topLayout->addWidget(dayBegins->label(),2,0);
612 615
613 //topLayout->addWidget(dayBegins->spinBox(),2,1); 616 //topLayout->addWidget(dayBegins->spinBox(),2,1);
614 topLayout->addMultiCellWidget(dummy,0,0,0,1); 617 topLayout->addMultiCellWidget(dummy,0,0,0,1);
615 618
616 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 619 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
617 topFrame),1,0); 620 topFrame),1,0);
618 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 621 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
619 mStartTimeSpin->setSuffix(":00"); 622 mStartTimeSpin->setSuffix(":00");
620 topLayout->addWidget(mStartTimeSpin,1,1); 623 topLayout->addWidget(mStartTimeSpin,1,1);
621 624
622 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 625 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
623 topFrame),2,0); 626 topFrame),2,0);
624 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 627 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
625 mDefaultDurationSpin->setSuffix(":00"); 628 mDefaultDurationSpin->setSuffix(":00");
626 topLayout->addWidget(mDefaultDurationSpin,2,1); 629 topLayout->addWidget(mDefaultDurationSpin,2,1);
627 630
628 QStringList alarmList; 631 QStringList alarmList;
629 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 632 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
630 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 633 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
631 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 634 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
632 3,0); 635 3,0);
633 mAlarmTimeCombo = new QComboBox(topFrame); 636 mAlarmTimeCombo = new QComboBox(topFrame);
634 mAlarmTimeCombo->insertStringList(alarmList); 637 mAlarmTimeCombo->insertStringList(alarmList);
635 topLayout->addWidget(mAlarmTimeCombo,3,1); 638 topLayout->addWidget(mAlarmTimeCombo,3,1);
636 639
637 640
638 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 641 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
639 i18n("Working Hours"), 642 i18n("Working Hours"),
640 topFrame); 643 topFrame);
641 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 644 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
642 workingHoursGroup->layout()->setSpacing( 0 ); 645 workingHoursGroup->layout()->setSpacing( 0 );
643 workingHoursGroup->layout()->setMargin( 4 ); 646 workingHoursGroup->layout()->setMargin( 4 );
644 QHBox *workStartBox = new QHBox(workingHoursGroup); 647 QHBox *workStartBox = new QHBox(workingHoursGroup);
645 // workStartBox->setMargin( 0 ); 648 // workStartBox->setMargin( 0 );
646 addWidTime(i18n("Daily starting hour:"), 649 addWidTime(i18n("Daily starting hour:"),
647 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 650 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
648 651
649 QHBox *workEndBox = new QHBox(workingHoursGroup); 652 QHBox *workEndBox = new QHBox(workingHoursGroup);
650 //workEndBox->setMargin( 0 ); 653 //workEndBox->setMargin( 0 );
651 addWidTime(i18n("Daily ending hour:"), 654 addWidTime(i18n("Daily ending hour:"),
652 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 655 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
653 QVBox *excludeBox = new QVBox(workingHoursGroup); 656 QVBox *excludeBox = new QVBox(workingHoursGroup);
654 //excludeBox->setMargin( 0 ); 657 //excludeBox->setMargin( 0 );
655 addWidBool(i18n("Exclude holidays"), 658 addWidBool(i18n("Exclude holidays"),
656 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 659 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
657 660
658 addWidBool(i18n("Exclude Saturdays"), 661 addWidBool(i18n("Exclude Saturdays"),
659 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 662 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
660 663
661// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 664// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
662 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 665 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
663 // topFrame); 666 // topFrame);
664// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 667// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
665 668
666 // topLayout->setRowStretch(6,1); 669 // topLayout->setRowStretch(6,1);
667} 670}
668 671
669 672
670void KOPrefsDialog::setupViewsTab() 673void KOPrefsDialog::setupViewsTab()
671{ 674{
672 675
673 QFrame *topFrame = addPage(i18n("Views"),0,0); 676 QFrame *topFrame = addPage(i18n("Views"),0,0);
674 // DesktopIcon("viewmag",KIcon::SizeMedium)); 677 // DesktopIcon("viewmag",KIcon::SizeMedium));
675 678
676 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 679 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
677 topLayout->setSpacing(spacingHint()); 680 topLayout->setSpacing(spacingHint());
678 topLayout->setMargin(marginHint()); 681 topLayout->setMargin(marginHint());
679 682
680// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 683// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
681// topLayout->addLayout(dayBeginsLayout,0,0); 684// topLayout->addLayout(dayBeginsLayout,0,0);
682 685
683// KPrefsWidTime *dayBegins = 686// KPrefsWidTime *dayBegins =
684// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 687// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
685// topFrame); 688// topFrame);
686// dayBeginsLayout->addWidget(dayBegins->label()); 689// dayBeginsLayout->addWidget(dayBegins->label());
687// dayBeginsLayout->addStretch(1); 690// dayBeginsLayout->addStretch(1);
688// dayBeginsLayout->addWidget(dayBegins->spinBox()); 691// dayBeginsLayout->addWidget(dayBegins->spinBox());
689 692
690// QBoxLayout *nextDaysLayout = new QHBoxLayout; 693// QBoxLayout *nextDaysLayout = new QHBoxLayout;
691// topLayout->addLayout(nextDaysLayout,1,0); 694// topLayout->addLayout(nextDaysLayout,1,0);
692// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 695// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
693// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 696// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
694// nextDaysLayout->addStretch(1); 697// nextDaysLayout->addStretch(1);
695// nextDaysLayout->addWidget(mNextXDaysSpin); 698// nextDaysLayout->addWidget(mNextXDaysSpin);
696 699
697 700
698 int ii = 0; 701 int ii = 0;
699 KPrefsDialogWidBool *dummy = 702 KPrefsDialogWidBool *dummy =
700 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 703 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
701 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 704 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
702 topLayout->addWidget(dummy->checkBox(),ii++,0); 705 topLayout->addWidget(dummy->checkBox(),ii++,0);
703 706
704 dummy = 707 dummy =
705 addWidBool(i18n("Highlight current day in agenda"), 708 addWidBool(i18n("Highlight current day in agenda"),
706 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 709 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
707 topLayout->addWidget(dummy->checkBox(),ii++,0); 710 topLayout->addWidget(dummy->checkBox(),ii++,0);
708 711
709 dummy = 712 dummy =
710 addWidBool(i18n("Use light color for highlight current day"), 713 addWidBool(i18n("Use light color for highlight current day"),
711 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 714 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
712 topLayout->addWidget(dummy->checkBox(),ii++,0); 715 topLayout->addWidget(dummy->checkBox(),ii++,0);
713 716
714 KPrefsDialogWidBool *dailyRecur = 717 KPrefsDialogWidBool *dailyRecur =
715 addWidBool(i18n("Show events that recur daily in date nav."), 718 addWidBool(i18n("Show events that recur daily in date nav."),
716 &(KOPrefs::instance()->mDailyRecur),topFrame); 719 &(KOPrefs::instance()->mDailyRecur),topFrame);
717 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 720 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
718 721
719 KPrefsDialogWidBool *weeklyRecur = 722 KPrefsDialogWidBool *weeklyRecur =
720 addWidBool(i18n("Show ev. that recur weekly in date nav."), 723 addWidBool(i18n("Show ev. that recur weekly in date nav."),
721 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 724 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
722 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 725 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
723 if ( QApplication::desktop()->width() > 640 ) { 726 if ( QApplication::desktop()->width() > 640 ) {
724 727
725 KPrefsDialogWidBool *enableToolTips = 728 KPrefsDialogWidBool *enableToolTips =
726 addWidBool(i18n("Enable tooltips displaying summary of ev."), 729 addWidBool(i18n("Enable tooltips displaying summary of ev."),
727 &(KOPrefs::instance()->mEnableToolTips),topFrame); 730 &(KOPrefs::instance()->mEnableToolTips),topFrame);
728 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 731 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
729 732
730 } 733 }
731 KPrefsDialogWidBool *passwdk = 734 KPrefsDialogWidBool *passwdk =
732 addWidBool(i18n("Show parent To-Do's in What's Next view"), 735 addWidBool(i18n("Show parent To-Do's in What's Next view"),
733 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 736 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
734 topLayout->addWidget(passwdk->checkBox(), ii++,0); 737 topLayout->addWidget(passwdk->checkBox(), ii++,0);
735 738
736 passwdk = 739 passwdk =
737 addWidBool(i18n("Show location in What's Next view"), 740 addWidBool(i18n("Show location in What's Next view"),
738 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 741 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
739 topLayout->addWidget(passwdk->checkBox(), ii++,0); 742 topLayout->addWidget(passwdk->checkBox(), ii++,0);
740 743
741 passwdk = 744 passwdk =
742 addWidBool(i18n("Show Sync Events in WN/Agenda view"), 745 addWidBool(i18n("Show Sync Events in WN/Agenda view"),
743 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 746 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
744 topLayout->addWidget(passwdk->checkBox(), ii++,0); 747 topLayout->addWidget(passwdk->checkBox(), ii++,0);
745 748
746 749
747 KPrefsDialogWidBool *marcusBainsEnabled = 750 KPrefsDialogWidBool *marcusBainsEnabled =
748 addWidBool(i18n("Show Marcus Bains line"), 751 addWidBool(i18n("Show Marcus Bains line"),
749 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 752 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
750 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 753 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
751 754
752 755
753 // topLayout->addWidget(hourSizeGroup,ii++,0); 756 // topLayout->addWidget(hourSizeGroup,ii++,0);
754 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 757 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
755 //topLayout->setRowStretch(11,1); 758 //topLayout->setRowStretch(11,1);
756 759
757 760
758 761
759 762
760 763
761 764
762 topFrame = addPage(i18n("ViewChange"),0,0); 765 topFrame = addPage(i18n("ViewChange"),0,0);
763 // DesktopIcon("viewmag",KIcon::SizeMedium)); 766 // DesktopIcon("viewmag",KIcon::SizeMedium));
764 767
765 topLayout = new QGridLayout(topFrame,6,1); 768 topLayout = new QGridLayout(topFrame,6,1);
766 topLayout->setSpacing(spacingHint()); 769 topLayout->setSpacing(spacingHint());
767 topLayout->setMargin(marginHint()); 770 topLayout->setMargin(marginHint());
768 ii = 0; 771 ii = 0;
769 772
770 773
771 dummy = 774 dummy =
772 addWidBool(i18n("Hold fullscreen on view change"), 775 addWidBool(i18n("Hold fullscreen on view change"),
773 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 776 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
774 topLayout->addWidget(dummy->checkBox(),ii++,0); 777 topLayout->addWidget(dummy->checkBox(),ii++,0);
775 778
776 dummy = 779 dummy =
777 addWidBool(i18n("Hold non-fullscreen on view change"), 780 addWidBool(i18n("Hold non-fullscreen on view change"),
778 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 781 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
779 topLayout->addWidget(dummy->checkBox(),ii++,0); 782 topLayout->addWidget(dummy->checkBox(),ii++,0);
780 783
781 784
782 KPrefsDialogWidBool *fullViewTodo = 785 KPrefsDialogWidBool *fullViewTodo =
783 addWidBool(i18n("Event list view uses full window"), 786 addWidBool(i18n("Event list view uses full window"),
784 &(KOPrefs::instance()->mFullViewTodo),topFrame); 787 &(KOPrefs::instance()->mFullViewTodo),topFrame);
785 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 788 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
786 789
787 KPrefsDialogWidBool *fullViewMonth = 790 KPrefsDialogWidBool *fullViewMonth =
788 addWidBool(i18n("Next days view uses full window"), 791 addWidBool(i18n("Next days view uses full window"),
789 &(KOPrefs::instance()->mFullViewMonth),topFrame); 792 &(KOPrefs::instance()->mFullViewMonth),topFrame);
790 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 793 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
791 794
792 dummy = 795 dummy =
793 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 796 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
794 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 797 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
795 topLayout->addWidget(dummy->checkBox(),ii++,0); 798 topLayout->addWidget(dummy->checkBox(),ii++,0);
796 799
797 dummy = 800 dummy =
798 addWidBool(i18n("Set agenda to current time on change"), 801 addWidBool(i18n("Set agenda to current time on change"),
799 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 802 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
800 topLayout->addWidget(dummy->checkBox(),ii++,0); 803 topLayout->addWidget(dummy->checkBox(),ii++,0);
801 804
802 dummy = 805 dummy =
803 addWidBool(i18n("Listview uses monthly timespan"), 806 addWidBool(i18n("Listview uses monthly timespan"),
804 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 807 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
805 topLayout->addWidget(dummy->checkBox(),ii++,0); 808 topLayout->addWidget(dummy->checkBox(),ii++,0);
806 dummy = 809 dummy =
807 addWidBool(i18n("Highlight selection in Time Edit"), 810 addWidBool(i18n("Highlight selection in Time Edit"),
808 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 811 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
809 topLayout->addWidget( dummy->checkBox(), ii++,0); 812 topLayout->addWidget( dummy->checkBox(), ii++,0);
810 813
811 814
812 815
813 816
814 817
815 topFrame = addPage(i18n("Month View"),0,0); 818 topFrame = addPage(i18n("Month View"),0,0);
816 // DesktopIcon("viewmag",KIcon::SizeMedium)); 819 // DesktopIcon("viewmag",KIcon::SizeMedium));
817 820
818 topLayout = new QGridLayout(topFrame,5,1); 821 topLayout = new QGridLayout(topFrame,5,1);
819 topLayout->setSpacing(spacingHint()); 822 topLayout->setSpacing(spacingHint());
820 topLayout->setMargin(marginHint()); 823 topLayout->setMargin(marginHint());
821 ii = 0; 824 ii = 0;
822 QLabel *lab; 825 QLabel *lab;
823 QHBox *habo = new QHBox( topFrame ); 826 QHBox *habo = new QHBox( topFrame );
824 if ( QApplication::desktop()->width() < 320 ) { 827 if ( QApplication::desktop()->width() < 320 ) {
825 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 828 lab = new QLabel ( i18n("Show events that recur "), topFrame );
826 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 829 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
827 ii++; 830 ii++;
828 831
829 } else { 832 } else {
830 new QLabel ( i18n("Show events that recur "), habo ); 833 new QLabel ( i18n("Show events that recur "), habo );
831 834
832 } 835 }
833 dailyRecur = 836 dailyRecur =
834 addWidBool(i18n("daily"), 837 addWidBool(i18n("daily"),
835 &(KOPrefs::instance()->mMonthDailyRecur),habo); 838 &(KOPrefs::instance()->mMonthDailyRecur),habo);
836 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 839 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
837 840
838 weeklyRecur = 841 weeklyRecur =
839 addWidBool(i18n("weekly"), 842 addWidBool(i18n("weekly"),
840 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 843 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
841 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 844 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
842 ii++; 845 ii++;
843 846
844 847
845 habo = new QHBox( topFrame ); 848 habo = new QHBox( topFrame );
846 if ( QApplication::desktop()->width() < 320 ) { 849 if ( QApplication::desktop()->width() < 320 ) {
847 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 850 lab = new QLabel (i18n("Show in every cell ") , topFrame );
848 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 851 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
849 ii++; 852 ii++;
850 853
851 } else { 854 } else {
852 new QLabel ( i18n("Show in every cell "), habo ); 855 new QLabel ( i18n("Show in every cell "), habo );
853 } 856 }
854 weeklyRecur = 857 weeklyRecur =
855 addWidBool(i18n("short month"), 858 addWidBool(i18n("short month"),
856 &(KOPrefs::instance()->mMonthShowShort),habo); 859 &(KOPrefs::instance()->mMonthShowShort),habo);
857 weeklyRecur = 860 weeklyRecur =
858 addWidBool(i18n("icons"), 861 addWidBool(i18n("icons"),
859 &(KOPrefs::instance()->mMonthShowIcons),habo); 862 &(KOPrefs::instance()->mMonthShowIcons),habo);
860 863
861 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 864 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
862 ii++; 865 ii++;
863#ifdef DESKTOP_VERSION 866#ifdef DESKTOP_VERSION
864 KPrefsDialogWidBool *enableMonthScroll = 867 KPrefsDialogWidBool *enableMonthScroll =
865 addWidBool(i18n("Enable scrollbars in month view cells"), 868 addWidBool(i18n("Enable scrollbars in month view cells"),
866 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 869 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
867 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 870 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
868#endif 871#endif
869 872
870 dummy = 873 dummy =
871 addWidBool(i18n("Show Sat/Sun together"), 874 addWidBool(i18n("Show Sat/Sun together"),
872 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 875 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
873 topLayout->addWidget(dummy->checkBox(),ii++,0); 876 topLayout->addWidget(dummy->checkBox(),ii++,0);
874 877
875 KPrefsDialogWidBool *coloredCategoriesInMonthView = 878 KPrefsDialogWidBool *coloredCategoriesInMonthView =
876 addWidBool(i18n("Month view uses category colors"), 879 addWidBool(i18n("Month view uses category colors"),
877 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 880 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
878 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 881 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
879 882
880 dummy = 883 dummy =
881 addWidBool(i18n("Categorie colors are applied to text"), 884 addWidBool(i18n("Categorie colors are applied to text"),
882 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 885 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
883 topLayout->addWidget(dummy->checkBox(),ii++,0); 886 topLayout->addWidget(dummy->checkBox(),ii++,0);
884 coloredCategoriesInMonthView = 887 coloredCategoriesInMonthView =
885 addWidBool(i18n("Month view uses day colors"), 888 addWidBool(i18n("Month view uses day colors"),
886 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 889 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
887 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 890 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
888 891
889 KPrefsWidColor *holidayColor = 892 KPrefsWidColor *holidayColor =
890 addWidColor(i18n("Day color odd months"), 893 addWidColor(i18n("Day color odd months"),
891 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 894 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
892 topLayout->addWidget(holidayColor->label(),ii,0); 895 topLayout->addWidget(holidayColor->label(),ii,0);
893 topLayout->addWidget(holidayColor->button(),ii++,1); 896 topLayout->addWidget(holidayColor->button(),ii++,1);
894 897
895 holidayColor = 898 holidayColor =
896 addWidColor(i18n("Day color even months"), 899 addWidColor(i18n("Day color even months"),
897 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 900 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
898 topLayout->addWidget(holidayColor->label(),ii,0); 901 topLayout->addWidget(holidayColor->label(),ii,0);
899 topLayout->addWidget(holidayColor->button(),ii++,1); 902 topLayout->addWidget(holidayColor->button(),ii++,1);
900 903
901 904
902 holidayColor = 905 holidayColor =
903 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 906 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
904 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 907 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
905 topLayout->addWidget(holidayColor->label(),ii,0); 908 topLayout->addWidget(holidayColor->label(),ii,0);
906 topLayout->addWidget(holidayColor->button(),ii++,1); 909 topLayout->addWidget(holidayColor->button(),ii++,1);
907 910
908 // *********************** Todo View 911 // *********************** Todo View
909 912
910 topFrame = addPage(i18n("Todo View"),0,0); 913 topFrame = addPage(i18n("Todo View"),0,0);
911 // DesktopIcon("viewmag",KIcon::SizeMedium)); 914 // DesktopIcon("viewmag",KIcon::SizeMedium));
912 915
913 topLayout = new QGridLayout(topFrame,4,1); 916 topLayout = new QGridLayout(topFrame,4,1);
914 topLayout->setSpacing(spacingHint()); 917 topLayout->setSpacing(spacingHint());
915 topLayout->setMargin(marginHint()); 918 topLayout->setMargin(marginHint());
916 ii = 0; 919 ii = 0;
917 920
918 KPrefsDialogWidBool *showCompletedTodo = 921 KPrefsDialogWidBool *showCompletedTodo =
919 addWidBool(i18n("To-do view shows completed Todos"), 922 addWidBool(i18n("To-do view shows completed Todos"),
920 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 923 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
921 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 924 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
922 dummy = 925 dummy =
923 addWidBool(i18n("To-do view shows complete as 'xx %'"), 926 addWidBool(i18n("To-do view shows complete as 'xx %'"),
924 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 927 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
925 topLayout->addWidget(dummy->checkBox(),ii++,0); 928 topLayout->addWidget(dummy->checkBox(),ii++,0);
926 929
927 dummy = 930 dummy =
928 addWidBool(i18n("Small To-do view uses smaller font"), 931 addWidBool(i18n("Small To-do view uses smaller font"),
929 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 932 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
930 topLayout->addWidget(dummy->checkBox(),ii++,0); 933 topLayout->addWidget(dummy->checkBox(),ii++,0);
931 934
932 935
933 936
934 dummy = 937 dummy =
935 addWidBool(i18n("Todo view uses category colors"), 938 addWidBool(i18n("Todo view uses category colors"),
936 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 939 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
937 topLayout->addWidget(dummy->checkBox(),ii++,0); 940 topLayout->addWidget(dummy->checkBox(),ii++,0);
938 941
939 942
940 QWidget* wid = new QWidget( topFrame ); 943 QWidget* wid = new QWidget( topFrame );
941 // Todo due today color 944 // Todo due today color
942 KPrefsWidColor *todoDueTodayColor = 945 KPrefsWidColor *todoDueTodayColor =
943 addWidColor(i18n("Todo due today color:"), 946 addWidColor(i18n("Todo due today color:"),
944 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 947 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
945 QHBoxLayout *widLayout = new QHBoxLayout(wid); 948 QHBoxLayout *widLayout = new QHBoxLayout(wid);
946 widLayout->addWidget( todoDueTodayColor->label() ); 949 widLayout->addWidget( todoDueTodayColor->label() );
947 widLayout->addWidget( todoDueTodayColor->button() ); 950 widLayout->addWidget( todoDueTodayColor->button() );
948 topLayout->addWidget(wid,ii++,0); 951 topLayout->addWidget(wid,ii++,0);
949 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 952 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
950 953
951 // Todo overdue color 954 // Todo overdue color
952 wid = new QWidget( topFrame ); 955 wid = new QWidget( topFrame );
953 widLayout = new QHBoxLayout(wid); 956 widLayout = new QHBoxLayout(wid);
954 KPrefsWidColor *todoOverdueColor = 957 KPrefsWidColor *todoOverdueColor =
955 addWidColor(i18n("Todo overdue color:"), 958 addWidColor(i18n("Todo overdue color:"),
956 &(KOPrefs::instance()->mTodoOverdueColor),wid); 959 &(KOPrefs::instance()->mTodoOverdueColor),wid);
957 widLayout->addWidget(todoOverdueColor->label()); 960 widLayout->addWidget(todoOverdueColor->label());
958 widLayout->addWidget(todoOverdueColor->button()); 961 widLayout->addWidget(todoOverdueColor->button());
959 topLayout->addWidget(wid,ii++,0); 962 topLayout->addWidget(wid,ii++,0);
960 963
961 dummy = 964 dummy =
962 addWidBool(i18n("Colors are applied to text"), 965 addWidBool(i18n("Colors are applied to text"),
963 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 966 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
964 topLayout->addWidget(dummy->checkBox(),ii++,0); 967 topLayout->addWidget(dummy->checkBox(),ii++,0);
965 968
966 dummy = 969 dummy =
967 addWidBool(i18n("Allday Agenda view shows todos"), 970 addWidBool(i18n("Allday Agenda view shows todos"),
968 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 971 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
969 topLayout->addWidget(dummy->checkBox(),ii++,0); 972 topLayout->addWidget(dummy->checkBox(),ii++,0);
970 973
971 974
972 975
973 976
974 topFrame = addPage(i18n("Alarm"),0,0); 977 topFrame = addPage(i18n("Alarm"),0,0);
975 // DesktopIcon("viewmag",KIcon::SizeMedium)); 978 // DesktopIcon("viewmag",KIcon::SizeMedium));
976 979
977 topLayout = new QGridLayout(topFrame,2,1); 980 topLayout = new QGridLayout(topFrame,2,1);
978 topLayout->setSpacing(spacingHint()); 981 topLayout->setSpacing(spacingHint());
979 topLayout->setMargin(marginHint()); 982 topLayout->setMargin(marginHint());
980 int iii = 0; 983 int iii = 0;
981 984
982 dummy = 985 dummy =
983 addWidBool(i18n("Use internal alarm notification"), 986 addWidBool(i18n("Use internal alarm notification"),
984 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 987 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
985 topLayout->addWidget(dummy->checkBox(),iii++,0); 988 topLayout->addWidget(dummy->checkBox(),iii++,0);
986 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 989 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
987 990
988 topLayout->addWidget(lab ,iii++,0); 991 topLayout->addWidget(lab ,iii++,0);
989#ifndef DESKTOP_VERSION 992#ifndef DESKTOP_VERSION
990 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 993 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
991#else 994#else
992 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 995 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
993 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 996 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
994#endif 997#endif
995 998
996 QHBox* dummyBox = new QHBox(topFrame); 999 QHBox* dummyBox = new QHBox(topFrame);
997 new QLabel(i18n("Play beeps count:"),dummyBox); 1000 new QLabel(i18n("Play beeps count:"),dummyBox);
998 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 1001 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
999 topLayout->addWidget(dummyBox,iii++,0); 1002 topLayout->addWidget(dummyBox,iii++,0);
1000 1003
1001 dummyBox = new QHBox(topFrame); 1004 dummyBox = new QHBox(topFrame);
1002 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1005 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
1003 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1006 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
1004 topLayout->addWidget(dummyBox,iii++,0); 1007 topLayout->addWidget(dummyBox,iii++,0);
1005 1008
1006 dummyBox = new QHBox(topFrame); 1009 dummyBox = new QHBox(topFrame);
1007 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1010 new QLabel(i18n("Default suspend time in min:"),dummyBox);
1008 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1011 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1009 topLayout->addWidget(dummyBox,iii++,0); 1012 topLayout->addWidget(dummyBox,iii++,0);
1010 1013
1011 dummyBox = new QHBox(topFrame); 1014 dummyBox = new QHBox(topFrame);
1012 new QLabel(i18n("Auto suspend count:"),dummyBox); 1015 new QLabel(i18n("Auto suspend count:"),dummyBox);
1013 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1016 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1014 topLayout->addWidget(dummyBox,iii++,0); 1017 topLayout->addWidget(dummyBox,iii++,0);
1015 1018
1016 1019
1017 1020
1018 1021
1019 1022
1020 1023
1021 1024
1022 QHBox* hbo = new QHBox ( topFrame ); 1025 QHBox* hbo = new QHBox ( topFrame );
1023 mDefaultAlarmFile = new QLineEdit(hbo); 1026 mDefaultAlarmFile = new QLineEdit(hbo);
1024 QPushButton * loadTemplate = new QPushButton(hbo); 1027 QPushButton * loadTemplate = new QPushButton(hbo);
1025 QPixmap icon; 1028 QPixmap icon;
1026 if ( QApplication::desktop()->width() < 321 ) 1029 if ( QApplication::desktop()->width() < 321 )
1027 icon = SmallIcon("fileimport16"); 1030 icon = SmallIcon("fileimport16");
1028 else 1031 else
1029 icon = SmallIcon("fileimport"); 1032 icon = SmallIcon("fileimport");
1030 loadTemplate->setIconSet (icon ) ; 1033 loadTemplate->setIconSet (icon ) ;
1031 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1034 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1032 int size = loadTemplate->sizeHint().height(); 1035 int size = loadTemplate->sizeHint().height();
1033 loadTemplate->setFixedSize( size, size ); 1036 loadTemplate->setFixedSize( size, size );
1034 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1037 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
1035 // topLayout->addWidget(lab ,iii++,0); 1038 // topLayout->addWidget(lab ,iii++,0);
1036 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 1039 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
1037 topLayout->addWidget(lab ,iii++,0); 1040 topLayout->addWidget(lab ,iii++,0);
1038 topLayout->addWidget(hbo,iii++,0); 1041 topLayout->addWidget(hbo,iii++,0);
1039 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 1042 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
1040 1043
1041// topLayout->addWidget(lab ,iii++,0); 1044// topLayout->addWidget(lab ,iii++,0);
1042// #ifndef DESKTOP_VERSION 1045// #ifndef DESKTOP_VERSION
1043// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1046// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
1044// #else 1047// #else
1045// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1048// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
1046// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1049// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1047// #endif 1050// #endif
1048 1051
1049 1052
1050} 1053}
1051 1054
1052void KOPrefsDialog::selectSoundFile() 1055void KOPrefsDialog::selectSoundFile()
1053{ 1056{
1054 QString fileName = mDefaultAlarmFile->text(); 1057 QString fileName = mDefaultAlarmFile->text();
1055 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1058 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1056 if ( fileName.length() > 0 ) 1059 if ( fileName.length() > 0 )
1057 mDefaultAlarmFile->setText( fileName ); 1060 mDefaultAlarmFile->setText( fileName );
1058} 1061}
1059void KOPrefsDialog::setupFontsTab() 1062void KOPrefsDialog::setupFontsTab()
1060{ 1063{
1061 1064
1062 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1065 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1063 // DesktopIcon("fonts",KIcon::SizeMedium)); 1066 // DesktopIcon("fonts",KIcon::SizeMedium));
1064 1067
1065 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1068 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1066 topLayout->setSpacing(1); 1069 topLayout->setSpacing(1);
1067 topLayout->setMargin(3); 1070 topLayout->setMargin(3);
1068 KPrefsDialogWidFont * tVFont; 1071 KPrefsDialogWidFont * tVFont;
1069 int i = 0; 1072 int i = 0;
1070 KPrefsDialogWidFont *timeLabelsFont = 1073 KPrefsDialogWidFont *timeLabelsFont =
1071 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1074 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1072 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1075 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1073 topLayout->addWidget(timeLabelsFont->label(),i,0); 1076 topLayout->addWidget(timeLabelsFont->label(),i,0);
1074 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1077 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1075 topLayout->addWidget(timeLabelsFont->button(),i,2); 1078 topLayout->addWidget(timeLabelsFont->button(),i,2);
1076 ++i; 1079 ++i;
1077 1080
1078 1081
1079 timeLabelsFont = 1082 timeLabelsFont =
1080 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1083 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1081 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1084 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1082 topLayout->addWidget(timeLabelsFont->label(),i,0); 1085 topLayout->addWidget(timeLabelsFont->label(),i,0);
1083 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1086 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1084 topLayout->addWidget(timeLabelsFont->button(),i,2); 1087 topLayout->addWidget(timeLabelsFont->button(),i,2);
1085 ++i; 1088 ++i;
1086 1089
1087 KPrefsDialogWidFont *timeBarFont = 1090 KPrefsDialogWidFont *timeBarFont =
1088 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1091 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1089 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1092 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1090 topLayout->addWidget(timeBarFont->label(),i,0); 1093 topLayout->addWidget(timeBarFont->label(),i,0);
1091 topLayout->addWidget(timeBarFont->preview(),i,1); 1094 topLayout->addWidget(timeBarFont->preview(),i,1);
1092 topLayout->addWidget(timeBarFont->button(),i,2); 1095 topLayout->addWidget(timeBarFont->button(),i,2);
1093 ++i; 1096 ++i;
1094 1097
1095 1098
1096 KPrefsDialogWidFont *marcusBainsFont = 1099 KPrefsDialogWidFont *marcusBainsFont =
1097 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1100 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1098 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1101 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1099 topLayout->addWidget(marcusBainsFont->label(),i,0); 1102 topLayout->addWidget(marcusBainsFont->label(),i,0);
1100 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1103 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1101 topLayout->addWidget(marcusBainsFont->button(),i,2); 1104 topLayout->addWidget(marcusBainsFont->button(),i,2);
1102 ++i; 1105 ++i;
1103 1106
1104 tVFont = 1107 tVFont =
1105 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1108 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1106 &(KOPrefs::instance()->mEventViewFont),topFrame); 1109 &(KOPrefs::instance()->mEventViewFont),topFrame);
1107 topLayout->addWidget(tVFont->label(),i,0); 1110 topLayout->addWidget(tVFont->label(),i,0);
1108 topLayout->addWidget(tVFont->preview(),i,1); 1111 topLayout->addWidget(tVFont->preview(),i,1);
1109 topLayout->addWidget(tVFont->button(),i,2); 1112 topLayout->addWidget(tVFont->button(),i,2);
1110 ++i; 1113 ++i;
1111 1114
1112 1115
1113 1116
1114 tVFont = 1117 tVFont =
1115 addWidFont(i18n("Details"),i18n("EditorBox:"), 1118 addWidFont(i18n("Details"),i18n("EditorBox:"),
1116 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1119 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1117 topLayout->addWidget(tVFont->label(),i,0); 1120 topLayout->addWidget(tVFont->label(),i,0);
1118 topLayout->addWidget(tVFont->preview(),i,1); 1121 topLayout->addWidget(tVFont->preview(),i,1);
1119 topLayout->addWidget(tVFont->button(),i,2); 1122 topLayout->addWidget(tVFont->button(),i,2);
1120 ++i; 1123 ++i;
1121 1124
1122 1125
1123 1126
1124 topLayout->setColStretch(1,1); 1127 topLayout->setColStretch(1,1);
1125 topLayout->setRowStretch(4,1); 1128 topLayout->setRowStretch(4,1);
1126 1129
1127 1130
1128 i = 0; 1131 i = 0;
1129 topFrame = addPage(i18n("View Fonts"),0, 1132 topFrame = addPage(i18n("View Fonts"),0,
1130 DesktopIcon("fonts",KIcon::SizeMedium)); 1133 DesktopIcon("fonts",KIcon::SizeMedium));
1131 1134
1132 topLayout = new QGridLayout(topFrame,7,3); 1135 topLayout = new QGridLayout(topFrame,7,3);
1133 topLayout->setSpacing(1); 1136 topLayout->setSpacing(1);
1134 topLayout->setMargin(3); 1137 topLayout->setMargin(3);
1135 1138
1136 tVFont = 1139 tVFont =
1137 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1140 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1138 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1141 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1139 topLayout->addWidget(tVFont->label(),i,0); 1142 topLayout->addWidget(tVFont->label(),i,0);
1140 topLayout->addWidget(tVFont->preview(),i,1); 1143 topLayout->addWidget(tVFont->preview(),i,1);
1141 topLayout->addWidget(tVFont->button(),i,2); 1144 topLayout->addWidget(tVFont->button(),i,2);
1142 ++i; 1145 ++i;
1143 KPrefsDialogWidFont *agendaViewFont = 1146 KPrefsDialogWidFont *agendaViewFont =
1144 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1147 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1145 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1148 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1146 topLayout->addWidget(agendaViewFont->label(),i,0); 1149 topLayout->addWidget(agendaViewFont->label(),i,0);
1147 topLayout->addWidget(agendaViewFont->preview(),i,1); 1150 topLayout->addWidget(agendaViewFont->preview(),i,1);
1148 topLayout->addWidget(agendaViewFont->button(),i,2); 1151 topLayout->addWidget(agendaViewFont->button(),i,2);
1149 ++i; 1152 ++i;
1150 1153
1151 1154
1152 KPrefsDialogWidFont *monthViewFont = 1155 KPrefsDialogWidFont *monthViewFont =
1153 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1156 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1154 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1157 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1155 topLayout->addWidget(monthViewFont->label(),i,0); 1158 topLayout->addWidget(monthViewFont->label(),i,0);
1156 topLayout->addWidget(monthViewFont->preview(),i,1); 1159 topLayout->addWidget(monthViewFont->preview(),i,1);
1157 topLayout->addWidget(monthViewFont->button(),i,2); 1160 topLayout->addWidget(monthViewFont->button(),i,2);
1158 ++i; 1161 ++i;
1159 1162
1160 1163
1161 KPrefsDialogWidFont *lVFont = 1164 KPrefsDialogWidFont *lVFont =
1162 addWidFont(i18n("Event"),i18n("List View:"), 1165 addWidFont(i18n("Event"),i18n("List View:"),
1163 &(KOPrefs::instance()->mListViewFont),topFrame); 1166 &(KOPrefs::instance()->mListViewFont),topFrame);
1164 topLayout->addWidget(lVFont->label(),i,0); 1167 topLayout->addWidget(lVFont->label(),i,0);
1165 topLayout->addWidget(lVFont->preview(),i,1); 1168 topLayout->addWidget(lVFont->preview(),i,1);
1166 topLayout->addWidget(lVFont->button(),i,2); 1169 topLayout->addWidget(lVFont->button(),i,2);
1167 ++i; 1170 ++i;
1168 1171
1169 1172
1170 tVFont = 1173 tVFont =
1171 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1174 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1172 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1175 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1173 topLayout->addWidget(tVFont->label(),i,0); 1176 topLayout->addWidget(tVFont->label(),i,0);
1174 topLayout->addWidget(tVFont->preview(),i,1); 1177 topLayout->addWidget(tVFont->preview(),i,1);
1175 topLayout->addWidget(tVFont->button(),i,2); 1178 topLayout->addWidget(tVFont->button(),i,2);
1176 ++i; 1179 ++i;
1177 1180
1178 1181
1179 tVFont = 1182 tVFont =
1180 addWidFont(i18n("Today"),i18n("JournalView:"), 1183 addWidFont(i18n("Today"),i18n("JournalView:"),
1181 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1184 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1182 topLayout->addWidget(tVFont->label(),i,0); 1185 topLayout->addWidget(tVFont->label(),i,0);
1183 topLayout->addWidget(tVFont->preview(),i,1); 1186 topLayout->addWidget(tVFont->preview(),i,1);
1184 topLayout->addWidget(tVFont->button(),i,2); 1187 topLayout->addWidget(tVFont->button(),i,2);
1185 ++i; 1188 ++i;
1186 1189
1187 1190
1188 1191
1189 1192
1190 topLayout->setColStretch(1,1); 1193 topLayout->setColStretch(1,1);
1191 topLayout->setRowStretch(4,1); 1194 topLayout->setRowStretch(4,1);
1192 1195
1193 1196
1194 1197
1195 1198
1196} 1199}
1197 1200
1198void KOPrefsDialog::setupColorsTab() 1201void KOPrefsDialog::setupColorsTab()
1199{ 1202{
1200 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1203 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1201 // DesktopIcon("colorize",KIcon::SizeMedium)); 1204 // DesktopIcon("colorize",KIcon::SizeMedium));
1202 1205
1203 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1206 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1204 // topLayout->setSpacing(spacingHint()); 1207 // topLayout->setSpacing(spacingHint());
1205 // topLayout->setMargin(marginHint()); 1208 // topLayout->setMargin(marginHint());
1206 1209
1207 topLayout->setSpacing(2); 1210 topLayout->setSpacing(2);
1208 topLayout->setMargin(3); 1211 topLayout->setMargin(3);
1209 1212
1210 int ii = 1; 1213 int ii = 1;
1211 QGroupBox *categoryGroup ; 1214 QGroupBox *categoryGroup ;
1212 1215
1213 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1216 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1214 topFrame); 1217 topFrame);
1215 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1218 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1216 1219
1217 mCategoryCombo = new QComboBox(categoryGroup); 1220 mCategoryCombo = new QComboBox(categoryGroup);
1218 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1221 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1219 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1222 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1220 1223
1221 mCategoryButton = new KColorButton(categoryGroup); 1224 mCategoryButton = new KColorButton(categoryGroup);
1222 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1225 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1223 updateCategoryColor(); 1226 updateCategoryColor();
1224 1227
1225 1228
1226 // Holiday Color 1229 // Holiday Color
1227 1230
1228 KPrefsWidColor *holidayColor = 1231 KPrefsWidColor *holidayColor =
1229 addWidColor(i18n("Holiday color:"), 1232 addWidColor(i18n("Holiday color:"),
1230 &(KOPrefs::instance()->mHolidayColor),topFrame); 1233 &(KOPrefs::instance()->mHolidayColor),topFrame);
1231 topLayout->addWidget(holidayColor->label(),ii,0); 1234 topLayout->addWidget(holidayColor->label(),ii,0);
1232 topLayout->addWidget(holidayColor->button(),ii++,1); 1235 topLayout->addWidget(holidayColor->button(),ii++,1);
1233 1236
1234 // Highlight Color 1237 // Highlight Color
1235 KPrefsWidColor *highlightColor = 1238 KPrefsWidColor *highlightColor =
1236 addWidColor(i18n("Highlight color:"), 1239 addWidColor(i18n("Highlight color:"),
1237 &(KOPrefs::instance()->mHighlightColor),topFrame); 1240 &(KOPrefs::instance()->mHighlightColor),topFrame);
1238 topLayout->addWidget(highlightColor->label(),ii,0); 1241 topLayout->addWidget(highlightColor->label(),ii,0);
1239 topLayout->addWidget(highlightColor->button(),ii++,1); 1242 topLayout->addWidget(highlightColor->button(),ii++,1);
1240 1243
1241 // Event color 1244 // Event color
1242 KPrefsWidColor *eventColor = 1245 KPrefsWidColor *eventColor =
1243 addWidColor(i18n("Default event color:"), 1246 addWidColor(i18n("Default event color:"),
1244 &(KOPrefs::instance()->mEventColor),topFrame); 1247 &(KOPrefs::instance()->mEventColor),topFrame);
1245 topLayout->addWidget(eventColor->label(),ii,0); 1248 topLayout->addWidget(eventColor->label(),ii,0);
1246 topLayout->addWidget(eventColor->button(),ii++,1); 1249 topLayout->addWidget(eventColor->button(),ii++,1);
1247 1250
1248 // agenda view background color 1251 // agenda view background color
1249 KPrefsWidColor *agendaBgColor = 1252 KPrefsWidColor *agendaBgColor =
1250 addWidColor(i18n("Agenda view background color:"), 1253 addWidColor(i18n("Agenda view background color:"),
1251 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1254 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1252 topLayout->addWidget(agendaBgColor->label(),ii,0); 1255 topLayout->addWidget(agendaBgColor->label(),ii,0);
1253 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1256 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1254 1257
1255 // working hours color 1258 // working hours color
1256 KPrefsWidColor *workingHoursColor = 1259 KPrefsWidColor *workingHoursColor =
1257 addWidColor(i18n("Working hours color:"), 1260 addWidColor(i18n("Working hours color:"),
1258 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1261 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1259 topLayout->addWidget(workingHoursColor->label(),ii,0); 1262 topLayout->addWidget(workingHoursColor->label(),ii,0);
1260 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1263 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1261 1264
1262 KPrefsDialogWidBool *sb = 1265 KPrefsDialogWidBool *sb =
1263 addWidBool(i18n("Use colors for application:"), 1266 addWidBool(i18n("Use colors for application:"),
1264 &(KOPrefs::instance()->mUseAppColors),topFrame); 1267 &(KOPrefs::instance()->mUseAppColors),topFrame);
1265 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1268 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1266 1269
1267 ii++; 1270 ii++;
1268 KPrefsWidColor * workingHoursColor1 = 1271 KPrefsWidColor * workingHoursColor1 =
1269 addWidColor(i18n("Buttons, menus, etc.:"), 1272 addWidColor(i18n("Buttons, menus, etc.:"),
1270 &(KOPrefs::instance()->mAppColor1),topFrame); 1273 &(KOPrefs::instance()->mAppColor1),topFrame);
1271 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1274 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1272 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1275 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1273 1276
1274 KPrefsWidColor * workingHoursColor2 = 1277 KPrefsWidColor * workingHoursColor2 =
1275 addWidColor(i18n("Frames, labels, etc.:"), 1278 addWidColor(i18n("Frames, labels, etc.:"),
1276 &(KOPrefs::instance()->mAppColor2),topFrame); 1279 &(KOPrefs::instance()->mAppColor2),topFrame);
1277 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1280 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1278 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1281 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1279 1282
1280 1283
1281 1284
1282} 1285}
1283 1286
1284void KOPrefsDialog::setCategoryColor() 1287void KOPrefsDialog::setCategoryColor()
1285{ 1288{
1286 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1289 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1287} 1290}
1288 1291
1289void KOPrefsDialog::updateCategoryColor() 1292void KOPrefsDialog::updateCategoryColor()
1290{ 1293{
1291 QString cat = mCategoryCombo->currentText(); 1294 QString cat = mCategoryCombo->currentText();
1292 QColor *color = mCategoryDict.find(cat); 1295 QColor *color = mCategoryDict.find(cat);
1293 if (!color) { 1296 if (!color) {
1294 color = KOPrefs::instance()->categoryColor(cat); 1297 color = KOPrefs::instance()->categoryColor(cat);
1295 } 1298 }
1296 if (color) { 1299 if (color) {
1297 mCategoryButton->setColor(*color); 1300 mCategoryButton->setColor(*color);
1298 } 1301 }
1299} 1302}
1300 1303
1301void KOPrefsDialog::setupPrinterTab() 1304void KOPrefsDialog::setupPrinterTab()
1302{ 1305{
1303 mPrinterTab = addPage(i18n("Printing"),0, 1306 mPrinterTab = addPage(i18n("Printing"),0,
1304 DesktopIcon("fileprint",KIcon::SizeMedium)); 1307 DesktopIcon("fileprint",KIcon::SizeMedium));
1305 1308
1306 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1309 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1307 topLayout->setSpacing(spacingHint()); 1310 topLayout->setSpacing(spacingHint());
1308 topLayout->setMargin(marginHint()); 1311 topLayout->setMargin(marginHint());
1309 1312
1310 topLayout->setRowStretch(4,1); 1313 topLayout->setRowStretch(4,1);
1311} 1314}
1312 1315
1313void KOPrefsDialog::setupGroupSchedulingTab() 1316void KOPrefsDialog::setupGroupSchedulingTab()
1314{ 1317{
1315#if 0 1318#if 0
1316 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1319 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1317 DesktopIcon("personal",KIcon::SizeMedium)); 1320 DesktopIcon("personal",KIcon::SizeMedium));
1318 1321
1319 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1322 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1320 topLayout->setSpacing(spacingHint()); 1323 topLayout->setSpacing(spacingHint());
1321 topLayout->setMargin(marginHint()); 1324 topLayout->setMargin(marginHint());
1322 1325
1323#if 0 1326#if 0
1324 KPrefsWidRadios *schedulerGroup = 1327 KPrefsWidRadios *schedulerGroup =
1325 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1328 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1326 topFrame); 1329 topFrame);
1327 schedulerGroup->addRadio("Dummy"); // Only for debugging 1330 schedulerGroup->addRadio("Dummy"); // Only for debugging
1328 schedulerGroup->addRadio(i18n("Mail client")); 1331 schedulerGroup->addRadio(i18n("Mail client"));
1329 1332
1330 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1333 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1331#endif 1334#endif
1332 1335
1333 KPrefsWidRadios *sendGroup = 1336 KPrefsWidRadios *sendGroup =
1334 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1337 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1335 topFrame); 1338 topFrame);
1336 sendGroup->addRadio(i18n("Send to outbox")); 1339 sendGroup->addRadio(i18n("Send to outbox"));
1337 sendGroup->addRadio(i18n("Send directly")); 1340 sendGroup->addRadio(i18n("Send directly"));
1338 1341
1339 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1342 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1340 1343
1341 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1344 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1342 mAMails = new QListView(topFrame); 1345 mAMails = new QListView(topFrame);
1343 mAMails->addColumn(i18n("Email"),300); 1346 mAMails->addColumn(i18n("Email"),300);
1344 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1347 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1345 1348
1346 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1349 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1347 aEmailsEdit = new QLineEdit(topFrame); 1350 aEmailsEdit = new QLineEdit(topFrame);
1348 aEmailsEdit->setEnabled(false); 1351 aEmailsEdit->setEnabled(false);
1349 topLayout->addWidget(aEmailsEdit,4,1); 1352 topLayout->addWidget(aEmailsEdit,4,1);
1350 1353
1351 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1354 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1352 topLayout->addWidget(add,5,0); 1355 topLayout->addWidget(add,5,0);
1353 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1356 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1354 topLayout->addWidget(del,5,1); 1357 topLayout->addWidget(del,5,1);
1355 1358
1356 //topLayout->setRowStretch(2,1); 1359 //topLayout->setRowStretch(2,1);
1357 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1360 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1358 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1361 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1359 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1362 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1360 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1363 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1361#endif 1364#endif
1362} 1365}
1363 1366
1364void KOPrefsDialog::setupGroupAutomationTab() 1367void KOPrefsDialog::setupGroupAutomationTab()
1365{ 1368{
1366 return; 1369 return;
1367 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1370 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1368 DesktopIcon("personal",KIcon::SizeMedium)); 1371 DesktopIcon("personal",KIcon::SizeMedium));
1369 1372
1370 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1373 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1371 topLayout->setSpacing(spacingHint()); 1374 topLayout->setSpacing(spacingHint());
1372 topLayout->setMargin(marginHint()); 1375 topLayout->setMargin(marginHint());
1373 1376
1374 KPrefsWidRadios *autoRefreshGroup = 1377 KPrefsWidRadios *autoRefreshGroup =
1375 addWidRadios(i18n("Auto Send Refresh"), 1378 addWidRadios(i18n("Auto Send Refresh"),
1376 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1379 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1377 autoRefreshGroup->addRadio(i18n("Never")); 1380 autoRefreshGroup->addRadio(i18n("Never"));
1378 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1381 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1379 //autoRefreshGroup->addRadio(i18n("selected emails")); 1382 //autoRefreshGroup->addRadio(i18n("selected emails"));
1380 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1383 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1381 1384
1382 KPrefsWidRadios *autoInsertGroup = 1385 KPrefsWidRadios *autoInsertGroup =
1383 addWidRadios(i18n("Auto Insert IMIP Replies"), 1386 addWidRadios(i18n("Auto Insert IMIP Replies"),
1384 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1387 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1385 autoInsertGroup->addRadio(i18n("Never")); 1388 autoInsertGroup->addRadio(i18n("Never"));
1386 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1389 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1387 //autoInsertGroup->addRadio(i18n("selected emails")); 1390 //autoInsertGroup->addRadio(i18n("selected emails"));
1388 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1391 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1389 1392
1390 KPrefsWidRadios *autoRequestGroup = 1393 KPrefsWidRadios *autoRequestGroup =
1391 addWidRadios(i18n("Auto Insert IMIP Requests"), 1394 addWidRadios(i18n("Auto Insert IMIP Requests"),
1392 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1395 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1393 autoRequestGroup->addRadio(i18n("Never")); 1396 autoRequestGroup->addRadio(i18n("Never"));
1394 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1397 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1395 //autoInsertGroup->addRadio(i18n("selected emails")); 1398 //autoInsertGroup->addRadio(i18n("selected emails"));
1396 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1399 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1397 1400
1398 KPrefsWidRadios *autoFreeBusyGroup = 1401 KPrefsWidRadios *autoFreeBusyGroup =
1399 addWidRadios(i18n("Auto Send FreeBusy Information"), 1402 addWidRadios(i18n("Auto Send FreeBusy Information"),
1400 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1403 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1401 autoFreeBusyGroup->addRadio(i18n("Never")); 1404 autoFreeBusyGroup->addRadio(i18n("Never"));
1402 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1405 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1403 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1406 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1404 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1407 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1405 1408
1406 KPrefsWidRadios *autoFreeBusyReplyGroup = 1409 KPrefsWidRadios *autoFreeBusyReplyGroup =
1407 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1410 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1408 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1411 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1409 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1412 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1410 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1413 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1411 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1414 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1412 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1415 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1413} 1416}
1414 1417
1415void KOPrefsDialog::showPrinterTab() 1418void KOPrefsDialog::showPrinterTab()
1416{ 1419{
1417 showPage(pageIndex(mPrinterTab)); 1420 showPage(pageIndex(mPrinterTab));
1418} 1421}
1419 1422
1420 1423
1421void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1424void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1422 const QStringList *tags) 1425 const QStringList *tags)
1423{ 1426{
1424 if (tags) { 1427 if (tags) {
1425 int i = tags->findIndex(text); 1428 int i = tags->findIndex(text);
1426 if (i > 0) combo->setCurrentItem(i); 1429 if (i > 0) combo->setCurrentItem(i);
1427 } else { 1430 } else {
1428 for(int i=0;i<combo->count();++i) { 1431 for(int i=0;i<combo->count();++i) {
1429 if (combo->text(i) == text) { 1432 if (combo->text(i) == text) {
1430 combo->setCurrentItem(i); 1433 combo->setCurrentItem(i);
1431 break; 1434 break;
1432 } 1435 }
1433 } 1436 }
1434 } 1437 }
1435} 1438}
1436 1439
1437void KOPrefsDialog::usrReadConfig() 1440void KOPrefsDialog::usrReadConfig()
1438{ 1441{
1439 mNameEdit->setText(KOPrefs::instance()->fullName()); 1442 mNameEdit->setText(KOPrefs::instance()->fullName());
1440 mEmailEdit->setText(KOPrefs::instance()->email()); 1443 mEmailEdit->setText(KOPrefs::instance()->email());
1441 1444
1442 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1445 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1443 QDate current ( 2001, 1,1); 1446 QDate current ( 2001, 1,1);
1444 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1447 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1445 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1448 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1446 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1449 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1447 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1450 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1448 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1451 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1449 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1452 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1450 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1453 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1451 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1454 // if (KOPrefs::instance()->mAllDaySize > 47 )
1452 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1455 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1453 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1456 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1454 1457
1455 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1458 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1456 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1459 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1457 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1460 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1458 // mAMails->clear(); 1461 // mAMails->clear();
1459 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1462 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1460// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1463// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1461// QListViewItem *item = new QListViewItem(mAMails); 1464// QListViewItem *item = new QListViewItem(mAMails);
1462// item->setText(0,*it); 1465// item->setText(0,*it);
1463// mAMails->insertItem(item); 1466// mAMails->insertItem(item);
1464// } 1467// }
1465 1468
1466 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1469 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1467 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1470 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1468 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1471 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1469 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1472 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1470 1473
1471 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1474 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1472 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1475 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1473 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1476 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1474 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1477 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1475 dummy = KOPrefs::instance()->mUserDateFormatShort; 1478 dummy = KOPrefs::instance()->mUserDateFormatShort;
1476 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1479 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1477 updateCategories(); 1480 updateCategories();
1478 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1481 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1479 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1482 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1480 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1483 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1481 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1484 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1482} 1485}
1483 1486
1484 1487
1485void KOPrefsDialog::usrWriteConfig() 1488void KOPrefsDialog::usrWriteConfig()
1486{ 1489{
1487 1490
1488 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1491 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1489 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1492 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1490 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1493 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1491 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1494 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1492 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1495 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1493 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1496 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1494 1497
1495 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1498 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1496 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1499 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1497 KOPrefs::instance()->setFullName(mNameEdit->text()); 1500 KOPrefs::instance()->setFullName(mNameEdit->text());
1498 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1501 KOPrefs::instance()->setEmail(mEmailEdit->text());
1499 1502
1500 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1503 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1501 1504
1502 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1505 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1503 QDate date; 1506 QDate date;
1504 date = mStartDateSavingEdit->date(); 1507 date = mStartDateSavingEdit->date();
1505 int sub = 0; 1508 int sub = 0;
1506 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1509 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1507 sub = 1; 1510 sub = 1;
1508 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1511 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1509 date = mEndDateSavingEdit->date(); 1512 date = mEndDateSavingEdit->date();
1510 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1513 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1511 sub = 1; 1514 sub = 1;
1512 else 1515 else
1513 sub = 0; 1516 sub = 0;
1514 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1517 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1515 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1518 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1516 1519
1517 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1520 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1518 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1521 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1519 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1522 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1520 1523
1521 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1524 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1522 1525
1523 QDictIterator<QColor> it(mCategoryDict); 1526 QDictIterator<QColor> it(mCategoryDict);
1524 while (it.current()) { 1527 while (it.current()) {
1525 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1528 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1526 ++it; 1529 ++it;
1527 } 1530 }
1528 1531
1529 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1532 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1530 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1533 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1531 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1534 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1532 1535
1533 KOPrefs::instance()->mAdditionalMails.clear(); 1536 KOPrefs::instance()->mAdditionalMails.clear();
1534 // QListViewItem *item; 1537 // QListViewItem *item;
1535 // item = mAMails->firstChild(); 1538 // item = mAMails->firstChild();
1536 // while (item) 1539 // while (item)
1537 // { 1540 // {
1538 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1541 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1539 // item = item->nextSibling(); 1542 // item = item->nextSibling();
1540 // } 1543 // }
1541 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1544 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1542 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1545 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1543 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1546 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1544 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1547 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1545 1548
1546} 1549}
1547 1550
1548void KOPrefsDialog::updateCategories() 1551void KOPrefsDialog::updateCategories()
1549{ 1552{
1550 mCategoryCombo->clear(); 1553 mCategoryCombo->clear();
1551 mCategoryDict.clear(); 1554 mCategoryDict.clear();
1552 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1555 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1553 updateCategoryColor(); 1556 updateCategoryColor();
1554} 1557}
1555 1558
1556void KOPrefsDialog::warningGroupScheduling() 1559void KOPrefsDialog::warningGroupScheduling()
1557{ 1560{
1558 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1561 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1559} 1562}
1560 1563
1561void KOPrefsDialog::warningProjectView() 1564void KOPrefsDialog::warningProjectView()
1562{ 1565{
1563 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1566 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1564} 1567}
1565 1568
1566void KOPrefsDialog::warningExperimental(bool on) 1569void KOPrefsDialog::warningExperimental(bool on)
1567{ 1570{
1568 if (on) { 1571 if (on) {
1569 KMessageBox::information(this,i18n("This is an experimental feature. " 1572 KMessageBox::information(this,i18n("This is an experimental feature. "
1570 "It may not work, it may do nothing useful and it may cause data loss. " 1573 "It may not work, it may do nothing useful and it may cause data loss. "
1571 "Use with care.\n" 1574 "Use with care.\n"
1572 "You have to restart KOrganizer for this setting to take effect.")); 1575 "You have to restart KOrganizer for this setting to take effect."));
1573 } else { 1576 } else {
1574 KMessageBox::information(this, 1577 KMessageBox::information(this,
1575 i18n("You have to restart KOrganizer for this setting to take effect.")); 1578 i18n("You have to restart KOrganizer for this setting to take effect."));
1576 } 1579 }
1577} 1580}
1578 1581
1579void KOPrefsDialog::toggleEmailSettings(bool on) 1582void KOPrefsDialog::toggleEmailSettings(bool on)
1580{ 1583{
1581 if (on) { 1584 if (on) {
1582 mEmailEdit->setEnabled(false); 1585 mEmailEdit->setEnabled(false);
1583 mNameEdit->setEnabled(false); 1586 mNameEdit->setEnabled(false);
1584 mEmailLabel->setEnabled(false); 1587 mEmailLabel->setEnabled(false);
1585 mNameLabel->setEnabled(false); 1588 mNameLabel->setEnabled(false);
1586 1589
1587 KEMailSettings settings; 1590 KEMailSettings settings;
1588 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1591 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1589 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1592 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1590 } else { 1593 } else {
1591 mEmailEdit->setEnabled(true); 1594 mEmailEdit->setEnabled(true);
1592 mNameEdit->setEnabled(true); 1595 mNameEdit->setEnabled(true);
1593 mEmailLabel->setEnabled(true); 1596 mEmailLabel->setEnabled(true);
1594 mNameLabel->setEnabled(true); 1597 mNameLabel->setEnabled(true);
1595 } 1598 }
1596} 1599}
1597 1600
1598void KOPrefsDialog::addItem() 1601void KOPrefsDialog::addItem()
1599{ 1602{
1600 // aEmailsEdit->setEnabled(true); 1603 // aEmailsEdit->setEnabled(true);
1601// QListViewItem *item = new QListViewItem(mAMails); 1604// QListViewItem *item = new QListViewItem(mAMails);
1602// mAMails->insertItem(item); 1605// mAMails->insertItem(item);
1603// mAMails->setSelected(item,true); 1606// mAMails->setSelected(item,true);
1604// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1607// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1605} 1608}
1606 1609
1607void KOPrefsDialog::removeItem() 1610void KOPrefsDialog::removeItem()
1608{ 1611{
1609// QListViewItem *item; 1612// QListViewItem *item;
1610// item = mAMails->selectedItem(); 1613// item = mAMails->selectedItem();
1611// if (!item) return; 1614// if (!item) return;
1612// mAMails->takeItem(item); 1615// mAMails->takeItem(item);
1613// item = mAMails->selectedItem(); 1616// item = mAMails->selectedItem();
1614// if (!item) { 1617// if (!item) {
1615// aEmailsEdit->setText(""); 1618// aEmailsEdit->setText("");
1616// aEmailsEdit->setEnabled(false); 1619// aEmailsEdit->setEnabled(false);
1617// } 1620// }
1618// if (mAMails->childCount() == 0) { 1621// if (mAMails->childCount() == 0) {
1619// aEmailsEdit->setEnabled(false); 1622// aEmailsEdit->setEnabled(false);
1620// } 1623// }
1621} 1624}
1622 1625
1623void KOPrefsDialog::updateItem() 1626void KOPrefsDialog::updateItem()
1624{ 1627{
1625 // QListViewItem *item; 1628 // QListViewItem *item;
1626// item = mAMails->selectedItem(); 1629// item = mAMails->selectedItem();
1627// if (!item) return; 1630// if (!item) return;
1628// item->setText(0,aEmailsEdit->text()); 1631// item->setText(0,aEmailsEdit->text());
1629} 1632}
1630 1633
1631void KOPrefsDialog::updateInput() 1634void KOPrefsDialog::updateInput()
1632{ 1635{
1633// QListViewItem *item; 1636// QListViewItem *item;
1634// item = mAMails->selectedItem(); 1637// item = mAMails->selectedItem();
1635// if (!item) return; 1638// if (!item) return;
1636// aEmailsEdit->setEnabled(true); 1639// aEmailsEdit->setEnabled(true);
1637// aEmailsEdit->setText(item->text(0)); 1640// aEmailsEdit->setText(item->text(0));
1638} 1641}
1639void KOPrefsDialog::updateTimezoneOffset( int index ) 1642void KOPrefsDialog::updateTimezoneOffset( int index )
1640{ 1643{
1641 /* 1644 /*
1642 qDebug("updateTimezoneOffset %d ", index); 1645 qDebug("updateTimezoneOffset %d ", index);
1643 if ( index < 24 ) { 1646 if ( index < 24 ) {
1644 mTimezoneOffsetSpin->setEnabled ( false ); 1647 mTimezoneOffsetSpin->setEnabled ( false );
1645 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); 1648 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1646 1649
1647 1650
1648 } else { 1651 } else {
1649 if ( index == 24 ) { 1652 if ( index == 24 ) {
1650 mTimezoneOffsetSpin->setEnabled ( true ); 1653 mTimezoneOffsetSpin->setEnabled ( true );
1651 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1654 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1652 1655
1653 } else { 1656 } else {
1654 mTimezoneOffsetSpin->setEnabled ( false ); 1657 mTimezoneOffsetSpin->setEnabled ( false );
1655 mTimezoneOffsetSpin->setValue( 0 ); 1658 mTimezoneOffsetSpin->setValue( 0 );
1656 } 1659 }
1657 } 1660 }
1658 */ 1661 */
1659} 1662}
1660 1663
1661void KOPrefsDialog::setupTimeZoneTab() 1664void KOPrefsDialog::setupTimeZoneTab()
1662{ 1665{
1663 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1666 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1664 // DesktopIcon("clock",KIcon::SizeMedium)); 1667 // DesktopIcon("clock",KIcon::SizeMedium));
1665 1668
1666 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1669 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1667 topLayout->setSpacing(spacingHint()); 1670 topLayout->setSpacing(spacingHint());
1668 topLayout->setMargin(marginHint()); 1671 topLayout->setMargin(marginHint());
1669 1672
1670 QHBox *timeZoneBox = new QHBox( topFrame ); 1673 QHBox *timeZoneBox = new QHBox( topFrame );
1671 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1674 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1672 1675
1673 new QLabel( i18n("Timezone:"), timeZoneBox ); 1676 new QLabel( i18n("Timezone:"), timeZoneBox );
1674 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1677 mTimeZoneCombo = new QComboBox( timeZoneBox );
1675 if ( QApplication::desktop()->width() < 300 ) { 1678 if ( QApplication::desktop()->width() < 300 ) {
1676 mTimeZoneCombo->setMaximumWidth(150); 1679 mTimeZoneCombo->setMaximumWidth(150);
1677 } 1680 }
1678 1681
1679 QStringList list; 1682 QStringList list;
1680 list = KGlobal::locale()->timeZoneList(); 1683 list = KGlobal::locale()->timeZoneList();
1681 mTimeZoneCombo->insertStringList(list); 1684 mTimeZoneCombo->insertStringList(list);
1682 1685
1683 // find the currently set time zone and select it 1686 // find the currently set time zone and select it
1684 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; 1687 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1685 int nCurrentlySet = 11; 1688 int nCurrentlySet = 11;
1686 for (int i = 0; i < mTimeZoneCombo->count(); i++) 1689 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1687 { 1690 {
1688 if (mTimeZoneCombo->text(i) == sCurrentlySet) 1691 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1689 { 1692 {
1690 nCurrentlySet = i; 1693 nCurrentlySet = i;
1691 break; 1694 break;
1692 } 1695 }
1693 } 1696 }
1694 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 1697 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1695 int iii = 1; 1698 int iii = 1;
1696 KPrefsDialogWidBool *sb = 1699 KPrefsDialogWidBool *sb =
1697 addWidBool(i18n("Timezone has daylight saving"), 1700 addWidBool(i18n("Timezone has daylight saving"),
1698 &(KOPrefs::instance()->mUseDaylightsaving),topFrame); 1701 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1699 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 1702 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1700 ++iii; 1703 ++iii;
1701 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 1704 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1702 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1705 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1703 ++iii; 1706 ++iii;
1704 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 1707 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1705 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1708 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1706 ++iii; 1709 ++iii;
1707 lab = new QLabel( i18n("Daylight start:"), topFrame ); 1710 lab = new QLabel( i18n("Daylight start:"), topFrame );
1708 topLayout->addWidget(lab, iii,0); 1711 topLayout->addWidget(lab, iii,0);
1709 mStartDateSavingEdit = new KDateEdit(topFrame); 1712 mStartDateSavingEdit = new KDateEdit(topFrame);
1710 topLayout->addWidget(mStartDateSavingEdit, iii,1); 1713 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1711 ++iii; 1714 ++iii;
1712 1715
1713 lab = new QLabel( i18n("Daylight end:"), topFrame ); 1716 lab = new QLabel( i18n("Daylight end:"), topFrame );
1714 topLayout->addWidget(lab, iii,0); 1717 topLayout->addWidget(lab, iii,0);
1715 mEndDateSavingEdit = new KDateEdit(topFrame); 1718 mEndDateSavingEdit = new KDateEdit(topFrame);
1716 topLayout->addWidget(mEndDateSavingEdit, iii,1); 1719 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1717 ++iii; 1720 ++iii;
1718 QDate current ( 2001, 1,1); 1721 QDate current ( 2001, 1,1);
1719 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1722 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1720 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1723 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1721 1724
1722 1725
1723} 1726}
1724#endif 1727#endif
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 484a635..ffb835c 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -1,146 +1,103 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#include "mailistviewitem.h" 2#include "mailistviewitem.h"
3#include <libmailwrapper/abstractmail.h> 3#include <libmailwrapper/abstractmail.h>
4#include <qtextstream.h> 4#include <qtextstream.h>
5#include <kiconloader.h> 5#include <kiconloader.h>
6#include "koprefs.h"
6//#include <qpe/resource.h> 7//#include <qpe/resource.h>
7 8
8MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) 9MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
9 :QListViewItem(parent,item),mail_data() 10 :QListViewItem(parent,item),mail_data()
10{ 11{
11} 12}
12 13
13void MailListViewItem::showEntry() 14void MailListViewItem::showEntry()
14{ 15{
15 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { 16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
16 setPixmap( 0, SmallIcon ( "kmmsgreplied") ); 17 setPixmap( 0, SmallIcon ( "kmmsgreplied") );
17 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { 18 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
18 /* I think it looks nicer if there are not such a log of icons but only on mails 19 /* I think it looks nicer if there are not such a log of icons but only on mails
19 replied or new - Alwin*/ 20 replied or new - Alwin*/
20 //setPixmap( 0,SmallIcon ("kmmsgunseen") ); 21 //setPixmap( 0,SmallIcon ("kmmsgunseen") );
21 } else { 22 } else {
22 setPixmap( 0,SmallIcon ( "kmmsgnew") ); 23 setPixmap( 0,SmallIcon ( "kmmsgnew") );
23 } 24 }
24 double s = mail_data->Msgsize(); 25 double s = mail_data->Msgsize();
25 int w = 0; 26 int w = 0;
26 s/=1024; 27 s/=1024;
27 if (s>999.0) { 28 if (s>999.0) {
28 s/=1024.0; 29 s/=1024.0;
29 ++w; 30 ++w;
30 } 31 }
31 QString fsort; 32 QString fsort;
32 fsort.sprintf( "%.2f", s ); 33 fsort.sprintf( "%.2f", s );
33 QString fsize = QString::number( s, 'f', 2 ); 34 QString fsize = QString::number( s, 'f', 2 );
34 // 1.23 35 // 1.23
35 // 11.23 36 // 11.23
36 // 111.23 37 // 111.23
37 // 999.23 maxlen 38 // 999.23 maxlen
38 switch(fsize.length() ) { 39 switch(fsize.length() ) {
39 case 4: 40 case 4:
40 fsort = "00" + fsize ; 41 fsort = "00" + fsize ;
41 break; 42 break;
42 case 5: 43 case 5:
43 fsort = "0" + fsize ; 44 fsort = "0" + fsize ;
44 break; 45 break;
45 default: 46 default:
46 fsort = fsize ; 47 fsort = fsize ;
47 break; 48 break;
48 49
49 } 50 }
50 if ( w == 0 ) { 51 if ( w == 0 ) {
51 setText(3, fsize + "kB" ); 52 setText(3, fsize + "kB" );
52 mKeyMap.insert(3, "k" + fsort); 53 mKeyMap.insert(3, "k" + fsort);
53 //setText(3, "kB" + fsort ); // test only 54 //setText(3, "kB" + fsort ); // test only
54 } else { 55 } else {
55 //setText(3, fsize + "MB"); 56 //setText(3, fsize + "MB");
56 mKeyMap.insert(3, "M" +fsort ); 57 mKeyMap.insert(3, "M" +fsort );
57 } 58 }
58 setText(1,mail_data->getSubject()); 59 setText(1,mail_data->getSubject());
59 setText(2,mail_data->getFrom()); 60 setText(2,mail_data->getFrom());
60#if 0
61 QString date = mail_data->getDate();
62
63 int kom = date.find( ",")+2;
64 if ( kom == 1 )
65 kom = 0;
66 if ( date.mid(kom,1) == " ")
67 ++kom;
68 if ( date.mid(kom+1,1) == " " )
69 date = "0" + date.mid( kom );
70 else if ( kom )
71 date = date.mid( kom );
72 if ( kom || date.mid(2,1 ) == " ") {
73 QString mon = date.mid(3,3);
74 QString so = 00;
75 if ( mon == "Jan" )
76 so = "01";
77 else if ( mon == "Feb" )
78 so = "02";
79 else if ( mon == "Mar" )
80 so = "03";
81 else if ( mon == "Apr" )
82 so = "04";
83 else if ( mon == "May" )
84 so = "05";
85 else if ( mon == "Jun" )
86 so = "06";
87 else if ( mon == "Jul" )
88 so = "07";
89 else if ( mon == "Aug" )
90 so = "08";
91 else if ( mon == "Sep" )
92 so = "09";
93 else if ( mon == "Oct" )
94 so = "10";
95 else if ( mon == "Nov" )
96 so = "11";
97 else if ( mon == "Dec" )
98 so = "12";
99 date = date.mid(7,4)+so+date.left(2)+date.mid(12,14);
100 }
101 //qDebug("insert Date %s ", date.latin1());
102 // if ( date.left(1) != "1" || date.left(1) != "2" )
103 // date = date.mid(5);
104 mKeyMap.insert(4,date);
105#endif
106 mKeyMap.insert(4,mail_data->getIsoDate()); 61 mKeyMap.insert(4,mail_data->getIsoDate());
107 setText(4,mail_data->getDate()); 62 setText(4,mail_data->getDate());
63 if ( KOPrefs::instance()->mShowToField )
64 setText(5,mail_data->To()[0]);
108} 65}
109 66
110void MailListViewItem::storeData(const RecMailP&data) 67void MailListViewItem::storeData(const RecMailP&data)
111{ 68{
112 mail_data = data; 69 mail_data = data;
113} 70}
114void MailListViewItem::setSortKey(int column,const QString &key) 71void MailListViewItem::setSortKey(int column,const QString &key)
115{ 72{
116 mKeyMap.insert(column,key); 73 mKeyMap.insert(column,key);
117} 74}
118QString MailListViewItem::key(int column, bool) const 75QString MailListViewItem::key(int column, bool) const
119{ 76{
120 // to make is fast, we use here special cases 77 // to make is fast, we use here special cases
121 if ( column == 3 || column == 4 ) { 78 if ( column == 3 || column == 4 ) {
122 return *mKeyMap.find(column); 79 return *mKeyMap.find(column);
123 } 80 }
124 if ( column == 1 ) { 81 if ( column == 1 ) {
125 if ( text(1).left(4).lower() == "re: " ) 82 if ( text(1).left(4).lower() == "re: " )
126 return text(1).mid(4); 83 return text(1).mid(4);
127 84
128 } 85 }
129 return text(column); 86 return text(column);
130 /* 87 /*
131 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 88 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
132 if (it == mKeyMap.end()) return text(column); 89 if (it == mKeyMap.end()) return text(column);
133 else return *it; 90 else return *it;
134 */ 91 */
135} 92}
136 93
137const RecMailP& MailListViewItem::data()const 94const RecMailP& MailListViewItem::data()const
138{ 95{
139 return mail_data; 96 return mail_data;
140} 97}
141 98
142MAILLIB::ATYPE MailListViewItem::wrapperType() 99MAILLIB::ATYPE MailListViewItem::wrapperType()
143{ 100{
144 if (!mail_data->Wrapper()) return MAILLIB::A_UNDEFINED; 101 if (!mail_data->Wrapper()) return MAILLIB::A_UNDEFINED;
145 return mail_data->Wrapper()->getType(); 102 return mail_data->Wrapper()->getType();
146} 103}
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 1dc374b..875ab77 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -1,355 +1,359 @@
1 1
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qvbox.h> 4#include <qvbox.h>
5#include <qheader.h> 5#include <qheader.h>
6#include <qtimer.h> 6#include <qtimer.h>
7#include <qlayout.h> 7#include <qlayout.h>
8//#include <kdialog.h> 8//#include <kdialog.h>
9#include <kiconloader.h> 9#include <kiconloader.h>
10#include <kapplication.h> 10#include <kapplication.h>
11 11
12#ifdef DESKTOP_VERSION 12#ifdef DESKTOP_VERSION
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qstatusbar.h> 14#include <qstatusbar.h>
15#include <kabc/stdaddressbook.h> 15#include <kabc/stdaddressbook.h>
16extern QStatusBar* globalSstatusBarMainWindow; 16extern QStatusBar* globalSstatusBarMainWindow;
17#else 17#else
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <klocale.h> 19#include <klocale.h>
20#endif 20#endif
21#include "defines.h" 21#include "defines.h"
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <KDGanttMinimizeSplitter.h> 23#include <KDGanttMinimizeSplitter.h>
24 24
25#include "koprefs.h" 25#include "koprefs.h"
26 26
27MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 27MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
28 : QMainWindow( parent, name ) //, flags ) 28 : QMainWindow( parent, name ) //, flags )
29{ 29{
30#ifdef DESKTOP_VERSION 30#ifdef DESKTOP_VERSION
31 globalSstatusBarMainWindow = statusBar(); 31 globalSstatusBarMainWindow = statusBar();
32#endif 32#endif
33 setCaption( i18n( "KOpieMail/Pi" ) ); 33 setCaption( i18n( "KOpieMail/Pi" ) );
34 setToolBarsMovable( false ); 34 setToolBarsMovable( false );
35 //KABC::StdAddressBook::self(); 35 //KABC::StdAddressBook::self();
36 toolBar = new QToolBar( this ); 36 toolBar = new QToolBar( this );
37 menuBar = new QPEMenuBar( toolBar ); 37 menuBar = new QPEMenuBar( toolBar );
38 mailMenu = new QPopupMenu( menuBar ); 38 mailMenu = new QPopupMenu( menuBar );
39 menuBar->insertItem( i18n( "Mail" ), mailMenu ); 39 menuBar->insertItem( i18n( "Mail" ), mailMenu );
40 settingsMenu = new QPopupMenu( menuBar ); 40 settingsMenu = new QPopupMenu( menuBar );
41 menuBar->insertItem( i18n( "Settings" ), settingsMenu ); 41 menuBar->insertItem( i18n( "Settings" ), settingsMenu );
42 42
43 addToolBar( toolBar ); 43 addToolBar( toolBar );
44 toolBar->setHorizontalStretchable( true ); 44 toolBar->setHorizontalStretchable( true );
45 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), 45 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"),
46 0, 0, this ); 46 0, 0, this );
47 connect(getMail, SIGNAL( activated() ), 47 connect(getMail, SIGNAL( activated() ),
48 SLOT( slotGetAllMail() ) ); 48 SLOT( slotGetAllMail() ) );
49 getMail->addTo( mailMenu ); 49 getMail->addTo( mailMenu );
50 50
51 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), 51 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"),
52 0, 0, this ); 52 0, 0, this );
53 getMail->addTo( toolBar ); 53 getMail->addTo( toolBar );
54 getMail->addTo( mailMenu ); 54 getMail->addTo( mailMenu );
55 connect(getMail, SIGNAL( activated() ), 55 connect(getMail, SIGNAL( activated() ),
56 SLOT( slotGetMail() ) ); 56 SLOT( slotGetMail() ) );
57 57
58 composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), 58 composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"),
59 0, 0, this ); 59 0, 0, this );
60 composeMail->addTo( toolBar ); 60 composeMail->addTo( toolBar );
61 composeMail->addTo( mailMenu ); 61 composeMail->addTo( mailMenu );
62 62
63 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , 63 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") ,
64 0, 0, this ); 64 0, 0, this );
65 sendQueued->addTo( toolBar ); 65 sendQueued->addTo( toolBar );
66 sendQueued->addTo( mailMenu ); 66 sendQueued->addTo( mailMenu );
67 67
68 /* 68 /*
69 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, 69 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC,
70 0, 0, this ); 70 0, 0, this );
71 syncFolders->addTo( toolBar ); 71 syncFolders->addTo( toolBar );
72 syncFolders->addTo( mailMenu ); 72 syncFolders->addTo( mailMenu );
73 */ 73 */
74 74
75 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , 75 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") ,
76 0, 0, this, 0, true ); 76 0, 0, this, 0, true );
77 showFolders->addTo( toolBar ); 77 showFolders->addTo( toolBar );
78 showFolders->addTo( mailMenu ); 78 showFolders->addTo( mailMenu );
79 showFolders->setOn( true ); 79 showFolders->setOn( true );
80 connect(showFolders, SIGNAL( toggled(bool) ), 80 connect(showFolders, SIGNAL( toggled(bool) ),
81 SLOT( slotShowFolders(bool) ) ); 81 SLOT( slotShowFolders(bool) ) );
82 82
83 /* 83 /*
84 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), 84 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ),
85 0, 0, this ); 85 0, 0, this );
86 searchMails->addTo( toolBar ); 86 searchMails->addTo( toolBar );
87 searchMails->addTo( mailMenu ); 87 searchMails->addTo( mailMenu );
88 */ 88 */
89 89
90 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); 90 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this);
91 deleteMails->addTo( toolBar ); 91 deleteMails->addTo( toolBar );
92 deleteMails->addTo( mailMenu ); 92 deleteMails->addTo( mailMenu );
93 connect( deleteMails, SIGNAL( activated() ), 93 connect( deleteMails, SIGNAL( activated() ),
94 SLOT( slotDeleteAllMail() ) ); 94 SLOT( slotDeleteAllMail() ) );
95 95
96 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , 96 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") ,
97 0, 0, this ); 97 0, 0, this );
98 editSettings->addTo( settingsMenu ); 98 editSettings->addTo( settingsMenu );
99 connect( editSettings, SIGNAL( activated() ), 99 connect( editSettings, SIGNAL( activated() ),
100 SLOT( slotEditSettings() ) ); 100 SLOT( slotEditSettings() ) );
101 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 101 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
102 0, 0, this ); 102 0, 0, this );
103 editAccounts->addTo( settingsMenu ); 103 editAccounts->addTo( settingsMenu );
104 codecMenu = new QPopupMenu( menuBar ); 104 codecMenu = new QPopupMenu( menuBar );
105 codecMenu->insertItem( "Western (iso-8859-1)",0,0); 105 codecMenu->insertItem( "Western (iso-8859-1)",0,0);
106 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); 106 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1);
107 codecMenu->insertItem( "Western (iso-8859-15)",2,2); 107 codecMenu->insertItem( "Western (iso-8859-15)",2,2);
108 codecMenu->insertItem( "Chinese (big-5)",3,3); 108 codecMenu->insertItem( "Chinese (big-5)",3,3);
109 codecMenu->insertItem( "Unicode (utf-8)",4,4); 109 codecMenu->insertItem( "Unicode (utf-8)",4,4);
110 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); 110 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5);
111 //disabled 111 //disabled
112 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); 112 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu);
113 //setCentralWidget( view ); 113 //setCentralWidget( view );
114 114
115 QVBox* wrapperBox = new QVBox( this ); 115 QVBox* wrapperBox = new QVBox( this );
116 setCentralWidget( wrapperBox ); 116 setCentralWidget( wrapperBox );
117 117
118 // QWidget *view = new QWidget( wrapperBox ); 118 // QWidget *view = new QWidget( wrapperBox );
119 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); 119 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox);
120 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); 120 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
121 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); 121 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
122 122
123 folderView = new AccountView( split ); 123 folderView = new AccountView( split );
124 folderView->header()->hide(); 124 folderView->header()->hide();
125 folderView->setRootIsDecorated( false ); 125 folderView->setRootIsDecorated( false );
126 folderView->addColumn( i18n( "Mailbox" ) ); 126 folderView->addColumn( i18n( "Mailbox" ) );
127 127
128 //layout->addWidget( folderView ); 128 //layout->addWidget( folderView );
129 129
130 mailView = new QListView( split ); 130 mailView = new QListView( split );
131 mailView->addColumn( i18n( " " ) ); 131 mailView->addColumn( i18n( " " ) );
132 mailView->addColumn( i18n( "Subject" ),QListView::Manual ); 132 mailView->addColumn( i18n( "Subject" ),QListView::Manual );
133 mailView->addColumn( i18n( "Sender" ),QListView::Manual ); 133 mailView->addColumn( i18n( "Sender" ),QListView::Manual );
134 mailView->addColumn( i18n( "Size" ),QListView::Manual); 134 mailView->addColumn( i18n( "Size" ),QListView::Manual);
135 mailView->addColumn( i18n( "Date" ),QListView::Manual); 135 mailView->addColumn( i18n( "Date" ),QListView::Manual);
136 if ( KOPrefs::instance()->mShowToField )
137 mailView->addColumn( i18n( "To" ),QListView::Manual);
136 mailView->setAllColumnsShowFocus(true); 138 mailView->setAllColumnsShowFocus(true);
137 //mailView->setSorting(-1); 139 //mailView->setSorting(-1);
138 mailView->setRootIsDecorated( false ); 140 mailView->setRootIsDecorated( false );
139 statusWidget = new StatusWidget( wrapperBox ); 141 statusWidget = new StatusWidget( wrapperBox );
140 statusWidget->hide(); 142 statusWidget->hide();
141 143
142 //layout->addWidget( mailView ); 144 //layout->addWidget( mailView );
143 //layout->setStretchFactor( folderView, 1 ); 145 //layout->setStretchFactor( folderView, 1 );
144 //layout->setStretchFactor( mailView, 2 ); 146 //layout->setStretchFactor( mailView, 2 );
145 147
146 slotAdjustLayout(); 148 slotAdjustLayout();
147#ifndef DESKTOP_VERSION 149#ifndef DESKTOP_VERSION
148 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 150 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
149 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 151 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
150#endif 152#endif
151 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, 153 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
152 SLOT( mailLeftClicked(QListViewItem*) ) ); 154 SLOT( mailLeftClicked(QListViewItem*) ) );
153 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, 155 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this,
154 SLOT( mailLeftClicked(QListViewItem*) ) ); 156 SLOT( mailLeftClicked(QListViewItem*) ) );
155 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 157 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
156 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); 158 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
157 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), 159 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
158 this,SLOT(refreshMailView(const QValueList<RecMailP>&))); 160 this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
159 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 161 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
160 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 162 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
161// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 163// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
162 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 164 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
163 //mailView->setMultiSelection ( true ); 165 //mailView->setMultiSelection ( true );
164 mailView->setSelectionMode( QListView::Extended ); 166 mailView->setSelectionMode( QListView::Extended );
165 QValueList<int> list; 167 QValueList<int> list;
166 int fw = 100; 168 int fw = 100;
167 if ( QApplication::desktop()->width() > 320 ) 169 if ( QApplication::desktop()->width() > 320 )
168 fw = 50; 170 fw = 50;
169 list.append( fw ); 171 list.append( fw );
170 list.append( 100 ); 172 list.append( 100 );
171 split->setSizes( list ); 173 split->setSizes( list );
172 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 174 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
173 mailView->setShowSortIndicator ( true ); 175 mailView->setShowSortIndicator ( true );
174 QLabel *spacer = new QLabel( toolBar ); 176 QLabel *spacer = new QLabel( toolBar );
175 spacer->setBackgroundMode( QWidget::PaletteButton ); 177 spacer->setBackgroundMode( QWidget::PaletteButton );
176 toolBar->setStretchableWidget( spacer ); 178 toolBar->setStretchableWidget( spacer );
177 179
178 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 180 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
179 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 181 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
180 if ( QApplication::desktop()->width() > 320 ) 182 if ( QApplication::desktop()->width() > 320 )
181 closeMail->addTo(toolBar); 183 closeMail->addTo(toolBar);
182 closeMail->addTo(mailMenu); 184 closeMail->addTo(mailMenu);
183 185
184 186
185 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 187 QPopupMenu* helpMenu = new QPopupMenu( menuBar );
186 menuBar->insertItem( i18n( "Help" ), helpMenu ); 188 menuBar->insertItem( i18n( "Help" ), helpMenu );
187 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); 189 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
188 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 190 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
189 li->addTo(helpMenu); 191 li->addTo(helpMenu);
190 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); 192 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
191 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 193 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
192 li->addTo(helpMenu); 194 li->addTo(helpMenu);
193 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); 195 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
194 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 196 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
195 li->addTo(helpMenu); 197 li->addTo(helpMenu);
196 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); 198 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) );
197 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 199 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
198#ifdef DESKTOP_VERSION 200#ifdef DESKTOP_VERSION
199 resize ( 640, 480 ); 201 resize ( 640, 480 );
200#endif 202#endif
201} 203}
202 204
203MainWindow::~MainWindow() 205MainWindow::~MainWindow()
204{ 206{
205} 207}
206 208
207void MainWindow::slotSetCodec( int codec ) 209void MainWindow::slotSetCodec( int codec )
208{ 210{
209 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); 211 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false );
210 //qDebug("codec %d ", codec); 212 //qDebug("codec %d ", codec);
211 KOPrefs::instance()->mCurrentCodec = codec; 213 KOPrefs::instance()->mCurrentCodec = codec;
212 KOPrefs::instance()->isDirty = true; 214 KOPrefs::instance()->isDirty = true;
213 QString name; 215 QString name;
214 switch ( codec ) { 216 switch ( codec ) {
215 case 0: 217 case 0:
216 name = "iso-8859-1"; 218 name = "iso-8859-1";
217 break; 219 break;
218 case 1: 220 case 1:
219 name = "iso-8859-5"; 221 name = "iso-8859-5";
220 break; 222 break;
221 case 2: 223 case 2:
222 name = "iso-8859-15"; 224 name = "iso-8859-15";
223 break; 225 break;
224 case 3: 226 case 3:
225 name = "big-5"; 227 name = "big-5";
226 break; 228 break;
227 case 4: 229 case 4:
228 name = "utf-8"; 230 name = "utf-8";
229 break; 231 break;
230 case 5: 232 case 5:
231 name = KOPrefs::instance()->mSendCodec.lower(); 233 name = KOPrefs::instance()->mSendCodec.lower();
232 break; 234 break;
233 } 235 }
234 KOPrefs::instance()->mCurrentCodeName = name ; 236 KOPrefs::instance()->mCurrentCodeName = name ;
235 codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); 237 codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")");
236 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); 238 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true );
237} 239}
238void MainWindow::showLicence() 240void MainWindow::showLicence()
239{ 241{
240 KApplication::showLicence(); 242 KApplication::showLicence();
241} 243}
242void MainWindow::showAbout() 244void MainWindow::showAbout()
243{ 245{
244 QString version; 246 QString version;
245#include <../version> 247#include <../version>
246 248
247 QString cap = "About KOpieMail/Pi"; 249 QString cap = "About KOpieMail/Pi";
248 QString text =i18n("KOpieMail/Platform-independent\n") + 250 QString text =i18n("KOpieMail/Platform-independent\n") +
249 "(OM/Pi) " + version + " - " 251 "(OM/Pi) " + version + " - "
250 252
251#ifdef DESKTOP_VERSION 253#ifdef DESKTOP_VERSION
252 "Desktop Edition\n" 254 "Desktop Edition\n"
253#else 255#else
254 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" 256 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n"
255#endif 257#endif
256 "www.pi-sync.net\n\n" 258 "www.pi-sync.net\n\n"
257 259
258 260
259 261
260"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" 262"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n"
261 "KOpieMail/Pi is based on Opie Mail\n" 263 "KOpieMail/Pi is based on Opie Mail\n"
262 "Copyright (c) Rajko Albrecht and the Opie team\n" 264 "Copyright (c) Rajko Albrecht and the Opie team\n"
263 "KOpieMail/Pi is licensed under the GPL\n" 265 "KOpieMail/Pi is licensed under the GPL\n"
264 "\n" 266 "\n"
265 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" 267 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
266 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" 268 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
267 "libEtPan has its own licence - see LibEtPan licence\n"; 269 "libEtPan has its own licence - see LibEtPan licence\n";
268 270
269 KApplication::showText( cap, text ); 271 KApplication::showText( cap, text );
270} 272}
271void MainWindow::showEtpanLicence() 273void MainWindow::showEtpanLicence()
272{ 274{
273 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); 275 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
274 276
275} 277}
276void MainWindow::appMessage(const QCString &, const QByteArray &) 278void MainWindow::appMessage(const QCString &, const QByteArray &)
277{ 279{
278 qDebug("appMessage implemented by subclass"); 280 qDebug("appMessage implemented by subclass");
279} 281}
280 282
281void MainWindow::slotAdjustLayout() { 283void MainWindow::slotAdjustLayout() {
282 284
283 /* 285 /*
284 QWidget *d = QApplication::desktop(); 286 QWidget *d = QApplication::desktop();
285 287
286 if ( d->width() < d->height() ) { 288 if ( d->width() < d->height() ) {
287 layout->setDirection( QBoxLayout::TopToBottom ); 289 layout->setDirection( QBoxLayout::TopToBottom );
288 } else { 290 } else {
289 layout->setDirection( QBoxLayout::LeftToRight ); 291 layout->setDirection( QBoxLayout::LeftToRight );
290 } 292 }
291 */ 293 */
292} 294}
293 295
294void MainWindow::slotAdjustColumns() 296void MainWindow::slotAdjustColumns()
295{ 297{
296 bool hidden = folderView->isHidden(); 298 bool hidden = folderView->isHidden();
297 if ( hidden ) folderView->show(); 299 if ( hidden ) folderView->show();
298 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 300 folderView->setColumnWidth( 0, folderView->visibleWidth() );
299 if ( hidden ) folderView->hide(); 301 if ( hidden ) folderView->hide();
300 302
301 mailView->setColumnWidth( 0, 10 ); 303 mailView->setColumnWidth( 0, 10 );
302 mailView->setColumnWidth( 1, 100 ); 304 mailView->setColumnWidth( 1, 100 );
303 mailView->setColumnWidth( 2, 100 ); 305 mailView->setColumnWidth( 2, 100 );
304 mailView->setColumnWidth( 3, 50 ); 306 mailView->setColumnWidth( 3, 50 );
305 mailView->setColumnWidth( 4, 120 ); 307 mailView->setColumnWidth( 4, 120 );
308 if ( KOPrefs::instance()->mShowToField )
309 mailView->setColumnWidth( 5, 100 );
306} 310}
307 311
308void MainWindow::slotEditSettings() 312void MainWindow::slotEditSettings()
309{ 313{
310} 314}
311 315
312void MainWindow::slotShowFolders( bool ) 316void MainWindow::slotShowFolders( bool )
313{ 317{
314 qDebug("not implemented: "); 318 qDebug("not implemented: ");
315} 319}
316 320
317void MainWindow::refreshMailView(const QValueList<RecMailP>&) 321void MainWindow::refreshMailView(const QValueList<RecMailP>&)
318{ 322{
319 qDebug("not implemented: "); 323 qDebug("not implemented: ");
320} 324}
321 325
322void MainWindow::mailLeftClicked(QListViewItem * ) 326void MainWindow::mailLeftClicked(QListViewItem * )
323{ 327{
324 qDebug("not implemented: "); 328 qDebug("not implemented: ");
325} 329}
326 330
327void MainWindow::displayMail() 331void MainWindow::displayMail()
328{ 332{
329 qDebug("not implemented: "); 333 qDebug("not implemented: ");
330} 334}
331 335
332void MainWindow::slotDeleteMail() 336void MainWindow::slotDeleteMail()
333{ 337{
334 qDebug("not implemented: "); 338 qDebug("not implemented: ");
335} 339}
336 340
337void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) 341void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
338{ 342{
339 qDebug("not implemented: "); 343 qDebug("not implemented: ");
340} 344}
341 345
342void MainWindow::slotSendQueued() 346void MainWindow::slotSendQueued()
343{ 347{
344 qDebug("not implemented: "); 348 qDebug("not implemented: ");
345} 349}
346 350
347void MainWindow::slotEditAccounts() 351void MainWindow::slotEditAccounts()
348{ 352{
349 qDebug("not implemented: "); 353 qDebug("not implemented: ");
350} 354}
351 355
352void MainWindow::slotComposeMail() 356void MainWindow::slotComposeMail()
353{ 357{
354 qDebug("not implemented: "); 358 qDebug("not implemented: ");
355} 359}
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 915b3e8..6e54bf4 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,587 +1,602 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3 3
4
5#define protected public
6#include <qwidget.h>
7#undef protected
4#include "koprefsdialog.h" 8#include "koprefsdialog.h"
5#include <kapplication.h> 9#include <kapplication.h>
6#include <libkdepim/externalapphandler.h> 10#include <libkdepim/externalapphandler.h>
7#include <libkdepim/kpimglobalprefs.h> 11#include <libkdepim/kpimglobalprefs.h>
8#ifdef MINIKDE_KDIALOG_H 12#ifdef MINIKDE_KDIALOG_H
9#undef MINIKDE_KDIALOG_H 13#undef MINIKDE_KDIALOG_H
10#endif 14#endif
11#include "settingsdialog.h" 15#include "settingsdialog.h"
12#include "opiemail.h" 16#include "opiemail.h"
13#include "editaccounts.h" 17#include "editaccounts.h"
14#include "composemail.h" 18#include "composemail.h"
15#include "mailistviewitem.h" 19#include "mailistviewitem.h"
16#include "viewmail.h" 20#include "viewmail.h"
17#include "selectstore.h" 21#include "selectstore.h"
18#include "selectsmtp.h" 22#include "selectsmtp.h"
19#include "accountitem.h" 23#include "accountitem.h"
20#include "klocale.h" 24#include "klocale.h"
21 25
22#include <qmessagebox.h> 26#include <qmessagebox.h>
23#include <qtimer.h> 27#include <qtimer.h>
24#include <qcursor.h> 28#include <qcursor.h>
29#include <qtextbrowser.h>
25#include <qregexp.h> 30#include <qregexp.h>
26#include <qpe/global.h> 31#include <qpe/global.h>
27 32
28#ifdef DESKTOP_VERSION 33#ifdef DESKTOP_VERSION
29#include <qapplication.h> 34#include <qapplication.h>
30#else 35#else
31#include <qpe/qpeapplication.h> 36#include <qpe/qpeapplication.h>
32#endif 37#endif
33#include <libmailwrapper/smtpwrapper.h> 38#include <libmailwrapper/smtpwrapper.h>
34#include <libmailwrapper/mailtypes.h> 39#include <libmailwrapper/mailtypes.h>
35#include <libmailwrapper/abstractmail.h> 40#include <libmailwrapper/abstractmail.h>
36#include "koprefs.h" 41#include "koprefs.h"
37 42
38//using namespace Opie::Core; 43//using namespace Opie::Core;
39 44
40OpieMail::OpieMail( QWidget *parent, const char *name ) 45OpieMail::OpieMail( QWidget *parent, const char *name )
41 : MainWindow( parent, name) //, WStyle_ContextHelp ) 46 : MainWindow( parent, name) //, WStyle_ContextHelp )
42{ 47{
43 settings = new Settings(); 48 settings = new Settings();
44 49 tb = 0;
45 setIcon(SmallIcon( "kmicromail" ) ); 50 setIcon(SmallIcon( "kmicromail" ) );
46 folderView->populate( settings->getAccounts() ); 51 folderView->populate( settings->getAccounts() );
47 52
48} 53}
49 54
50OpieMail::~OpieMail() 55OpieMail::~OpieMail()
51{ 56{
52 if (settings) delete settings; 57 if (settings) delete settings;
58 if ( tb )
59 delete tb;
53} 60}
54 61
55void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 62void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
56{ 63{
57 64
58} 65}
59#include <stdlib.h> 66#include <stdlib.h>
60void OpieMail::message(const QCString &msg, const QByteArray &data) 67void OpieMail::message(const QCString &msg, const QByteArray &data)
61{ 68{
62 // copied from old mail2 69 // copied from old mail2
63 static int ii = 0; 70 static int ii = 0;
64 //qDebug("QCOP CALL ############################# %d ", ii); 71 //qDebug("QCOP CALL ############################# %d ", ii);
65 //QString mess ( msg ); 72 //QString mess ( msg );
66 //qDebug("Message = %s ",mess.latin1()); 73 //qDebug("Message = %s ",mess.latin1());
67 ++ii; 74 ++ii;
68 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 75 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
69 76
70 mPendingEmail = QString::null; 77 mPendingEmail = QString::null;
71 mPendingName = QString::null; 78 mPendingName = QString::null;
72 if (msg == "writeMail(QString,QString)") 79 if (msg == "writeMail(QString,QString)")
73 { 80 {
74 //qDebug("writeMail(QString,QString) "); 81 //qDebug("writeMail(QString,QString) ");
75 QDataStream stream(data,IO_ReadOnly); 82 QDataStream stream(data,IO_ReadOnly);
76 stream >> mPendingName >> mPendingEmail; 83 stream >> mPendingName >> mPendingEmail;
77 // removing the whitespaces at beginning and end is needed! 84 // removing the whitespaces at beginning and end is needed!
78 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 85 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
79 } 86 }
80 else if (msg == "newMail()") 87 else if (msg == "newMail()")
81 { 88 {
82 //qDebug("slotComposeMail() "); 89 //qDebug("slotComposeMail() ");
83 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call 90 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call
84 // and a QCOP call does not like a processevents in his execution 91 // and a QCOP call does not like a processevents in his execution
85 // with the Qtimer we call slotComposeMail() after we reached the main event loop 92 // with the Qtimer we call slotComposeMail() after we reached the main event loop
86 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 93 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
87 // slotComposeMail(); 94 // slotComposeMail();
88 } 95 }
89 else if (msg == "newMail(QString)") 96 else if (msg == "newMail(QString)")
90 { 97 {
91 //qDebug(" newMail(QString)"); 98 //qDebug(" newMail(QString)");
92 QDataStream stream(data,IO_ReadOnly); 99 QDataStream stream(data,IO_ReadOnly);
93 stream >> mPendingName; 100 stream >> mPendingName;
94 // the format is 101 // the format is
95 // NAME <EMAIL>:SUBJECT 102 // NAME <EMAIL>:SUBJECT
96 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 103 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
97 } else { 104 } else {
98 mPendingData = data; 105 mPendingData = data;
99 mPendingMessage = msg; 106 mPendingMessage = msg;
100 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); 107 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
101 } 108 }
102 109
103 //qDebug("END OpieMail::message "); 110 //qDebug("END OpieMail::message ");
104} 111}
105void OpieMail::slotExtAppHandler() 112void OpieMail::slotExtAppHandler()
106{ 113{
107 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); 114 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData );
108} 115}
109void OpieMail::slotwriteMail2(const QString& namemail ) 116void OpieMail::slotwriteMail2(const QString& namemail )
110{ 117{
111 //qDebug("OpieMail::slotwriteMail2 "); 118 //qDebug("OpieMail::slotwriteMail2 ");
112 //qApp->processEvents(); 119 //qApp->processEvents();
113 ComposeMail compose( settings, this, 0, true ); 120 ComposeMail compose( settings, this, 0, true );
114 if ( !namemail.isEmpty() ) { 121 if ( !namemail.isEmpty() ) {
115 QString to = namemail; 122 QString to = namemail;
116 if ( namemail.find( " <") > 1 ) { 123 if ( namemail.find( " <") > 1 ) {
117 to = "\"" +to.replace( QRegExp( " <"), "\" <") ; 124 to = "\"" +to.replace( QRegExp( " <"), "\" <") ;
118 } else 125 } else
119 if ( namemail.find( "<") > 1 ) { 126 if ( namemail.find( "<") > 1 ) {
120 to = "\"" +to.replace( QRegExp( "<"), "\" <") ; 127 to = "\"" +to.replace( QRegExp( "<"), "\" <") ;
121 } 128 }
122 int sub = to.find( ">:"); 129 int sub = to.find( ">:");
123 if ( sub > 0 ) { 130 if ( sub > 0 ) {
124 compose.setTo( to.left(sub+1) ); 131 compose.setTo( to.left(sub+1) );
125 compose.setSubject( to.mid(sub+2) ); 132 compose.setSubject( to.mid(sub+2) );
126 } else 133 } else
127 compose.setTo( to ); 134 compose.setTo( to );
128 } 135 }
129 compose.slotAdjustColumns(); 136 compose.slotAdjustColumns();
130#ifndef DESKTOP_VERSION 137#ifndef DESKTOP_VERSION
131 compose.showMaximized(); 138 compose.showMaximized();
132#endif 139#endif
133 compose.exec(); 140 compose.exec();
134 raise(); 141 raise();
135 //qDebug("retttich "); 142 //qDebug("retttich ");
136} 143}
137void OpieMail::slotwriteMail(const QString&name,const QString&email) 144void OpieMail::slotwriteMail(const QString&name,const QString&email)
138{ 145{
139 // qDebug("OpieMail::slotwriteMail "); 146 // qDebug("OpieMail::slotwriteMail ");
140 ComposeMail compose( settings, this, 0, true ); 147 ComposeMail compose( settings, this, 0, true );
141 if (!email.isEmpty()) 148 if (!email.isEmpty())
142 { 149 {
143 if (!name.isEmpty()) 150 if (!name.isEmpty())
144 { 151 {
145 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); 152 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
146 } 153 }
147 else 154 else
148 { 155 {
149 compose.setTo(email); 156 compose.setTo(email);
150 } 157 }
151 } 158 }
152 compose.slotAdjustColumns(); 159 compose.slotAdjustColumns();
153#ifndef DESKTOP_VERSION 160#ifndef DESKTOP_VERSION
154 compose.showMaximized(); 161 compose.showMaximized();
155#endif 162#endif
156 compose.exec(); 163 compose.exec();
157 raise(); 164 raise();
158} 165}
159 166
160void OpieMail::slotComposeMail() 167void OpieMail::slotComposeMail()
161{ 168{
162 if ( mPendingEmail == QString::null && mPendingName == QString::null) 169 if ( mPendingEmail == QString::null && mPendingName == QString::null)
163 slotwriteMail2( QString () ); 170 slotwriteMail2( QString () );
164 else { 171 else {
165 if ( mPendingEmail == QString::null ) 172 if ( mPendingEmail == QString::null )
166 slotwriteMail2( mPendingName ); 173 slotwriteMail2( mPendingName );
167 else 174 else
168 slotwriteMail( mPendingName, mPendingEmail ); 175 slotwriteMail( mPendingName, mPendingEmail );
169 } 176 }
170 //slotwriteMail(0l,0l); 177 //slotwriteMail(0l,0l);
171} 178}
172 179
173void OpieMail::slotSendQueued() 180void OpieMail::slotSendQueued()
174{ 181{
175 SMTPaccount *smtp = 0; 182 SMTPaccount *smtp = 0;
176 183
177 QList<Account> list = settings->getAccounts(); 184 QList<Account> list = settings->getAccounts();
178 QList<SMTPaccount> smtpList; 185 QList<SMTPaccount> smtpList;
179 smtpList.setAutoDelete(false); 186 smtpList.setAutoDelete(false);
180 Account *it; 187 Account *it;
181 for ( it = list.first(); it; it = list.next() ) 188 for ( it = list.first(); it; it = list.next() )
182 { 189 {
183 if ( it->getType() == MAILLIB::A_SMTP ) 190 if ( it->getType() == MAILLIB::A_SMTP )
184 { 191 {
185 smtp = static_cast<SMTPaccount *>(it); 192 smtp = static_cast<SMTPaccount *>(it);
186 smtpList.append(smtp); 193 smtpList.append(smtp);
187 } 194 }
188 } 195 }
189 if (smtpList.count()==0) 196 if (smtpList.count()==0)
190 { 197 {
191 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); 198 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n"));
192 return; 199 return;
193 } 200 }
194 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) 201 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
195 return; 202 return;
196 if (smtpList.count()==1) 203 if (smtpList.count()==1)
197 { 204 {
198 smtp = smtpList.at(0); 205 smtp = smtpList.at(0);
199 } 206 }
200 else 207 else
201 { 208 {
202 smtp = 0; 209 smtp = 0;
203 selectsmtp selsmtp; 210 selectsmtp selsmtp;
204 selsmtp.setSelectionlist(&smtpList); 211 selsmtp.setSelectionlist(&smtpList);
205#ifndef DESKTOP_VERSION 212#ifndef DESKTOP_VERSION
206 selsmtp.showMaximized(); 213 selsmtp.showMaximized();
207#endif 214#endif
208 if ( selsmtp.exec() == QDialog::Accepted ) 215 if ( selsmtp.exec() == QDialog::Accepted )
209 { 216 {
210 smtp = selsmtp.selected_smtp(); 217 smtp = selsmtp.selected_smtp();
211 } 218 }
212 } 219 }
213 if (smtp) 220 if (smtp)
214 { 221 {
215 222
216 Global::statusMessage("Sending mails...!"); 223 Global::statusMessage("Sending mails...!");
217 SMTPwrapper * wrap = new SMTPwrapper(smtp); 224 SMTPwrapper * wrap = new SMTPwrapper(smtp);
218 if ( wrap->flushOutbox() ) 225 if ( wrap->flushOutbox() )
219 { 226 {
220 Global::statusMessage("Mails sent!"); 227 Global::statusMessage("Mails sent!");
221 } 228 }
222 delete wrap; 229 delete wrap;
223 } 230 }
224 // pending refresh list view, if outgoing is displayed 231 // pending refresh list view, if outgoing is displayed
225} 232}
226 233
227void OpieMail::slotSearchMails() 234void OpieMail::slotSearchMails()
228{ 235{
229 qDebug("OpieMail::slotSearchMails():not implemented "); 236 qDebug("OpieMail::slotSearchMails():not implemented ");
230} 237}
231 238
232void OpieMail::slotEditSettings() 239void OpieMail::slotEditSettings()
233{ 240{
234 241
235 KOPrefsDialog settingsDialog( this, "koprefs", true ); 242 KOPrefsDialog settingsDialog( this, "koprefs", true );
236#ifndef DESKTOP_VERSION 243#ifndef DESKTOP_VERSION
237 settingsDialog.showMaximized(); 244 settingsDialog.showMaximized();
238#endif 245#endif
239 settingsDialog.exec(); 246 settingsDialog.exec();
240 247
241 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 248 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
242 // KApplication::execDialog(settingsDialog); 249 // KApplication::execDialog(settingsDialog);
243} 250}
244 251
245void OpieMail::slotEditAccounts() 252void OpieMail::slotEditAccounts()
246{ 253{
247 EditAccounts eaDialog( settings, this, 0, true ); 254 EditAccounts eaDialog( settings, this, 0, true );
248 eaDialog.slotAdjustColumns(); 255 eaDialog.slotAdjustColumns();
249#ifndef DESKTOP_VERSION 256#ifndef DESKTOP_VERSION
250 eaDialog.showMaximized(); 257 eaDialog.showMaximized();
251#endif 258#endif
252 eaDialog.exec(); 259 eaDialog.exec();
253 if ( settings ) delete settings; 260 if ( settings ) delete settings;
254 settings = new Settings(); 261 settings = new Settings();
255 262
256 folderView->populate( settings->getAccounts() ); 263 folderView->populate( settings->getAccounts() );
257} 264}
258void OpieMail::replyMail() 265void OpieMail::replyMail()
259{ 266{
260 267
261 QListViewItem*item = mailView->currentItem(); 268 QListViewItem*item = mailView->currentItem();
262 if (!item) return; 269 if (!item) return;
263 RecMailP mail = ((MailListViewItem*)item)->data(); 270 RecMailP mail = ((MailListViewItem*)item)->data();
264 RecBodyP body = folderView->fetchBody(mail); 271 RecBodyP body = folderView->fetchBody(mail);
265 272
266 QString rtext; 273 QString rtext;
267 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 274 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
268 .arg( mail->getFrom()) 275 .arg( mail->getFrom())
269 .arg( mail->getDate()); 276 .arg( mail->getDate());
270 277
271 QString text = body->Bodytext(); 278 QString text = body->Bodytext();
272 QStringList lines = QStringList::split(QRegExp("\\n"), text); 279 QStringList lines = QStringList::split(QRegExp("\\n"), text);
273 QStringList::Iterator it; 280 QStringList::Iterator it;
274 for (it = lines.begin(); it != lines.end(); it++) 281 for (it = lines.begin(); it != lines.end(); it++)
275 { 282 {
276 rtext += "> " + *it + "\n"; 283 rtext += "> " + *it + "\n";
277 } 284 }
278 rtext += "\n"; 285 rtext += "\n";
279 286
280 QString prefix; 287 QString prefix;
281 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 288 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
282 else prefix = "Re: "; // no i18n on purpose 289 else prefix = "Re: "; // no i18n on purpose
283 290
284 Settings *settings = new Settings(); 291 Settings *settings = new Settings();
285 ComposeMail composer( settings ,this, 0, true); 292 ComposeMail composer( settings ,this, 0, true);
286 if (mail->Replyto().isEmpty()) { 293 if (mail->Replyto().isEmpty()) {
287 composer.setTo( mail->getFrom()); 294 composer.setTo( mail->getFrom());
288 } else { 295 } else {
289 composer.setTo( mail->Replyto()); 296 composer.setTo( mail->Replyto());
290 } 297 }
291 composer.setSubject( prefix + mail->getSubject()); 298 composer.setSubject( prefix + mail->getSubject());
292 composer.setMessage( rtext ); 299 composer.setMessage( rtext );
293 composer.setInReplyTo( mail->Msgid()); 300 composer.setInReplyTo( mail->Msgid());
294 composer.setCharset( body->getCharset() ); 301 composer.setCharset( body->getCharset() );
295 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 302 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
296 { 303 {
297 mail->Wrapper()->answeredMail(mail); 304 mail->Wrapper()->answeredMail(mail);
298 } 305 }
299 delete settings; 306 delete settings;
300 307
301} 308}
302void OpieMail::closeViewMail(ViewMail * vm) 309void OpieMail::closeViewMail(ViewMail * vm)
303{ 310{
304 vm->hide(); 311 vm->hide();
305} 312}
313
314void OpieMail::slotDownloadMail( )
315{
316 qDebug("slotDownloadMail( ) ");
317}
318
319
306void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) 320void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
307{ 321{
308 QListViewItem*item = mailView->currentItem(); 322 QListViewItem*item = mailView->currentItem();
309 if (!item ) { 323 if (!item ) {
310 closeViewMail(vm); 324 closeViewMail(vm);
311 return; 325 return;
312 } 326 }
313 RecMailP mail = ((MailListViewItem*)item)->data(); 327 RecMailP mail = ((MailListViewItem*)item)->data();
314 mail->Wrapper()->deleteMail( mail ); 328 mail->Wrapper()->deleteMail( mail );
315 item = item->itemBelow(); 329 item = item->itemBelow();
316 if (!item ) { 330 if (!item ) {
317 closeViewMail(vm); 331 closeViewMail(vm);
318 return; 332 return;
319 } 333 }
320 mailView->setCurrentItem(item); 334 mailView->setCurrentItem(item);
321 mail = ((MailListViewItem*)item)->data(); 335 mail = ((MailListViewItem*)item)->data();
322 RecBodyP body = folderView->fetchBody(mail); 336 RecBodyP body = folderView->fetchBody(mail);
323 vm->setBody( body ); 337 vm->setBody( body );
324 vm->setMail( mail ); 338 vm->setMail( mail );
325} 339}
326void OpieMail::displayNextMail(ViewMail * vm) 340void OpieMail::displayNextMail(ViewMail * vm)
327{ 341{
328 QListViewItem*item = mailView->currentItem(); 342 QListViewItem*item = mailView->currentItem();
329 if (!item) return; 343 if (!item) return;
330 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 344 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
331 item = item->itemBelow(); 345 item = item->itemBelow();
332 if (!item) { 346 if (!item) {
333 vm->setCaption(i18n("End of List" )); 347 vm->setCaption(i18n("End of List" ));
334 return; 348 return;
335 } 349 }
336 mailView->setCurrentItem(item); 350 mailView->setCurrentItem(item);
337 RecMailP mail = ((MailListViewItem*)item)->data(); 351 RecMailP mail = ((MailListViewItem*)item)->data();
338 RecBodyP body = folderView->fetchBody(mail); 352 RecBodyP body = folderView->fetchBody(mail);
339 vm->setBody( body ); 353 vm->setBody( body );
340 vm->setMail( mail ); 354 vm->setMail( mail );
341} 355}
342void OpieMail::displayMail() 356void OpieMail::displayMail()
343{ 357{
344 QListViewItem*item = mailView->currentItem(); 358 QListViewItem*item = mailView->currentItem();
345 if (!item) return; 359 if (!item) return;
346 RecMailP mail = ((MailListViewItem*)item)->data(); 360 RecMailP mail = ((MailListViewItem*)item)->data();
347 RecBodyP body = folderView->fetchBody(mail); 361 RecBodyP body = folderView->fetchBody(mail);
348 ViewMail readMail( this,"", Qt::WType_Modal ); 362 ViewMail readMail( this,"", Qt::WType_Modal );
349 readMail.setBody( body ); 363 readMail.setBody( body );
350 readMail.setMail( mail ); 364 readMail.setMail( mail );
351#ifndef DESKTOP_VERSION 365#ifndef DESKTOP_VERSION
352 readMail.showMaximized(); 366 readMail.showMaximized();
353#else 367#else
354 readMail.resize( 640, 480); 368 readMail.resize( 640, 480);
355#endif 369#endif
356 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); 370 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
357 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); 371 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
372 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
358 373
359 readMail.exec(); 374 readMail.exec();
360 375
361 if ( readMail.deleted ) 376 if ( readMail.deleted )
362 { 377 {
363 folderView->refreshCurrent(); 378 folderView->refreshCurrent();
364 } 379 }
365 else 380 else
366 { 381 {
367 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 382 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
368 } 383 }
369} 384}
370void OpieMail::slotGetAllMail() 385void OpieMail::slotGetAllMail()
371{ 386{
372 QListViewItem * item = folderView->firstChild(); 387 QListViewItem * item = folderView->firstChild();
373 while ( item ){ 388 while ( item ){
374 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 389 ((AccountViewItem *)item)->contextMenuSelected( 101 );
375 item = item->nextSibling (); 390 item = item->nextSibling ();
376 } 391 }
377} 392}
378void OpieMail::slotGetMail() 393void OpieMail::slotGetMail()
379{ 394{
380 QListViewItem * item = folderView->currentItem(); 395 QListViewItem * item = folderView->currentItem();
381 if ( ! item ) return; 396 if ( ! item ) return;
382 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 397 ((AccountViewItem *)item)->contextMenuSelected( 101 );
383} 398}
384void OpieMail::slotDeleteMail() 399void OpieMail::slotDeleteMail()
385{ 400{
386 if (!mailView->currentItem()) return; 401 if (!mailView->currentItem()) return;
387 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 402 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
388 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 403 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
389 { 404 {
390 mail->Wrapper()->deleteMail( mail ); 405 mail->Wrapper()->deleteMail( mail );
391 folderView->refreshCurrent(); 406 folderView->refreshCurrent();
392 } 407 }
393} 408}
394void OpieMail::slotDeleteAllMail() 409void OpieMail::slotDeleteAllMail()
395{ 410{
396 411
397 QValueList<RecMailP> t; 412 QValueList<RecMailP> t;
398 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 413 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
399 { 414 {
400 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 415 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
401 while ( item ) { 416 while ( item ) {
402 if ( item->isSelected() ) { 417 if ( item->isSelected() ) {
403 t.append( item->data() ); 418 t.append( item->data() );
404 } 419 }
405 item = (MailListViewItem*)item->nextSibling(); 420 item = (MailListViewItem*)item->nextSibling();
406 } 421 }
407 } 422 }
408 else 423 else
409 return; 424 return;
410 if ( t.count() == 0 ) 425 if ( t.count() == 0 )
411 return; 426 return;
412 RecMailP mail = t.first(); 427 RecMailP mail = t.first();
413 mail->Wrapper()->deleteMailList(t); 428 mail->Wrapper()->deleteMailList(t);
414 folderView->refreshCurrent(); 429 folderView->refreshCurrent();
415 430
416 431
417} 432}
418void OpieMail::clearSelection() 433void OpieMail::clearSelection()
419{ 434{
420 mailView->clearSelection(); 435 mailView->clearSelection();
421 436
422} 437}
423 438
424void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) 439void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
425{ 440{
426 if (!mailView->currentItem()) return; 441 if (!mailView->currentItem()) return;
427 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 442 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
428 /* just the RIGHT button - or hold on pda */ 443 /* just the RIGHT button - or hold on pda */
429 if (button!=2) {return;} 444 if (button!=2) {return;}
430 if (!item) return; 445 if (!item) return;
431 QPopupMenu *m = new QPopupMenu(0); 446 QPopupMenu *m = new QPopupMenu(0);
432 if (m) 447 if (m)
433 { 448 {
434 if (mailtype==MAILLIB::A_NNTP) { 449 if (mailtype==MAILLIB::A_NNTP) {
435 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); 450 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
436 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); 451 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
437 m->insertSeparator(); 452 m->insertSeparator();
438 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); 453 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
439 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 454 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
440 } else { 455 } else {
441 if (folderView->currentisDraft()) { 456 if (folderView->currentisDraft()) {
442 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); 457 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
443 } 458 }
444 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); 459 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
445 m->insertSeparator(); 460 m->insertSeparator();
446 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); 461 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail()));
447 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); 462 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
448 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); 463 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail()));
449 m->insertSeparator(); 464 m->insertSeparator();
450 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); 465 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
451 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); 466 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
452 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 467 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
453 } 468 }
454 m->setFocus(); 469 m->setFocus();
455 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 470 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
456 delete m; 471 delete m;
457 } 472 }
458} 473}
459 474
460void OpieMail::slotShowFolders( bool show ) 475void OpieMail::slotShowFolders( bool show )
461{ 476{
462 if ( show && folderView->isHidden() ) 477 if ( show && folderView->isHidden() )
463 { 478 {
464 folderView->show(); 479 folderView->show();
465 } 480 }
466 else if ( !show && !folderView->isHidden() ) 481 else if ( !show && !folderView->isHidden() )
467 { 482 {
468 folderView->hide(); 483 folderView->hide();
469 } 484 }
470} 485}
471 486
472void OpieMail::refreshMailView(const QValueList<RecMailP>&list) 487void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
473{ 488{
474 MailListViewItem*item = 0; 489 MailListViewItem*item = 0;
475 mailView->clear(); 490 mailView->clear();
476 491
477 QValueList<RecMailP>::ConstIterator it; 492 QValueList<RecMailP>::ConstIterator it;
478 for (it = list.begin(); it != list.end();++it) 493 for (it = list.begin(); it != list.end();++it)
479 { 494 {
480 item = new MailListViewItem(mailView,item); 495 item = new MailListViewItem(mailView,item);
481 item->storeData((*it)); 496 item->storeData((*it));
482 item->showEntry(); 497 item->showEntry();
483 } 498 }
484 mailView->setSorting ( 4, false ); 499 mailView->setSorting ( 4, false );
485} 500}
486 501
487void OpieMail::mailLeftClicked( QListViewItem *item ) 502void OpieMail::mailLeftClicked( QListViewItem *item )
488{ 503{
489 mailView->clearSelection(); 504 mailView->clearSelection();
490 /* just LEFT button - or tap with stylus on pda */ 505 /* just LEFT button - or tap with stylus on pda */
491 //if (button!=1) return; 506 //if (button!=1) return;
492 if (!item) return; 507 if (!item) return;
493 if (folderView->currentisDraft()) { 508 if (folderView->currentisDraft()) {
494 reEditMail(); 509 reEditMail();
495 } else { 510 } else {
496 displayMail(); 511 displayMail();
497 } 512 }
498} 513}
499 514
500void OpieMail::slotMoveCopyMail() 515void OpieMail::slotMoveCopyMail()
501{ 516{
502 if (!mailView->currentItem()) return; 517 if (!mailView->currentItem()) return;
503 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 518 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
504 AbstractMail*targetMail = 0; 519 AbstractMail*targetMail = 0;
505 QString targetFolder = ""; 520 QString targetFolder = "";
506 Selectstore sels; 521 Selectstore sels;
507 folderView->setupFolderselect(&sels); 522 folderView->setupFolderselect(&sels);
508 if (!sels.exec()) return; 523 if (!sels.exec()) return;
509 targetMail = sels.currentMail(); 524 targetMail = sels.currentMail();
510 targetFolder = sels.currentFolder(); 525 targetFolder = sels.currentFolder();
511 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 526 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
512 targetFolder.isEmpty()) 527 targetFolder.isEmpty())
513 { 528 {
514 return; 529 return;
515 } 530 }
516 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 531 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
517 { 532 {
518 QMessageBox::critical(0,i18n("Error creating new Folder"), 533 QMessageBox::critical(0,i18n("Error creating new Folder"),
519 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 534 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
520 return; 535 return;
521 } 536 }
522 sels.hide(); 537 sels.hide();
523 qApp->processEvents(); 538 qApp->processEvents();
524 // qDebug("hiding sels "); 539 // qDebug("hiding sels ");
525 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); 540 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
526 folderView->refreshCurrent(); 541 folderView->refreshCurrent();
527} 542}
528 543
529void OpieMail::slotMoveCopyAllMail() 544void OpieMail::slotMoveCopyAllMail()
530{ 545{
531 546
532 if (!mailView->currentItem()) return; 547 if (!mailView->currentItem()) return;
533 QValueList<RecMailP> t; 548 QValueList<RecMailP> t;
534 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 549 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
535 { 550 {
536 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 551 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
537 while ( item ) { 552 while ( item ) {
538 if ( item->isSelected() ) { 553 if ( item->isSelected() ) {
539 t.append( item->data() ); 554 t.append( item->data() );
540 } 555 }
541 item = (MailListViewItem*)item->nextSibling(); 556 item = (MailListViewItem*)item->nextSibling();
542 } 557 }
543 } 558 }
544 // else 559 // else
545 // return; 560 // return;
546 if ( t.count() == 0 ) 561 if ( t.count() == 0 )
547 return; 562 return;
548 RecMailP mail = t.first(); 563 RecMailP mail = t.first();
549 AbstractMail*targetMail = 0; 564 AbstractMail*targetMail = 0;
550 QString targetFolder = ""; 565 QString targetFolder = "";
551 Selectstore sels; 566 Selectstore sels;
552 folderView->setupFolderselect(&sels); 567 folderView->setupFolderselect(&sels);
553 if (!sels.exec()) return; 568 if (!sels.exec()) return;
554 targetMail = sels.currentMail(); 569 targetMail = sels.currentMail();
555 targetFolder = sels.currentFolder(); 570 targetFolder = sels.currentFolder();
556 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 571 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
557 targetFolder.isEmpty()) 572 targetFolder.isEmpty())
558 { 573 {
559 return; 574 return;
560 } 575 }
561 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 576 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
562 { 577 {
563 QMessageBox::critical(0,i18n("Error creating new Folder"), 578 QMessageBox::critical(0,i18n("Error creating new Folder"),
564 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 579 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
565 return; 580 return;
566 } 581 }
567 sels.hide(); 582 sels.hide();
568 qApp->processEvents(); 583 qApp->processEvents();
569 //qDebug("hiding sels "); 584 //qDebug("hiding sels ");
570 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); 585 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
571 folderView->refreshCurrent(); 586 folderView->refreshCurrent();
572} 587}
573 588
574void OpieMail::reEditMail() 589void OpieMail::reEditMail()
575{ 590{
576 if (!mailView->currentItem()) return; 591 if (!mailView->currentItem()) return;
577 592
578 ComposeMail compose( settings, this, 0, true ); 593 ComposeMail compose( settings, this, 0, true );
579 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); 594 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
580 compose.slotAdjustColumns(); 595 compose.slotAdjustColumns();
581#ifndef DESKTOP_VERSION 596#ifndef DESKTOP_VERSION
582 compose.showMaximized(); 597 compose.showMaximized();
583#else 598#else
584 compose.resize(640,480); 599 compose.resize(640,480);
585#endif 600#endif
586 compose.exec(); 601 compose.exec();
587} 602}
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index a81a34c..b8a527f 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -1,60 +1,61 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef OPIEMAIL_H 2#ifndef OPIEMAIL_H
3#define OPIEMAIL_H 3#define OPIEMAIL_H
4 4
5#include "mainwindow.h" 5#include "mainwindow.h"
6#include <libmailwrapper/settings.h> 6#include <libmailwrapper/settings.h>
7 7
8#include <opie2/osmartpointer.h> 8#include <opie2/osmartpointer.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <viewmail.h> 10#include <viewmail.h>
11 11
12class OpieMail : public MainWindow 12class OpieMail : public MainWindow
13{ 13{
14 Q_OBJECT 14 Q_OBJECT
15 15
16public: 16public:
17 OpieMail( QWidget *parent = 0, const char *name = 0 ); 17 OpieMail( QWidget *parent = 0, const char *name = 0 );
18 virtual ~OpieMail(); 18 virtual ~OpieMail();
19 static QString appName() { return QString::fromLatin1("kopiemail"); } 19 static QString appName() { return QString::fromLatin1("kopiemail"); }
20 20
21public slots: 21public slots:
22 virtual void slotwriteMail(const QString&name,const QString&email); 22 virtual void slotwriteMail(const QString&name,const QString&email);
23 virtual void slotwriteMail2(const QString&nameemail); 23 virtual void slotwriteMail2(const QString&nameemail);
24 virtual void slotComposeMail(); 24 virtual void slotComposeMail();
25 virtual void slotExtAppHandler(); 25 virtual void slotExtAppHandler();
26 virtual void appMessage(const QCString &msg, const QByteArray &data); 26 virtual void appMessage(const QCString &msg, const QByteArray &data);
27 virtual void message(const QCString &msg, const QByteArray &data); 27 virtual void message(const QCString &msg, const QByteArray &data);
28protected slots: 28protected slots:
29 virtual void deleteAndDisplayNextMail(ViewMail * vm); 29 virtual void deleteAndDisplayNextMail(ViewMail * vm);
30 virtual void displayNextMail(ViewMail * vm); 30 virtual void displayNextMail(ViewMail * vm);
31 virtual void slotSendQueued(); 31 virtual void slotSendQueued();
32 virtual void slotSearchMails(); 32 virtual void slotSearchMails();
33 virtual void slotEditSettings(); 33 virtual void slotEditSettings();
34 virtual void slotEditAccounts(); 34 virtual void slotEditAccounts();
35 virtual void displayMail(); 35 virtual void displayMail();
36 virtual void replyMail(); 36 virtual void replyMail();
37 virtual void slotDeleteMail(); 37 virtual void slotDeleteMail();
38 virtual void slotGetMail(); 38 virtual void slotGetMail();
39 virtual void slotGetAllMail(); 39 virtual void slotGetAllMail();
40 virtual void slotDeleteAllMail(); 40 virtual void slotDeleteAllMail();
41 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 41 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
42 virtual void slotShowFolders( bool show ); 42 virtual void slotShowFolders( bool show );
43 virtual void refreshMailView(const QValueList<RecMailP>&); 43 virtual void refreshMailView(const QValueList<RecMailP>&);
44 virtual void mailLeftClicked( QListViewItem * ); 44 virtual void mailLeftClicked( QListViewItem * );
45 virtual void slotMoveCopyMail(); 45 virtual void slotMoveCopyMail();
46 virtual void slotMoveCopyAllMail(); 46 virtual void slotMoveCopyAllMail();
47 virtual void reEditMail(); 47 virtual void reEditMail();
48 void clearSelection(); 48 void clearSelection();
49 49 void slotDownloadMail();
50private: 50private:
51 void closeViewMail(ViewMail * vm); 51 void closeViewMail(ViewMail * vm);
52 QString mPendingEmail; 52 QString mPendingEmail;
53 QString mPendingName; 53 QString mPendingName;
54 QByteArray mPendingData; 54 QByteArray mPendingData;
55 QCString mPendingMessage; 55 QCString mPendingMessage;
56 Settings *settings; 56 Settings *settings;
57 QTextBrowser * tb;
57 58
58}; 59};
59 60
60#endif 61#endif
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 6d88cad..767a369 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -1,534 +1,557 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2 2
3 3
4 4
5#include <kfiledialog.h> 5#include <kfiledialog.h>
6#include "koprefs.h" 6#include "koprefs.h"
7#include <klocale.h> 7#include <klocale.h>
8#include <kglobal.h> 8#include <kglobal.h>
9#include <kapplication.h> 9#include <kapplication.h>
10 10
11#ifdef MINIKDE_KDIALOG_H 11#ifdef MINIKDE_KDIALOG_H
12#undef MINIKDE_KDIALOG_H 12#undef MINIKDE_KDIALOG_H
13#endif 13#endif
14 14
15#include "composemail.h" 15#include "composemail.h"
16#include "viewmail.h" 16#include "viewmail.h"
17 17
18#include <libmailwrapper/settings.h> 18#include <libmailwrapper/settings.h>
19#include <libmailwrapper/abstractmail.h> 19#include <libmailwrapper/abstractmail.h>
20#include <libmailwrapper/mailtypes.h> 20#include <libmailwrapper/mailtypes.h>
21 21
22#include <qdialog.h> 22#include <qdialog.h>
23 23
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25 25
26/* QT */ 26/* QT */
27#include <qtextbrowser.h> 27#include <qtextbrowser.h>
28#include <qmessagebox.h> 28#include <qmessagebox.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qaction.h> 30#include <qaction.h>
31#include <qpopupmenu.h> 31#include <qpopupmenu.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qlayout.h> 33#include <qlayout.h>
34 34
35//using namespace Opie::Ui; 35//using namespace Opie::Ui;
36//using namespace Opie::Core; 36//using namespace Opie::Core;
37 37
38AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 38AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
39 const QString&fsize,int num,const QValueList<int>&path) 39 const QString&fsize,int num,const QValueList<int>&path)
40 : QListViewItem(parent,after),_partNum(num) 40 : QListViewItem(parent,after),_partNum(num)
41{ 41{
42 _path=path; 42 _path=path;
43 setText(0, mime); 43 setText(0, mime);
44 setText(1, desc); 44 setText(1, desc);
45 setText(2, file); 45 setText(2, file);
46 setText(3, fsize); 46 setText(3, fsize);
47} 47}
48 48
49AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 49AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
50 const QString&fsize,int num,const QValueList<int>&path) 50 const QString&fsize,int num,const QValueList<int>&path)
51 : QListViewItem(parent,after),_partNum(num) 51 : QListViewItem(parent,after),_partNum(num)
52{ 52{
53 _path=path; 53 _path=path;
54 setText(0, mime); 54 setText(0, mime);
55 setText(1, desc); 55 setText(1, desc);
56 setText(2, file); 56 setText(2, file);
57 setText(3, fsize); 57 setText(3, fsize);
58} 58}
59 59
60bool AttachItem::isParentof(const QValueList<int>&path) 60bool AttachItem::isParentof(const QValueList<int>&path)
61{ 61{
62 /* if not set, then no parent */ 62 /* if not set, then no parent */
63 if (path.count()==0||_path.count()==0) return false; 63 if (path.count()==0||_path.count()==0) return false;
64 /* the parent must have one digit less then a child */ 64 /* the parent must have one digit less then a child */
65 if (path.count()!=_path.count()+1) return false; 65 if (path.count()!=_path.count()+1) return false;
66 for (unsigned int i=0; i < _path.count();++i) 66 for (unsigned int i=0; i < _path.count();++i)
67 { 67 {
68 if (_path[i]!=path[i]) return false; 68 if (_path[i]!=path[i]) return false;
69 } 69 }
70 return true; 70 return true;
71} 71}
72 72
73AttachItem* ViewMail::searchParent(const QValueList<int>&path) 73AttachItem* ViewMail::searchParent(const QValueList<int>&path)
74{ 74{
75 QListViewItemIterator it( attachments ); 75 QListViewItemIterator it( attachments );
76 for ( ; it.current(); ++it ) 76 for ( ; it.current(); ++it )
77 { 77 {
78 AttachItem*ati = (AttachItem*)it.current(); 78 AttachItem*ati = (AttachItem*)it.current();
79 if (ati->isParentof(path)) return ati; 79 if (ati->isParentof(path)) return ati;
80 } 80 }
81 return 0; 81 return 0;
82} 82}
83 83
84AttachItem* ViewMail::lastChild(AttachItem*parent) 84AttachItem* ViewMail::lastChild(AttachItem*parent)
85{ 85{
86 if (!parent) return 0; 86 if (!parent) return 0;
87 AttachItem* item = (AttachItem*)parent->firstChild(); 87 AttachItem* item = (AttachItem*)parent->firstChild();
88 if (!item) return item; 88 if (!item) return item;
89 AttachItem*temp=0; 89 AttachItem*temp=0;
90 while( (temp=(AttachItem*)item->nextSibling())) 90 while( (temp=(AttachItem*)item->nextSibling()))
91 { 91 {
92 item = temp; 92 item = temp;
93 } 93 }
94 return item; 94 return item;
95} 95}
96 96
97void ViewMail::setBody(const RecBodyP&body ) 97void ViewMail::setBody(const RecBodyP&body )
98{ 98{
99 99
100 m_body = body; 100 m_body = body;
101 m_mail[2] = body->Bodytext(); 101 m_mail[2] = body->Bodytext();
102 // qDebug("********text %s ",m_mail[2].latin1() ); 102 // qDebug("********text %s ",m_mail[2].latin1() );
103 attachbutton->setEnabled(body->Parts().count()>0); 103 attachbutton->setEnabled(body->Parts().count()>0);
104 attachments->setEnabled(body->Parts().count()>0); 104 attachments->setEnabled(body->Parts().count()>0);
105 if (body->Parts().count()==0) 105 if (body->Parts().count()==0)
106 { 106 {
107 return; 107 return;
108 } 108 }
109 AttachItem * curItem=0; 109 AttachItem * curItem=0;
110 AttachItem * parentItem = 0; 110 AttachItem * parentItem = 0;
111 QString type=body->Description()->Type()+"/"+body->Description()->Subtype(); 111 QString type=body->Description()->Type()+"/"+body->Description()->Subtype();
112 QString desc,fsize; 112 QString desc,fsize;
113 double s = body->Description()->Size(); 113 double s = body->Description()->Size();
114 int w; 114 int w;
115 w=0; 115 w=0;
116 116
117 while (s>1024) 117 while (s>1024)
118 { 118 {
119 s/=1024; 119 s/=1024;
120 ++w; 120 ++w;
121 if (w>=2) break; 121 if (w>=2) break;
122 } 122 }
123 123
124 QString q=""; 124 QString q="";
125 switch(w) 125 switch(w)
126 { 126 {
127 case 1: 127 case 1:
128 q="k"; 128 q="k";
129 break; 129 break;
130 case 2: 130 case 2:
131 q="M"; 131 q="M";
132 break; 132 break;
133 default: 133 default:
134 break; 134 break;
135 } 135 }
136 136
137 { 137 {
138 /* I did not found a method to make a CONTENT reset on a QTextStream 138 /* I did not found a method to make a CONTENT reset on a QTextStream
139 so I use this construct that the stream will re-constructed in each 139 so I use this construct that the stream will re-constructed in each
140 loop. To let it work, the textstream is packed into a own area of 140 loop. To let it work, the textstream is packed into a own area of
141 code is it will be destructed after finishing its small job. 141 code is it will be destructed after finishing its small job.
142 */ 142 */
143 QTextOStream o(&fsize); 143 QTextOStream o(&fsize);
144 if (w>0) o.precision(2); else o.precision(0); 144 if (w>0) o.precision(2); else o.precision(0);
145 o.setf(QTextStream::fixed); 145 o.setf(QTextStream::fixed);
146 o << s << " " << q << "Byte"; 146 o << s << " " << q << "Byte";
147 } 147 }
148 148
149 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist()); 149 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist());
150 QString filename = ""; 150 QString filename = "";
151 151
152 for (unsigned int i = 0; i < body->Parts().count();++i) 152 for (unsigned int i = 0; i < body->Parts().count();++i)
153 { 153 {
154 filename = ""; 154 filename = "";
155 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype(); 155 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
156 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin(); 156 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
157 for (;it!=body->Parts()[i]->Parameters().end();++it) 157 for (;it!=body->Parts()[i]->Parameters().end();++it)
158 { 158 {
159 if (it.key().lower()=="name") 159 if (it.key().lower()=="name")
160 { 160 {
161 filename=it.data(); 161 filename=it.data();
162 } 162 }
163 } 163 }
164 s = body->Parts()[i]->Size(); 164 s = body->Parts()[i]->Size();
165 w = 0; 165 w = 0;
166 while (s>1024) 166 while (s>1024)
167 { 167 {
168 s/=1024; 168 s/=1024;
169 ++w; 169 ++w;
170 if (w>=2) break; 170 if (w>=2) break;
171 } 171 }
172 switch(w) 172 switch(w)
173 { 173 {
174 case 1: 174 case 1:
175 q="k"; 175 q="k";
176 break; 176 break;
177 case 2: 177 case 2:
178 q="M"; 178 q="M";
179 break; 179 break;
180 default: 180 default:
181 q=""; 181 q="";
182 break; 182 break;
183 } 183 }
184 QTextOStream o(&fsize); 184 QTextOStream o(&fsize);
185 if (w>0) o.precision(2); else o.precision(0); 185 if (w>0) o.precision(2); else o.precision(0);
186 o.setf(QTextStream::fixed); 186 o.setf(QTextStream::fixed);
187 o << s << " " << q << "Byte"; 187 o << s << " " << q << "Byte";
188 desc = body->Parts()[i]->Description(); 188 desc = body->Parts()[i]->Description();
189 parentItem = searchParent(body->Parts()[i]->Positionlist()); 189 parentItem = searchParent(body->Parts()[i]->Positionlist());
190 if (parentItem) 190 if (parentItem)
191 { 191 {
192 AttachItem*temp = lastChild(parentItem); 192 AttachItem*temp = lastChild(parentItem);
193 if (temp) curItem = temp; 193 if (temp) curItem = temp;
194 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); 194 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
195 attachments->setRootIsDecorated(true); 195 attachments->setRootIsDecorated(true);
196 curItem = parentItem; 196 curItem = parentItem;
197 } 197 }
198 else 198 else
199 { 199 {
200 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); 200 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
201 } 201 }
202 } 202 }
203} 203}
204 204
205 205
206void ViewMail::slotViewSource()
207{
208
209 if ( !sourceOn ) {
210 sourceOn = true;
211 viewSource->setText(i18n("View Body Text"));
212 encodedString*st = 0;
213 st = m_recMail->Wrapper()->fetchRawBody(m_recMail);
214 if ( st ) {
215 QString source = QString::fromUtf8( st->Content(), st->Length());
216 browser->setText( source );
217 delete st;
218 }
219 } else
220 setText();
221
222
223}
206void ViewMail::slotShowHtml( bool state ) 224void ViewMail::slotShowHtml( bool state )
207{ 225{
208 m_showHtml = state; 226 m_showHtml = state;
209 setText(); 227 setText();
210} 228}
211 229
212void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) 230void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int )
213{ 231{
214 if (!item ) 232 if (!item )
215 return; 233 return;
216 234
217 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 235 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
218 { 236 {
219 setText(); 237 setText();
220 return; 238 return;
221 } 239 }
222 QPopupMenu *menu = new QPopupMenu(); 240 QPopupMenu *menu = new QPopupMenu();
223 int ret=0; 241 int ret=0;
224 242
225 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) 243 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
226 { 244 {
227 menu->insertItem( i18n( "Show Text" ), 1 ); 245 menu->insertItem( i18n( "Show Text" ), 1 );
228 } 246 }
229 if (item->text(0).left(6)=="image/") { 247 if (item->text(0).left(6)=="image/") {
230 menu->insertItem(i18n("Display image preview"),2); 248 menu->insertItem(i18n("Display image preview"),2);
231 } 249 }
232 menu->insertItem( i18n( "Save Attachment" ), 0 ); 250 menu->insertItem( i18n( "Save Attachment" ), 0 );
233 menu->insertSeparator(1); 251 menu->insertSeparator(1);
234 252
235 ret = menu->exec( point, 0 ); 253 ret = menu->exec( point, 0 );
236 254
237 switch(ret) 255 switch(ret)
238 { 256 {
239 case 0: 257 case 0:
240 { 258 {
241 //MimeTypes types; 259 //MimeTypes types;
242 //types.insert( "all", "*" ); 260 //types.insert( "all", "*" );
243 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); 261 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this );
244 262
245 if( !str.isEmpty() ) 263 if( !str.isEmpty() )
246 { 264 {
247 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 265 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
248 if (content) 266 if (content)
249 { 267 {
250 QFile output(str); 268 QFile output(str);
251 output.open(IO_WriteOnly); 269 output.open(IO_WriteOnly);
252 output.writeBlock(content->Content(),content->Length()); 270 output.writeBlock(content->Content(),content->Length());
253 output.close(); 271 output.close();
254 delete content; 272 delete content;
255 } 273 }
256 } 274 }
257 } 275 }
258 break ; 276 break ;
259 277
260 case 2: 278 case 2:
261 { 279 {
262#ifdef DESKTOP_VERSION 280#ifdef DESKTOP_VERSION
263 QString tmpfile = locateLocal( "tmp", "opiemail-image"); 281 QString tmpfile = locateLocal( "tmp", "opiemail-image");
264#else 282#else
265 QString tmpfile = "/tmp/opiemail-image"; 283 QString tmpfile = "/tmp/opiemail-image";
266#endif 284#endif
267 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 285 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
268 if (content) { 286 if (content) {
269 QFile output(tmpfile); 287 QFile output(tmpfile);
270 output.open(IO_WriteOnly); 288 output.open(IO_WriteOnly);
271 output.writeBlock(content->Content(),content->Length()); 289 output.writeBlock(content->Content(),content->Length());
272 output.close(); 290 output.close();
273 delete content; 291 delete content;
274 MailImageDlg iview(""); 292 MailImageDlg iview("");
275 iview.setName(tmpfile); 293 iview.setName(tmpfile);
276 KApplication::execDialog(&iview); 294 KApplication::execDialog(&iview);
277 output.remove(); 295 output.remove();
278 } 296 }
279 } 297 }
280 break; 298 break;
281 case 1: 299 case 1:
282 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 300 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
283 { 301 {
284 setText(); 302 setText();
285 } 303 }
286 else 304 else
287 { 305 {
288 if ( m_recMail->Wrapper() != 0l ) 306 if ( m_recMail->Wrapper() != 0l )
289 { // make sure that there is a wrapper , even after delete or simular actions 307 { // make sure that there is a wrapper , even after delete or simular actions
290 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); 308 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
291 } 309 }
292 } 310 }
293 break; 311 break;
294 } 312 }
295 delete menu; 313 delete menu;
296} 314}
297 315
298 316
299void ViewMail::setMail(const RecMailP&mail ) 317void ViewMail::setMail(const RecMailP&mail )
300{ 318{
301 319
302 m_recMail = mail; 320 m_recMail = mail;
303 321
304 m_mail[0] = mail->getFrom(); 322 m_mail[0] = mail->getFrom();
305 m_mail[1] = mail->getSubject(); 323 m_mail[1] = mail->getSubject();
306 m_mail[3] = mail->getDate(); 324 m_mail[3] = mail->getDate();
307 m_mail[4] = mail->Msgid(); 325 m_mail[4] = mail->Msgid();
308 326
309 m_mail2[0] = mail->To(); 327 m_mail2[0] = mail->To();
310 m_mail2[1] = mail->CC(); 328 m_mail2[1] = mail->CC();
311 m_mail2[2] = mail->Bcc(); 329 m_mail2[2] = mail->Bcc();
312 330
313 setText(); 331 setText();
314} 332}
315 333
316 334
317 335
318ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 336ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
319 : ViewMailBase(parent, name, fl), _inLoop(false) 337 : ViewMailBase(parent, name, fl), _inLoop(false)
320{ 338{
321 m_gotBody = false; 339 m_gotBody = false;
322 deleted = false; 340 deleted = false;
323 341 sourceOn = false;
324 connect( reply, SIGNAL(activated()), SLOT(slotReply())); 342 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
325 connect( forward, SIGNAL(activated()), SLOT(slotForward())); 343 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
326 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); 344 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
327 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); 345 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
328 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 346 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
329 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); 347 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
348 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
349 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
330 350
331 attachments->setEnabled(m_gotBody); 351 attachments->setEnabled(m_gotBody);
332 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); 352 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
333 353
334 readConfig(); 354 readConfig();
335 attachments->setSorting(-1); 355 attachments->setSorting(-1);
336} 356}
337 357
338void ViewMail::readConfig() 358void ViewMail::readConfig()
339{ 359{
340 360
341 setFont ( KOPrefs::instance()->mReadFont ); 361 setFont ( KOPrefs::instance()->mReadFont );
342 m_showHtml = KOPrefs::instance()->mViewAsHtml; 362 m_showHtml = KOPrefs::instance()->mViewAsHtml;
343 showHtml->setOn( m_showHtml ); 363 showHtml->setOn( m_showHtml );
344} 364}
345 365
346void ViewMail::setText() 366void ViewMail::setText()
347{ 367{
348 368
369 viewSource->setText(i18n("View Source"));
370 sourceOn = false;
349 QString toString; 371 QString toString;
350 QString ccString; 372 QString ccString;
351 QString bccString; 373 QString bccString;
352 374
353 375
354 toString = m_mail2[0].join(","); 376 toString = m_mail2[0].join(",");
355 ccString = m_mail2[1].join(","); 377 ccString = m_mail2[1].join(",");
356 bccString = m_mail2[2].join(","); 378 bccString = m_mail2[2].join(",");
357 379
358 380
359 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) ); 381 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) );
360 382
361 m_mailHtml = "<html><body>" 383 m_mailHtml = "<html><body>"
362 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 384 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
363 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 385 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
364 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" 386 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
365 "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" 387 "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
366 "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + 388 "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
367 i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" 389 i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
368 "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] + 390 "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] +
369 "</td></tr></table><font>"; 391 "</td></tr></table><font>";
370 392
371 if ( !m_showHtml ) 393 if ( !m_showHtml )
372 { 394 {
373 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); 395 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
374 } 396 }
375 else 397 else
376 { 398 {
377 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); 399 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
378 } 400 }
379 // remove later in favor of a real handling 401 // remove later in favor of a real handling
380 m_gotBody = true; 402 m_gotBody = true;
381} 403}
382 404
383 405
384ViewMail::~ViewMail() 406ViewMail::~ViewMail()
385{ 407{
386 m_recMail->Wrapper()->cleanMimeCache(); 408 m_recMail->Wrapper()->cleanMimeCache();
387 hide(); 409 hide();
388} 410}
389 411
390void ViewMail::hide() 412void ViewMail::hide()
391{ 413{
392 QWidget::hide(); 414 QWidget::hide();
393 415
394 if (_inLoop) 416 if (_inLoop)
395 { 417 {
396 _inLoop = false; 418 _inLoop = false;
397 qApp->exit_loop(); 419 qApp->exit_loop();
398 420
399 } 421 }
400 422
401} 423}
402 424
403void ViewMail::exec() 425void ViewMail::exec()
404{ 426{
405 show(); 427 show();
406 428
407 if (!_inLoop) 429 if (!_inLoop)
408 { 430 {
409 _inLoop = true; 431 _inLoop = true;
410 qApp->enter_loop(); 432 qApp->enter_loop();
411 } 433 }
412 434
413} 435}
414 436
415QString ViewMail::deHtml(const QString &string) 437QString ViewMail::deHtml(const QString &string)
416{ 438{
417 QString string_ = string; 439 QString string_ = string;
418 string_.replace(QRegExp("&"), "&amp;"); 440 string_.replace(QRegExp("&"), "&amp;");
419 string_.replace(QRegExp("<"), "&lt;"); 441 string_.replace(QRegExp("<"), "&lt;");
420 string_.replace(QRegExp(">"), "&gt;"); 442 string_.replace(QRegExp(">"), "&gt;");
421 string_.replace(QRegExp("\\n"), "<br>"); 443 string_.replace(QRegExp("\\n"), "<br>");
422 return string_; 444 return string_;
423} 445}
424 446
425void ViewMail::slotReply() 447void ViewMail::slotReply()
426{ 448{
427 if (!m_gotBody) 449 if (!m_gotBody)
428 { 450 {
429 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot reply yet."), i18n("Ok")); 451 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot reply yet."), i18n("Ok"));
430 return; 452 return;
431 } 453 }
432 454
433 QString rtext; 455 QString rtext;
434 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 456 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
435 .arg( m_mail[0] ) 457 .arg( m_mail[0] )
436 .arg( m_mail[3] ); 458 .arg( m_mail[3] );
437 459
438 QString text = m_mail[2]; 460 QString text = m_mail[2];
439 QStringList lines = QStringList::split(QRegExp("\\n"), text); 461 QStringList lines = QStringList::split(QRegExp("\\n"), text);
440 QStringList::Iterator it; 462 QStringList::Iterator it;
441 for (it = lines.begin(); it != lines.end(); it++) 463 for (it = lines.begin(); it != lines.end(); it++)
442 { 464 {
443 rtext += "> " + *it + "\n"; 465 rtext += "> " + *it + "\n";
444 } 466 }
445 rtext += "\n"; 467 rtext += "\n";
446 468
447 QString prefix; 469 QString prefix;
448 if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = ""; 470 if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
449 else prefix = "Re: "; // no i18n on purpose 471 else prefix = "Re: "; // no i18n on purpose
450 472
451 Settings *settings = new Settings(); 473 Settings *settings = new Settings();
452 ComposeMail composer( settings ,this, 0, true); 474 ComposeMail composer( settings ,this, 0, true);
453 if (m_recMail->Replyto().isEmpty()) { 475 if (m_recMail->Replyto().isEmpty()) {
454 composer.setTo(m_recMail->getFrom()); 476 composer.setTo(m_recMail->getFrom());
455 } else { 477 } else {
456 composer.setTo(m_recMail->Replyto()); 478 composer.setTo(m_recMail->Replyto());
457 } 479 }
458 composer.setSubject( prefix + m_mail[1] ); 480 composer.setSubject( prefix + m_mail[1] );
459 composer.setMessage( rtext ); 481 composer.setMessage( rtext );
460 composer.setInReplyTo(m_recMail->Msgid()); 482 composer.setInReplyTo(m_recMail->Msgid());
461 composer.setCharset( m_body->getCharset() ); 483 composer.setCharset( m_body->getCharset() );
462 484
463 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 485 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
464 { 486 {
465 m_recMail->Wrapper()->answeredMail(m_recMail); 487 m_recMail->Wrapper()->answeredMail(m_recMail);
466 } 488 }
467 delete settings; 489 delete settings;
468} 490}
469 491
470void ViewMail::slotForward() 492void ViewMail::slotForward()
471{ 493{
472 if (!m_gotBody) 494 if (!m_gotBody)
473 { 495 {
474 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok")); 496 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok"));
475 return; 497 return;
476 } 498 }
477 499
478 QString ftext; 500 QString ftext;
479 ftext += QString("\n----- Forwarded message from %1 -----\n\n") 501 ftext += QString("\n----- Forwarded message from %1 -----\n\n")
480 .arg( m_mail[0] ); 502 .arg( m_mail[0] );
481 if (!m_mail[3].isNull()) 503 if (!m_mail[3].isNull())
482 ftext += QString("Date: %1\n") 504 ftext += QString("Date: %1\n")
483 .arg( m_mail[3] ); 505 .arg( m_mail[3] );
484 if (!m_mail[0].isNull()) 506 if (!m_mail[0].isNull())
485 ftext += QString("From: %1\n") 507 ftext += QString("From: %1\n")
486 .arg( m_mail[0] ); 508 .arg( m_mail[0] );
487 if (!m_mail[1].isNull()) 509 if (!m_mail[1].isNull())
488 ftext += QString("Subject: %1\n") 510 ftext += QString("Subject: %1\n")
489 .arg( m_mail[1] ); 511 .arg( m_mail[1] );
490 512
491 ftext += QString("\n%1\n") 513 ftext += QString("\n%1\n")
492 .arg( m_mail[2]); 514 .arg( m_mail[2]);
493 515
494 ftext += QString("----- End forwarded message -----\n"); 516 ftext += QString("----- End forwarded message -----\n");
495 517
496 Settings *settings = new Settings(); 518 Settings *settings = new Settings();
497 ComposeMail composer( settings ,this, 0, true); 519 ComposeMail composer( settings ,this, 0, true);
498 composer.setSubject( "Fwd: " + m_mail[1] ); 520 composer.setSubject( "Fwd: " + m_mail[1] );
499 composer.setMessage( ftext ); 521 composer.setMessage( ftext );
500 if ( QDialog::Accepted == KApplication::execDialog( &composer )) 522 if ( QDialog::Accepted == KApplication::execDialog( &composer ))
501 { 523 {
502 } 524 }
503} 525}
504 526
505void ViewMail::slotDeleteMail( ) 527void ViewMail::slotDeleteMail( )
506{ 528{
507 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 529 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
508 { 530 {
509 emit deleteAndDisplayNextMail( this); 531 emit deleteAndDisplayNextMail( this);
510 //m_recMail->Wrapper()->deleteMail( m_recMail ); 532 //m_recMail->Wrapper()->deleteMail( m_recMail );
511 //hide(); 533 //hide();
512 deleted = true; 534 deleted = true;
513 } 535 }
514} 536}
515 537
516MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) 538MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
517 : QDialog(parent,name,modal) 539 : QDialog(parent,name,modal)
518{ 540{
519 QVBoxLayout*dlglayout = new QVBoxLayout(this); 541 QVBoxLayout*dlglayout = new QVBoxLayout(this);
520 dlglayout->setSpacing(2); 542 dlglayout->setSpacing(2);
521 dlglayout->setMargin(1); 543 dlglayout->setMargin(1);
522 //m_imageview = new Opie::MM::OImageScrollView(this); 544 //m_imageview = new Opie::MM::OImageScrollView(this);
523 //dlglayout->addWidget(m_imageview); 545 //dlglayout->addWidget(m_imageview);
524} 546}
525 547
526MailImageDlg::~MailImageDlg() 548MailImageDlg::~MailImageDlg()
527{ 549{
528} 550}
529 551
530void MailImageDlg::setName(const QString&fname) 552void MailImageDlg::setName(const QString&fname)
531{ 553{
532 qDebug("viewmail.cpp: MailImageDlg::setName Pending"); 554 qDebug("viewmail.cpp: MailImageDlg::setName Pending");
533 // m_imageview->setImage(fname); 555 // m_imageview->setImage(fname);
534} 556}
557
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index d85b8b2..561989e 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -1,89 +1,91 @@
1#ifndef VIEWMAIL_H 1#ifndef VIEWMAIL_H
2#define VIEWMAIL_H 2#define VIEWMAIL_H
3 3
4#include "viewmailbase.h" 4#include "viewmailbase.h"
5#include <libmailwrapper/mailtypes.h> 5#include <libmailwrapper/mailtypes.h>
6 6
7#include <qdialog.h> 7#include <qdialog.h>
8 8
9#include <qlistview.h> 9#include <qlistview.h>
10#include <qmap.h> 10#include <qmap.h>
11#include <qstringlist.h> 11#include <qstringlist.h>
12#include <qvaluelist.h> 12#include <qvaluelist.h>
13 13
14//namespace Opie { namespace MM { class OImageScrollView; } } 14//namespace Opie { namespace MM { class OImageScrollView; } }
15 15
16class AttachItem : public QListViewItem 16class AttachItem : public QListViewItem
17{ 17{
18public: 18public:
19 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 19 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
20 const QString&fsize,int num,const QValueList<int>&path); 20 const QString&fsize,int num,const QValueList<int>&path);
21 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 21 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
22 const QString&fsize,int num,const QValueList<int>&path); 22 const QString&fsize,int num,const QValueList<int>&path);
23 int Partnumber() { return _partNum; } 23 int Partnumber() { return _partNum; }
24 bool isParentof(const QValueList<int>&path); 24 bool isParentof(const QValueList<int>&path);
25 25
26private: 26private:
27 int _partNum; 27 int _partNum;
28 /* needed for a better display of attachments */ 28 /* needed for a better display of attachments */
29 QValueList<int> _path; 29 QValueList<int> _path;
30}; 30};
31 31
32class ViewMail : public ViewMailBase 32class ViewMail : public ViewMailBase
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35 35
36public: 36public:
37 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 37 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
38 ~ViewMail(); 38 ~ViewMail();
39 39
40 void hide(); 40 void hide();
41 void exec(); 41 void exec();
42 void setMail(const RecMailP&mail ); 42 void setMail(const RecMailP&mail );
43 void setBody(const RecBodyP&body); 43 void setBody(const RecBodyP&body);
44 bool deleted; 44 bool deleted;
45 signals: 45 signals:
46 void showNextMail(ViewMail*); 46 void showNextMail(ViewMail*);
47 void deleteAndDisplayNextMail(ViewMail *); 47 void deleteAndDisplayNextMail(ViewMail *);
48 void signalDownloadMail();
48protected: 49protected:
49 QString deHtml(const QString &string); 50 QString deHtml(const QString &string);
50 AttachItem* searchParent(const QValueList<int>&path); 51 AttachItem* searchParent(const QValueList<int>&path);
51 AttachItem* lastChild(AttachItem*parent); 52 AttachItem* lastChild(AttachItem*parent);
52 53
53protected slots: 54protected slots:
54 void slotNextMail() { emit showNextMail(this); }; 55 void slotNextMail() { emit showNextMail(this); };
55 void slotReply(); 56 void slotReply();
56 void slotForward(); 57 void slotForward();
57 void setText(); 58 void setText();
58 void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); 59 void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
59 void slotDeleteMail( ); 60 void slotDeleteMail( );
60 void slotShowHtml( bool ); 61 void slotShowHtml( bool );
62 void slotViewSource();
61 63
62private: 64private:
63 void readConfig(); 65 void readConfig();
64 66 bool sourceOn;;
65 bool _inLoop; 67 bool _inLoop;
66 QString m_mailHtml; 68 QString m_mailHtml;
67 bool m_gotBody; 69 bool m_gotBody;
68 RecBodyP m_body; 70 RecBodyP m_body;
69 RecMailP m_recMail; 71 RecMailP m_recMail;
70 bool m_showHtml; 72 bool m_showHtml;
71 73
72 // 0 from 1 subject 2 bodytext 3 date 74 // 0 from 1 subject 2 bodytext 3 date
73 QMap <int,QString> m_mail; 75 QMap <int,QString> m_mail;
74 // 0 to 1 cc 2 bcc 76 // 0 to 1 cc 2 bcc
75 QMap <int,QStringList> m_mail2; 77 QMap <int,QStringList> m_mail2;
76}; 78};
77 79
78class MailImageDlg:public QDialog 80class MailImageDlg:public QDialog
79{ 81{
80 Q_OBJECT 82 Q_OBJECT
81public: 83public:
82 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); 84 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0);
83 ~MailImageDlg(); 85 ~MailImageDlg();
84 void setName(const QString&); 86 void setName(const QString&);
85protected: 87protected:
86 //Opie::MM::OImageScrollView*m_imageview; 88 //Opie::MM::OImageScrollView*m_imageview;
87}; 89};
88 90
89#endif 91#endif
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index d21696a..9365c23 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -1,104 +1,112 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#include <qtextbrowser.h> 2#include <qtextbrowser.h>
3#include <qlistview.h> 3#include <qlistview.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qvbox.h> 6#include <qvbox.h>
7 7
8#include <qtoolbar.h> 8#include <qtoolbar.h>
9#include <qmenubar.h> 9#include <qmenubar.h>
10#include <kiconloader.h> 10#include <kiconloader.h>
11//#include <qpe/resource.h> 11//#include <qpe/resource.h>
12#include <klocale.h> 12#include <klocale.h>
13 13
14#include "viewmailbase.h" 14#include "viewmailbase.h"
15//#include "opendiag.h" 15//#include "opendiag.h"
16 16
17ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) 17ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
18 : QMainWindow(parent, name, fl) 18 : QMainWindow(parent, name, fl)
19{ 19{
20 20
21 setToolBarsMovable(false); 21 setToolBarsMovable(false);
22 22
23 toolbar = new QToolBar(this); 23 toolbar = new QToolBar(this);
24 menubar = new QMenuBar( toolbar ); 24 menubar = new QMenuBar( toolbar );
25 mailmenu = new QPopupMenu( menubar ); 25 mailmenu = new QPopupMenu( menubar );
26 menubar->insertItem( i18n( "Mail" ), mailmenu ); 26 menubar->insertItem( i18n( "Mail" ), mailmenu );
27 27
28 toolbar->setHorizontalStretchable(true); 28 toolbar->setHorizontalStretchable(true);
29 addToolBar(toolbar); 29 addToolBar(toolbar);
30 30
31 viewSource = new QAction(i18n("View Source"), 0, 0, this);
32 viewSource->addTo(mailmenu);
33
34 downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this);
35 downloadMail->addTo(toolbar);
36 downloadMail->addTo(mailmenu);
37
38
31 reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); 39 reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this);
32 reply->addTo(toolbar); 40 reply->addTo(toolbar);
33 reply->addTo(mailmenu); 41 reply->addTo(mailmenu);
34 42
35 forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this); 43 forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this);
36 forward->addTo(toolbar); 44 forward->addTo(toolbar);
37 forward->addTo(mailmenu); 45 forward->addTo(mailmenu);
38 46
39 attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true); 47 attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true);
40 attachbutton->addTo(toolbar); 48 attachbutton->addTo(toolbar);
41 attachbutton->addTo(mailmenu); 49 attachbutton->addTo(mailmenu);
42 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); 50 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool)));
43 51
44 52
45 showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); 53 showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true );
46 showHtml->addTo( toolbar ); 54 showHtml->addTo( toolbar );
47 showHtml->addTo( mailmenu ); 55 showHtml->addTo( mailmenu );
48 56
49 deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this); 57 deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this);
50 deleteMail->addTo(toolbar); 58 deleteMail->addTo(toolbar);
51 deleteMail->addTo(mailmenu); 59 deleteMail->addTo(mailmenu);
52 60
53 61
54 62
55 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this); 63 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this);
56 QLabel *spacer = new QLabel(toolbar); 64 QLabel *spacer = new QLabel(toolbar);
57 nextMail->addTo(toolbar); 65 nextMail->addTo(toolbar);
58 nextMail->addTo(mailmenu); 66 nextMail->addTo(mailmenu);
59 67
60 68
61 69
62 70
63 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 71 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
64 //QLabel *spacer = new QLabel(toolbar); 72 //QLabel *spacer = new QLabel(toolbar);
65 spacer->setBackgroundMode(QWidget::PaletteButton); 73 spacer->setBackgroundMode(QWidget::PaletteButton);
66 toolbar->setStretchableWidget(spacer); 74 toolbar->setStretchableWidget(spacer);
67 closeMail->addTo(toolbar); 75 closeMail->addTo(toolbar);
68 closeMail->addTo(mailmenu); 76 closeMail->addTo(mailmenu);
69 QVBox *view = new QVBox(this); 77 QVBox *view = new QVBox(this);
70 setCentralWidget(view); 78 setCentralWidget(view);
71 79
72 attachments = new QListView(view); 80 attachments = new QListView(view);
73 attachments->setMinimumHeight(90); 81 attachments->setMinimumHeight(90);
74 attachments->setMaximumHeight(90); 82 attachments->setMaximumHeight(90);
75 attachments->setAllColumnsShowFocus(true); 83 attachments->setAllColumnsShowFocus(true);
76 attachments->addColumn("Mime Type", 60); 84 attachments->addColumn("Mime Type", 60);
77 attachments->addColumn(i18n("Description"), 100); 85 attachments->addColumn(i18n("Description"), 100);
78 attachments->addColumn(i18n("Filename"), 80); 86 attachments->addColumn(i18n("Filename"), 80);
79 attachments->addColumn(i18n("Size"), 80); 87 attachments->addColumn(i18n("Size"), 80);
80 attachments->setSorting(-1); 88 attachments->setSorting(-1);
81 attachments->hide(); 89 attachments->hide();
82 90
83 browser = new QTextBrowser(view); 91 browser = new QTextBrowser(view);
84 92
85 //openDiag = new OpenDiag(view); 93 //openDiag = new OpenDiag(view);
86 //openDiag->hide(); 94 //openDiag->hide();
87 95
88} 96}
89 97
90void ViewMailBase::slotChangeAttachview(bool state) 98void ViewMailBase::slotChangeAttachview(bool state)
91{ 99{
92 if (state) attachments->show(); 100 if (state) attachments->show();
93 else attachments->hide(); 101 else attachments->hide();
94} 102}
95 103
96void ViewMailBase::keyPressEvent ( QKeyEvent * e ) 104void ViewMailBase::keyPressEvent ( QKeyEvent * e )
97{ 105{
98 if( e->key()==Qt::Key_Escape ) { 106 if( e->key()==Qt::Key_Escape ) {
99 close(); 107 close();
100 e->accept(); 108 e->accept();
101 return; 109 return;
102 } 110 }
103 QWidget::keyPressEvent(e); 111 QWidget::keyPressEvent(e);
104} 112}
diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h
index c97e9e3..7ad1eec 100644
--- a/kmicromail/viewmailbase.h
+++ b/kmicromail/viewmailbase.h
@@ -1,39 +1,39 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#ifndef VIEWMAILBASE_H 2#ifndef VIEWMAILBASE_H
3#define VIEWMAILBASE_H 3#define VIEWMAILBASE_H
4 4
5#include <qmainwindow.h> 5#include <qmainwindow.h>
6 6
7class QAction; 7class QAction;
8class OpenDiag; 8class OpenDiag;
9class QListView; 9class QListView;
10class QToolBar; 10class QToolBar;
11class QTextBrowser; 11class QTextBrowser;
12class QMenuBar; 12class QMenuBar;
13class QPopupMenu; 13class QPopupMenu;
14 14
15class ViewMailBase : public QMainWindow 15class ViewMailBase : public QMainWindow
16{ 16{
17 Q_OBJECT 17 Q_OBJECT
18 18
19public: 19public:
20 ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 20 ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
21 21
22protected: 22protected:
23 QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail; 23 QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource;
24 QListView *attachments; 24 QListView *attachments;
25 QToolBar *toolbar; 25 QToolBar *toolbar;
26 QTextBrowser *browser; 26 QTextBrowser *browser;
27 OpenDiag *openDiag; 27 OpenDiag *openDiag;
28 QMenuBar *menubar; 28 QMenuBar *menubar;
29 QPopupMenu *mailmenu; 29 QPopupMenu *mailmenu;
30 30
31protected slots: 31protected slots:
32 void slotChangeAttachview(bool state); 32 void slotChangeAttachview(bool state);
33 virtual void keyPressEvent ( QKeyEvent * e ); 33 virtual void keyPressEvent ( QKeyEvent * e );
34 34
35 35
36}; 36};
37 37
38#endif 38#endif
39 39